diff --git a/AtlasGeometryCommon/SubDetectorEnvelopes/CMakeLists.txt b/AtlasGeometryCommon/SubDetectorEnvelopes/CMakeLists.txt
index d186c2168089d1ba473e56aed6f41410e9d0589d..416349c21213b219ae129ce21c1b81ffdcee8757 100644
--- a/AtlasGeometryCommon/SubDetectorEnvelopes/CMakeLists.txt
+++ b/AtlasGeometryCommon/SubDetectorEnvelopes/CMakeLists.txt
@@ -10,7 +10,7 @@ find_package( CLHEP )
 atlas_add_library( SubDetectorEnvelopesLib
                    INTERFACE
                    PUBLIC_HEADERS SubDetectorEnvelopes
-                   LINK_LIBRARIES GaudiKernel AtlasDetDescr )
+                   LINK_LIBRARIES GaudiKernel AtlasDetDescr CxxUtils )
 
 atlas_add_component( SubDetectorEnvelopes
                      src/*.cxx
diff --git a/AtlasGeometryCommon/SubDetectorEnvelopes/SubDetectorEnvelopes/IEnvelopeDefSvc.h b/AtlasGeometryCommon/SubDetectorEnvelopes/SubDetectorEnvelopes/IEnvelopeDefSvc.h
index 76671fd8cf5e776e52bd5e800235b26854c34342..88332ef2658795d45bd9fbec026c530a0f269d55 100644
--- a/AtlasGeometryCommon/SubDetectorEnvelopes/SubDetectorEnvelopes/IEnvelopeDefSvc.h
+++ b/AtlasGeometryCommon/SubDetectorEnvelopes/SubDetectorEnvelopes/IEnvelopeDefSvc.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
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -17,6 +17,8 @@
 // SubDetectorEnvelopes includes
 #include "SubDetectorEnvelopes/RZPair.h"
 
+#include "CxxUtils/checker_macros.h"
+
 class IEnvelopeDefSvc : virtual public IInterface {
   /**
    @class IEnvelopeDefSvc
@@ -48,15 +50,6 @@ class IEnvelopeDefSvc : virtual public IInterface {
     const RZPairVector &getMuonRZBoundary()     const { return getRZBoundary(AtlasDetDescr::fAtlasMS);      }
     const RZPairVector &getCavernRZBoundary()   const { return getRZBoundary(AtlasDetDescr::fAtlasCavern);  }
 
-    /** legacy methods
-          Any client should update to use the methods defined above!
-          The following lecagy methods will be phased out once all clients have migrated to the new methods above */
-    RZPairVector &getBeamPipeRZValues( unsigned short = 0) const { return const_cast<RZPairVector&>( getRZBoundary(AtlasDetDescr::fAtlasForward) ); }
-    RZPairVector &getInDetRZValues( unsigned short = 0)    const { return const_cast<RZPairVector&>( getRZBoundary(AtlasDetDescr::fAtlasID) );      }
-    RZPairVector &getCaloRZValues( unsigned short = 0)     const { return const_cast<RZPairVector&>( getRZBoundary(AtlasDetDescr::fAtlasCalo) );    }
-    RZPairVector &getMuonRZValues( unsigned short = 0)     const { return const_cast<RZPairVector&>( getRZBoundary(AtlasDetDescr::fAtlasMS) );      }
-    RZPairVector &getCavernRZValues( unsigned short = 0)   const { return const_cast<RZPairVector&>( getRZBoundary(AtlasDetDescr::fAtlasCavern) );  }
-
   protected:
     /** mirror the given srcRZ RZPairVector in the XY-plane to describe all corner points
      in (r,z) space in the dstRZ RZPairVector */
diff --git a/AtlasTest/GoogleTestTools/CMakeLists.txt b/AtlasTest/GoogleTestTools/CMakeLists.txt
index 33da7bfd397fde6d92346dfc30d5fd4858db02e1..f0d2911518002f510c5dedf2a21172532c3a104f 100644
--- a/AtlasTest/GoogleTestTools/CMakeLists.txt
+++ b/AtlasTest/GoogleTestTools/CMakeLists.txt
@@ -4,7 +4,7 @@
 atlas_subdir( GoogleTestTools )
 
 # External package dependencies:
-find_package( GMock )
+find_package( GTest )
 
 # In standalone mode we just use the headers from the package. While in
 # offline mode we build a proper library.
@@ -17,13 +17,11 @@ else()
   atlas_add_library( GoogleTestTools
     GoogleTestTools/*.h src/*.cxx
     PUBLIC_HEADERS GoogleTestTools
-    INCLUDE_DIRS ${GMOCK_INCLUDE_DIRS}
-    LINK_LIBRARIES ${GMOCK_LIBRARIES}
-    PRIVATE_LINK_LIBRARIES GaudiKernel )
+    INCLUDE_DIRS ${GTEST_INCLUDE_DIRS}
+    LINK_LIBRARIES ${GTEST_LIBRARIES} GaudiKernel )
 endif()
 
 # Unit tests for InitGaudiGoogleTest:
 atlas_add_test( GoogleTestToolsTests
   SOURCES test/gt_GoogleTestTools.cxx
-  INCLUDE_DIRS ${GMOCK_INCLUDE_DIRS} 
-  LINK_LIBRARIES ${GMOCK_LIBRARIES} GaudiKernel GoogleTestTools )
+  LINK_LIBRARIES GoogleTestTools )
diff --git a/AtlasTest/GoogleTestTools/share/GoogleTestToolsTests.ref b/AtlasTest/GoogleTestTools/share/GoogleTestToolsTests.ref
index 1a12a640a5ecd04aa11ef9c7c7ae696be9f8d331..7783206061346edc5e1636307b25201e18b74b4e 100644
--- a/AtlasTest/GoogleTestTools/share/GoogleTestToolsTests.ref
+++ b/AtlasTest/GoogleTestTools/share/GoogleTestToolsTests.ref
@@ -1,22 +1,21 @@
-[==========] Running 1 test from 1 test case.
+[==========] Running 1 test from 1 test suite.
 [----------] Global test environment set-up.
 [----------] 1 test from InitGaudiGoogleTestTest
 [ RUN      ] InitGaudiGoogleTestTest.basictest
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
-                                                   Welcome to ApplicationMgr (GaudiCoreSvc v27r1p99)
-                                          running on karma on Wed Jul  4 10:48:30 2018
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v34r0)
+                                          running on 36d5a1e47246 on Sat Sep 12 19:51:31 2020
 ====================================================================================================================================
 ApplicationMgr       INFO Application Manager Configured successfully
-HistogramPersis...WARNING Histograms saving not required.
 ApplicationMgr       INFO Application Manager Initialized successfully
 EventLoopMgr         INFO Histograms converted successfully according to request.
 ToolSvc              INFO Removing all tools created by ToolSvc
 ApplicationMgr       INFO Application Manager Finalized successfully
 ApplicationMgr       INFO Application Manager Terminated successfully
-[       OK ] InitGaudiGoogleTestTest.basictest (44 ms)
-[----------] 1 test from InitGaudiGoogleTestTest (44 ms total)
+[       OK ] InitGaudiGoogleTestTest.basictest (382 ms)
+[----------] 1 test from InitGaudiGoogleTestTest (382 ms total)
 
 [----------] Global test environment tear-down
-[==========] 1 test from 1 test case ran. (44 ms total)
+[==========] 1 test from 1 test suite ran. (382 ms total)
 [  PASSED  ] 1 test.
diff --git a/Calorimeter/CaloInterface/CaloInterface/IToolWithConstants.h b/Calorimeter/CaloInterface/CaloInterface/IToolWithConstants.h
new file mode 100644
index 0000000000000000000000000000000000000000..d58d79b057cb86e2492aa9ea8c39b6ad5840018b
--- /dev/null
+++ b/Calorimeter/CaloInterface/CaloInterface/IToolWithConstants.h
@@ -0,0 +1,48 @@
+// This file's extension implies that it's C, but it's really -*- C++ -*-.
+/*
+ * Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration.
+ */
+/**
+ * @file CaloInterface/IToolWithConstants.h
+ * @author scott snyder <snyder@bnl.gov>
+ * @date Sep, 2020
+ * @brief Abstact interface for ToolWithConstants.
+ */
+
+
+#ifndef CALOINTERFACE_ITOOLWITHCONSTANTS_H
+#define CALOINTERFACE_ITOOLWITHCONSTANTS_H
+
+
+#include "CaloConditions/ToolConstants.h"
+#include "GaudiKernel/IAlgTool.h"
+#include "GaudiKernel/StatusCode.h"
+#include "GaudiKernel/EventContext.h"
+#include <string>
+
+
+/**
+ * @brief Abstact interface for ToolWithConstants.
+ *
+ * Defines operations needed by CaloClusterCorrDBWriter.
+ */
+class IToolWithConstants
+  : virtual public IAlgTool
+{
+public:
+  DeclareInterfaceID (IToolWithConstants, 1, 0);
+
+
+  /**
+   * @brief Merge our constants into @c out with the proper prefix.
+   * @param[out] out Object to receive our constants.
+   * @param ctx Event context.
+   */
+  virtual
+  StatusCode
+  mergeConstants (CaloRec::ToolConstants& out,
+                  const EventContext& ctx) const = 0;
+};
+
+
+#endif // not CALOINTERFACE_ITOOLWITHCONSTANTS_H
diff --git a/Calorimeter/CaloSimEvent/CaloSimEvent/ATLAS_CHECK_THREAD_SAFETY b/Calorimeter/CaloSimEvent/CaloSimEvent/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..f1fce840a8ce7d5b6ef17237ba7f42c625c7b5fb
--- /dev/null
+++ b/Calorimeter/CaloSimEvent/CaloSimEvent/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Calorimeter/CaloSimEvent
diff --git a/Calorimeter/CaloSimEvent/CaloSimEvent/CaloCalibrationHit.h b/Calorimeter/CaloSimEvent/CaloSimEvent/CaloCalibrationHit.h
index 50b7b0a469f348e36a3f5dbec3834b3b4ff6c7f7..12c292b107841d81b5f0967d18b55282b8afbbfa 100755
--- a/Calorimeter/CaloSimEvent/CaloSimEvent/CaloCalibrationHit.h
+++ b/Calorimeter/CaloSimEvent/CaloSimEvent/CaloCalibrationHit.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
 */
 
 // CaloCalibrationHit
@@ -75,13 +75,13 @@ class CaloCalibrationHit
 
   /** Copy constructor **/
   CaloCalibrationHit(const CaloCalibrationHit &cchSource)
+    : m_ID (cchSource.m_ID),
+      m_energy0 (cchSource.m_energy0),
+      m_energy1 (cchSource.m_energy1),
+      m_energy2 (cchSource.m_energy2),
+      m_energy3 (cchSource.m_energy3),
+      m_particleID (cchSource.m_particleID)
   {
-    m_ID = cchSource.m_ID;
-    m_energy0 = cchSource.m_energy0;
-    m_energy1 = cchSource.m_energy1;
-    m_energy2 = cchSource.m_energy2;
-    m_energy3 = cchSource.m_energy3;
-    m_particleID = cchSource.m_particleID;
   }
 
   /** Assignment operator **/
diff --git a/Calorimeter/CaloSimEvent/src/CaloCalibrationHitContainer.cxx b/Calorimeter/CaloSimEvent/src/CaloCalibrationHitContainer.cxx
index 4f4302493a38d230c96e8905520c9677a82d6330..ed516d8878295af147a7a85b2c9c81ec6d2e5895 100755
--- a/Calorimeter/CaloSimEvent/src/CaloCalibrationHitContainer.cxx
+++ b/Calorimeter/CaloSimEvent/src/CaloCalibrationHitContainer.cxx
@@ -38,7 +38,7 @@ CaloCalibrationHitContainer::operator std::string () const
  int counter = 0 ;
  CaloCalibrationHit * hit ;    
  
-     for(it = this->begin() ; it != this->end() ; it++ ){ // Loop over Hits
+     for(it = this->begin() ; it != this->end() ; ++it ){ // Loop over Hits
      
        hit = *it ;
              
diff --git a/Calorimeter/CaloTrackingGeometry/src/CaloTrackingGeometryBuilder.cxx b/Calorimeter/CaloTrackingGeometry/src/CaloTrackingGeometryBuilder.cxx
index 863c05aae82b1d3230083a7eca71f74ce4fde2e3..876a01a83c1da11427105e069f650b70f02fd87a 100755
--- a/Calorimeter/CaloTrackingGeometry/src/CaloTrackingGeometryBuilder.cxx
+++ b/Calorimeter/CaloTrackingGeometry/src/CaloTrackingGeometryBuilder.cxx
@@ -233,8 +233,7 @@ const Trk::TrackingGeometry* Calo::CaloTrackingGeometryBuilder::trackingGeometry
     keyDim.push_back(RZPair(enclosedInnerSectorRadius, enclosedInnerSectorHalflength));
   }   
   // get the dimensions from the envelope service
-  RZPairVector& envelopeDefsIn = m_enclosingEnvelopeSvc->getCaloRZValues(0);
-  //RZPairVector& envelopeDefs = m_enclosingEnvelopeSvc->getCaloRZValues(0);
+  const RZPairVector& envelopeDefsIn = m_enclosingEnvelopeSvc->getCaloRZBoundary();
 
   // find the max,max pair
   unsigned int ii=0;
@@ -316,7 +315,7 @@ const Trk::TrackingGeometry* Calo::CaloTrackingGeometryBuilder::trackingGeometry
  
   // BEAM PIPE
   //std::cout <<"envelope svc : number of BeamPipe Volumes:"<< m_enclosingEnvelopeSvc->getBeamPipeNumVols()<< std::endl;  
-  RZPairVector& bpDefs = m_enclosingEnvelopeSvc->getBeamPipeRZValues(0);
+  const RZPairVector& bpDefs = m_enclosingEnvelopeSvc->getBeamPipeRZBoundary();
   
   ATH_MSG_VERBOSE( "BeamPipe envelope definition retrieved:" );   
   m_bpCutouts.clear();
diff --git a/Calorimeter/CaloTrackingGeometry/src/CaloTrackingGeometryBuilderCond.cxx b/Calorimeter/CaloTrackingGeometry/src/CaloTrackingGeometryBuilderCond.cxx
index ad91e58448529f31ca4cc4d9a67fb7c8422e05a5..1992999c271be8fc4091b294a3cfefb1592722b3 100755
--- a/Calorimeter/CaloTrackingGeometry/src/CaloTrackingGeometryBuilderCond.cxx
+++ b/Calorimeter/CaloTrackingGeometry/src/CaloTrackingGeometryBuilderCond.cxx
@@ -240,8 +240,7 @@ std::pair<EventIDRange, const Trk::TrackingGeometry*> Calo::CaloTrackingGeometry
     keyDim.push_back(RZPair(enclosedInnerSectorRadius, enclosedInnerSectorHalflength));
   }   
   // get the dimensions from the envelope service
-  RZPairVector& envelopeDefsIn = m_enclosingEnvelopeSvc->getCaloRZValues(0);
-  //RZPairVector& envelopeDefs = m_enclosingEnvelopeSvc->getCaloRZValues(0);
+  const RZPairVector& envelopeDefsIn = m_enclosingEnvelopeSvc->getCaloRZBoundary();
 
   // find the max,max pair
   unsigned int ii=0;
@@ -323,7 +322,7 @@ std::pair<EventIDRange, const Trk::TrackingGeometry*> Calo::CaloTrackingGeometry
  
   // BEAM PIPE
   //std::cout <<"envelope svc : number of BeamPipe Volumes:"<< m_enclosingEnvelopeSvc->getBeamPipeNumVols()<< std::endl;  
-  RZPairVector& bpDefs = m_enclosingEnvelopeSvc->getBeamPipeRZValues(0);
+  const RZPairVector& bpDefs = m_enclosingEnvelopeSvc->getBeamPipeRZBoundary();
   
   ATH_MSG_VERBOSE( "BeamPipe envelope definition retrieved:" );   
   m_bpCutouts.clear();
diff --git a/Control/AthAnalysisBaseComps/AthAnalysisBaseComps/AthAnalysisHelper.h b/Control/AthAnalysisBaseComps/AthAnalysisBaseComps/AthAnalysisHelper.h
index 51707fde53be472c6cecd887d922ccb3c1e8acd2..b0f8645d292f1ea9dd8efa5098e1e48622e7c74d 100644
--- a/Control/AthAnalysisBaseComps/AthAnalysisBaseComps/AthAnalysisHelper.h
+++ b/Control/AthAnalysisBaseComps/AthAnalysisBaseComps/AthAnalysisHelper.h
@@ -31,6 +31,8 @@
 
 #include "GaudiKernel/ToolHandle.h"
 
+#include <type_traits>
+
 class AthAnalysisHelper { //thought about being a namespace but went for static methods instead, in case I want private data members in future
 
 public:
@@ -55,7 +57,19 @@ public:
         return StatusCode::FAILURE;
       }
      }
-     joSvc->set( name+"."+property , Gaudi::Utils::toString ( value ) );
+
+     if constexpr (std::is_convertible<W, std::string>::value) {
+       // If value is already convertible to a string, don't use toString().
+       // Otherwise, toString() will add quotes around the string,
+       // which confuses things further on.
+       // (These quotes used to be removed by the old 
+       // IJobOptionsSvc::addPropertyToCatalogue interface, but IOptionsSvc::set
+       // doesn't do that.)
+       joSvc->set( name+"."+property , std::string (value) );
+     }
+     else {
+       joSvc->set( name+"."+property , Gaudi::Utils::toString ( value ) );
+     }
      return StatusCode::SUCCESS;
    }
    
diff --git a/Control/AthToolSupport/AsgExampleTools/test/gt_AnaToolHandle_test.cxx b/Control/AthToolSupport/AsgExampleTools/test/gt_AnaToolHandle_test.cxx
index d540cef446b37887070c93855821ae2c2557a805..17fcdc4782dff18cdbc9d1303435def2bed64af6 100644
--- a/Control/AthToolSupport/AsgExampleTools/test/gt_AnaToolHandle_test.cxx
+++ b/Control/AthToolSupport/AsgExampleTools/test/gt_AnaToolHandle_test.cxx
@@ -1006,7 +1006,7 @@ namespace asg
     {
       ASSERT_SUCCESS (th3.setProperty ("usePublic", true));
     }
-    
+
     ASSERT_SUCCESS (th3.initialize ());
     if (value == -1)
     {
@@ -1018,7 +1018,7 @@ namespace asg
     }
   }
 
-  INSTANTIATE_TEST_CASE_P
+  INSTANTIATE_TEST_SUITE_P
   (MySubtoolTest1, SubtoolTest, ::testing::Values
    (std::make_tuple ("regPublicHandle",  "public",  "ATH"),
     std::make_tuple ("anaPublicHandle",  "public",  "ATH"),
@@ -1037,7 +1037,7 @@ namespace asg
     std::make_tuple ("regPrivateHandle", "private", "empty"),
     std::make_tuple ("anaPrivateHandle", "private", "empty"),
     std::make_tuple ("regPrivateHandle", "private", "none"),
-    std::make_tuple ("anaPrivateHandle", "private", "none")),);
+    std::make_tuple ("anaPrivateHandle", "private", "none")));
 }
 
 ATLAS_GOOGLE_TEST_MAIN
diff --git a/Control/AthenaCommon/share/Preparation.py b/Control/AthenaCommon/share/Preparation.py
index 8bf10b03a4dee40126f1edb487303a453c758a12..de3afe83a052c806cef900f4491964d9d994044a 100644
--- a/Control/AthenaCommon/share/Preparation.py
+++ b/Control/AthenaCommon/share/Preparation.py
@@ -75,7 +75,7 @@ else:
    min_cppyy_vmem_growth = None
 
 from PyUtils.Helpers import ROOT6Setup
-ROOT6Setup()
+ROOT6Setup(batch=opts.run_batch)
 
 if min_cppyy_vmem_growth:
    grow_vmem( vmem_before_cppyy + min_cppyy_vmem_growth )
diff --git a/Control/AthenaCommon/share/bootstrap.pkl b/Control/AthenaCommon/share/bootstrap.pkl
index 044ddef8f837497bc320600ffa749dc69f6670cd..1fbadb9efe48ecbc16fa3f336a726c78b3defb91 100644
Binary files a/Control/AthenaCommon/share/bootstrap.pkl and b/Control/AthenaCommon/share/bootstrap.pkl differ
diff --git a/Control/AthenaCommon/share/bootstrap_threaded.pkl b/Control/AthenaCommon/share/bootstrap_threaded.pkl
index b3064d2da12442802dbb8bdf73140b05893e90a5..4e2911ba5c7b415b01039392ef0b7c154a956adc 100644
Binary files a/Control/AthenaCommon/share/bootstrap_threaded.pkl and b/Control/AthenaCommon/share/bootstrap_threaded.pkl differ
diff --git a/Control/AthenaConfiguration/python/ComponentAccumulator.py b/Control/AthenaConfiguration/python/ComponentAccumulator.py
index d5c540af4306e272e11fbe9facd80ec90aa5876e..fb442cd303028d7c0c711308ceecaad6ad1bb296 100644
--- a/Control/AthenaConfiguration/python/ComponentAccumulator.py
+++ b/Control/AthenaConfiguration/python/ComponentAccumulator.py
@@ -24,14 +24,16 @@ from AthenaConfiguration.UnifyProperties import unifySet
 
 class ConfigurationError(RuntimeError):
     pass
+_basicServicesToCreateOrder=("CoreDumpSvc/CoreDumpSvc", "GeoModelSvc/GeoModelSvc", "DetDescrCnvSvc/DetDescrCnvSvc")
 
-_basicServicesToCreate=frozenset(('GeoModelSvc','TileInfoLoader','DetDescrCnvSvc','CoreDumpSvc','VTuneProfilerService','EvtIdModifierSvc'))
 
-def printProperties(msg, c, nestLevel = 0):
+
+def printProperties(msg, c, nestLevel = 0, printDefaults=False):
     # Iterate in sorted order.
     propnames= sorted(c._descriptors.keys())
     for propname in propnames:
-        if not c.is_property_set(propname): 
+        
+        if not printDefaults and not c.is_property_set(propname):
             continue
         propval=getattr(c,propname)
         # Ignore empty lists
@@ -42,7 +44,10 @@ def printProperties(msg, c, nestLevel = 0):
         if propname in ["DetStore","EvtStore"]:
             continue
 
-
+        if isinstance( propval, GaudiConfig2.Configurable ):
+            msg.info( " "*nestLevel +"    * {0}: {1}/{2}".format(propname, propval.__cpp_type__, propval.getName()))
+            printProperties(msg, propval, nestLevel+3)
+            continue
         if isinstance(propval,GaudiHandles.PublicToolHandleArray):
             ths = [th.getName() for th in propval]
             propstr = "PublicToolHandleArray([ {0} ])".format(', '.join(ths))
@@ -77,7 +82,7 @@ class ComponentAccumulator(object):
         self._algorithms = {}            #Flat algorithms list, useful for merging
         self._conditionsAlgs=[]          #Unordered list of conditions algorithms + their private tools
         self._services=[]                #List of service, not yet sure if the order matters here in the MT age
-        self._servicesToCreate=set(_basicServicesToCreate)
+        self._servicesToCreate=[]
         self._privateTools=None          #A placeholder to carry a private tool(s) not yet attached to its parent
         self._primaryComp=None           #A placeholder to designate the primary service 
 
@@ -141,12 +146,12 @@ class ComponentAccumulator(object):
         self._msg=logging.getLogger('ComponentAccumulator')
 
 
-    def printCondAlgs(self, summariseProps=False, onlyComponents=[]):
+    def printCondAlgs(self, summariseProps=False, onlyComponents=[], printDefaults=False):
         self._msg.info( "Condition Algorithms" )
         for (c, flag) in filterComponents (self._conditionsAlgs, onlyComponents):
             self._msg.info( " " +"\\__ "+ c.name +" (cond alg)" )
             if summariseProps and flag:
-                printProperties(self._msg, c, 1)
+                printProperties(self._msg, c, 1, printDefaults)
         return
         
 
@@ -155,7 +160,7 @@ class ComponentAccumulator(object):
     # in the list with a trailing `-', then only the name of the component
     # will be printed, not its properties.
     def printConfig(self, withDetails=False, summariseProps=False,
-                    onlyComponents = []):
+                    onlyComponents = [], printDefaults=False):
         self._msg.info( "Event Inputs" )
         self._msg.info( "Event Algorithm Sequences" )
 
@@ -179,7 +184,7 @@ class ComponentAccumulator(object):
                     else:
                         self._msg.info( " "*nestLevel +"\\__ "+ c.name +" (alg)" )
                         if summariseProps and flag:
-                            printProperties(self._msg, c, nestLevel)
+                            printProperties(self._msg, c, nestLevel, printDefaults)
 
             for n,s in enumerate(self._allSequences):
                 self._msg.info( "Top sequence {}".format(n) )
@@ -195,7 +200,7 @@ class ComponentAccumulator(object):
             self._msg.info( "  {0},".format(t.getFullJobOptName()) )
             # Not nested, for now
             if summariseProps and flag:
-                printProperties(self._msg, t)
+                printProperties(self._msg, t, printDefaults)
         self._msg.info( "]" )
         self._msg.info( "Private Tools")
         self._msg.info( "[" )
@@ -204,12 +209,12 @@ class ComponentAccumulator(object):
                 self._msg.info( "  {0},".format(t.getFullJobOptsName()) )
                 # Not nested, for now
                 if summariseProps and flag:
-                    printProperties(self._msg, t)
+                    printProperties(self._msg, t, printDefaults)
         else:
             if self._privateTools is not None:
                 self._msg.info( "  {0},".format(self._privateTools.getFullJobOptName()) )
                 if summariseProps:
-                    printProperties(self._msg, self._privateTools)
+                    printProperties(self._msg, self._privateTools, printDefaults)
         self._msg.info( "]" )
         self._msg.info( "TheApp properties" )
         for k,v in six.iteritems(self._theAppProps):
@@ -391,9 +396,12 @@ class ComponentAccumulator(object):
             #keep a ref of the de-duplicated public tool as primary component
             self._primaryComp=self.__getOne( self._services, newSvc.name, "Services") 
         self._lastAddedComponent=newSvc.name
-        if create: self._servicesToCreate.add(newSvc.name)
-        return 
 
+        if create:
+            sname = newSvc.getFullJobOptName()
+            if sname not in self._servicesToCreate:
+                self._servicesToCreate.append(sname)
+        return
 
     def addPublicTool(self,newTool,primary=False):
         if newTool.__component_type__ != "AlgTool":
@@ -568,9 +576,7 @@ class ComponentAccumulator(object):
             self.addCondAlgo(condAlg) #Profit from deduplicaton here
 
         for svc in other._services:
-            self.addService(svc) #Profit from deduplicaton here
-
-        self._servicesToCreate.update(other._servicesToCreate)
+            self.addService(svc, create = svc.getFullJobOptName() in other._servicesToCreate) #Profit from deduplicaton here
 
         for pt in other._publicTools:
             self.addPublicTool(pt) #Profit from deduplicaton here
@@ -663,9 +669,14 @@ class ComponentAccumulator(object):
             extSvc += [
                 svc.getFullJobOptName(),
             ]
-            if svc.name in self._servicesToCreate:
+            if svc.getFullJobOptName() in self._servicesToCreate:
                 svcToCreate.append(svc.getFullJobOptName())
 
+        # order basic services
+        for bs in reversed(_basicServicesToCreateOrder):
+            if bs in svcToCreate:
+                svcToCreate.insert(0, svcToCreate.pop( svcToCreate.index(bs) ) )
+
         extSvc.append("PyAthena::PyComponentMgr/PyComponentMgr")
 
         appPropsToSet["ExtSvc"] = str(extSvc)
@@ -829,6 +840,8 @@ def __indent( indent = ""):
 def __setProperties( destConfigurableInstance, sourceConf2Instance, indent="" ):
     _log = logging.getLogger( "__setProperties".ljust(30) )
     for pname, pvalue in six.iteritems( sourceConf2Instance._properties ):
+        if destConfigurableInstance.__class__.__name__ == 'AlgSequence' and pname == 'Members':
+            continue
         propType = sourceConf2Instance._descriptors[pname].cpp_type
         if "PrivateToolHandleArray" in propType:
             setattr( destConfigurableInstance, pname, [conf2toConfigurable( tool, __indent( indent ) ) for tool in pvalue] )
@@ -854,7 +867,7 @@ def __setProperties( destConfigurableInstance, sourceConf2Instance, indent="" ):
                 pass
             setattr( destConfigurableInstance, pname, pvalue )
 
-def conf2toConfigurable( comp, indent="" ):
+def conf2toConfigurable( comp, indent="", suppressDupes=False ):
     """
     Method converts from Conf2 ( comp argument ) to old Configurable
     If the Configurable of the same name exists, the properties merging process is invoked
@@ -929,9 +942,11 @@ def conf2toConfigurable( comp, indent="" ):
             return listOrDictHelper
 
     def __areSettingsSame( existingConfigurableInstance, newConf2Instance, indent="" ):
-        _log.debug( "{}Checking if setting is the same {}".format( indent, existingConfigurableInstance.getFullName() ) )
+        _log.debug( "{}Checking if setting is the same {} {}".format( indent, existingConfigurableInstance.getFullName(), newConf2Instance.getFullJobOptName() ) )
         alreadySetProperties = dict([ (pname, pvalue) for pname,pvalue
                                       in six.iteritems(existingConfigurableInstance.getValuedProperties()) ])
+        _log.debug("Existing properties: {}".format(alreadySetProperties))
+        _log.debug("New properties: {}".format(newConf2Instance._properties))
         for pname, pvalue in six.iteritems( newConf2Instance._properties ): # six.iteritems(comp._properties):
             if __isOldConfigurable( pvalue ):
                 _log.warning( "{}New configuration object {} property {} has legacy configuration components assigned to it {}"
@@ -939,10 +954,31 @@ def conf2toConfigurable( comp, indent="" ):
                 _log.warning( "Skipping comparison, no guarantees about configuration consistency" )
                 continue
             propType = newConf2Instance._descriptors[pname].cpp_type
-            _log.debug("{}Comparing type: {}".format(indent, propType))
+            _log.debug("{}Comparing type: {} for: {}".format(indent, propType, pname))
             if  "PrivateToolHandleArray" in  propType:
-                for oldC, newC in zip( alreadySetProperties[pname], pvalue):
-                    __areSettingsSame( oldC, newC, __indent(indent))
+                toolDict = {_.getName(): _ for _ in alreadySetProperties[pname]}
+                _log.debug('Private tool properties? {}'.format(toolDict))
+                newCdict = {_.getName() : _ for _ in pvalue}
+                oldCset = set(toolDict); newCset = set(newCdict)
+                _log.debug('Private tool property names? {} {}'.format(oldCset, newCset))
+                for oldC in oldCset & newCset:
+                    __areSettingsSame( toolDict[oldC], newCdict[oldC], __indent(indent))
+                for newC in newCset-oldCset:
+                    # clone new config to old array
+                    alreadySetProperties[pname].append(conf2toConfigurable(newCdict[newC]))
+            elif "PublicToolHandleArray" in propType:
+                toolSet = {_.getName() for _ in alreadySetProperties[pname]}
+                _log.debug('Public tool handle array properties? {} {}'.format(toolSet, pvalue))
+                # strings?
+                for newC in pvalue:
+                    if isinstance(newC, six.string_types):
+                        pubtoolclass, pubtoolname = newC.split('/')
+                        if pubtoolname not in toolSet:
+                            klass = __findConfigurableClass( pubtoolclass )
+                            alreadySetProperties[pname].append(klass( pubtoolname ))
+                    else:
+                        _log.warning('Not handling actual Configurable2s for public tool merging yet')
+                        raise Exception()           
             elif "PrivateToolHandle" in propType or "GaudiConfig2.Configurables" in propType or "ServiceHandle" in propType:
                 existingVal = getattr(existingConfigurableInstance, pname)
                 if isinstance( pvalue, str ):
@@ -951,10 +987,13 @@ def conf2toConfigurable( comp, indent="" ):
                     _log.debug( "{}Some kind of handle  and, object type {} existing {}".format( indent, type(pvalue), type(existingVal) ) )
                     __areSettingsSame( existingVal, pvalue, indent)
             else:
-                pvalue=__listHelperToList(pvalue)
+                if isinstance(pvalue,(GaudiConfig2.semantics._ListHelper,GaudiConfig2.semantics._DictHelper)):
+                    pvalue=pvalue.data
+
                 if pname not in alreadySetProperties:
-                    continue
-                if alreadySetProperties[pname] != pvalue:
+                    _log.info("{}Adding property: {} for {}".format(indent, pname, newConf2Instance.getName() ))
+                    setattr(existingConfigurableInstance, pname, pvalue)
+                elif alreadySetProperties[pname] != pvalue:
                     _log.info("{}Merging property: {} for {}".format(indent, pname, newConf2Instance.getName() ))
                     # create surrogate
                     clone = newConf2Instance.getInstance("Clone")
@@ -971,7 +1010,7 @@ def conf2toConfigurable( comp, indent="" ):
         _log.debug( "{}Pre-existing configurable {} was found, checking if has the same properties".format( indent, comp.getName() ) )
         __areSettingsSame( existingConfigurable, comp )
         _log.debug( "{}Pre-existing configurable was found to have the same properties".format( indent, comp.name ) )
-        instance = existingConfigurable
+        instance = existingConfigurable if not suppressDupes else None
     else: # create new configurable
         _log.debug( "{}Creating component configurable {}".format( indent, comp.getFullJobOptName() ) )
         configurableClass = __findConfigurableClass( comp.getFullJobOptName().split( "/" )[0] )
@@ -1002,14 +1041,22 @@ def appendCAtoAthena(ca):
     _log = logging.getLogger( "conf2toConfigurable".ljust(32) )
     _log.info( "Merging of CA to global ..." )
 
-
     from AthenaCommon.AppMgr import ServiceMgr,ToolSvc,theApp,athCondSeq,athOutSeq,athAlgSeq,topSequence
+    if len( ca.getPublicTools() ) != 0:
+        _log.info( "Merging public tools" )
+        for comp in ca.getPublicTools():
+            instance = conf2toConfigurable( comp, indent="  " )
+            if instance not in ToolSvc:
+                ToolSvc += instance
+
     if len(ca.getServices()) != 0:
         _log.info( "Merging services" )
         for comp in ca.getServices():
             instance = conf2toConfigurable( comp, indent="  " )
             if instance not in ServiceMgr:
                 ServiceMgr += instance
+        for svcName in ca._servicesToCreate:
+            theApp.CreateSvc += [svcName]
 
     if  len(ca._conditionsAlgs) != 0:
         _log.info( "Merging condition algorithms" )
@@ -1018,13 +1065,6 @@ def appendCAtoAthena(ca):
             if instance not in athCondSeq:
                 athCondSeq += instance
 
-    if len( ca.getPublicTools() ) != 0:
-        _log.info( "Merging public tools" )
-        for comp in ca.getPublicTools():
-            instance = conf2toConfigurable( comp, indent="  " )
-            if instance not in ToolSvc:
-                ToolSvc += instance
-
     if len( ca.getAppProps() ) != 0:
         _log.info( "Merging ApplicationMgr properties" )
         for (propName, propValue) in six.iteritems(ca.getAppProps()):
@@ -1066,8 +1106,10 @@ def appendCAtoAthena(ca):
             if el.__class__.__name__ == "AthSequencer":
                 __mergeSequences( sequence, el, __indent( indent ) )
             elif el.getGaudiType() == "Algorithm":
-                sequence += conf2toConfigurable( el, indent=__indent( indent ) )
-                _log.info( "{}Algorithm {} and added to the sequence {}".format( __indent( indent ),  el.getFullJobOptName(), sequence.name() ) )
+                toadd = conf2toConfigurable( el, indent=__indent( indent ), suppressDupes=True)
+                if toadd is not None:
+                    sequence += toadd
+                    _log.info( "{}Algorithm {} and added to the sequence {}".format( __indent( indent ),  el.getFullJobOptName(), sequence.name() ) )
 
 
     preconfigured = [athCondSeq,athOutSeq,athAlgSeq,topSequence]
diff --git a/Control/AthenaConfiguration/python/JobOptsDumper.py b/Control/AthenaConfiguration/python/JobOptsDumper.py
new file mode 100644
index 0000000000000000000000000000000000000000..96f7ce28dc24005e51c0b67def5f62549e186929
--- /dev/null
+++ b/Control/AthenaConfiguration/python/JobOptsDumper.py
@@ -0,0 +1,13 @@
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+from AthenaConfiguration.ComponentFactory import CompFactory
+
+
+def JobOptsDumperCfg(flags, FileName="JobOptsConfig.txt"):
+    """Return ComponentAccumulator with JobOptsDumperAlg.
+
+    This dumps the configuration to text in a file named by FileName.
+    """
+    acc = ComponentAccumulator()
+    acc.addEventAlgo(CompFactory.JobOptsDumperAlg(FileName=FileName))
+    return acc
diff --git a/Control/AthenaConfiguration/python/MainServicesConfig.py b/Control/AthenaConfiguration/python/MainServicesConfig.py
index 83dacda189f67aef1707a73d0d4c495089d34ae9..0b8a8eba503825d897449e9d945a2ea6b6fce4ad 100644
--- a/Control/AthenaConfiguration/python/MainServicesConfig.py
+++ b/Control/AthenaConfiguration/python/MainServicesConfig.py
@@ -77,8 +77,11 @@ def MainServicesCfg(cfgFlags):
     cfg.addService(StoreGateSvc("DetectorStore"))
     cfg.addService(StoreGateSvc("HistoryStore"))
     cfg.addService(StoreGateSvc("ConditionStore"))
-    
-    cfg.addService(CompFactory.CoreDumpSvc())
+
+    from AtlasGeoModel.GeoModelConfig import GeoModelCfg
+    cfg.merge( GeoModelCfg(cfgFlags) )
+    cfg.addService(CompFactory.DetDescrCnvSvc(), create=True)
+    cfg.addService(CompFactory.CoreDumpSvc(), create=True)
 
     cfg.setAppProperty('InitializationLoopCheck',False)
 
diff --git a/Control/AthenaConfiguration/share/confTool.py b/Control/AthenaConfiguration/share/confTool.py
index 7e6054d81e187adbcb27870826970e1cd0ef940e..3ae4bc6447e583f6814285a2ff0e9d36428ea174 100755
--- a/Control/AthenaConfiguration/share/confTool.py
+++ b/Control/AthenaConfiguration/share/confTool.py
@@ -123,9 +123,9 @@ def _loadSingleFile(fname, args):
                 conf = [to_json, props[0], props[1]]
 
             elif isinstance(cfg, collections.defaultdict):  # old configuration
+                cfg.update(pickle.load(input_file))
+                conf.append(pickle.load(input_file))
                 conf.append(cfg)
-                for _ in range(2):
-                    conf.append(pickle.load(input_file))
         print("... Read", len(conf), "items from python pickle file: ", fname)
 
     elif fname.endswith(".json"):
diff --git a/Control/AthenaExamples/AthAsgExUnittest/src/IMyPackageTool.h b/Control/AthenaExamples/AthAsgExUnittest/AthAsgExUnittest/IMyPackageTool.h
similarity index 100%
rename from Control/AthenaExamples/AthAsgExUnittest/src/IMyPackageTool.h
rename to Control/AthenaExamples/AthAsgExUnittest/AthAsgExUnittest/IMyPackageTool.h
diff --git a/Control/AthenaExamples/AthAsgExUnittest/src/MyPackageTool.h b/Control/AthenaExamples/AthAsgExUnittest/AthAsgExUnittest/MyPackageTool.h
similarity index 86%
rename from Control/AthenaExamples/AthAsgExUnittest/src/MyPackageTool.h
rename to Control/AthenaExamples/AthAsgExUnittest/AthAsgExUnittest/MyPackageTool.h
index ebc1bef9cbf18ea5b3947d48d504e7a4b1d22dc5..7cb9a2c8b5b4b3fa03381d8873e5192b08334d1e 100644
--- a/Control/AthenaExamples/AthAsgExUnittest/src/MyPackageTool.h
+++ b/Control/AthenaExamples/AthAsgExUnittest/AthAsgExUnittest/MyPackageTool.h
@@ -6,26 +6,26 @@
 #define ATHASGEXUNITTEST_MYPACKAGETOOL_H 1
 
 #include "AsgTools/AsgTool.h"
-#include "IMyPackageTool.h"
+#include "AthAsgExUnittest/IMyPackageTool.h"
 
-class MyPackageTool: public asg::AsgTool, public virtual IMyPackageTool { 
-public: 
+class MyPackageTool: public asg::AsgTool, public virtual IMyPackageTool {
+public:
 
   ASG_TOOL_CLASS( MyPackageTool, IMyPackageTool )
   // Add another constructor for non-athena use cases
   MyPackageTool( const std::string& name );
-  
+
   // Initialize is required by AsgTool base class
   virtual StatusCode initialize() override;
 
   // This tools method
   virtual double useTheProperty() override;
 
-private: 
+private:
 
   double m_nProperty;
-  unsigned int m_enumProperty; 
+  unsigned int m_enumProperty;
 
-}; 
+};
 
 #endif //> !ATHASGEXUNITTEST_MYPACKAGETOOL_H
diff --git a/Control/AthenaExamples/AthAsgExUnittest/CMakeLists.txt b/Control/AthenaExamples/AthAsgExUnittest/CMakeLists.txt
index 2386195349647cb205a3ca7511773728f788b027..9a01371f64cf4da3dc6f585dd9a78296bd70abb4 100644
--- a/Control/AthenaExamples/AthAsgExUnittest/CMakeLists.txt
+++ b/Control/AthenaExamples/AthAsgExUnittest/CMakeLists.txt
@@ -3,30 +3,37 @@
 # Declare the package name:
 atlas_subdir( AthAsgExUnittest )
 
+# Necessary external(s).
+find_package( GTest )
+find_package( GMock )
+
 # Libraries in the package:
 atlas_add_library( AthAsgExUnittestLib
-                   MyPackage/*.h src/*.cxx
-                   Root/*.cxx
-                   NO_PUBLIC_HEADERS
-                   LINK_LIBRARIES GaudiKernel AsgTools AthAnalysisBaseCompsLib )
+   AthAsgExUnittest/*.h Root/*.cxx
+   PUBLIC_HEADERS AthAsgExUnittest
+   LINK_LIBRARIES AsgTools )
 
 atlas_add_component( AthAsgExUnittest
-                     src/components/*.cxx
-                     LINK_LIBRARIES AthAsgExUnittestLib )
+   src/*.h src/*.cxx src/components/*.cxx
+   LINK_LIBRARIES AthAnalysisBaseCompsLib AsgTools AthAsgExUnittestLib )
 
 # Add tests:
 atlas_add_test( gt_AthAsgExUnittest
   SOURCES test/gt_AthAsgExUnittest.cxx
-  LINK_LIBRARIES GaudiKernel GoogleTestTools AthAsgExUnittestLib )
+  LINK_LIBRARIES GaudiKernel GoogleTestTools AsgTools AthAnalysisBaseCompsLib
+  AthAsgExUnittestLib )
 
 atlas_add_test( gt_AthExUnittest
   SOURCES test/gt_AthExUnittest.cxx
-  LINK_LIBRARIES GaudiKernel GoogleTestTools AthenaBaseComps AsgTools )
+  LINK_LIBRARIES GaudiKernel GoogleTestTools AthenaBaseComps
+  AthAsgExUnittestLib )
 
 atlas_add_test( gt_MockxAODJet
   SOURCES test/gt_MockxAODJet.cxx
-  LINK_LIBRARIES xAODJet GoogleTestTools )
+  INCLUDE_DIRS ${GTEST_INCLUDE_DIRS} ${GMOCK_INCLUDE_DIRS}
+  LINK_LIBRARIES ${GTEST_LIBRARIES} ${GMOCK_LIBRARIES} xAODJet )
 
 atlas_add_test( gt_xAODJet
   SOURCES test/gt_xAODJet.cxx
-  LINK_LIBRARIES xAODJet GoogleTestTools )
+  INCLUDE_DIRS ${GTEST_INCLUDE_DIRS}
+  LINK_LIBRARIES ${GTEST_LIBRARIES} xAODJet )
diff --git a/Control/AthenaExamples/AthAsgExUnittest/Root/MyPackageTool.cxx b/Control/AthenaExamples/AthAsgExUnittest/Root/MyPackageTool.cxx
index 0350e0f3b4c1a07f529d15d28bff44465a64e9e9..a2412ea53aa9392cdbfe868a06b6a947a5eb2375 100644
--- a/Control/AthenaExamples/AthAsgExUnittest/Root/MyPackageTool.cxx
+++ b/Control/AthenaExamples/AthAsgExUnittest/Root/MyPackageTool.cxx
@@ -4,13 +4,13 @@
 //
 
 // MyPackage includes
-#include "../src/MyPackageTool.h"
+#include "AthAsgExUnittest/MyPackageTool.h"
 
 MyPackageTool::MyPackageTool( const std::string& name ) : asg::AsgTool( name ) {
   //example property declarations with default values
-  declareProperty( "Property", m_nProperty = 3.0, 
+  declareProperty( "Property", m_nProperty = 3.0,
                    "Please describe the property here" );
-  declareProperty( "ENumProperty", m_enumProperty = Val1, 
+  declareProperty( "ENumProperty", m_enumProperty = Val1,
                    "Please define enums inside your classes, not just in namespaces" );
 }
 
@@ -27,4 +27,3 @@ StatusCode MyPackageTool::initialize() {
 double MyPackageTool::useTheProperty() {
   return m_nProperty;
 }
-
diff --git a/Control/AthenaExamples/AthAsgExUnittest/src/MyPackageAlg.h b/Control/AthenaExamples/AthAsgExUnittest/src/MyPackageAlg.h
index e8a9607eb7ed94bdeb8db453068ffbe61325a885..083cd15d3266c53e515d4fcb1d86965bb95f6d55 100644
--- a/Control/AthenaExamples/AthAsgExUnittest/src/MyPackageAlg.h
+++ b/Control/AthenaExamples/AthAsgExUnittest/src/MyPackageAlg.h
@@ -1,6 +1,6 @@
 // -*- mode: 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
 //
 
 #ifndef ATHASGEXUNITTEST_MYPACKAGEALG_H
@@ -12,24 +12,24 @@
 #include "AsgTools/AnaToolHandle.h" //use asg::AnaToolHandle instead of regular ToolHandles for full dual-use experience!
 #endif
 
-#include "IMyPackageTool.h"
+#include "AthAsgExUnittest/IMyPackageTool.h"
 
 
-class MyPackageAlg: public ::AthAnalysisAlgorithm { 
-public: 
+class MyPackageAlg: public ::AthAnalysisAlgorithm {
+public:
 
   MyPackageAlg( const std::string& name, ISvcLocator* pSvcLocator );
-  virtual ~MyPackageAlg(); 
+  virtual ~MyPackageAlg();
 
   virtual StatusCode initialize() override;
   virtual StatusCode execute() override;
   virtual StatusCode finalize() override;
 
-private: 
+private:
 
   int m_property;
   ToolHandle<IMyPackageTool> m_tool;
 
-}; 
+};
 
 #endif //> !ATHASGEXUNITTEST_MYPACKAGEALG_H
diff --git a/Control/AthenaExamples/AthAsgExUnittest/src/components/AthAsgExUnittest_entries.cxx b/Control/AthenaExamples/AthAsgExUnittest/src/components/AthAsgExUnittest_entries.cxx
index ef5eb1e88d28c2273a95c33b751286b122b17992..c0eca92882a183eb5bc5856f72540f56937aad77 100644
--- a/Control/AthenaExamples/AthAsgExUnittest/src/components/AthAsgExUnittest_entries.cxx
+++ b/Control/AthenaExamples/AthAsgExUnittest/src/components/AthAsgExUnittest_entries.cxx
@@ -1,8 +1,9 @@
+//
+// Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+//
+
+#include "AthAsgExUnittest/MyPackageTool.h"
 #include "../MyPackageAlg.h"
 
 DECLARE_COMPONENT( MyPackageAlg )
-
-
-#include "../MyPackageTool.h"
 DECLARE_COMPONENT( MyPackageTool )
-
diff --git a/Control/AthenaExamples/AthAsgExUnittest/test/gt_AthAsgExUnittest.cxx b/Control/AthenaExamples/AthAsgExUnittest/test/gt_AthAsgExUnittest.cxx
index d0de4e2dff099bef22ed6f8c9e7bd5cbdbb0392c..1f095366e2aeb64aa80197142c6491dd155d64ed 100644
--- a/Control/AthenaExamples/AthAsgExUnittest/test/gt_AthAsgExUnittest.cxx
+++ b/Control/AthenaExamples/AthAsgExUnittest/test/gt_AthAsgExUnittest.cxx
@@ -12,10 +12,11 @@
 #include "AsgTools/AnaToolHandle.h"
 #include "AthAnalysisBaseComps/AthAnalysisHelper.h"
 
-#include "../src/IMyPackageTool.h"
+#include "AthAsgExUnittest/IMyPackageTool.h"
+#include "AthAsgExUnittest/MyPackageTool.h"
 
-#include "../src/MyPackageTool.h"
-#include "../src/MyPackageAlg.h"
+#include "GaudiKernel/IAlgManager.h"
+#include "Gaudi/Algorithm.h"
 
 #include <iostream>
 #include <fstream>
@@ -44,25 +45,19 @@ namespace Athena_test {
     EXPECT_TRUE( myTool.getProperty( "Property", prop ).isSuccess() );
     EXPECT_EQ( std::stod( prop ), 42.0 );
   }
-  
+
   TEST_F( MyPackageToolTest, enumProperty ) {
     EXPECT_TRUE( myTool.setProperty( "EnumProperty", IMyPackageTool::Val2 ).isSuccess() );
     EXPECT_TRUE( myTool.initialize().isSuccess() );
     std::string prop;
     EXPECT_TRUE( myTool.getProperty( "EnumProperty", prop ).isSuccess() );
-    EXPECT_EQ( std::stoi( prop ), IMyPackageTool::Val2 ); 
+    EXPECT_EQ( std::stoi( prop ), IMyPackageTool::Val2 );
   }
-  
+
   // Algorithm test suite:
 
   class MyPackageAlgTest : public InitGaudiGoogleTest {
   public:
-
-    MyPackageAlgTest() 
-    //  : InitGaudiGoogleTest( MSG::INFO ) // get usual message blurb
-      : myAlg(nullptr)
-    {}
-
     virtual void SetUp() override {
       // Algorithm and Tool properties via service:
       // see: Control/AthAnalysisBaseComps/AthAnalysisBaseComps/AthAnalysisHelper.h
@@ -76,8 +71,15 @@ namespace Athena_test {
       EXPECT_TRUE( AthAnalysisHelper::addPropertyToCatalogue( "MyPackageAlg.AnotherName",
                                                               "Property",
                                                               42.0 ).isSuccess() );
-      // Create instance of my algorithm directly in dual_use package
-      myAlg= new MyPackageAlg( "MyPackageAlg", Gaudi::svcLocator() );
+      // Create instance of my algorithm through Gaudi.
+      IAlgManager* algMgr = svcMgr.as< IAlgManager >();
+      EXPECT_TRUE( algMgr != nullptr );
+      IAlgorithm* alg = nullptr;
+      EXPECT_TRUE( algMgr->createAlgorithm( "MyPackageAlg", "MyPackageAlg",
+                                            alg ).isSuccess() );
+      EXPECT_TRUE( alg != nullptr );
+      myAlg = dynamic_cast< Algorithm* >( alg );
+      EXPECT_TRUE( myAlg != nullptr );
     }
 
     MyPackageTool* getMyTool() {
@@ -89,14 +91,14 @@ namespace Athena_test {
       return mpt;
     }
 
-    MyPackageAlg* myAlg;
+    Algorithm* myAlg = nullptr;
 
   };
-  
+
   TEST_F( MyPackageAlgTest, initialise ) {
     EXPECT_TRUE( myAlg->initialize().isSuccess() );
   }
-  
+
   TEST_F( MyPackageAlgTest, setProperty ) {
     EXPECT_TRUE( myAlg->setProperty( "MyProperty", 5 ).isSuccess() );
     EXPECT_TRUE( myAlg->initialize().isSuccess() );
@@ -104,14 +106,14 @@ namespace Athena_test {
     EXPECT_TRUE( myAlg->getProperty( "MyProperty", prop ).isSuccess() );
     EXPECT_EQ( prop, "5" );
   }
-  
+
   TEST_F( MyPackageAlgTest, sysInitialize ) {
     EXPECT_TRUE( myAlg->sysInitialize().isSuccess() );
     std::string prop;
     EXPECT_TRUE( myAlg->getProperty( "MyProperty", prop ).isSuccess() );
     EXPECT_EQ( std::stoi( prop ), 21 );
   }
-  
+
   TEST_F( MyPackageAlgTest, toolProperty ) {
     // sysInitialize() gets properties then call initialize()
     EXPECT_TRUE( myAlg->sysInitialize().isSuccess() );
@@ -120,11 +122,10 @@ namespace Athena_test {
     EXPECT_TRUE( mpt->getProperty( "Property", prop ).isSuccess() );
     EXPECT_EQ( std::stod( prop ), 42.0 );
   }
-  
+
 }
 
 int main( int argc, char **argv ) {
   ::testing::InitGoogleTest( &argc, argv );
   return RUN_ALL_TESTS();
 }
-
diff --git a/Control/AthenaExamples/AthAsgExUnittest/test/gt_AthExUnittest.cxx b/Control/AthenaExamples/AthAsgExUnittest/test/gt_AthExUnittest.cxx
index 8772ce7043c2f48e16b2348d796e8fd521a5628b..6ef392c53035aacb202607c0dffcd745d314c985 100644
--- a/Control/AthenaExamples/AthAsgExUnittest/test/gt_AthExUnittest.cxx
+++ b/Control/AthenaExamples/AthAsgExUnittest/test/gt_AthExUnittest.cxx
@@ -12,7 +12,7 @@
 #include "AthenaBaseComps/AthAlgorithm.h"
 #include "AthenaBaseComps/AthService.h"
 
-#include "../src/IMyPackageTool.h"
+#include "AthAsgExUnittest/IMyPackageTool.h"
 
 #include <string>
 #include <iostream>
@@ -25,7 +25,7 @@ namespace Athena_test {
   class MyPackageAlgTest : public InitGaudiGoogleTest {
   public:
 
-    MyPackageAlgTest() 
+    MyPackageAlgTest()
     //  : InitGaudiGoogleTest( MSG::INFO ) // get usual message blurb
       : myAlg(nullptr)
     {}
@@ -61,29 +61,29 @@ namespace Athena_test {
     Gaudi::Algorithm* myAlg;
 
   };
-  
+
   TEST_F( MyPackageAlgTest, getDefaultPropertyValue ) {
     int prop= getIntProperty( "MyProperty" );
     EXPECT_EQ( prop, 1 );
   }
-  
+
   TEST_F( MyPackageAlgTest, initialise ) {
     EXPECT_TRUE( myAlg->initialize().isSuccess() );
   }
-  
+
   TEST_F( MyPackageAlgTest, setProperty ) {
     EXPECT_TRUE( myAlg->setProperty( "MyProperty", 5 ).isSuccess() );
     EXPECT_TRUE( myAlg->initialize().isSuccess() );
     int prop= getIntProperty( "MyProperty" );
     EXPECT_EQ( prop, 5 );
   }
-  
+
   TEST_F( MyPackageAlgTest, getPropertyFromCatalogue ) {
     EXPECT_TRUE( myAlg->sysInitialize().isSuccess() );
     int prop= getIntProperty( "MyProperty" );
     EXPECT_EQ( prop, 21 );
   }
-  
+
   TEST_F( MyPackageAlgTest, toolProperty ) {
     // sysInitialize() gets properties then calls initialize()
     EXPECT_TRUE( myAlg->sysInitialize().isSuccess() );
@@ -91,7 +91,7 @@ namespace Athena_test {
     double prop= mpt->useTheProperty();
     EXPECT_EQ( prop, 42.0 );
   }
-  
+
 }
 
 int main( int argc, char **argv ) {
diff --git a/Control/AthenaInterprocess/AthenaInterprocess/ATLAS_CHECK_THREAD_SAFETY b/Control/AthenaInterprocess/AthenaInterprocess/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..ab67b8a7d68bf327956b11d61f67ba55cd8ba5a3
--- /dev/null
+++ b/Control/AthenaInterprocess/AthenaInterprocess/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Control/AthenaInterprocess
diff --git a/Control/AthenaInterprocess/AthenaInterprocess/ProcessGroup.h b/Control/AthenaInterprocess/AthenaInterprocess/ProcessGroup.h
index 614710d95abc78744758d54afca5391408dc3da6..72fe47d101c9fc4d70c7f7f002ee34f5798cc857 100644
--- a/Control/AthenaInterprocess/AthenaInterprocess/ProcessGroup.h
+++ b/Control/AthenaInterprocess/AthenaInterprocess/ProcessGroup.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 ATHENAINTERPROCESS_PROCESSGROUP_H
@@ -7,6 +7,7 @@
 
 #include "AthenaInterprocess/Process.h"
 #include "AthenaInterprocess/IdentifiedSharedQueue.h"
+#include "CxxUtils/checker_macros.h"
 #include <vector>
 
 namespace AthenaInterprocess {
@@ -29,10 +30,10 @@ class ProcessGroup {
 
    virtual ~ProcessGroup();
 
-   pid_t launchProcess();  // Add one new process to the group
+   pid_t launchProcess ATLAS_NOT_THREAD_SAFE ();  // Add one new process to the group
 
-   int map_async(const IMessageDecoder* func, const ScheduledWork* args, pid_t pid=0); // If pid=0 map on the entire group
-   int wait(int options = 0); 
+   int map_async ATLAS_NOT_THREAD_SAFE (const IMessageDecoder* func, const ScheduledWork* args, pid_t pid=0); // If pid=0 map on the entire group
+   int wait ATLAS_NOT_THREAD_SAFE (int options = 0); 
    pid_t wait_once(bool& flag); // flag=true if process succeeded, flag=false otherwise
    ProcessResult* pullOneResult(); // The caller takes ownership on the result 
 
@@ -41,7 +42,7 @@ class ProcessGroup {
    const std::vector<ProcessStatus>& getStatuses() const;
 
  private:
-   bool create();
+   bool create ATLAS_NOT_THREAD_SAFE ();
 
    std::vector<Process> m_processes;
    std::vector<ProcessStatus> m_statuses;
diff --git a/Control/AthenaInterprocess/src/ProcessGroup.cxx b/Control/AthenaInterprocess/src/ProcessGroup.cxx
index b4b2a4c985cf42b97034723c474f4bc8286fa221..18f3c77fe9588d679f87bf799f10e3e32fa97104 100644
--- a/Control/AthenaInterprocess/src/ProcessGroup.cxx
+++ b/Control/AthenaInterprocess/src/ProcessGroup.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 "AthenaInterprocess/ProcessGroup.h"
@@ -46,7 +46,7 @@ ProcessGroup::~ProcessGroup()
 {
 }
 
-pid_t ProcessGroup::launchProcess()
+pid_t ProcessGroup::launchProcess ATLAS_NOT_THREAD_SAFE ()
 {
   if(m_pgid==-1)
     return -1;
@@ -72,7 +72,7 @@ pid_t ProcessGroup::launchProcess()
   return newpid;
 }
 
-int ProcessGroup::map_async(const IMessageDecoder* func, const ScheduledWork* args, pid_t pid) {
+int ProcessGroup::map_async ATLAS_NOT_THREAD_SAFE (const IMessageDecoder* func, const ScheduledWork* args, pid_t pid) {
   // If pid=0, map the function-object 'func' onto all current child processes. Does
   // not wait for the results, but will return success only if the writing to
   // all the child queues succeeds.
@@ -105,7 +105,7 @@ int ProcessGroup::map_async(const IMessageDecoder* func, const ScheduledWork* ar
   }
 }
 
-int ProcessGroup::wait(int options)
+int ProcessGroup::wait ATLAS_NOT_THREAD_SAFE (int options)
 {
   // Wait for all child processes and store their status codes in m_statuses
   if(m_processes.empty())
@@ -206,7 +206,7 @@ const std::vector<ProcessStatus>& ProcessGroup::getStatuses() const
   return m_statuses;
 }
 
-bool ProcessGroup::create()
+bool ProcessGroup::create ATLAS_NOT_THREAD_SAFE ()
 {
 // TODO: this code leaves the queues from the previous children visible to all
 // their subsequent siblings. This can be helped by creating the queue first
diff --git a/Control/AthenaKernel/AthenaKernel/IMetaDataTool.h b/Control/AthenaKernel/AthenaKernel/IMetaDataTool.h
index 2558e16bda4971e9b69fac1c0bb89061c94e45f7..f4c1c0b4fd90a76e9e591885947da8ead06274dc 100755
--- a/Control/AthenaKernel/AthenaKernel/IMetaDataTool.h
+++ b/Control/AthenaKernel/AthenaKernel/IMetaDataTool.h
@@ -32,10 +32,20 @@ public: // Non-static members
   virtual StatusCode metaDataStop() = 0;
 
   /// Gaudi boilerplate
-   static const InterfaceID& interfaceID();
-private: // Data
+  static const InterfaceID& interfaceID();
 };
 
+/** @class ILockableTool
+ *  @brief This class provides the locking interface that MetaData tools can implement.
+           MetaDataSvc will use these methods when writing out MetaData
+ **/
+class ILockableTool {
+public:
+   virtual void lock_shared() const = 0;
+   virtual void unlock_shared() const = 0;
+};
+
+
 inline const InterfaceID& IMetaDataTool::interfaceID() {
    static const InterfaceID IID("IMetaDataTool", 1, 0);
    return(IID);
diff --git a/Control/AthenaMonitoring/python/BadLBFilterToolConfig.py b/Control/AthenaMonitoring/python/BadLBFilterToolConfig.py
index 86384e7caebc02d433a13072f033a991bc15a3a7..62b3f0ac25245fb5574f2d693ab0b2667337fb4e 100644
--- a/Control/AthenaMonitoring/python/BadLBFilterToolConfig.py
+++ b/Control/AthenaMonitoring/python/BadLBFilterToolConfig.py
@@ -66,7 +66,7 @@ def BadLBFilterToolCfg(inputFlags,name, defects, alwaysReturnTrue=False, ignoreR
 
     sgkey = 'DQBadLBFilterAlgResult_%s' % name
     #Schedule required cond-algo
-    result.merge(BadLBFilterAlgCfg(inputFlags,name,defects,sgkey,ignoreRecoverable, origDbTag))
+    result.merge(BadLBFilterAlgCfg(inputFlags,name+'_Alg',defects,sgkey,ignoreRecoverable, origDbTag))
 
     monFilterTool=CompFactory.DQBadLBFilterTool(name,alwaysReturnTrue=alwaysReturnTrue,
                                                 ReadKey= sgkey)
diff --git a/Control/AthenaMonitoring/python/DQMonFlags.py b/Control/AthenaMonitoring/python/DQMonFlags.py
index e624702ee23d8125eb9ba4c5659a2bc8a2aa8d00..8b733d2b926f1e991fe45aace3d64c36ee24fdd7 100644
--- a/Control/AthenaMonitoring/python/DQMonFlags.py
+++ b/Control/AthenaMonitoring/python/DQMonFlags.py
@@ -227,7 +227,7 @@ class doAFPMon(JobProperty):
     """Switch for AFP monitoring"""
     statusOn=True
     allowedTypes=['bool']
-    StoredValue=False
+    StoredValue=True
 list+=[doAFPMon]
 
 class doHIMon(JobProperty):
@@ -414,6 +414,13 @@ class specialCleaningConfiguration(JobProperty):
     StoredValue={}
 list+=[specialCleaningConfiguration]
 
+class doNewMonitoring(JobProperty):
+    """ Global switch for monitoring """
+    statusOn=True
+    allowedTypes=['bool']
+    StoredValue=False
+list+=[doNewMonitoring]
+
 ##-----------------------------------------------------------------------------
 ## 2nd step
 ## Definition of the DQMon flag container
diff --git a/Control/AthenaMonitoring/python/TriggerInterface.py b/Control/AthenaMonitoring/python/TriggerInterface.py
index 83848acfbb52624fe1bbfb92cf1e3214ccffd975..fd3f07f7602a446944dbe3860840054998e8a7bf 100644
--- a/Control/AthenaMonitoring/python/TriggerInterface.py
+++ b/Control/AthenaMonitoring/python/TriggerInterface.py
@@ -18,8 +18,7 @@ def getTrigDecisionTool(flags):
     rv = ComponentAccumulator()
 
     if flags.DQ.isReallyOldStyle:
-        from AthenaCommon.AppMgr import ToolSvc
-        rv.addPublicTool(ToolSvc.TrigDecisionTool)
+        rv.addPublicTool(CompFactory.Trig.TrigDecisionTool('TrigDecisionTool'))
         getTrigDecisionTool.rv = rv
         return getTrigDecisionTool.rv
 
@@ -29,7 +28,12 @@ def getTrigDecisionTool(flags):
     tdt = CompFactory.Trig.TrigDecisionTool('TrigDecisionTool')
     tdt.TrigConfigSvc = cfgsvc
 
-    tdt.NavigationFormat = "TrigComposite" if 'HLTNav_Summary' in flags.Input.Collections else "TriggerElement"
+    if not flags.Input.isMC and flags.Input.Format == 'BS' and min(flags.Input.RunNumber) <= 380000:
+        # need to work through exact details here
+        # tdt.UseOldEventInfoDecisionFormat = True
+        tdt.NavigationFormat = "TrigComposite"
+    else:
+        tdt.NavigationFormat = "TrigComposite" if 'HLTNav_Summary' in flags.Input.Collections else "TriggerElement"
     rv.addPublicTool(tdt)
     # Other valid option of NavigationFormat is "TriggerElement" for Run 2 navigation. 
     # This option to be removed and "TrigComposite" the only valid choice once a R2->R3 converter is put in place. 
diff --git a/Control/AthenaMonitoring/share/DQMonFlagsConfig_jobOptions.py b/Control/AthenaMonitoring/share/DQMonFlagsConfig_jobOptions.py
index 38ef6113f109a5f4602102b778d412fbb1d9c58f..dfb1421e91687d48958a416b526e9f08206f5661 100644
--- a/Control/AthenaMonitoring/share/DQMonFlagsConfig_jobOptions.py
+++ b/Control/AthenaMonitoring/share/DQMonFlagsConfig_jobOptions.py
@@ -17,12 +17,6 @@ if not 'rec' in dir():
 
 from RecExConfig.RecAlgsFlags import recAlgs
 
-if rec.doTrigger() == False:
-   DQMonFlags.useTrigger=False     # steers trigger-awareness
-   DQMonFlags.doLVL1CaloMon=False
-   DQMonFlags.doCTPMon=False
-   DQMonFlags.doHLTMon=False
-
 # Set the data type based on beamType/HI flag
 if globalflags.DataSource.get_Value() == 'geant4':
    DQMonFlags.monManDataType = 'monteCarlo'
@@ -71,6 +65,13 @@ elif DQMonFlags.monType=='BSall':
 else:
    local_logger.warning("invalid DQMonFlags.monType: %s, using default monManEnvironment", DQMonFlags.monType())
 
+# the meaning of this flag has changed in MT
+if rec.doTrigger() == False and not (TriggerFlags.doMT() and DQMonFlags.monManEnvironment=='tier0ESD'):
+   DQMonFlags.useTrigger=False     # steers trigger-awareness
+   DQMonFlags.doLVL1CaloMon=False
+   DQMonFlags.doCTPMon=False
+   DQMonFlags.doHLTMon=False
+
 if not DQMonFlags.doMonitoring():
    local_logger.info("monitoring globally switched off")
    DQMonFlags.doGlobalMon=False
@@ -104,53 +105,54 @@ if not DQMonFlags.doMonitoring():
 else:
    local_logger.info("monitoring environment set to %s", DQMonFlags.monManEnvironment())
 
-   # AOD monitoring
-   if DQMonFlags.monManEnvironment == 'AOD':
-      DQMonFlags.histogramFile='MonitorAOD.root'
-      DQMonFlags.doCaloMon=False
-      DQMonFlags.doLArMon=False
-      DQMonFlags.doTileMon=False
-#      DQMonFlags.doJetMon=False
-      # ??
-      DQMonFlags.doCTPMon=False
-      DQMonFlags.doPixelMon=False
-      DQMonFlags.doSCTMon=False
-      DQMonFlags.doTRTMon=False
-      DQMonFlags.doTRTElectronMon=False
-      DQMonFlags.doInDetGlobalMon=False
-      DQMonFlags.doInDetAlignMon=False
+   # new-style monitoring drives this internally so skip this section
+   if not DQMonFlags.doNewMonitoring:
 
-      DQMonFlags.doGlobalMon=False
-      DQMonFlags.doLVL1CaloMon=False
-      DQMonFlags.doHLTMon=False
-      DQMonFlags.doEgammaMon=False
-      DQMonFlags.doMuonRawMon=False
-      DQMonFlags.doLucidMon=False
+      # AOD monitoring
+      if DQMonFlags.monManEnvironment == 'AOD':
+         DQMonFlags.histogramFile='MonitorAOD.root'
+         DQMonFlags.doCaloMon=False
+         DQMonFlags.doLArMon=False
+         DQMonFlags.doTileMon=False
+         DQMonFlags.doCTPMon=False
+         DQMonFlags.doPixelMon=False
+         DQMonFlags.doSCTMon=False
+         DQMonFlags.doTRTMon=False
+         DQMonFlags.doTRTElectronMon=False
+         DQMonFlags.doInDetGlobalMon=False
+         DQMonFlags.doInDetAlignMon=False
 
-   # ESD monitoring: switch off DQ monitoring packages which are not yet migrated:
-   elif DQMonFlags.monManEnvironment == 'tier0ESD':
-      DQMonFlags.histogramFile='MonitorESD.root'
-      DQMonFlags.doCTPMon=False
-      DQMonFlags.doPixelMon=False
-      DQMonFlags.doSCTMon=False
-      DQMonFlags.doTRTMon=False
-      DQMonFlags.doTRTElectronMon=False
-      DQMonFlags.doInDetGlobalMon=False
-      DQMonFlags.doInDetAlignMon=False
-   # ESD monitoring: packages which use only ESD: disable when running over BS
-   elif DQMonFlags.monManEnvironment == 'tier0Raw':
-      DQMonFlags.doInDetPerfMon=False
-      DQMonFlags.doMissingEtMon=False
-      DQMonFlags.doTauMon=False
-      DQMonFlags.doMuonTrackMon=False
-      DQMonFlags.doMuonAlignMon=False
-      DQMonFlags.doMuonPhysicsMon=False
-      DQMonFlags.doMuonSegmentMon=False
-      DQMonFlags.doMuonTrkPhysMon=False
-      DQMonFlags.doMuonCombinedMon=False
-      DQMonFlags.doLucidMon=False
-      DQMonFlags.doJetTagMon=False
-      DQMonFlags.doJetMon=False
+         DQMonFlags.doGlobalMon=False
+         DQMonFlags.doLVL1CaloMon=False
+         DQMonFlags.doHLTMon=False
+         DQMonFlags.doEgammaMon=False
+         DQMonFlags.doMuonRawMon=False
+         DQMonFlags.doLucidMon=False
+
+      # ESD monitoring: switch off DQ monitoring packages which are not yet migrated:
+      elif DQMonFlags.monManEnvironment == 'tier0ESD':
+         DQMonFlags.histogramFile='MonitorESD.root'
+         DQMonFlags.doCTPMon=False
+         DQMonFlags.doPixelMon=False
+         DQMonFlags.doSCTMon=False
+         DQMonFlags.doTRTMon=False
+         DQMonFlags.doTRTElectronMon=False
+         DQMonFlags.doInDetGlobalMon=False
+         DQMonFlags.doInDetAlignMon=False
+      # ESD monitoring: packages which use only ESD: disable when running over BS
+      elif DQMonFlags.monManEnvironment == 'tier0Raw':
+         DQMonFlags.doInDetPerfMon=False
+         DQMonFlags.doMissingEtMon=False
+         DQMonFlags.doTauMon=False
+         DQMonFlags.doMuonTrackMon=False
+         DQMonFlags.doMuonAlignMon=False
+         DQMonFlags.doMuonPhysicsMon=False
+         DQMonFlags.doMuonSegmentMon=False
+         DQMonFlags.doMuonTrkPhysMon=False
+         DQMonFlags.doMuonCombinedMon=False
+         DQMonFlags.doLucidMon=False
+         DQMonFlags.doJetTagMon=False
+         DQMonFlags.doJetMon=False
       
    # switch off monitoring if reco is off during BS reading
    if rec.readRDO() and not 'DetFlags' in dir():
@@ -246,9 +248,9 @@ if (not rec.doJetMissingETTag() or (rec.readRDO() and not jobproperties.JetRecFl
 if (not rec.doTau()):
    DQMonFlags.doTauMon=False
 
-# covered now by doJetMissingETTag
-# if (not recAlgs.doMissingET()):
-#    DQMonFlags.doMissingEtMon=False
+if not rec.doAFP() or DQMonFlags.monManDataType == 'monteCarlo':
+   DQMonFlags.doAFPMon=False
+
 
 #
 # Stream Aware Monitoring
diff --git a/Control/AthenaMonitoring/share/DataQualityInit_jobOptions.py b/Control/AthenaMonitoring/share/DataQualityInit_jobOptions.py
index 2ba251977e06a4534be3d961f030533fc9c2986a..83bcd2cbffa8cd1dcec8827aede9982b5510c5e9 100644
--- a/Control/AthenaMonitoring/share/DataQualityInit_jobOptions.py
+++ b/Control/AthenaMonitoring/share/DataQualityInit_jobOptions.py
@@ -11,7 +11,7 @@ try:
 except Exception:
    treatException("Could not load AthenaMonitoring/DQMonFlagsConfig_jobOptions.py")
 
-if DQMonFlags.doMonitoring(): 
+if DQMonFlags.doMonitoring() and not DQMonFlags.doNewMonitoring():
    if DQMonFlags.useTrigger():
       # trigger decision tool
       try:
diff --git a/Control/AthenaMonitoring/share/DataQualitySteering_jobOptions.py b/Control/AthenaMonitoring/share/DataQualitySteering_jobOptions.py
index e26b895994479194d2c03cdaf76cf79b916e7810..fababdb80e0ae6fe17a8818461bce12acbb8cc90 100644
--- a/Control/AthenaMonitoring/share/DataQualitySteering_jobOptions.py
+++ b/Control/AthenaMonitoring/share/DataQualitySteering_jobOptions.py
@@ -13,331 +13,371 @@ TRTELEMON=False
 local_logger = logging.getLogger('DataQualitySteering_jobOptions')
 
 if DQMonFlags.doMonitoring():
-   if DQMonFlags.useTrigger():
-      if not hasattr(ToolSvc, DQMonFlags.nameTrigDecTool()):
-         local_logger.debug("trigger decision tool not found, including it now")
-         include("AthenaMonitoring/TrigDecTool_jobOptions.py")
-
-
-   # don't set up lumi access if in MC or enableLumiAccess == False
-   if globalflags.DataSource.get_Value() != 'geant4' and DQMonFlags.enableLumiAccess():
-      if athenaCommonFlags.isOnline:
-         local_logger.debug("luminosity tool not found, importing online version")
-         from LumiBlockComps.LuminosityCondAlgDefault import LuminosityCondAlgOnlineDefault
-         LuminosityCondAlgOnlineDefault()
-      else:
-         local_logger.debug("luminosity tool not found, importing offline version")
-         from LumiBlockComps.LuminosityCondAlgDefault import LuminosityCondAlgDefault 
-         LuminosityCondAlgDefault()
-
-      from LumiBlockComps.LBDurationCondAlgDefault import LBDurationCondAlgDefault 
-      LBDurationCondAlgDefault()
-
-      from LumiBlockComps.TrigLiveFractionCondAlgDefault import TrigLiveFractionCondAlgDefault 
-      TrigLiveFractionCondAlgDefault()
-
-   from AthenaMonitoring.AtlasReadyFilterTool import GetAtlasReadyFilterTool
-   from AthenaMonitoring.FilledBunchFilterTool import GetFilledBunchFilterTool
-
-   #---------------------------#
-   # Inner detector monitoring #
-   #---------------------------#
-   if DQMonFlags.doPixelMon() or DQMonFlags.doSCTMon() or DQMonFlags.doTRTMon() or \
-         DQMonFlags.doInDetGlobalMon() or DQMonFlags.doInDetAlignMon():
-      try:
-         include("InDetRecExample/InDetMonitoring.py")
-      except Exception:
-         treatException("DataQualitySteering_jobOptions.py: exception when setting up inner detector monitoring")
-
-   #----------------------------#
-   # Global combined monitoring #
-   #----------------------------#
-   if DQMonFlags.doGlobalMon():
-      try:
-         include("DataQualityTools/DataQualityMon_jobOptions.py")
-      except Exception:
-         treatException("DataQualitySteering_jobOptions.py: exception when setting up global monitoring")
-   
-   #--------------------#
-   # Trigger monitoring #
-   #--------------------#
-   if DQMonFlags.doLVL1CaloMon():
-      try:
-         include("TrigT1CaloMonitoring/TrigT1CaloMonitoring_forRecExCommission.py")
-         include("TrigT1Monitoring/TrigT1Monitoring_forRecExCommission.py")
-      except Exception:
-         treatException("DataQualitySteering_jobOptions.py: exception when setting up L1 Calo monitoring")
-
-   if DQMonFlags.doCTPMon():
-      try:
-         include("TrigT1CTMonitoring/TrigT1CTMonitoringJobOptions_forRecExCommission.py")
-      except Exception:
-         treatException("DataQualitySteering_jobOptions.py: exception when setting up central trigger monitoring")
-
-   if DQMonFlags.doHLTMon():
-      try:
-         include("TrigHLTMonitoring/HLTMonitoring_topOptions.py")
-         HLTMonMan = topSequence.HLTMonManager
-         HLTMonMan.FileKey = DQMonFlags.monManFileKey()  
-      except Exception:
-         treatException("DataQualitySteering_jobOptions.py: exception when setting up HLT monitoring")
-
-   #--------------#
-   # TRT electron #
-   #--------------#
-   if DQMonFlags.doTRTElectronMon() and TRTELEMON:
-      try:
-         include("InDetPerformanceMonitoring/TRT_Monitoring_RecExCommonAddOn_jobOptions.py") 
-         TRTElMonMan = topSequence.TRTElectronMonManager
-         TRTElMonMan.FileKey     = DQMonFlags.monManFileKey()
-         TRTElMonMan.Environment = DQMonFlags.monManEnvironment()
-      except Exception:
-         treatException("DataQualitySteering_jobOptions.py: exception when setting up TRT electron monitoring")
-
-   #----------------#
-   # ID performance #
-   #----------------#
-   if DQMonFlags.doInDetPerfMon():
-      try:
-         include("InDetPerformanceMonitoring/IDPerfMon_jobOptions.py")
-         IDPerfMonManager = topSequence.IDPerfMonManager
-         IDPerfMonManager.FileKey          = DQMonFlags.monManFileKey()
-         IDPerfMonManager.Environment      = DQMonFlags.monManEnvironment()
-         include("InDetDiMuonMonitoring/InDetDiMuMon_jobOptions.py")
-         InDetDiMuMonManager = topSequence.InDetDiMuMonManager
-         InDetDiMuMonManager.FileKey          = DQMonFlags.monManFileKey()
-         InDetDiMuMonManager.Environment      = DQMonFlags.monManEnvironment()
-      except Exception:
-         treatException("DataQualitySteering_jobOptions.py: exception when setting up InDetPerformance/InDetDiMuon monitoring")
-
-   #--------------------#
-   # TileCal monitoring #
-   #--------------------#
-   if DQMonFlags.doTileMon():
-      try:
-      	 include("TileMonitoring/TileMon_jobOptions.py")
+   if not DQMonFlags.doNewMonitoring():
+      if DQMonFlags.useTrigger():
+         if not hasattr(ToolSvc, DQMonFlags.nameTrigDecTool()):
+            local_logger.debug("trigger decision tool not found, including it now")
+            include("AthenaMonitoring/TrigDecTool_jobOptions.py")
+
+
+      # don't set up lumi access if in MC or enableLumiAccess == False
+      if globalflags.DataSource.get_Value() != 'geant4' and DQMonFlags.enableLumiAccess():
+         if athenaCommonFlags.isOnline:
+            local_logger.debug("luminosity tool not found, importing online version")
+            from LumiBlockComps.LuminosityCondAlgDefault import LuminosityCondAlgOnlineDefault
+            LuminosityCondAlgOnlineDefault()
+         else:
+            local_logger.debug("luminosity tool not found, importing offline version")
+            from LumiBlockComps.LuminosityCondAlgDefault import LuminosityCondAlgDefault 
+            LuminosityCondAlgDefault()
+
+         from LumiBlockComps.LBDurationCondAlgDefault import LBDurationCondAlgDefault 
+         LBDurationCondAlgDefault()
+
+         from LumiBlockComps.TrigLiveFractionCondAlgDefault import TrigLiveFractionCondAlgDefault 
+         TrigLiveFractionCondAlgDefault()
+
+      from AthenaMonitoring.AtlasReadyFilterTool import GetAtlasReadyFilterTool
+      from AthenaMonitoring.FilledBunchFilterTool import GetFilledBunchFilterTool
+
+      #---------------------------#
+      # Inner detector monitoring #
+      #---------------------------#
+      if DQMonFlags.doPixelMon() or DQMonFlags.doSCTMon() or DQMonFlags.doTRTMon() or \
+            DQMonFlags.doInDetGlobalMon() or DQMonFlags.doInDetAlignMon():
+         try:
+            include("InDetRecExample/InDetMonitoring.py")
+         except Exception:
+            treatException("DataQualitySteering_jobOptions.py: exception when setting up inner detector monitoring")
+
+      #----------------------------#
+      # Global combined monitoring #
+      #----------------------------#
+      if DQMonFlags.doGlobalMon():
+         try:
+            include("DataQualityTools/DataQualityMon_jobOptions.py")
+         except Exception:
+            treatException("DataQualitySteering_jobOptions.py: exception when setting up global monitoring")
+      
+      #--------------------#
+      # Trigger monitoring #
+      #--------------------#
+      if DQMonFlags.doLVL1CaloMon():
+         try:
+            include("TrigT1CaloMonitoring/TrigT1CaloMonitoring_forRecExCommission.py")
+            include("TrigT1Monitoring/TrigT1Monitoring_forRecExCommission.py")
+         except Exception:
+            treatException("DataQualitySteering_jobOptions.py: exception when setting up L1 Calo monitoring")
+
+      if DQMonFlags.doCTPMon():
+         try:
+            include("TrigT1CTMonitoring/TrigT1CTMonitoringJobOptions_forRecExCommission.py")
+         except Exception:
+            treatException("DataQualitySteering_jobOptions.py: exception when setting up central trigger monitoring")
+
+      if DQMonFlags.doHLTMon():
+         try:
+            include("TrigHLTMonitoring/HLTMonitoring_topOptions.py")
+            HLTMonMan = topSequence.HLTMonManager
+            HLTMonMan.FileKey = DQMonFlags.monManFileKey()  
+         except Exception:
+            treatException("DataQualitySteering_jobOptions.py: exception when setting up HLT monitoring")
+
+      #--------------#
+      # TRT electron #
+      #--------------#
+      if DQMonFlags.doTRTElectronMon() and TRTELEMON:
+         try:
+            include("InDetPerformanceMonitoring/TRT_Monitoring_RecExCommonAddOn_jobOptions.py") 
+            TRTElMonMan = topSequence.TRTElectronMonManager
+            TRTElMonMan.FileKey     = DQMonFlags.monManFileKey()
+            TRTElMonMan.Environment = DQMonFlags.monManEnvironment()
+         except Exception:
+            treatException("DataQualitySteering_jobOptions.py: exception when setting up TRT electron monitoring")
+
+      #----------------#
+      # ID performance #
+      #----------------#
+      if DQMonFlags.doInDetPerfMon():
+         try:
+            include("InDetPerformanceMonitoring/IDPerfMon_jobOptions.py")
+            IDPerfMonManager = topSequence.IDPerfMonManager
+            IDPerfMonManager.FileKey          = DQMonFlags.monManFileKey()
+            IDPerfMonManager.Environment      = DQMonFlags.monManEnvironment()
+            include("InDetDiMuonMonitoring/InDetDiMuMon_jobOptions.py")
+            InDetDiMuMonManager = topSequence.InDetDiMuMonManager
+            InDetDiMuMonManager.FileKey          = DQMonFlags.monManFileKey()
+            InDetDiMuMonManager.Environment      = DQMonFlags.monManEnvironment()
+         except Exception:
+            treatException("DataQualitySteering_jobOptions.py: exception when setting up InDetPerformance/InDetDiMuon monitoring")
+
+      #--------------------#
+      # TileCal monitoring #
+      #--------------------#
+      if DQMonFlags.doTileMon():
+         try:
+            include("TileMonitoring/TileMon_jobOptions.py")
+      
+         except Exception:
+            treatException("DataQualitySteering_jobOptions.py: exception when setting up Tile monitoring")
+
+      #------------------#
+      # LAr monitoring   #
+      #------------------#
+      if DQMonFlags.doLArMon():
+         try:
+            LArMon = AthenaMonManager(name="LArMonManager",
+                           FileKey             = DQMonFlags.monManFileKey(),
+                           Environment         = DQMonFlags.monManEnvironment(),
+                           ManualDataTypeSetup = DQMonFlags.monManManualDataTypeSetup(),
+                           DataType            = DQMonFlags.monManDataType())
+            topSequence += LArMon
+            include("LArMonTools/LArAllMonitoring_jobOptions.py")
+            include("LArMonitoring/LArMonitoring_jobOption.py")
+         except Exception:
+            treatException("DataQualitySteering_jobOptions.py: exception when setting up LAr monitoring")
+
+      #-------------------------------------------------------------------------#
+      # Calo monitoring - cells and clusters independent of LAr or Tile origin  #
+      #-------------------------------------------------------------------------#
+      if DQMonFlags.doCaloMon():
+         try:
+            include("CaloMonitoring/CaloAllMonitoring_jobOptions.py")
+            include("CaloMonitoring/CaloNewMonitoring_jobOptions.py")
+         except Exception:
+            treatException("DataQualitySteering_jobOptions.py: exception when setting up Calo monitoring")
+
+      #-------------------#
+      # Egamma monitoring #
+      #-------------------#
+      if DQMonFlags.doEgammaMon():
+         try:
+            include("egammaPerformance/egammaMonitoring_jobOptions.py")
+         except Exception:
+            treatException("DataQualitySteering_jobOptions.py: exception when setting up Egamma monitoring")
+
+      #----------------#
+      # MET monitoring #
+      #----------------#
+      if DQMonFlags.doMissingEtMon():
+         try:
+            include("MissingETMonitoring/MissingET_Monitoring.py")
+         except Exception:
+            treatException("DataQualitySteering_jobOptions.py: exception when setting up ETmiss monitoring")
+
+      #----------------#
+      # Jet monitoring #
+      #----------------#
+      if DQMonFlags.doJetMon():
+         try:
+            include("JetMonitoring/JetMonitoring_jobOptions.py")
+         except Exception:
+            treatException("DataQualitySteering_jobOptions.py: exception when setting up Jet monitoring")
+
+      #----------------#
+      # Tau monitoring #
+      #----------------#
+      if DQMonFlags.doTauMon():
+         try:
+            include("tauMonitoring/tauMonitoring_jobOptions.py")
+         except Exception:
+            treatException("DataQualitySteering_jobOptions.py: exception when setting up Tau monitoring")
+
+      #--------------------#
+      # Jet tag monitoring #
+      #--------------------#
+      if DQMonFlags.doJetTagMon():
+         try:
+            include("JetTagMonitoring/JetTagMonitoring_jobOptions.py")
+         except Exception:
+            treatException("DataQualitySteering_jobOptions.py: exception when setting up jet-tag monitoring")
+
+      #-----------------------------#
+      # MuonSpectrometer monitoring #
+      #-----------------------------#
+      if (DQMonFlags.doMuonRawMon() or DQMonFlags.doMuonSegmentMon()
+         or DQMonFlags.doMuonTrackMon() or DQMonFlags.doMuonAlignMon()
+         or DQMonFlags.doMuonTrkPhysMon() or DQMonFlags.doMuonPhysicsMon()):
+         try:
+            include("MuonDQAMonitoring/MuonDetMonitoring.py")
+         except Exception:
+            treatException("DataQualitySteering_jobOptions.py: exception when setting up Muon detector monitoring")
    
-      except Exception:
-         treatException("DataQualitySteering_jobOptions.py: exception when setting up Tile monitoring")
-
-   #------------------#
-   # LAr monitoring   #
-   #------------------#
-   if DQMonFlags.doLArMon():
-      try:
-         LArMon = AthenaMonManager(name="LArMonManager",
-                          FileKey             = DQMonFlags.monManFileKey(),
-                          Environment         = DQMonFlags.monManEnvironment(),
-                          ManualDataTypeSetup = DQMonFlags.monManManualDataTypeSetup(),
-                          DataType            = DQMonFlags.monManDataType())
-         topSequence += LArMon
-         include("LArMonTools/LArAllMonitoring_jobOptions.py")
-         include("LArMonitoring/LArMonitoring_jobOption.py")
-      except Exception:
-         treatException("DataQualitySteering_jobOptions.py: exception when setting up LAr monitoring")
-
-   #-------------------------------------------------------------------------#
-   # Calo monitoring - cells and clusters independent of LAr or Tile origin  #
-   #-------------------------------------------------------------------------#
-   if DQMonFlags.doCaloMon():
-      try:
-         include("CaloMonitoring/CaloAllMonitoring_jobOptions.py")
-         include("CaloMonitoring/CaloNewMonitoring_jobOptions.py")
-      except Exception:
-         treatException("DataQualitySteering_jobOptions.py: exception when setting up Calo monitoring")
-
-   #-------------------#
-   # Egamma monitoring #
-   #-------------------#
-   if DQMonFlags.doEgammaMon():
-      try:
-         include("egammaPerformance/egammaMonitoring_jobOptions.py")
-      except Exception:
-         treatException("DataQualitySteering_jobOptions.py: exception when setting up Egamma monitoring")
-
-   #----------------#
-   # MET monitoring #
-   #----------------#
-   if DQMonFlags.doMissingEtMon():
-      try:
-         include("MissingETMonitoring/MissingET_Monitoring.py")
-      except Exception:
-         treatException("DataQualitySteering_jobOptions.py: exception when setting up ETmiss monitoring")
-
-   #----------------#
-   # Jet monitoring #
-   #----------------#
-   if DQMonFlags.doJetMon():
-      try:
-         include("JetMonitoring/JetMonitoring_jobOptions.py")
-      except Exception:
-         treatException("DataQualitySteering_jobOptions.py: exception when setting up Jet monitoring")
-
-   #----------------#
-   # Tau monitoring #
-   #----------------#
-   if DQMonFlags.doTauMon():
-      try:
-         include("tauMonitoring/tauMonitoring_jobOptions.py")
-      except Exception:
-         treatException("DataQualitySteering_jobOptions.py: exception when setting up Tau monitoring")
-
-   #--------------------#
-   # Jet tag monitoring #
-   #--------------------#
-   if DQMonFlags.doJetTagMon():
-      try:
-         include("JetTagMonitoring/JetTagMonitoring_jobOptions.py")
-      except Exception:
-         treatException("DataQualitySteering_jobOptions.py: exception when setting up jet-tag monitoring")
-
-   #-----------------------------#
-   # MuonSpectrometer monitoring #
-   #-----------------------------#
-   if (DQMonFlags.doMuonRawMon() or DQMonFlags.doMuonSegmentMon()
-       or DQMonFlags.doMuonTrackMon() or DQMonFlags.doMuonAlignMon()
-       or DQMonFlags.doMuonTrkPhysMon() or DQMonFlags.doMuonPhysicsMon()):
-     try:
-        include("MuonDQAMonitoring/MuonDetMonitoring.py")
-     except Exception:
-        treatException("DataQualitySteering_jobOptions.py: exception when setting up Muon detector monitoring")
-  
-   #------------------#
-   # LUCID monitoring #
-   #------------------#
-   if DQMonFlags.doLucidMon():
-      try:
-         include("LUCID_Monitoring/LUCIDMon_jobOptions.py")
-      except Exception:
-         treatException("DataQualitySteering_jobOptions.py: exception when setting up LUCID monitoring")
-
-   #------------------#                                                                                                                       
-   # AFP monitoring   #                                                                                                                       
-   #------------------#                                                                                                                       
-   if DQMonFlags.doAFPMon():
-      try:
-         include("AFP_Monitoring/AFPMonitoring_jobOptions.py")
-      except Exception:
-         treatException("DataQualitySteering_jobOptions.py: exception when setting up AFP monitoring")
-
-
-   #---------------------#
-   # HeavyIon monitoring #
-   #---------------------#
-   if DQMonFlags.doHIMon():
-      try:
-         include("HIMonitoring/HIMonitoringSteering_jo.py")
-      except Exception:
-         treatException("DataQualitySteering_jobOptions.py: exception when setting up HI monitoring")
-
-   #------------------------#
-   # Trigger chain steering #
-   #------------------------#
-   trigMap = DQMonFlags.triggerChainMap.get_Value()
-   for toolName, trigChain in six.iteritems(trigMap):
-      local_logger.debug("Applying trigger %s to %s", trigChain, toolName)
-      if hasattr(ToolSvc,toolName):
-         tool = getattr(ToolSvc,toolName)
-         tool.TriggerChain = trigChain
-      else:
-         local_logger.debug("%s is not found in ToolSvc. Cannot set trigger chain!", toolName)
-
-   #--------------------------#
-   # Post-setup configuration #
-   #--------------------------#
-   # force conditions update because the converter can't do it
-   if DQMonFlags.monManEnvironment in ('tier0ESD', 'AOD'):
-      from AthenaCommon.AlgSequence import AthSequencer
-      from AthenaMonitoring.AthenaMonitoringConf import ForceIDConditionsAlg
-      asq = AthSequencer("AthBeginSeq") 
-      asq += [ForceIDConditionsAlg()]
-
-   if rec.triggerStream()=='express':
-      include("AthenaMonitoring/AtlasReadyFilterTool_jobOptions.py")
-   local_logger.debug('DQ Post-Setup Configuration')
-   import re
-   from AthenaMonitoring.EventFlagFilterTool import GetEventFlagFilterTool
-
-   # now the DQ tools are private, extract them from the set of monitoring algorithms
-   toolset = set()
-   from AthenaMonitoring.AthenaMonitoringConf import AthenaMonManager
-   for _ in topSequence:
-      if isinstance(_, AthenaMonManager):
-         toolset.update(_.AthenaMonTools)
-
-         # in MT the initialization can be in random order ... force all managers to have common setup
-         _.FileKey             = DQMonFlags.monManFileKey()
-         _.ManualDataTypeSetup = DQMonFlags.monManManualDataTypeSetup()
-         _.DataType            = DQMonFlags.monManDataType()
-         _.Environment         = DQMonFlags.monManEnvironment()
-         _.LBsInLowStatInterval = DQMonFlags.monManLBsInLowStatInterval()
-         _.LBsInMediumStatInterval = DQMonFlags.monManLBsInMediumStatInterval()
-         _.LBsInHighStatInterval = DQMonFlags.monManLBsInHighStatInterval()
-         _.ManualRunLBSetup    = DQMonFlags.monManManualRunLBSetup()
-         _.Run                 = DQMonFlags.monManRun()
-         _.LumiBlock           = DQMonFlags.monManLumiBlock()
-
-   for tool in toolset:
-      # stop lumi access if we're in MC or enableLumiAccess == False
-      if 'EnableLumi' in dir(tool):
-         if globalflags.DataSource.get_Value() == 'geant4' or not DQMonFlags.enableLumiAccess():
-            tool.EnableLumi = False
+      #------------------#
+      # LUCID monitoring #
+      #------------------#
+      if DQMonFlags.doLucidMon():
+         try:
+            include("LUCID_Monitoring/LUCIDMon_jobOptions.py")
+         except Exception:
+            treatException("DataQualitySteering_jobOptions.py: exception when setting up LUCID monitoring")
+
+      #------------------#                                                                                                                       
+      # AFP monitoring   #                                                                                                                       
+      #------------------#                                                                                                                       
+      if DQMonFlags.doAFPMon():
+         try:
+            include("AFP_Monitoring/AFPMonitoring_jobOptions.py")
+         except Exception:
+            treatException("DataQualitySteering_jobOptions.py: exception when setting up AFP monitoring")
+
+
+      #---------------------#
+      # HeavyIon monitoring #
+      #---------------------#
+      if DQMonFlags.doHIMon():
+         try:
+            include("HIMonitoring/HIMonitoringSteering_jo.py")
+         except Exception:
+            treatException("DataQualitySteering_jobOptions.py: exception when setting up HI monitoring")
+
+      #------------------------#
+      # Trigger chain steering #
+      #------------------------#
+      trigMap = DQMonFlags.triggerChainMap.get_Value()
+      for toolName, trigChain in six.iteritems(trigMap):
+         local_logger.debug("Applying trigger %s to %s", trigChain, toolName)
+         if hasattr(ToolSvc,toolName):
+            tool = getattr(ToolSvc,toolName)
+            tool.TriggerChain = trigChain
          else:
-            tool.EnableLumi = True
-      # if we have the FilterTools attribute, assume this is in fact a
-      # monitoring tool
-      if hasattr(tool, 'FilterTools'):
-         # if express: use ATLAS Ready filter
-         local_logger.debug('Setting up filters for tool %s', tool)
-         if rec.triggerStream()=='express':
-            local_logger.info('Stream is express and we will add ready tool for %s', tool)
-            tool.FilterTools += [GetAtlasReadyFilterTool()]
-         # if requested: configure a generic event cleaning tool
-         if not athenaCommonFlags.isOnline() and any(re.match(_, tool.name()) for _ in DQMonFlags.includeInCleaning()):
-            if tool.name() in DQMonFlags.specialCleaningConfiguration():
-               config_ = DQMonFlags.specialCleaningConfiguration()[tool.name()].copy()
-               for _ in config_:
-                  try:
-                     config_[_] = bool(config_[_])
-                  except:
-                     local_logger.error('Unable to enact special event cleaning configuration for tool %s; cannot cast %s=%s to bool', tool.name(), _, config_[_])
-               config_['name'] = 'DQEventFlagFilterTool_%s' % tool.name()
-               tool.FilterTools += [GetEventFlagFilterTool(**config_)]
-               del config_
-               local_logger.info('Configurating special event cleaning for tool %s', tool)
+            local_logger.debug("%s is not found in ToolSvc. Cannot set trigger chain!", toolName)
+
+      #--------------------------#
+      # Post-setup configuration #
+      #--------------------------#
+      # force conditions update because the converter can't do it
+      if DQMonFlags.monManEnvironment in ('tier0ESD', 'AOD'):
+         from AthenaCommon.AlgSequence import AthSequencer
+         from AthenaMonitoring.AthenaMonitoringConf import ForceIDConditionsAlg
+         asq = AthSequencer("AthBeginSeq") 
+         asq += [ForceIDConditionsAlg()]
+
+      if rec.triggerStream()=='express':
+         include("AthenaMonitoring/AtlasReadyFilterTool_jobOptions.py")
+      local_logger.debug('DQ Post-Setup Configuration')
+      import re
+      from AthenaMonitoring.EventFlagFilterTool import GetEventFlagFilterTool
+
+      # now the DQ tools are private, extract them from the set of monitoring algorithms
+      toolset = set()
+      from AthenaMonitoring.AthenaMonitoringConf import AthenaMonManager
+      for _ in topSequence:
+         if isinstance(_, AthenaMonManager):
+            toolset.update(_.AthenaMonTools)
+
+            # in MT the initialization can be in random order ... force all managers to have common setup
+            _.FileKey             = DQMonFlags.monManFileKey()
+            _.ManualDataTypeSetup = DQMonFlags.monManManualDataTypeSetup()
+            _.DataType            = DQMonFlags.monManDataType()
+            _.Environment         = DQMonFlags.monManEnvironment()
+            _.LBsInLowStatInterval = DQMonFlags.monManLBsInLowStatInterval()
+            _.LBsInMediumStatInterval = DQMonFlags.monManLBsInMediumStatInterval()
+            _.LBsInHighStatInterval = DQMonFlags.monManLBsInHighStatInterval()
+            _.ManualRunLBSetup    = DQMonFlags.monManManualRunLBSetup()
+            _.Run                 = DQMonFlags.monManRun()
+            _.LumiBlock           = DQMonFlags.monManLumiBlock()
+
+      for tool in toolset:
+         # stop lumi access if we're in MC or enableLumiAccess == False
+         if 'EnableLumi' in dir(tool):
+            if globalflags.DataSource.get_Value() == 'geant4' or not DQMonFlags.enableLumiAccess():
+               tool.EnableLumi = False
             else:
-               local_logger.info('Configuring generic event cleaning for tool %s', tool)
-               tool.FilterTools += [GetEventFlagFilterTool('DQEventFlagFilterTool')]
-         else:
-            local_logger.info('NOT configuring event cleaning for tool %s', tool)
-
-         # give all the tools the trigger translator
-         if DQMonFlags.useTrigger():
-            tool.TrigDecisionTool = monTrigDecTool
-            tool.TriggerTranslatorTool = monTrigTransTool
-
-         if DQMonFlags.monToolPostExec():
-            postprocfunc = eval(DQMonFlags.monToolPostExec())
-            local_logger.debug('Applying postexec transform to  ===> %s', tool)
-            postprocfunc(tool)
-            del postprocfunc
-
-   # # set up new-style monitoring with new-style configuration
-   # # only enable this when we understand details better...
-   # local_logger.info('Setting up new-style DQ monitoring')
-   # from AthenaMonitoring.AthenaMonitoringCfg import AthenaMonitoringCfg
-   # from AthenaCommon.Configurable import Configurable
-
-   # _ = Configurable.configurableRun3Behavior
-   # Configurable.configurableRun3Behavior = 1
-   # from AthenaConfiguration.AllConfigFlags import ConfigFlags
-   # ConfigFlags.Input.Files = jobproperties.AthenaCommonFlags.FilesInput()
-   # ConfigFlags.Output.HISTFileName = DQMonFlags.histogramFile()
-   # ConfigFlags.DQ.isReallyOldStyle = True
-   # _2 = AthenaMonitoringCfg(ConfigFlags)
-   # Configurable.configurableRun3Behavior = _
-   # _2.printConfig()
-   # _2.appendToGlobals()
-   # del _, _2
-
-del local_logger
+               tool.EnableLumi = True
+         # if we have the FilterTools attribute, assume this is in fact a
+         # monitoring tool
+         if hasattr(tool, 'FilterTools'):
+            # if express: use ATLAS Ready filter
+            local_logger.debug('Setting up filters for tool %s', tool)
+            if rec.triggerStream()=='express':
+               local_logger.info('Stream is express and we will add ready tool for %s', tool)
+               tool.FilterTools += [GetAtlasReadyFilterTool()]
+            # if requested: configure a generic event cleaning tool
+            if not athenaCommonFlags.isOnline() and any(re.match(_, tool.name()) for _ in DQMonFlags.includeInCleaning()):
+               if tool.name() in DQMonFlags.specialCleaningConfiguration():
+                  config_ = DQMonFlags.specialCleaningConfiguration()[tool.name()].copy()
+                  for _ in config_:
+                     try:
+                        config_[_] = bool(config_[_])
+                     except:
+                        local_logger.error('Unable to enact special event cleaning configuration for tool %s; cannot cast %s=%s to bool', tool.name(), _, config_[_])
+                  config_['name'] = 'DQEventFlagFilterTool_%s' % tool.name()
+                  tool.FilterTools += [GetEventFlagFilterTool(**config_)]
+                  del config_
+                  local_logger.info('Configurating special event cleaning for tool %s', tool)
+               else:
+                  local_logger.info('Configuring generic event cleaning for tool %s', tool)
+                  tool.FilterTools += [GetEventFlagFilterTool('DQEventFlagFilterTool')]
+            else:
+               local_logger.info('NOT configuring event cleaning for tool %s', tool)
+
+            # give all the tools the trigger translator
+            if DQMonFlags.useTrigger():
+               tool.TrigDecisionTool = monTrigDecTool
+               tool.TriggerTranslatorTool = monTrigTransTool
+
+            if DQMonFlags.monToolPostExec():
+               postprocfunc = eval(DQMonFlags.monToolPostExec())
+               local_logger.debug('Applying postexec transform to  ===> %s', tool)
+               postprocfunc(tool)
+               del postprocfunc
+
+   else:
+      local_logger.info("DQ: setting up ConfigFlags")
+      from AthenaConfiguration.AllConfigFlags import ConfigFlags
+      if globalflags.InputFormat() == 'bytestream':
+         ConfigFlags.Input.Files=athenaCommonFlags.BSRDOInput()
+      elif globalflags.InputFormat() == 'pool':
+         ConfigFlags.Input.Files=svcMgr.EventSelector.InputCollections
+
+      ConfigFlags.GeoModel.Align.Dynamic=InDetFlags.useDynamicAlignFolders()
+      ConfigFlags.Detector.GeometryPixel=DetFlags.pixel_on()
+      ConfigFlags.Detector.GeometrySCT=DetFlags.SCT_on()
+      ConfigFlags.Detector.GeometryTRT=DetFlags.TRT_on()
+      ConfigFlags.InDet.usePixelDCS=InDetFlags.usePixelDCS()
+
+      ConfigFlags.Output.HISTFileName=DQMonFlags.histogramFile()
+      ConfigFlags.DQ.FileKey=DQMonFlags.monManFileKey()
+      ConfigFlags.DQ.Environment=DQMonFlags.monManEnvironment()
+      ConfigFlags.DQ.useTrigger=DQMonFlags.useTrigger()
+      ConfigFlags.IOVDb.GlobalTag=globalflags.ConditionsTag()
+      ConfigFlags.DQ.isReallyOldStyle=False
+
+      from AthenaConfiguration import ComponentAccumulator
+      from AthenaMonitoring.AthenaMonitoringCfg import AthenaMonitoringCfg
+      from AthenaMonitoring.DQConfigFlags import allSteeringFlagsOff
+      from AthenaMonitoring import AthenaMonitoringConf
+
+      Steering = ConfigFlags.DQ.Steering
+      Steering.doGlobalMon=DQMonFlags.doGlobalMon()
+      Steering.doLVL1CaloMon=DQMonFlags.doLVL1CaloMon()
+      Steering.doCTPMon=DQMonFlags.doCTPMon()
+      Steering.doHLTMon=DQMonFlags.doHLTMon()
+      Steering.doPixelMon=DQMonFlags.doPixelMon()
+      Steering.doSCTMon=DQMonFlags.doSCTMon()
+      Steering.doTRTMon=DQMonFlags.doTRTMon()
+      Steering.doLArMon=DQMonFlags.doLArMon()
+      Steering.doTileMon=DQMonFlags.doTileMon()
+      Steering.doCaloGlobalMon=DQMonFlags.doCaloMon()
+      Steering.Muon.doRawMon=DQMonFlags.doMuonRawMon()
+      Steering.Muon.doTrackMon=DQMonFlags.doMuonTrackMon()
+      Steering.doMuonMon=(Steering.Muon.doRawMon or Steering.Muon.doTrackMon)
+      Steering.doLucidMon=DQMonFlags.doLucidMon()
+      Steering.doAFPMon=DQMonFlags.doAFPMon()
+      Steering.doHIMon=DQMonFlags.doHIMon()
+      Steering.doEgammaMon=DQMonFlags.doEgammaMon()
+      Steering.doJetMon=DQMonFlags.doJetMon()
+      Steering.doMissingEtMon=DQMonFlags.doMissingEtMon()
+      Steering.doTauMon=DQMonFlags.doTauMon()
+      Steering.doJetTagMon=DQMonFlags.doJetTagMon()
+
+      ConfigFlags.dump()
+      ComponentAccumulator.CAtoGlobalWrapper(AthenaMonitoringCfg, ConfigFlags)
+
+      if len([_ for _ in AthSequencer("AthCondSeq") if _.getName()=="PixelDetectorElementCondAlg"]) > 0:
+         local_logger.info("DQ: force ID conditions loading")
+         asq = AthSequencer("AthBeginSeq")
+         asq += AthenaMonitoringConf.ForceIDConditionsAlg("ForceIDConditionsAlg")
+
+del local_logger
\ No newline at end of file
diff --git a/Control/AthenaMonitoring/share/TrigDecTool_jobOptions.py b/Control/AthenaMonitoring/share/TrigDecTool_jobOptions.py
index 5d8e8bf5e25a01bc35bdca0039c703ffca073d80..e52c842f309143277e676f0dc0b7259f6fe857b8 100644
--- a/Control/AthenaMonitoring/share/TrigDecTool_jobOptions.py
+++ b/Control/AthenaMonitoring/share/TrigDecTool_jobOptions.py
@@ -21,22 +21,19 @@ if DQMonFlags.useTrigger():
          cfg = TriggerConfigGetter()
 
    if not hasattr(ToolSvc, DQMonFlags.nameTrigDecTool().split('/')[-1]):
-      tdt_local_logger.error('DQ Monitoring is being asked to set up the TrigDecisionTool for some reason.  THIS IS A TERRIBLE IDEA AND SHOULD BE CONSIDERED A BUG!')
-      from TrigDecisionTool.TrigDecisionToolConf import Trig__TrigDecisionTool
-      monTrigDecTool = Trig__TrigDecisionTool(name=DQMonFlags.nameTrigDecTool(),
-                                              OutputLevel=ERROR,
-                                              PublicChainGroups = {"EFTau": "EF_[0-9]?tau.*",
-                                                                   "EFPhoton": "EF_[0-9]?g*",
-                                                                   "EFJets":"EF_J.*",
-                                                                  }
-                                             )
-      ToolSvc += monTrigDecTool
-      # The following should be provided automatically when setting up the tool, but is not
-      # Still needs to be provided by the trigger
-      # When trigger has a standard procedure for this, switch
-      ToolSvc.TrigDecisionTool.TrigConfigSvc = "Trig::TrigConfigSvc/TrigConfigSvc"
-      from TrigEDMConfig.TriggerEDM import EDMLibraries
-      ToolSvc.TrigDecisionTool.Navigation.Dlls = [e for e in  EDMLibraries if 'TPCnv' not in e]
+      if rec.doTrigger():
+         tdt_local_logger.error('DQ Monitoring is being asked to set up the TrigDecisionTool for some reason.  THIS IS A TERRIBLE IDEA AND SHOULD BE CONSIDERED A BUG!')
+      from AthenaMonitoring.TriggerInterface import getTrigDecisionTool
+      from AthenaConfiguration.AllConfigFlags import ConfigFlags
+      if globalflags.InputFormat() == 'bytestream':
+         ConfigFlags.Input.Files=athenaCommonFlags.BSRDOInput()
+      elif globalflags.InputFormat() == 'pool':
+         ConfigFlags.Input.Files=svcMgr.EventSelector.InputCollections
+
+      from AthenaConfiguration import ComponentAccumulator
+      ComponentAccumulator.CAtoGlobalWrapper(getTrigDecisionTool, ConfigFlags)
+
+      monTrigDecTool = getattr(ToolSvc, 'TrigDecisionTool')
    else:
       monTrigDecTool = getattr(ToolSvc, DQMonFlags.nameTrigDecTool().split('/')[-1])
    tdt_local_logger.info('Scheduled monitoring TDT %s', monTrigDecTool)
diff --git a/Control/AthenaMonitoringKernel/AthenaMonitoringKernel/GenericMonitoringTool.h b/Control/AthenaMonitoringKernel/AthenaMonitoringKernel/GenericMonitoringTool.h
index 4240937a3dba98c155e7b4a269907a49de2c5d63..8deb6504183a603cb0a8ef3518b2a4cb3aacd674 100644
--- a/Control/AthenaMonitoringKernel/AthenaMonitoringKernel/GenericMonitoringTool.h
+++ b/Control/AthenaMonitoringKernel/AthenaMonitoringKernel/GenericMonitoringTool.h
@@ -21,7 +21,7 @@
 
 #include "StoreGate/ReadHandleKey.h"
 #include "xAODEventInfo/EventInfo.h"
-
+#include "AthenaMonitoringKernel/HistogramFiller.h"
 
 /* Here, by forward declaring these two classes, which appear as parameters and values
    in GenericMonitoringTool functions only as pointers (not as the objects themselves),
@@ -81,8 +81,9 @@ private:
   Gaudi::Property<bool> m_explicitBooking { this, "ExplicitBooking", false, "Do not create histograms automatically in initialize but wait until the method book is called." };
   Gaudi::Property<bool> m_failOnEmpty { this, "FailOnEmpty", true, "Fail in initialize() if no histograms defined" };
 
-  std::unordered_map<std::string, std::vector<std::shared_ptr<Monitored::HistogramFiller>>> m_fillerMap; //!< map from variables to fillers
+  std::vector<std::shared_ptr<Monitored::HistogramFiller>> m_fillers; //!< plain list of fillers
   mutable std::mutex m_fillMutex;
+  mutable Monitored::HistogramFiller::VariablesPack m_vars ATLAS_THREAD_SAFE;
 };
 
 /**
diff --git a/Control/AthenaMonitoringKernel/AthenaMonitoringKernel/HistogramFiller.h b/Control/AthenaMonitoringKernel/AthenaMonitoringKernel/HistogramFiller.h
index 96b7bf5db3a8b11a4867a092f52552dbff5a43f5..670f3efe686b5990c5e73a5f118745725ec35e46 100644
--- a/Control/AthenaMonitoringKernel/AthenaMonitoringKernel/HistogramFiller.h
+++ b/Control/AthenaMonitoringKernel/AthenaMonitoringKernel/HistogramFiller.h
@@ -8,6 +8,7 @@
 #include <functional>
 #include <memory>
 #include <vector>
+#include "CxxUtils/AthUnlikelyMacros.h"
 
 #include "AthenaMonitoringKernel/HistogramDef.h"
 #include "AthenaMonitoringKernel/IHistogramProvider.h"
@@ -45,9 +46,7 @@ namespace Monitored {
      */
     HistogramFiller(const HistogramFiller& hf)
       : m_histDef(hf.m_histDef),
-        m_histogramProvider(hf.m_histogramProvider),
-        m_monWeight(hf.m_monWeight),
-        m_monCutMask(hf.m_monCutMask) {}
+        m_histogramProvider(hf.m_histogramProvider) {}
     /**
      * @brief Move constructor
      */
@@ -58,35 +57,65 @@ namespace Monitored {
      */
     virtual ~HistogramFiller() {}
 
+
     /**
-     * @brief Method that actually fills the ROOT object
-     * @return number of fills performed
+     * @brief helper class to pass variables to fillers
      */
-    virtual unsigned fill() const = 0;
+    struct VariablesPack {
+      VariablesPack() {}
+      VariablesPack( const std::initializer_list<const Monitored::IMonitoredVariable*>&  v)
+	:var( v ) {}
+
+      /**
+       * @brief number of variables in the pack ( not counting the weight and mask )
+       */
+      size_t size () const {
+	return var.size() - std::count( var.begin(), var.end(), nullptr );
+      }
 
+      /**
+       * @brief removes all monitored variables
+       */
+      inline void reset() {
+	std::fill( var.begin(), var.end(), nullptr );
+	cut = nullptr;
+	weight = nullptr;
+      }
 
-    /**
-     * @brief clone filler for actual filling
-     * Note that this operation is very cheap as the this class is effectively a flyweight
-     */
-    virtual HistogramFiller* clone() const = 0;
+      /**
+       * @brief sets monitored variable at the index (may need to reszie vector of variables)
+       */
+      inline void set( unsigned index, const IMonitoredVariable* ptr ) {
+	if ( ATH_UNLIKELY( var.size() <= index ) ) {
+	  var.resize(index+1);
+	}
+	var[index] = ptr;
+      }
 
+      /**
+       * @brief names of all varaibles stored
+       */
+      std::vector<std::string> names() const {
+	std::vector<std::string> r;
+	for ( const auto* v: var )
+	  if ( v != nullptr )
+	    r.push_back( v->name() );
+	return r;
+      }
 
-    void setMonitoredVariables(std::vector<std::reference_wrapper<Monitored::IMonitoredVariable>>&& monitoredVariables) {
-      m_monVariables = std::move(monitoredVariables);
-    }
+      std::vector<const Monitored::IMonitoredVariable*> var = { nullptr, nullptr, nullptr, nullptr }; //!< storage for variables, default size of 4, serves all histograming uses
+      const Monitored::IMonitoredVariable* weight = nullptr; //!< pointer to weight variable, typically absent
+      const Monitored::IMonitoredVariable* cut = nullptr; //!< pointer to cut mask variable, typically absent
+    };
 
     /**
-     * @brief Stores histogram weight
-     * @param monitoredWeight weight to use
+     * @brief Method that actually fills the ROOT object
+     * @return number of fills performed
      */
-    void setMonitoredWeight(Monitored::IMonitoredVariable* monitoredWeight) {
-      m_monWeight = monitoredWeight;
-    }
+    virtual unsigned fill( const VariablesPack& ) const = 0;
+
+
 
-    void setMonitoredCutMask(Monitored::IMonitoredVariable* monitoredCutMask) {
-      m_monCutMask = monitoredCutMask;
-    }
 
     const std::vector<std::string>& histogramVariablesNames() const {
       return m_histDef->name;
@@ -99,7 +128,7 @@ namespace Monitored {
     const std::string& histogramCutMaskName() const {
       return m_histDef->cutMask;
     }
-    
+
   protected:
     template <class H>
     H* histogram() const {
@@ -107,19 +136,19 @@ namespace Monitored {
     }
 
     // convenience function to provide a function that interprets the cutmask
-    std::pair<size_t, std::function<bool(size_t)>> getCutMaskFunc() const {
-      std::function<bool(size_t)> cutMaskValue = [] (size_t){ return true; }; // default is true
+    std::pair<size_t, std::function<bool(size_t)>> getCutMaskFunc(const Monitored::IMonitoredVariable* mask ) const {
+      std::function<bool(size_t)> cutMaskValue = [mask] (size_t){ return true; }; // default is true
       size_t maskSize = 1;
-      if ( m_monCutMask != nullptr ) {
-        maskSize = m_monCutMask->size();
+      if ( mask != nullptr ) {
+        maskSize = mask->size();
         if (maskSize == 1) {
-          if (!m_monCutMask->get(0)) {
+          if (!mask->get(0)) {
             // globally fails cut; zero first argument is a signal that one can abort
             return std::make_pair(0, [](size_t){ return false; });
             // otherwise, default cutMaskValue is sufficient
           }
         } else {
-          return std::make_pair(maskSize, [this](size_t i){ return static_cast<bool>(m_monCutMask->get(i)); });
+          return std::make_pair(maskSize, [mask](size_t i){ return static_cast<bool>(mask->get(i)); });
         }
       }
       return std::make_pair(maskSize, cutMaskValue);
@@ -150,10 +179,7 @@ namespace Monitored {
 
     std::shared_ptr<HistogramDef> m_histDef;
     std::shared_ptr<IHistogramProvider> m_histogramProvider;
-    std::vector<std::reference_wrapper<Monitored::IMonitoredVariable>> m_monVariables;
-    Monitored::IMonitoredVariable* m_monWeight{nullptr}; // bare pointer instead of reference as it can be null
-    Monitored::IMonitoredVariable* m_monCutMask{nullptr};
-    
+
   private:
     HistogramFiller& operator=(HistogramFiller const&) = delete;
   };
diff --git a/Control/AthenaMonitoringKernel/src/GenericMonitoringTool.cxx b/Control/AthenaMonitoringKernel/src/GenericMonitoringTool.cxx
index 15bc0bb6aef566f0192a28dfbfb613a6ada3d87f..3431c7a2138ef45c0ffab32d45a2e0e0a9646064 100644
--- a/Control/AthenaMonitoringKernel/src/GenericMonitoringTool.cxx
+++ b/Control/AthenaMonitoringKernel/src/GenericMonitoringTool.cxx
@@ -39,7 +39,7 @@ StatusCode GenericMonitoringTool::start() {
 }
 
 StatusCode GenericMonitoringTool::stop() {
-  m_fillerMap.clear();
+  m_fillers.clear();
   return StatusCode::SUCCESS;
 }
 
@@ -58,10 +58,6 @@ StatusCode GenericMonitoringTool::book() {
 
   HistogramFillerFactory factory(this, m_histoPath);
 
-  // First, make a vector of fillers. Then move the pointers to an unordered_map en masse.
-  std::vector<std::shared_ptr<Monitored::HistogramFiller>> fillers;
-  fillers.reserve(m_histograms.size());
-  m_fillerMap.reserve(m_histograms.size());
   for (const std::string& item : m_histograms) {
     if (item.empty()) {
       ATH_MSG_DEBUG( "Skipping empty histogram definition" );
@@ -74,7 +70,7 @@ StatusCode GenericMonitoringTool::book() {
       std::shared_ptr<HistogramFiller> filler(factory.create(def));
 
       if (filler) {
-        fillers.push_back(filler);
+	m_fillers.push_back(filler);
       } else {
         ATH_MSG_WARNING( "The histogram filler cannot be instantiated for: " << def.name );
       }
@@ -85,7 +81,7 @@ StatusCode GenericMonitoringTool::book() {
     ATH_MSG_DEBUG( "Monitoring for variable " << def.name << " prepared" );
   }
 
-  if ( fillers.empty() && m_failOnEmpty ) {
+  if ( m_fillers.empty() && m_failOnEmpty ) {
     std::string hists;
     for (const auto &h : m_histograms) hists += (h+",");
     ATH_MSG_ERROR("No monitored variables created based on histogram definition: [" << hists <<
@@ -93,12 +89,6 @@ StatusCode GenericMonitoringTool::book() {
     return StatusCode::FAILURE;
   }
 
-  for (const auto& filler : fillers ) {
-    const auto& fillerVariables = filler->histogramVariablesNames();
-    for (const auto& fillerVariable : fillerVariables) {
-      m_fillerMap[fillerVariable].push_back(filler);
-    }
-  }
 
   return StatusCode::SUCCESS;
 }
@@ -112,89 +102,68 @@ namespace Monitored {
 
 
 void GenericMonitoringTool::invokeFillers(const std::vector<std::reference_wrapper<Monitored::IMonitoredVariable>>& monitoredVariables) const {
-
-  // stage 1: get candidate fillers (assume generally we get only a few variables)
-  std::vector<HistogramFiller*> candidates;
-  for (const auto& monValue : monitoredVariables) {
-    const auto& match = m_fillerMap.find(monValue.get().name());
-    if (match != m_fillerMap.end()) {
-      candidates.reserve(candidates.size() + match->second.size());
-      for (const auto& i : match->second) {
-        candidates.push_back(i.get());
-      }
-    }
-  }
-  // dedup vector (yes, this is faster than using std::set above)
-  std::sort(candidates.begin(), candidates.end());
-  candidates.erase(std::unique(candidates.begin(), candidates.end()), candidates.end());
-  // stage 2: refine for fillers that have all variables set
-  std::vector<std::reference_wrapper<IMonitoredVariable>> variables;
-  variables.reserve(3); // enough for all current fillers
-
-  for (const auto& filler : candidates) {
-    // Find the associated monitored variable for each histogram's variable(s)
-    const auto& fillerVariables = filler->histogramVariablesNames();
-
-    variables.clear();
-    for (const auto& fillerVariable : fillerVariables) {
-      for (const auto& monValue : monitoredVariables) {
-        if (fillerVariable.compare(monValue.get().name()) == 0) {
-          variables.push_back(monValue);
+  std::scoped_lock guard(m_fillMutex);
+  for ( auto filler: m_fillers ) {
+    m_vars.reset();
+    const int fillerCardinality = filler->histogramVariablesNames().size() + (filler->histogramWeightName().empty() ? 0: 1) + (filler->histogramCutMaskName().empty() ? 0 : 1);
+
+    if ( fillerCardinality == 1 ) { // simplest case, optimising this to be super fast
+      for ( auto& var: monitoredVariables ) {
+        if ( var.get().name().compare( filler->histogramVariablesNames()[0] ) == 0 )  {
+	  m_vars.var[0] = &var.get();
+          filler->fill( m_vars );
           break;
         }
       }
-    }
-
-    // Find the weight variable in the list of monitored variables
-    const auto& fillerWeight = filler->histogramWeightName();
-    Monitored::IMonitoredVariable* weight(nullptr);
-    if ( not fillerWeight.empty() ) {
-      for (const auto& monValue : monitoredVariables) {
-        if (fillerWeight.compare(monValue.get().name()) == 0) {
-          weight = &monValue.get();
-          break;
-        }
+    } else { // a more complicated case, and cuts or weights
+      int matchesCount = 0;
+      for ( const auto& var: monitoredVariables ) {
+	bool matched = false;
+	for ( unsigned fillerVarIndex = 0; fillerVarIndex < filler->histogramVariablesNames().size(); ++fillerVarIndex ) {
+	  if ( var.get().name().compare( filler->histogramVariablesNames()[fillerVarIndex] ) == 0 ) {
+	    m_vars.set(fillerVarIndex, &var.get());
+	    matched = true;
+	    matchesCount++;
+	    break;
+	  }
+	}
+	if ( matchesCount == fillerCardinality ) break;
+	if ( not matched ) { // may be a weight or cut variable still
+	  if ( var.get().name().compare( filler->histogramWeightName() ) == 0 )  {
+	    m_vars.weight = &var.get();
+	    matchesCount ++;
+	  } else if ( var.get().name().compare( filler->histogramCutMaskName() ) == 0 )  {
+	    m_vars.cut = &var.get();
+	    matchesCount++;
+	  }
+	}
+	if ( matchesCount == fillerCardinality ) break;
       }
-    }
-
-    // Find the cutMask variable in the list of monitored variables
-    const auto& fillerCutMask = filler->histogramCutMaskName();
-    Monitored::IMonitoredVariable* cutmask(nullptr);
-    if ( not fillerCutMask.empty() ) {
-      for (const auto& monValue : monitoredVariables) {
-        if (fillerCutMask.compare(monValue.get().name()) == 0) {
-          cutmask = &monValue.get();
-          break;
-        }
+      if ( matchesCount == fillerCardinality ) {
+	filler->fill( m_vars );
+      } else if ( ATH_UNLIKELY( matchesCount != 0 ) ) { // something has matched, but not all, worth informing user
+	bool reasonFound = false;
+	if (ATH_UNLIKELY(!filler->histogramWeightName().empty() && !m_vars.weight)) {
+	  reasonFound = true;
+	  ATH_MSG_DEBUG("Filler weight not found in monitoredVariables:"
+			<< "\n  Filler weight               : " << filler->histogramWeightName()
+			<< "\n  Asked to fill from mon. vars: " << monitoredVariables);
+	}
+	if (ATH_UNLIKELY(!filler->histogramCutMaskName().empty() && !m_vars.cut)) {
+	  reasonFound = true;
+	  ATH_MSG_DEBUG("Filler cut mask not found in monitoredVariables:"
+			<< "\n  Filler cut mask             : " << filler->histogramCutMaskName()
+			<< "\n  Asked to fill from mon. vars: " << monitoredVariables);
+	}
+	if ( not reasonFound ) {
+	  ATH_MSG_DEBUG("Filler has different variables than monitoredVariables:"
+			<< "\n  Filler variables            : " << filler->histogramVariablesNames()
+			<< "\n  Asked to fill from mon. vars: " << monitoredVariables
+			<< "\n  Selected monitored variables: " << m_vars.names() );
+	}
       }
     }
-
-    if (fillerVariables.size() != variables.size()) {
-      ATH_MSG_DEBUG("Filler has different variables than monitoredVariables:"
-                    << "\n  Filler variables            : " << fillerVariables
-                    << "\n  Asked to fill from mon. vars: " << monitoredVariables
-                    << "\n  Selected monitored variables: " << variables);
-      continue;
-    }
-    if (ATH_UNLIKELY(!fillerWeight.empty() && !weight)) {
-      ATH_MSG_DEBUG("Filler weight not found in monitoredVariables:"
-                    << "\n  Filler weight               : " << fillerWeight
-                    << "\n  Asked to fill from mon. vars: " << monitoredVariables);
-      continue;
-    }
-    if (ATH_UNLIKELY(!fillerCutMask.empty() && !cutmask)) {
-      ATH_MSG_DEBUG("Filler cut mask not found in monitoredVariables:"
-                    << "\n  Filler cut mask             : " << fillerCutMask
-                    << "\n  Asked to fill from mon. vars: " << monitoredVariables);
-      continue;
-    }
-    
-    std::scoped_lock guard(m_fillMutex);
-    filler->setMonitoredVariables(std::move(variables));
-    filler->setMonitoredWeight(weight);
-    filler->setMonitoredCutMask(cutmask);
-    filler->fill();    
-  }  
+  }
 }
 
 uint32_t GenericMonitoringTool::runNumber() {
diff --git a/Control/AthenaMonitoringKernel/src/HistogramFiller/CumulativeHistogramFiller1D.h b/Control/AthenaMonitoringKernel/src/HistogramFiller/CumulativeHistogramFiller1D.h
index 195ce9c23b6617da681aca6580d8c4a20ece2e6c..3cd467a27562c1c258f893fed90dbf3a65ba1892 100644
--- a/Control/AthenaMonitoringKernel/src/HistogramFiller/CumulativeHistogramFiller1D.h
+++ b/Control/AthenaMonitoringKernel/src/HistogramFiller/CumulativeHistogramFiller1D.h
@@ -16,20 +16,17 @@ namespace Monitored {
     CumulativeHistogramFiller1D(const HistogramDef& definition, std::shared_ptr<IHistogramProvider> provider)
       : HistogramFiller1D(definition, provider) {}
 
-    virtual CumulativeHistogramFiller1D* clone() const override {
-      return new CumulativeHistogramFiller1D( *this );
-    }
 
     
-    virtual unsigned fill() const override {
-      if (m_monVariables.size() != 1) {
+    virtual unsigned fill( const HistogramFiller::VariablesPack& vars ) const override {
+      if ( vars.size() != 1) {
         return 0;
       }
 
-      size_t varVecSize = m_monVariables.at(0).get().size();
+      const size_t varVecSize = vars.var[0]->size();
 
       // handling of the cutmask
-      auto cutMaskValuePair = getCutMaskFunc();
+      auto cutMaskValuePair = getCutMaskFunc( vars.cut );
       if (cutMaskValuePair.first == 0) { return 0; }
       if (ATH_UNLIKELY(cutMaskValuePair.first > 1 && cutMaskValuePair.first != varVecSize)) {
         MsgStream log(Athena::getMessageSvc(), "CumulativeHistogramFiller1D");
@@ -37,13 +34,11 @@ namespace Monitored {
             << cutMaskValuePair.first << " " << varVecSize << endmsg;
       }
       auto cutMaskValue = cutMaskValuePair.second;
-
-      unsigned i(0);
+      unsigned i{0};
       auto histogram = this->histogram<TH1>();
-      const IMonitoredVariable& var = m_monVariables[0].get();
-      for (size_t i = 0; i < var.size(); i++) {
+      for (; i < varVecSize; i++) {
         if (!cutMaskValue(i)) { continue; }
-        const unsigned bin = histogram->FindBin(var.get(i));
+        const unsigned bin = histogram->FindBin(vars.var[0]->get(i));
 
         for (unsigned j = bin; j > 0; --j) {
           histogram->AddBinContent(j);
diff --git a/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFiller1D.h b/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFiller1D.h
index 4d0232d865496375faec67f200669a61fc6016bb..57c8e9064b1ef4240c36b6cc9eedc319233acfa4 100644
--- a/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFiller1D.h
+++ b/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFiller1D.h
@@ -24,42 +24,35 @@ namespace Monitored {
       : HistogramFiller(definition, provider) {
     }
 
-    virtual HistogramFiller1D* clone() const override {
-      return new HistogramFiller1D( *this );
-    }
-
-    virtual unsigned fill() const override {
-      if (m_monVariables.size() != 1) { return 0; }
-      const IMonitoredVariable& var = m_monVariables.at(0).get();
-
+    virtual unsigned fill( const HistogramFiller::VariablesPack& vars ) const override {
       std::function<bool(size_t)> cutMaskAccessor;
-      if (m_monCutMask) {
+      if ( vars.cut ) {
         // handling of the cutmask
-        auto cutMaskValuePair = getCutMaskFunc();
+        auto cutMaskValuePair = getCutMaskFunc(vars.cut);
         if (cutMaskValuePair.first == 0) { return 0; }
-        if (ATH_UNLIKELY(cutMaskValuePair.first > 1 && cutMaskValuePair.first != var.size())) {
+        if (ATH_UNLIKELY(cutMaskValuePair.first > 1 && cutMaskValuePair.first != vars.var[0]->size())) {
           MsgStream log(Athena::getMessageSvc(), "HistogramFiller1D");
           log << MSG::ERROR << "CutMask does not match the size of plotted variable: "
-              << cutMaskValuePair.first << " " << var.size() << endmsg;
+              << cutMaskValuePair.first << " " << vars.var[0]->size() << endmsg;
         }
         cutMaskAccessor = cutMaskValuePair.second;
       }
 
-      if (m_monWeight) {
-        auto weightAccessor = [&](size_t i){ return m_monWeight->get(i); };
+      if (vars.weight) {
+        auto weightAccessor = [&](size_t i){ return vars.weight->get(i); };
 
-        if (ATH_UNLIKELY(m_monWeight->size() != var.size())) {
+        if (ATH_UNLIKELY(vars.weight->size() != vars.var[0]->size())) {
           MsgStream log(Athena::getMessageSvc(), "HistogramFiller1D");
           log << MSG::ERROR << "Weight does not match the size of plotted variable: "
-              << m_monWeight->size() << " " << var.size() << endmsg;
+              << vars.weight->size() << " " << vars.var[0]->size() << endmsg;
         }
         // Need to fill here while weightVector is still in scope
-        if (not m_monCutMask) return HistogramFiller::fill<TH1>(weightAccessor, detail::noCut, var);
-        else                  return HistogramFiller::fill<TH1>(weightAccessor, cutMaskAccessor, var);
+        if (not vars.cut) return HistogramFiller::fill<TH1>(weightAccessor, detail::noCut, *vars.var[0]);
+        else                  return HistogramFiller::fill<TH1>(weightAccessor, cutMaskAccessor, *vars.var[0]);
       }
 
-      if (not m_monCutMask) return HistogramFiller::fill<TH1>(detail::noWeight, detail::noCut, var);
-      else                  return HistogramFiller::fill<TH1>(detail::noWeight, cutMaskAccessor, var);
+      if (not vars.cut) return HistogramFiller::fill<TH1>(detail::noWeight, detail::noCut, *vars.var[0]);
+      else                  return HistogramFiller::fill<TH1>(detail::noWeight, cutMaskAccessor, *vars.var[0]);      
     }
   };
 }
diff --git a/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFiller2D.h b/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFiller2D.h
index 302e6f3c293874f748e6bf08414d65e4f9718244..fdea3f617abb955f1cada3df3851380d8f66f0b8 100644
--- a/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFiller2D.h
+++ b/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFiller2D.h
@@ -25,62 +25,55 @@ namespace Monitored {
     HistogramFiller2DGeneric(const HistogramDef& definition, std::shared_ptr<IHistogramProvider> provider)
       : HistogramFiller(definition, provider) {}
 
-    virtual HistogramFiller2DGeneric* clone() const override {
-      return new HistogramFiller2DGeneric( *this );
-    }
-    
-    virtual unsigned fill() const override {
-      if (ATH_UNLIKELY(m_monVariables.size() != 2)) return 0;
+    virtual unsigned fill( const HistogramFiller::VariablesPack& vars) const override {
+      if (ATH_UNLIKELY(vars.var[0] == nullptr or vars.var[1] == nullptr )) return 0;
 
-      const IMonitoredVariable& var1 = m_monVariables[0].get();
-      const IMonitoredVariable& var2 = m_monVariables[1].get();
-      const size_t size1 = var1.size();
-      const size_t size2 = var2.size();
+      const size_t size0 = vars.var[0]->size();
+      const size_t size1 = vars.var[1]->size();
 
-      if (ATH_UNLIKELY(size1 == 0 || size2 == 0)) {
+      if (ATH_UNLIKELY(size0 == 0 || size1 == 0)) {
         // nothing to do
         return 0;
       }
 
-      if (ATH_UNLIKELY(size1 > 1 && size2 > 1 && size1 != size2)) {
+      if (ATH_UNLIKELY(size0 > 1 && size1 > 1 && size0 != size1)) {
         MsgStream log(Athena::getMessageSvc(), "HistogramFiller2D");
         log << MSG::ERROR << "Mismatch of provided vector sizes "
-            << size1 << "," << size2 << " for " << m_histDef->alias << endmsg;
+            << size0 << "," << size1 << " for " << m_histDef->alias << endmsg;
         return 0;
       }
 
       std::function<bool(size_t)> cutMaskAccessor;
-      if (m_monCutMask) {
+      if (vars.cut) {
         // handling of the cutmask
-        auto cutMaskValuePair = getCutMaskFunc();
+        auto cutMaskValuePair = getCutMaskFunc(vars.cut);
         if (cutMaskValuePair.first == 0) { return 0; }
-        if (ATH_UNLIKELY(size1 > 1 && size2 > 1 &&
-                         cutMaskValuePair.first > 1 && size1 != cutMaskValuePair.first)) {
+        if (ATH_UNLIKELY(size0 > 1 && size1 > 1 &&
+                         cutMaskValuePair.first > 1 && size0 != cutMaskValuePair.first)) {
           MsgStream log(Athena::getMessageSvc(), "HistogramFiller2D");
           log << MSG::ERROR << "CutMask does not match the size of plotted variable: "
-              << cutMaskValuePair.first << " " << size1 << endmsg;
+              << cutMaskValuePair.first << " " << size0 << endmsg;
           return 0;
         }
         cutMaskAccessor = cutMaskValuePair.second;
       }
 
-      if (m_monWeight) {
-        auto weightAccessor = [&](size_t i){ return m_monWeight->get(i); };
-
-        if (ATH_UNLIKELY(size1 > 1 && size2 > 1 &&
-                         m_monWeight->size() > 1 && size1 != m_monWeight->size())) {
+      if (vars.weight) {
+        auto weightAccessor = [&](size_t i){ return vars.weight->get(i); };
+        if (ATH_UNLIKELY(size0 > 1 && size1 > 1 &&
+                         vars.weight->size() > 1 && size0 != vars.weight->size())) {
           MsgStream log(Athena::getMessageSvc(), "HistogramFiller2D");
           log << MSG::ERROR << "Weight does not match the size of plotted variable: "
-              << m_monWeight->size() << " " << size1 << endmsg;
+              << vars.weight->size() << " " << size0 << endmsg;
           return 0;
         }
         // Need to fill here while weightVector is still in scope
-        if (not m_monCutMask) return HistogramFiller::fill<H>(weightAccessor, detail::noCut, var1, var2);
-        else                  return HistogramFiller::fill<H>(weightAccessor, cutMaskAccessor, var1, var2);
+        if (not vars.cut) return HistogramFiller::fill<H>(weightAccessor, detail::noCut, *vars.var[0], *vars.var[1]);
+        else                  return HistogramFiller::fill<H>(weightAccessor, cutMaskAccessor, *vars.var[0], *vars.var[1]);
       }
 
-      if (not m_monCutMask) return HistogramFiller::fill<H>(detail::noWeight, detail::noCut, var1, var2);
-      else                  return HistogramFiller::fill<H>(detail::noWeight, cutMaskAccessor, var1, var2);
+      if (not vars.cut) return HistogramFiller::fill<H>(detail::noWeight, detail::noCut, *vars.var[0], *vars.var[1]);
+      else                  return HistogramFiller::fill<H>(detail::noWeight, cutMaskAccessor, *vars.var[0], *vars.var[1]);
     }
   };
 
@@ -88,3 +81,4 @@ namespace Monitored {
 }
 
 #endif /* AthenaMonitoringKernel_HistogramFiller_HistogramFiller2D_h */
+
diff --git a/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFiller2DProfile.h b/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFiller2DProfile.h
index e8f8e150b19a248d42680300bfa93387b5f04012..1e79c9462cc76dd251491fcb0e8b883fbb6d5644 100644
--- a/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFiller2DProfile.h
+++ b/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFiller2DProfile.h
@@ -19,26 +19,18 @@ namespace Monitored {
     HistogramFiller2DProfile(const HistogramDef& definition, std::shared_ptr<IHistogramProvider> provider)
       : HistogramFiller(definition, provider) {}
 
-    virtual HistogramFiller2DProfile* clone() const override {
-      return new HistogramFiller2DProfile( *this );
-    }
-
 
-    virtual unsigned fill() const override {
-      if (m_monVariables.size() != 3) {
+    virtual unsigned fill( const HistogramFiller::VariablesPack& vars ) const override {
+	if ( vars.size() != 3) {
         return 0;
       }
 
       // handling of the cutmask
-      auto cutMaskValuePair = getCutMaskFunc();
+      auto cutMaskValuePair = getCutMaskFunc(vars.cut);
       if (cutMaskValuePair.first == 0) { return 0; }
       auto cutMaskAccessor = cutMaskValuePair.second;
 
       auto histogram = this->histogram<TProfile2D>();
-      const IMonitoredVariable& var1 = m_monVariables[0].get();
-      const IMonitoredVariable& var2 = m_monVariables[1].get();
-      const IMonitoredVariable& var3 = m_monVariables[2].get();
-
       /*HERE NEED TO INCLUDE CASE IN WHICH SOME VARIABLES ARE SCALAR AND SOME VARIABLES ARE VECTORS
       unsigned i(0);
       if (m_variable1->size() != m_variable2->size() || m_variable1->size() != m_variable3->size() || m_variable2->size() != m_variable3->size() ) {
@@ -46,22 +38,22 @@ namespace Monitored {
       }*/
 
       //For now lets just consider the case in which all variables are of the same length
-      if ( m_monWeight && m_monWeight->size()==var1.size() ) {
+      if ( vars.weight && vars.weight->size() == vars.var[0]->size() ) {
         // Weighted fill
-        for (unsigned i = 0; i < var1.size(); ++i) {
+        for (unsigned i = 0; i < vars.var[0]->size(); ++i) {
           if (cutMaskAccessor(i)) {
-            histogram->Fill(var1.get(i), var2.get(i), var3.get(i), m_monWeight->get(i));
+            histogram->Fill(vars.var[0]->get(i), vars.var[1]->get(i), vars.var[2]->get(i), vars.weight->get(i));
           }
         }
       } else {
         // Unweighted fill
-        for (unsigned i = 0; i < var1.size(); ++i) {
+        for (unsigned i = 0; i < vars.var[0]->size(); ++i) {
           if (cutMaskAccessor(i)) {
-            histogram->Fill(var1.get(i), var2.get(i), var3.get(i));
+            histogram->Fill(vars.var[0]->get(i), vars.var[1]->get(i), vars.var[2]->get(i));
           }
         }
       }
-      return var1.size();
+      return vars.var[0]->size();
     }
   };
 }
diff --git a/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFillerEfficiency.h b/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFillerEfficiency.h
index 2cd1f38d003ed449de1d7481d93aeeb76f088056..14a619ce24526925832ca0129fb6655a1714742d 100644
--- a/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFillerEfficiency.h
+++ b/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFillerEfficiency.h
@@ -19,58 +19,57 @@ namespace Monitored {
     HistogramFillerEfficiency(const HistogramDef& definition, std::shared_ptr<IHistogramProvider> provider)
       : HistogramFiller(definition, provider) {}
 
-    virtual HistogramFillerEfficiency* clone() const override {
-      return new HistogramFillerEfficiency( *this );
-    }
+    virtual unsigned fill( const HistogramFiller::VariablesPack& vars ) const override {
+
+      if ( ATH_UNLIKELY( vars.var[0] == nullptr or vars.var[1] == nullptr ) ) return 0;
 
-    virtual unsigned fill() const override {
-      const size_t nMonVar = m_monVariables.size();
-      if ( nMonVar<2 ) return 0;
 
-      const IMonitoredVariable& var0 = m_monVariables[0].get();
 
-      auto cutMaskValuePair = getCutMaskFunc();
+      auto cutMaskValuePair = getCutMaskFunc(vars.cut);
       if (cutMaskValuePair.first == 0) { return 0; }
-      if (ATH_UNLIKELY(cutMaskValuePair.first > 1 && cutMaskValuePair.first != var0.size())) {
+      if (ATH_UNLIKELY(cutMaskValuePair.first > 1 && cutMaskValuePair.first != vars.var[0]->size())) {
         MsgStream log(Athena::getMessageSvc(), "HistogramFillerEfficiency");
         log << MSG::ERROR << "CutMask does not match the size of plotted variable: " 
-            << cutMaskValuePair.first << " " << var0.size() << endmsg;
+            << cutMaskValuePair.first << " " << vars.var[0]->size() << endmsg;
       }
       auto cutMaskAccessor = cutMaskValuePair.second;
 
       TEfficiency* efficiency = this->histogram<TEfficiency>();
       const TH1* efftot = efficiency->GetTotalHistogram();
 
+      const unsigned nMonVar = vars.size();
+      const size_t var0Size = vars.var[0]->size();
       if ( nMonVar==2 ) { // Single observable (1D TEfficiency)
-        for (unsigned i = 0; i < var0.size(); ++i) {
+        for (unsigned i = 0; i < var0Size; ++i) {
           if (cutMaskAccessor(i)) {
-            efficiency->Fill(var0.get(i),
-                             detail::getFillValue<Axis::X>(efftot, m_monVariables[1].get(), i));
+            efficiency->Fill(vars.var[0]->get(i),
+                             detail::getFillValue<Axis::X>(efftot, vars.var[1], i));
           }
         }
-        return var0.size();
+        return var0Size;
       } else if ( nMonVar==3 ) { // Two observables (2D TEfficiency)
-        for (unsigned i = 0; i < var0.size(); ++i) {
+        for (unsigned i = 0; i < var0Size; ++i) {
           if (cutMaskAccessor(i)) {
-            efficiency->Fill(var0.get(i),
-                             detail::getFillValue<Axis::X>(efftot, m_monVariables[1].get(), i),
-                             detail::getFillValue<Axis::Y>(efftot, m_monVariables[2].get(), i));
+            efficiency->Fill(vars.var[0]->get(i),
+                             detail::getFillValue<Axis::X>(efftot, vars.var[1], i),
+                             detail::getFillValue<Axis::Y>(efftot, vars.var[2], i));
           }
         }
-        return var0.size();
+        return var0Size;
       } else if ( nMonVar==4 ) { // Three observables (3D Efficiency)
-        for (unsigned i = 0; i < var0.size(); ++i) {
+        for (unsigned i = 0; i < var0Size; ++i) {
           if (cutMaskAccessor(i)) {
-            efficiency->Fill(var0.get(i),
-                             detail::getFillValue<Axis::X>(efftot, m_monVariables[1].get(), i),
-                             detail::getFillValue<Axis::Y>(efftot, m_monVariables[2].get(), i),
-                             detail::getFillValue<Axis::Z>(efftot, m_monVariables[3].get(), i));
+            efficiency->Fill(vars.var[0]->get(i),
+                             detail::getFillValue<Axis::X>(efftot, vars.var[1], i),
+                             detail::getFillValue<Axis::Y>(efftot, vars.var[2], i),
+                             detail::getFillValue<Axis::Z>(efftot, vars.var[3], i));
           }
         }
-        return var0.size();
+        return var0Size;
       } else {
         return 0;
       }
+      return var0Size;
     }
   };
 }
diff --git a/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFillerRebinable.h b/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFillerRebinable.h
index e609696d8bebd50d32548d61a2b972a0f1f394db..acbfe563cd74822a1730ac02309c7d3c02461634 100644
--- a/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFillerRebinable.h
+++ b/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFillerRebinable.h
@@ -33,17 +33,13 @@ namespace Monitored {
       }
     }
 
-    virtual HistogramFillerRebinableAxis* clone() const override {
-      return new HistogramFillerRebinableAxis( *this );
-    }
-
-    virtual unsigned fill() const override {
-      if (AXIS >= this->m_monVariables.size()) { return 0; }
-      if (this->m_monVariables[AXIS].get().size()==0) { return 0; }
+    virtual unsigned fill( const HistogramFiller::VariablesPack& vars ) const override {
+      if (AXIS >= vars.size() ) { return 0; }
+      if (vars.var[AXIS]->size()==0) { return 0; }
 
       double min = std::numeric_limits<double>::max();
       double max = std::numeric_limits<double>::min();
-      const IMonitoredVariable& var = this->m_monVariables[AXIS].get();
+      const IMonitoredVariable& var = *vars.var[AXIS];
       for (size_t i = 0; i < var.size(); i++) {
         const double v = var.get(i);
         if (v < min) min = v;
@@ -62,7 +58,7 @@ namespace Monitored {
         if (max >= axis->GetXmax()) hist->ExtendAxis(max, axis);
         if (min < axis->GetXmin()) hist->ExtendAxis(min, axis);
       }
-      return BASE::fill();
+      return BASE::fill( vars );
     }
 
   private:
diff --git a/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFillerTree.h b/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFillerTree.h
index f06b017558dc78eec1e485e2e7f14b8d3b712f1d..07f5bdf52af566b1c2eda5ca002e2b51a67aadc4 100644
--- a/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFillerTree.h
+++ b/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFillerTree.h
@@ -26,13 +26,9 @@ namespace Monitored {
         parseDefinition();
     }
 
-    virtual HistogramFillerTree* clone() const override {
-      return new HistogramFillerTree( *this );
-    }
-
-    virtual unsigned fill() const override {
-      // handling of the cutmask
-      auto cutMaskValuePair = getCutMaskFunc();
+    virtual unsigned fill( const HistogramFiller::VariablesPack& vars ) const override {
+      // handling of the cutmask      
+      auto cutMaskValuePair = getCutMaskFunc(vars.cut);
       if (cutMaskValuePair.first == 0) { return 0; }
       if (ATH_UNLIKELY(cutMaskValuePair.first > 1)) {
         MsgStream log(Athena::getMessageSvc(), "HistogramFillerTree");
@@ -42,10 +38,10 @@ namespace Monitored {
         if (! cutMaskValuePair.second(0)) { return 0; }
       }
 
-      if (ATH_UNLIKELY(m_monVariables.size() != m_branchDefs.size())) {
+      if (ATH_UNLIKELY(vars.size() != m_branchDefs.size())) {
         MsgStream log(Athena::getMessageSvc(), "HistogramFillerTree");
         log << MSG::ERROR << "Mismatch of passed variables and expected variables for " << m_histDef->alias 
-                          << "(" << m_monVariables.size() << ", " << m_branchDefs.size() << ")" << endmsg;
+                          << "(" << vars.size() << ", " << m_branchDefs.size() << ")" << endmsg;
         return 0;
       }
 
@@ -63,7 +59,8 @@ namespace Monitored {
           ++idx; continue;
         }
         TBranch* branch = static_cast<TBranch*>(branchList->At(idxgood));
-        m_fillerFunctions[idx](branch, m_monVariables[idx].get());
+	std::cout << "Calling filler function for var : " <<  vars.var[idx]->name() << " branch " << branch->GetName() << "\n";
+        m_fillerFunctions[idx](branch, *vars.var[idx]);
         ++idx; ++idxgood;
       }
       for (Int_t i = 0; i < branchList->GetEntries(); ++i) {
@@ -71,7 +68,7 @@ namespace Monitored {
 
       }
       tree->SetEntries(tree->GetEntries() + 1);
-      return 1;
+      return 1;     
     }
 
   private:
diff --git a/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFillerUtils.h b/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFillerUtils.h
index 3552810fe76032bf441e17625bc3371a399dba8d..546eaf03f1876d4bd4f31ef9b2f7e6ae31ede1f8 100644
--- a/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFillerUtils.h
+++ b/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFillerUtils.h
@@ -51,13 +51,13 @@ namespace Monitored {
      * @param  i       index for IMonitoredVariable value lookup
      */
     template<Axis AXIS, typename H>
-    double getFillValue(const H* hist, const IMonitoredVariable& var, size_t i) {
-      if ( var.hasStringRepresentation() ) {
+    double getFillValue(const H* hist, const IMonitoredVariable* var, size_t i) {
+      if ( var->hasStringRepresentation() ) {
         const TAxis* axis = getAxis<AXIS>(hist);
-        const int binNumber = axis->FindFixBin( var.getString(i).c_str() );
+        const int binNumber = axis->FindFixBin( var->getString(i).c_str() );
         return axis->GetBinCenter(binNumber);
       } else {
-        return var.get(i);
+        return var->get(i);
       }
     }
 
diff --git a/Control/AthenaMonitoringKernel/src/HistogramFiller/VecHistogramFiller1D.h b/Control/AthenaMonitoringKernel/src/HistogramFiller/VecHistogramFiller1D.h
index 71424fa18f1c123a6a45e6a2d763ea805a1c725e..27ecc1c19d164512785a5911276f544c6c78052d 100644
--- a/Control/AthenaMonitoringKernel/src/HistogramFiller/VecHistogramFiller1D.h
+++ b/Control/AthenaMonitoringKernel/src/HistogramFiller/VecHistogramFiller1D.h
@@ -13,38 +13,34 @@ namespace Monitored {
     VecHistogramFiller1D(const HistogramDef& definition, std::shared_ptr<IHistogramProvider> provider)
       : HistogramFiller1D(definition, provider) {}
 
-    virtual VecHistogramFiller1D* clone() const override {
-      return new VecHistogramFiller1D( *this );
-    }
 
-    virtual unsigned fill() const override {
-      if (m_monVariables.size() != 1) { return 0; }
-      const IMonitoredVariable& var = m_monVariables[0].get();
+    virtual unsigned fill(const HistogramFiller::VariablesPack& vars) const override {
+      if ( ATH_UNLIKELY( vars.var[0] == nullptr or vars.size() != 0 ) ) { return 0; }
 
       std::function<bool(size_t)> cutMaskAccessor;
-      if (m_monCutMask) {
+      if (vars.cut) {
         // handling of the cutmask
-        auto cutMaskValuePair = getCutMaskFunc();
+        auto cutMaskValuePair = getCutMaskFunc(vars.cut);
         if (cutMaskValuePair.first == 0) { return 0; }
-        if (ATH_UNLIKELY(cutMaskValuePair.first > 1 && cutMaskValuePair.first != var.size())) {
+        if (ATH_UNLIKELY(cutMaskValuePair.first > 1 && cutMaskValuePair.first != vars.var[0]->size())) {
           MsgStream log(Athena::getMessageSvc(), "VecHistogramFiller1D");
           log << MSG::ERROR << "CutMask does not match the size of plotted variable: "
-              << cutMaskValuePair.first << " " << var.size() << endmsg;
+              << cutMaskValuePair.first << " " << vars.var[0]->size() << endmsg;
         }
         cutMaskAccessor = cutMaskValuePair.second;
       }
 
       auto histogram = this->histogram<TH1>();
       const unsigned offset = m_histDef->kVecUO ? 0 : 1;
-      for (unsigned i = 0; i < var.size(); ++i) {
+      for (unsigned i = 0; i < vars.var[0]->size(); ++i) {
         if (cutMaskAccessor && cutMaskAccessor(i)) {
-          const double value = var.get(i);
+          const double value = vars.var[0]->get(i);
           histogram->AddBinContent(i+offset, value);
           histogram->SetEntries(histogram->GetEntries() + value);
         }
       }
 
-      return var.size();
+      return vars.var[0]->size();
     }
   };
 }
diff --git a/Control/AthenaMonitoringKernel/test/HistogramFillerFactoryTestSuite.cxx b/Control/AthenaMonitoringKernel/test/HistogramFillerFactoryTestSuite.cxx
index a16941c0cc10146ccd499318dcc83215f4795f70..a62e401b2280e52438e24e4ddda6da1ed455e723 100644
--- a/Control/AthenaMonitoringKernel/test/HistogramFillerFactoryTestSuite.cxx
+++ b/Control/AthenaMonitoringKernel/test/HistogramFillerFactoryTestSuite.cxx
@@ -47,7 +47,7 @@ class HistogramProviderGetter : public HistogramFiller {
     HistogramProviderGetter(const HistogramFiller& hf) 
       : HistogramFiller(hf) {}
 
-    virtual unsigned fill() const { return 0; }
+  virtual unsigned fill( const HistogramFiller::VariablesPack& ) const { return 0; }
     virtual HistogramFiller* clone() const { return nullptr; }
 
     std::shared_ptr<IHistogramProvider> histogramProvider() { return m_histogramProvider; }
diff --git a/Control/AthenaMonitoringKernel/test/HistogramFillerRebinable1DTestSuite.cxx b/Control/AthenaMonitoringKernel/test/HistogramFillerRebinable1DTestSuite.cxx
index 1744e3dd5e901e61349133e23bc20957df7f59a0..4133e65d0efb96343a29913f455dee260cac8006 100644
--- a/Control/AthenaMonitoringKernel/test/HistogramFillerRebinable1DTestSuite.cxx
+++ b/Control/AthenaMonitoringKernel/test/HistogramFillerRebinable1DTestSuite.cxx
@@ -64,12 +64,14 @@ class HistogramFillerRebinable1DTestSuite {
 
     void test_shouldKeepNumberOfBinsForValueInHistogramsRange() {
       Monitored::Scalar<double> var("var", 2.9);
-      m_testObj->setMonitoredVariables({var});
+      HistogramFiller::VariablesPack vars({&var});
+
+
       VALUE(m_histogram->GetXaxis()->GetNbins()) EXPECTED(8);
       VALUE(m_histogram->GetXaxis()->GetXmin()) EXPECTED(1.0);
       VALUE(m_histogram->GetXaxis()->GetXmax()) EXPECTED(3.0);
 
-      m_testObj->fill();
+      m_testObj->fill(vars);
 
       VALUE(m_histogram->GetXaxis()->GetNbins()) EXPECTED(8);
       VALUE(m_histogram->GetXaxis()->GetXmin()) EXPECTED(1.0);
@@ -79,13 +81,13 @@ class HistogramFillerRebinable1DTestSuite {
 
     void test_shouldDoubleNumberOfBinsForBoundaryValueOf3() {
       Monitored::Scalar<double> var("var", 3.0);
-      m_testObj->setMonitoredVariables({var});
+      HistogramFiller::VariablesPack vars({&var});
 
       VALUE(m_histogram->GetXaxis()->GetNbins()) EXPECTED(8);
       VALUE(m_histogram->GetXaxis()->GetXmin()) EXPECTED(1.0);
       VALUE(m_histogram->GetXaxis()->GetXmax()) EXPECTED(3.0);
 
-      m_testObj->fill();
+      m_testObj->fill(vars);
 
       VALUE(m_histogram->GetXaxis()->GetNbins()) EXPECTED(16);
       VALUE(m_histogram->GetXaxis()->GetXmin()) EXPECTED(1.0);
@@ -95,13 +97,13 @@ class HistogramFillerRebinable1DTestSuite {
 
     void test_shouldDoubleNumberOfBinsForValueSlightlySmallerThan5() {
       Monitored::Scalar<double> var("var", 4.9);
-      m_testObj->setMonitoredVariables({var});
+      HistogramFiller::VariablesPack vars({&var});
 
       VALUE(m_histogram->GetXaxis()->GetNbins()) EXPECTED(8);
       VALUE(m_histogram->GetXaxis()->GetXmin()) EXPECTED(1.0);
       VALUE(m_histogram->GetXaxis()->GetXmax()) EXPECTED(3.0);
 
-      m_testObj->fill();
+      m_testObj->fill(vars);
 
       VALUE(m_histogram->GetXaxis()->GetNbins()) EXPECTED(16);
       VALUE(m_histogram->GetXaxis()->GetXmin()) EXPECTED(1.0);
@@ -111,13 +113,13 @@ class HistogramFillerRebinable1DTestSuite {
 
     void test_shouldQuadrupleNumberOfBinsForBoundaryValueOf5() {
       Monitored::Scalar<double> var("var", 5.0);
-      m_testObj->setMonitoredVariables({var});
+      HistogramFiller::VariablesPack vars({&var});
 
       VALUE(m_histogram->GetXaxis()->GetNbins()) EXPECTED(8);
       VALUE(m_histogram->GetXaxis()->GetXmin()) EXPECTED(1.0);
       VALUE(m_histogram->GetXaxis()->GetXmax()) EXPECTED(3.0);
 
-      m_testObj->fill();
+      m_testObj->fill(vars);
 
       VALUE(m_histogram->GetXaxis()->GetNbins()) EXPECTED(32);
       VALUE(m_histogram->GetXaxis()->GetXmin()) EXPECTED(1.0);
@@ -127,13 +129,13 @@ class HistogramFillerRebinable1DTestSuite {
 
     void test_shouldQuadrupleNumberOfBinsForValueSlightlyBiggerThan5() {
       Monitored::Scalar<double> var("var", 5.1);
-      m_testObj->setMonitoredVariables({var});
+      HistogramFiller::VariablesPack vars({&var});
 
       VALUE(m_histogram->GetXaxis()->GetNbins()) EXPECTED(8);
       VALUE(m_histogram->GetXaxis()->GetXmin()) EXPECTED(1.0);
       VALUE(m_histogram->GetXaxis()->GetXmax()) EXPECTED(3.0);
 
-      m_testObj->fill();
+      m_testObj->fill(vars);
 
       VALUE(m_histogram->GetXaxis()->GetNbins()) EXPECTED(32);
       VALUE(m_histogram->GetXaxis()->GetXmin()) EXPECTED(1.0);
@@ -143,13 +145,13 @@ class HistogramFillerRebinable1DTestSuite {
 
     void test_shouldQuadrupleNumberOfBinsForValueSlightlySmallerThan9() {
       Monitored::Scalar<double> var("var", 8.9);
-      m_testObj->setMonitoredVariables({var});
+      HistogramFiller::VariablesPack vars({&var});
 
       VALUE(m_histogram->GetXaxis()->GetNbins()) EXPECTED(8);
       VALUE(m_histogram->GetXaxis()->GetXmin()) EXPECTED(1.0);
       VALUE(m_histogram->GetXaxis()->GetXmax()) EXPECTED(3.0);
 
-      m_testObj->fill();
+      m_testObj->fill(vars);
 
       VALUE(m_histogram->GetXaxis()->GetNbins()) EXPECTED(32);
       VALUE(m_histogram->GetXaxis()->GetXmin()) EXPECTED(1.0);
@@ -159,13 +161,13 @@ class HistogramFillerRebinable1DTestSuite {
 
     void test_shouldOctupleNumberOfBinsForBoundaryValueOf9() {
       Monitored::Scalar<double> var("var", 9.0);
-      m_testObj->setMonitoredVariables({var});
+      HistogramFiller::VariablesPack vars({&var});
 
       VALUE(m_histogram->GetXaxis()->GetNbins()) EXPECTED(8);
       VALUE(m_histogram->GetXaxis()->GetXmin()) EXPECTED(1.0);
       VALUE(m_histogram->GetXaxis()->GetXmax()) EXPECTED(3.0);
 
-      m_testObj->fill();
+      m_testObj->fill(vars);
 
       VALUE(m_histogram->GetXaxis()->GetNbins()) EXPECTED(64);
       VALUE(m_histogram->GetXaxis()->GetXmin()) EXPECTED(1.0);
@@ -175,13 +177,13 @@ class HistogramFillerRebinable1DTestSuite {
 
     void test_shouldOctupleNumberOfBinsForValueSlightlyBiggerThan9() {
       Monitored::Scalar<double> var("var", 9.1);
-      m_testObj->setMonitoredVariables({var});
+      HistogramFiller::VariablesPack vars({&var});
 
       VALUE(m_histogram->GetXaxis()->GetNbins()) EXPECTED(8);
       VALUE(m_histogram->GetXaxis()->GetXmin()) EXPECTED(1.0);
       VALUE(m_histogram->GetXaxis()->GetXmax()) EXPECTED(3.0);
 
-      m_testObj->fill();
+      m_testObj->fill(vars);
 
       VALUE(m_histogram->GetXaxis()->GetNbins()) EXPECTED(64);
       VALUE(m_histogram->GetXaxis()->GetXmin()) EXPECTED(1.0);
@@ -194,7 +196,7 @@ class HistogramFillerRebinable1DTestSuite {
 
   // ==================== Initialization & run ====================
   public:
-    HistogramFillerRebinable1DTestSuite() 
+    HistogramFillerRebinable1DTestSuite()
       : m_log(Athena::getMessageSvc(), "HistogramFillerRebinable1DTestSuite") {
     }
 
@@ -224,7 +226,7 @@ class HistogramFillerRebinable1DTestSuite {
     HistogramDef m_histogramDef;
     shared_ptr<MockHistogramProvider> m_histogramProvider;
     shared_ptr<TH1D> m_histogram;
-    
+
     shared_ptr<HistogramFillerRebinable1D> m_testObj;
 };
 
diff --git a/Control/AthenaMonitoringKernel/test/HistogramFillerRebinable2DTestSuite.cxx b/Control/AthenaMonitoringKernel/test/HistogramFillerRebinable2DTestSuite.cxx
index 3986434f8673586094261287f63aa4b910a5d66f..f55abb00313aa8dc81bd34a738c6fe8c2514d0f8 100644
--- a/Control/AthenaMonitoringKernel/test/HistogramFillerRebinable2DTestSuite.cxx
+++ b/Control/AthenaMonitoringKernel/test/HistogramFillerRebinable2DTestSuite.cxx
@@ -22,7 +22,7 @@
 #include "AthenaKernel/getMessageSvc.h"
 
 #include "TH2D.h"
-
+#include "AthenaMonitoringKernel/HistogramFiller.h"
 #include "AthenaMonitoringKernel/MonitoredScalar.h"
 #include "../src/HistogramFiller/HistogramFillerRebinable.h"
 
@@ -60,7 +60,7 @@ class HistogramFillerRebinable2DTestSuite {
     void test_shouldKeepNumberOfBinsForValueInHistogramsRange() {
       Monitored::Scalar<double> var1("var1", 2.9);
       Monitored::Scalar<double> var2("var2", 4.9);
-      m_testObj->setMonitoredVariables({var1, var2});
+      HistogramFiller::VariablesPack vars({&var1, &var2});
 
       auto check = [&](){
         VALUE(m_histogram->GetXaxis()->GetNbins()) EXPECTED(8);
@@ -71,7 +71,7 @@ class HistogramFillerRebinable2DTestSuite {
         VALUE(m_histogram->GetYaxis()->GetXmax()) EXPECTED(5.0);
       };
       check();
-      m_testObj->fill();
+      m_testObj->fill(vars);
       check();
       VALUE(m_histogram->GetBinContent(8,5)) EXPECTED(1.0);
     }
@@ -79,9 +79,9 @@ class HistogramFillerRebinable2DTestSuite {
     void test_shouldDoubleNumberOfBinsForValueOutsideRange() {
       Monitored::Scalar<double> var1("var1", 3.0);
       Monitored::Scalar<double> var2("var2", 5.0);
-      m_testObj->setMonitoredVariables({var1, var2});
+      HistogramFiller::VariablesPack vars({&var1, &var2});
 
-      m_testObj->fill();
+      m_testObj->fill(vars);
 
       VALUE(m_histogram->GetXaxis()->GetNbins()) EXPECTED(16);
       VALUE(m_histogram->GetXaxis()->GetXmin()) EXPECTED(1.0);
@@ -125,7 +125,7 @@ class HistogramFillerRebinable2DTestSuite {
     HistogramDef m_histogramDef;
     shared_ptr<MockHistogramProvider> m_histogramProvider;
     shared_ptr<TH2D> m_histogram;
-    
+
     shared_ptr<HistogramFillerRebinable2D> m_testObj;
 };
 
diff --git a/Control/AthenaPython/CMakeLists.txt b/Control/AthenaPython/CMakeLists.txt
index e248f15c17e753a95506bee759a54fd33557dca8..460c29c03f8317b7b19d6a67d53f07553d71b1cb 100644
--- a/Control/AthenaPython/CMakeLists.txt
+++ b/Control/AthenaPython/CMakeLists.txt
@@ -5,27 +5,28 @@ atlas_subdir( AthenaPython )
 
 # External dependencies:
 find_package( Python COMPONENTS Development )
-find_package( ROOT COMPONENTS Core PyROOT ROOTTPython cppyy3_7)
+find_package( ROOT COMPONENTS Core PyROOT ROOTTPython
+   cppyy${Python_VERSION_MAJOR}_${Python_VERSION_MINOR} )
 
 # Component(s) in the package:
 atlas_add_library( AthenaPython
-                   src/*.cxx
-                   PUBLIC_HEADERS AthenaPython
-                   PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Python_INCLUDE_DIRS}
-                   LINK_LIBRARIES AthenaBaseComps AthenaKernel GaudiKernel
-                   PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} ${Python_LIBRARIES} CxxUtils DataModelRoot RootUtils )
+   AthenaPython/*.h src/*.cxx
+   PUBLIC_HEADERS AthenaPython
+   PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Python_INCLUDE_DIRS}
+   LINK_LIBRARIES AthenaBaseComps GaudiKernel CxxUtils
+   PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} ${Python_LIBRARIES} DataModelRoot
+   RootUtilsPyROOT )
 
 atlas_add_component( AthenaPythonComps
-                     src/components/*.cxx
-                     LINK_LIBRARIES AthenaPython )
+   src/components/*.cxx
+   LINK_LIBRARIES AthenaPython )
 
 atlas_add_dictionary( AthenaPythonDict
-                      AthenaPython/AthenaPythonDict.h
-                      AthenaPython/selection.xml
-                      LINK_LIBRARIES AthenaPython )
+   AthenaPython/AthenaPythonDict.h
+   AthenaPython/selection.xml
+   LINK_LIBRARIES GaudiKernel AthenaKernel AthenaBaseComps AthenaPython )
 
 # Install files from the package:
 atlas_install_python_modules( python/*.py python/tests
                               POST_BUILD_CMD ${ATLAS_FLAKE8} )
 atlas_install_joboptions( share/*.py share/tests/*.py )
-
diff --git a/Control/AthenaPython/share/icopy_file.py b/Control/AthenaPython/share/icopy_file.py
index 7b78938e01718d9eb438f43f1481d1fb862ff83a..ce7b1b4749fc5033d7030fc1d6bc4dac477ba5bf 100644
--- a/Control/AthenaPython/share/icopy_file.py
+++ b/Control/AthenaPython/share/icopy_file.py
@@ -13,7 +13,7 @@ __doc__ = "simple jobo to copy any file, leveraging the auto-config fwk"
 from AthenaCommon.AthenaCommonFlags import jobproperties as jp
 acf = jp.AthenaCommonFlags
 _input_files = globals()['FNAME']
-if isinstance(_input_files, basestring):
+if isinstance(_input_files, str):
     _input_files = [_input_files]
 acf.FilesInput = _input_files
 del _input_files
diff --git a/Control/AthenaPython/share/iread_file.py b/Control/AthenaPython/share/iread_file.py
index 057cbad995e4d93f23cf707946ddd1e1cba3cf95..398d27da60ccb274518fe26f7f040284c329b079 100644
--- a/Control/AthenaPython/share/iread_file.py
+++ b/Control/AthenaPython/share/iread_file.py
@@ -13,7 +13,7 @@ __doc__ = "simple jobo to read any file, leveraging the auto-config fwk"
 from AthenaCommon.AthenaCommonFlags import jobproperties as jp
 acf = jp.AthenaCommonFlags
 _input_files = globals().get('FNAME', [])
-if isinstance(_input_files, basestring):
+if isinstance(_input_files, str):
     _input_files = [_input_files]
 acf.FilesInput = _input_files
 del _input_files
diff --git a/Control/AthenaServices/CMakeLists.txt b/Control/AthenaServices/CMakeLists.txt
index 92dd6d0831c603b2b7ce326da59d3d2bdba05155..661a54d6b713a9d8bb8fbb1b197fc3037d9fc60e 100644
--- a/Control/AthenaServices/CMakeLists.txt
+++ b/Control/AthenaServices/CMakeLists.txt
@@ -10,13 +10,15 @@ find_package( Python COMPONENTS Development )
 find_package( yampl )
 
 # Component(s) in the package:
-atlas_add_component( AthenaServices src/*.cxx src/components/*.cxx
+atlas_add_component( AthenaServices
+   src/*.h src/*.cxx src/components/*.cxx
    INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${Python_INCLUDE_DIRS}
    ${CLHEP_INCLUDE_DIRS} ${YAMPL_INCLUDE_DIRS}
    LINK_LIBRARIES ${Boost_LIBRARIES} ${Python_LIBRARIES} ${YAMPL_LIBRARIES}
-   ${CLHEP_LIBRARIES} z TestTools AsgTools AthenaBaseComps AthenaKernel RootUtils CxxUtils
-   AthContainers AthContainersInterfaces DataModelRoot Navigation PerfMonEvent PerfMonKernel SGTools
-   StoreGateLib SGtests PersistentDataModel EventInfo xAODCore xAODEventInfo EventInfoUtils GaudiKernel )
+   ${CLHEP_LIBRARIES} AthenaBaseComps AthenaKernel RootUtilsPyROOT CxxUtils
+   AthContainers AthContainersInterfaces DataModelRoot PerfMonEvent
+   PerfMonKernel SGTools StoreGateLib PersistentDataModel EventInfo xAODCore
+   xAODEventInfo EventInfoUtils GaudiKernel )
 
 # Test library checking the ability to build T/P converters:
 atlas_add_tpcnv_library( AthenaServicesTest src/test/*.cxx
@@ -92,10 +94,10 @@ atlas_install_joboptions( share/AthTPCnvSvc_test.py
    share/TestSeedRunEvent.py
    share/AthDictLoaderSvc_test.py
    share/ReadAthenaPoolSeek_jobOptions.py
-   share/test_tpcnvdb.py 
-   share/AthenaOutputStream_test.txt 
-   share/FPEControlSvc_test.txt 
-   share/AthenaEventLoopMgr_test.txt 
+   share/test_tpcnvdb.py
+   share/AthenaOutputStream_test.txt
+   share/FPEControlSvc_test.txt
+   share/AthenaEventLoopMgr_test.txt
    share/ConditionsCleanerSvc_test.txt
    share/RCUSvc_test.txt
    share/DelayedConditionsCleanerSvc_test.txt
diff --git a/Control/AthenaServices/src/AthenaOutputStream.cxx b/Control/AthenaServices/src/AthenaOutputStream.cxx
index 2a902b9c6feac43e1edc7189057735afc650070b..1472648ee1f1c585ec93628df9e676bbebdecfea 100644
--- a/Control/AthenaServices/src/AthenaOutputStream.cxx
+++ b/Control/AthenaServices/src/AthenaOutputStream.cxx
@@ -418,6 +418,9 @@ void AthenaOutputStream::writeMetaData(const std::string outputFN)
    if( m_metaDataSvc->prepareOutput(outputFN).isFailure() ) {
       throw GaudiException("Failed on MetaDataSvc prepareOutput", name(), StatusCode::FAILURE);
    }
+   // lock all metadata to prevent updates during writing
+   MetaDataSvc::ToolLockGuard   tool_guard( *m_metaDataSvc );
+
    // Always force a final commit in stop - mainly applies to AthenaPool
    if (m_writeOnFinalize) {
       if (write().isFailure()) {  // true mean write AND commit
diff --git a/Control/AthenaServices/src/MetaDataSvc.cxx b/Control/AthenaServices/src/MetaDataSvc.cxx
index 7163e5c9ec75748a6af1be8dea2512bb327a1e5b..2a81f9dd6bb051ea394654d5b4e179548cfe765b 100644
--- a/Control/AthenaServices/src/MetaDataSvc.cxx
+++ b/Control/AthenaServices/src/MetaDataSvc.cxx
@@ -581,6 +581,7 @@ StatusCode MetaDataSvc::initInputMetaDataStore(const std::string& fileName) {
       }
       for (SG::TransientAddress* tad : tList) {
          CLID clid = tad->clID();
+          ATH_MSG_VERBOSE("initInputMetaDataStore: add proxy for clid = " << clid << ", key = " << tad->name());
          if (m_inputDataStore->contains(tad->clID(), tad->name())) {
             ATH_MSG_DEBUG("initInputMetaDataStore: MetaData Store already contains clid = " << clid << ", key = " << tad->name());
          } else {
@@ -620,3 +621,23 @@ CLID MetaDataSvc::remapMetaContCLID( const CLID& item_id ) const
    }
    return item_id;
 }
+
+
+void MetaDataSvc::lockTools() const
+{
+   ATH_MSG_DEBUG("Locking metadata tools");
+   for(auto tool : m_metaDataTools ) {
+      ILockableTool *lockable = dynamic_cast<ILockableTool*>( tool.get() );
+      if( lockable ) lockable->lock_shared();
+   }
+}
+
+
+void MetaDataSvc::unlockTools() const
+{
+   ATH_MSG_DEBUG("Unlocking metadata tools");
+   for(auto tool : m_metaDataTools ) {
+      ILockableTool *lockable = dynamic_cast<ILockableTool*>( tool.get() );
+      if( lockable ) lockable->unlock_shared();
+   }
+}
diff --git a/Control/AthenaServices/src/MetaDataSvc.h b/Control/AthenaServices/src/MetaDataSvc.h
index b7e6fbc4ea4497e22282f839a64cc5f370646b8f..4a6c181c12f66605f4870c7e749890979f5231ce 100644
--- a/Control/AthenaServices/src/MetaDataSvc.h
+++ b/Control/AthenaServices/src/MetaDataSvc.h
@@ -113,6 +113,19 @@ public: // Non-static members
 
    CLID remapMetaContCLID( const CLID& item_id ) const;
 
+   class ToolLockGuard {
+   public:
+      ToolLockGuard(const MetaDataSvc& mds) : m_mds(mds) { m_mds.lockTools(); }
+      ~ToolLockGuard() { m_mds.unlockTools(); }
+      ToolLockGuard(const ToolLockGuard&) = delete;
+      void operator=(const ToolLockGuard&) = delete;
+   private:
+      const MetaDataSvc& m_mds;
+   };
+
+   void lockTools() const;
+   void unlockTools() const;
+
 private:
    /// Add proxy to input metadata store - can be called directly or via BeginInputFile incident
    StatusCode addProxyToInputMetaDataStore(const std::string& tokenStr);
@@ -139,8 +152,9 @@ private: // data
 private: // properties
    /// MetaDataContainer, POOL container name for MetaData.
    StringProperty                 m_metaDataCont;
-   /// MetaDataTools, vector with the MetaData tools.
+   /// MetaDataTools, vector with the MetaData tools
    ToolHandleArray<IMetaDataTool> m_metaDataTools;
+
 };
- 
+
 #endif
diff --git a/Control/Hephaestus/python/__init__.py b/Control/Hephaestus/python/__init__.py
index 15107d51dc3aff6b2d001a818f08aca366d22597..940a0fdc184537e423427dda561a14f575523d44 100644
--- a/Control/Hephaestus/python/__init__.py
+++ b/Control/Hephaestus/python/__init__.py
@@ -12,9 +12,9 @@ def setup():
 
   # make sure that 3rd party libraries can see Hephaestus symbols by letting
   # python load the memory tracker in "broadcast" mode
-    import DLFCN, sys
+    import sys
     dlflags = sys.getdlopenflags() 
-    sys.setdlopenflags( DLFCN.RTLD_GLOBAL | DLFCN.RTLD_NOW )
+    sys.setdlopenflags( os.RTLD_GLOBAL | os.RTLD_NOW )
     import MemoryTracker
     sys.setdlopenflags( dlflags )
 
diff --git a/Control/Hephaestus/src/MemoryTracker.c b/Control/Hephaestus/src/MemoryTracker.c
index c37b3b24982cd1c11c7723321754146a5dfb678d..a655a5284e9281aaba0f480b175cccd21c35a0de 100644
--- a/Control/Hephaestus/src/MemoryTracker.c
+++ b/Control/Hephaestus/src/MemoryTracker.c
@@ -1137,7 +1137,13 @@ static PyMethodDef gFreeStatisticsMethods[] = {
 PyObject* initMemoryTrace();
 PyObject* initDoubleDeleteChecker();
 
-void initMemoryTracker() {
+#if PY_MAJOR_VERSION >= 3
+PyObject *
+PyInit_MemoryTracker(void)
+#else
+void initMemoryTracker()
+#endif
+{
    PyObject *memtrack;
    PyObject *chkpoints, *freestat;
    PyObject *ddcheck, *memtrace;
@@ -1213,4 +1219,8 @@ void initMemoryTracker() {
 /* double delete checker functionality */
    ddcheck = initDoubleDeleteChecker();
    PyModule_AddObject( memtrack, (char*)"DeleteChecker", ddcheck );
+
+#if PY_MAJOR_VERSION >= 3
+   return memtrack;
+#endif
 }
diff --git a/Control/PerformanceMonitoring/PerfMonComps/CMakeLists.txt b/Control/PerformanceMonitoring/PerfMonComps/CMakeLists.txt
index 7ad7a696c0a6ce53e876819302ff040e0e592d0f..e2512aedb0f2e8677ac158ab46ebc8e22920425f 100644
--- a/Control/PerformanceMonitoring/PerfMonComps/CMakeLists.txt
+++ b/Control/PerformanceMonitoring/PerfMonComps/CMakeLists.txt
@@ -7,7 +7,8 @@ atlas_subdir( PerfMonComps )
 find_package( AIDA )
 find_package( Boost )
 find_package( Python COMPONENTS Development )
-find_package( ROOT COMPONENTS Core PyROOT cppyy3_7 )
+find_package( ROOT COMPONENTS Core ROOTTPython
+   cppyy${Python_VERSION_MAJOR}_${Python_VERSION_MINOR} )
 find_package( nlohmann_json )
 find_package( psutil )
 
@@ -17,7 +18,7 @@ atlas_add_component( PerfMonComps
    INCLUDE_DIRS ${AIDA_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
    ${Python_INCLUDE_DIRS}
    LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} ${Python_LIBRARIES}
-   ${CMAKE_DL_LIBS} AthenaBaseComps AthenaKernel RootUtils CxxUtils
+   ${CMAKE_DL_LIBS} AthenaBaseComps AthenaKernel RootUtilsPyROOT CxxUtils
    PerfMonEvent PerfMonKernel SGTools StoreGateLib GaudiKernel
    AthDSoCallBacks nlohmann_json::nlohmann_json)
 
diff --git a/Control/PerformanceMonitoring/PerfMonComps/src/PerfMonSvc.cxx b/Control/PerformanceMonitoring/PerfMonComps/src/PerfMonSvc.cxx
index 5a91438576a77917b97bac81cf83febb96883434..c160ec3bcc04bfb1c398a6beea9e9d2c76e0f7b5 100644
--- a/Control/PerformanceMonitoring/PerfMonComps/src/PerfMonSvc.cxx
+++ b/Control/PerformanceMonitoring/PerfMonComps/src/PerfMonSvc.cxx
@@ -594,10 +594,6 @@ StatusCode PerfMonSvc::initialize()
     PMON_ERROR("Unable to get the IncidentSvc");
     return StatusCode::FAILURE;
   }
-  const long highestPriority = static_cast<long>(-1);
-  const long lowestPriority  = 0;
-  incSvc->addListener( this, IncidentType::BeginEvent, highestPriority );
-  incSvc->addListener( this, IncidentType::EndEvent,    lowestPriority );
   incSvc->addListener( this, IncidentType::SvcPostFinalize );
 
   // make sure the correct auditor is configured and running
@@ -853,33 +849,6 @@ void PerfMonSvc::handle( const Incident& inc )
     return;
   }
 
-  // Performing performance-monitoring for BeginEvent incident
-  if ( inc.type() == IncidentType::BeginEvent ) {
-    static bool s_firstEvt = true;
-    if ( s_firstEvt ) {
-      s_firstEvt = false;
-      stopAud( "ini", "PerfMonSlice" );
-      // capture the number of algorithms - here
-      ServiceHandle<IAlgManager> mgr("ApplicationMgr", this->name());
-      m_nalgs = mgr->getAlgorithms().size();
-      m_ntuple.comp["ini"].clear();
-      m_ntuple.comp["cbk"].clear();
-      m_ntuple.comp["preLoadProxies"].clear();
-    }
-    startAud( "evt", "PerfMonSlice" );
-    PMON_VERBOSE("[" << IncidentType::BeginEvent << "] handled");
-    return;
-  }
-
-  // Performing performance-monitoring for EndEvent incident
-  if ( inc.type() == IncidentType::EndEvent ) {
-    // make sure we update the data from declareInfo...
-    poll();
-    stopAud( "evt", "PerfMonSlice" );
-    PMON_VERBOSE("[" << IncidentType::EndEvent << "] handled");
-    return;
-  }
-
   return;
 }
 
@@ -1146,6 +1115,23 @@ do_msg_mon(int lvl,
 void PerfMonSvc::startAud( const std::string& stepName,
                            const std::string& compName )
 {
+  // Performing performance-monitoring for BeginEvent
+  if ( compName == "AthMasterSeq" && stepName == "evt" ) {
+    static bool s_firstEvt = true;
+    if ( s_firstEvt ) {
+      s_firstEvt = false;
+      stopAud( "ini", "PerfMonSlice" );
+      // capture the number of algorithms - here
+      ServiceHandle<IAlgManager> mgr("ApplicationMgr", this->name());
+      m_nalgs = mgr->getAlgorithms().size();
+      m_ntuple.comp["ini"].clear();
+      m_ntuple.comp["cbk"].clear();
+      m_ntuple.comp["preLoadProxies"].clear();
+    }
+    startAud( "evt", "PerfMonSlice" );
+    return;
+  }
+
   if (m_extraPrintouts) {
     double vmem,rss;
     PMonSD::get_vmem_rss_kb(vmem,rss);
@@ -1172,6 +1158,14 @@ void PerfMonSvc::startAud( const std::string& stepName,
 void PerfMonSvc::stopAud( const std::string& stepName,
                           const std::string& compName )
 {
+  // Performing performance-monitoring for EndEvent
+  if ( compName == "AthMasterSeq" && stepName == "evt" ) {
+    // make sure we update the data from declareInfo...
+    poll();
+    stopAud( "evt", "PerfMonSlice" );
+    return;
+  }
+
   if (m_pmonsd)
     m_pmonsd->stopAud(stepName,compName,m_nevts);
 
diff --git a/Control/PerformanceMonitoring/PerfMonVTune/python/PerfMonVTuneConfig.py b/Control/PerformanceMonitoring/PerfMonVTune/python/PerfMonVTuneConfig.py
index e30b019e0f1fda01880e2e7a18293ebc0a7959a5..1cf3887727e5e3e22d98c7a47cee84058a4fcc81 100644
--- a/Control/PerformanceMonitoring/PerfMonVTune/python/PerfMonVTuneConfig.py
+++ b/Control/PerformanceMonitoring/PerfMonVTune/python/PerfMonVTuneConfig.py
@@ -16,7 +16,7 @@ def VTuneProfilerServiceCfg(flags, **kwargs):
 
     VTuneProfilerService = CompFactory.VTuneProfilerService
     acc = ComponentAccumulator()
-    acc.addService(VTuneProfilerService(**kwargs))
+    acc.addService(VTuneProfilerService(**kwargs), create=True)
     acc.setAppProperty("AuditAlgorithms", True)
     acc.setAppProperty("AuditTools", True)
     acc.setAppProperty("AuditServices", True)
diff --git a/Control/RootUtils/CMakeLists.txt b/Control/RootUtils/CMakeLists.txt
index 6cad2d3f313f674119def5ddc6f6ecd550534c80..176cd0a728e9109c9c7257924c3ee383ba4f6c23 100644
--- a/Control/RootUtils/CMakeLists.txt
+++ b/Control/RootUtils/CMakeLists.txt
@@ -59,5 +59,6 @@ atlas_add_test( TTreePatch_test
                 SCRIPT python ${CMAKE_CURRENT_SOURCE_DIR}/test/TTreePatch_t.py )
 endif()
 
+
 # Install files from the package:
 atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
diff --git a/Control/StoreGateBindings/CMakeLists.txt b/Control/StoreGateBindings/CMakeLists.txt
index a29160e8217fd35c6c4360a93aedfc22da4de5db..65f5d72ff5bc673b913b069408d8335b67a7907c 100644
--- a/Control/StoreGateBindings/CMakeLists.txt
+++ b/Control/StoreGateBindings/CMakeLists.txt
@@ -5,19 +5,21 @@ atlas_subdir( StoreGateBindings )
 
 # External dependencies:
 find_package( Python COMPONENTS Development )
-find_package( ROOT COMPONENTS PyROOT Core Tree MathCore Hist RIO pthread ROOTTPython cppyy3_7)
+find_package( ROOT COMPONENTS Core ROOTTPython
+   cppyy${Python_VERSION_MAJOR}_${Python_VERSION_MINOR} )
 
 # Component(s) in the package:
 atlas_add_library( StoreGateBindings
-                   src/*.cxx
-                   PUBLIC_HEADERS StoreGateBindings
-                   PRIVATE_INCLUDE_DIRS ${Python_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
-                   PRIVATE_LINK_LIBRARIES ${Python_LIBRARIES} ${ROOT_LIBRARIES} AthenaKernel DataModelRoot GaudiKernel RootUtils SGTools StoreGateLib )
+   StoreGateBindings/*.h src/*.cxx
+   PUBLIC_HEADERS StoreGateBindings
+   PRIVATE_INCLUDE_DIRS ${Python_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
+   PRIVATE_LINK_LIBRARIES ${Python_LIBRARIES} ${ROOT_LIBRARIES} AthenaKernel
+   DataModelRoot GaudiKernel RootUtils RootUtilsPyROOT SGTools StoreGateLib )
 
 atlas_add_dictionary( StoreGateBindingsDict
-                      src/StoreGateBindingsDict.h
-                      StoreGateBindings/selection.xml
-                      LINK_LIBRARIES StoreGateLib )
+   src/StoreGateBindingsDict.h
+   StoreGateBindings/selection.xml
+   LINK_LIBRARIES StoreGateLib )
 
 # Install files from the package:
 atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
diff --git a/Control/xAODRootAccess/Root/TPyEvent.cxx b/Control/xAODRootAccess/Root/TPyEvent.cxx
index 187fd2b37618f4d858fff10c373677ff37eab926..224215389884e7dc282348799599927827ae45f3 100644
--- a/Control/xAODRootAccess/Root/TPyEvent.cxx
+++ b/Control/xAODRootAccess/Root/TPyEvent.cxx
@@ -10,11 +10,6 @@
 
 namespace xAOD {
 
-   TPyEvent::TPyEvent()
-      : TEvent() {
-
-   }
-
    ::Bool_t TPyEvent::contains( const std::string& key,
                                 const std::string& type ) {
 
@@ -49,7 +44,7 @@ namespace xAOD {
                     "Type name \"%s\" not known", type.c_str() );
          return kFALSE;
       }
-      
+
       // Check if the dictionary can return a type_info:
       const std::type_info* ti = cl->GetTypeInfo();
       if( ! ti ) {
@@ -58,7 +53,7 @@ namespace xAOD {
                     type.c_str() );
          return kFALSE;
       }
-      
+
       // Let the base class do the work:
       return TEvent::transientContains( key, *ti, kFALSE );
    }
diff --git a/Control/xAODRootAccess/Root/TPyStore.cxx b/Control/xAODRootAccess/Root/TPyStore.cxx
index b0480825934dd07ba6fc165f70ba34105eb22770..82fc6f1c3aa13324f8f770fee8f4c64197eff221 100644
--- a/Control/xAODRootAccess/Root/TPyStore.cxx
+++ b/Control/xAODRootAccess/Root/TPyStore.cxx
@@ -1,9 +1,7 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
-// $Id: TPyStore.cxx 659468 2015-04-08 14:31:56Z krasznaa $
-
 // ROOT include(s):
 #include <TClass.h>
 #include <TError.h>
@@ -14,11 +12,6 @@
 
 namespace xAOD {
 
-   TPyStore::TPyStore()
-      : TStore() {
-
-   }
-
    /// This function can be used in the same manner as
    /// TStore::contains<...>(...), but instead of providing a type, one gives it
    /// a type name.
@@ -77,7 +70,7 @@ namespace xAOD {
                     "Type name \"%s\" not known", type.c_str() );
          return kFALSE;
       }
-      
+
       // Check if the dictionary can return a type_info:
       const std::type_info* ti = cl->GetTypeInfo();
       if( ! ti ) {
diff --git a/Control/xAODRootAccess/test/ut_xaodrootaccess_tpyevent_test.py b/Control/xAODRootAccess/test/ut_xaodrootaccess_tpyevent_test.py
index ff4e880ff601f09c5d3e678dc40fceb6f1dc210b..088b885dbad506bbb0090556a83be3aad8aba5c6 100755
--- a/Control/xAODRootAccess/test/ut_xaodrootaccess_tpyevent_test.py
+++ b/Control/xAODRootAccess/test/ut_xaodrootaccess_tpyevent_test.py
@@ -26,6 +26,11 @@ def main():
         logger.error( "Failed to call xAOD::Init(...)" )
         return 1
 
+    # Pre-load some dictionaries. To avoid ROOT-10940.
+    ROOT.xAOD.L2CombinedMuonContainer()
+    ROOT.xAOD.TrigElectronContainer()
+    ROOT.xAOD.MuonContainer()
+
     # Create the objects to test:
     from xAODRootAccess.TPyEvent import TPyEvent
     event = TPyEvent()
@@ -59,7 +64,7 @@ def main():
         return 1
 
     # Loop over 10 events from the input file:
-    for entry in xrange( 10 ):
+    for entry in range( 10 ):
 
         # Load the event:
         tree.GetEntry( entry )
diff --git a/Control/xAODRootAccess/test/ut_xaodrootaccess_transtree2_test.py b/Control/xAODRootAccess/test/ut_xaodrootaccess_transtree2_test.py
index 06257601501ef20e7301fdc5930d3599d4e63a47..81ea4bf06448c58d57a4af109219c3b352158b22 100755
--- a/Control/xAODRootAccess/test/ut_xaodrootaccess_transtree2_test.py
+++ b/Control/xAODRootAccess/test/ut_xaodrootaccess_transtree2_test.py
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 #
 # Unit test for the transient tree creating infrastructure
 #
@@ -64,7 +64,7 @@ def main():
     import xAODRootAccess.GenerateDVIterators
 
     # Loop over a few event:
-    for entry in xrange( 10 ):
+    for entry in range( 10 ):
         # Load the event:
         if mgr.eventTree().GetEntry( entry ) < 0:
             logger.error( "Couldn't load entry %i" % entry )
diff --git a/Control/xAODRootAccess/xAODRootAccess/TEvent.h b/Control/xAODRootAccess/xAODRootAccess/TEvent.h
index d134471bc5b3f826a900d6f34f2c74f63248a26d..763a44d58725abe898c1f6ba5b8c48d8e2c3693d 100644
--- a/Control/xAODRootAccess/xAODRootAccess/TEvent.h
+++ b/Control/xAODRootAccess/xAODRootAccess/TEvent.h
@@ -102,7 +102,7 @@ namespace xAOD {
       /// Constructor connecting the objects to an input TTree/TChain
       TEvent( ::TTree* tree, EAuxMode mode = kUndefinedAccess );
       /// Destructor
-      ~TEvent();
+      virtual ~TEvent();
 
       /// Do not allow copy-constructing this object:
       TEvent( const TEvent& parent ) = delete;
diff --git a/Control/xAODRootAccess/xAODRootAccess/TPyEvent.h b/Control/xAODRootAccess/xAODRootAccess/TPyEvent.h
index 4afc407e0e8334a136a6a8d871f639d914d16a59..670e44c85d61ff3fe32efa39c75fb3b72856911a 100644
--- a/Control/xAODRootAccess/xAODRootAccess/TPyEvent.h
+++ b/Control/xAODRootAccess/xAODRootAccess/TPyEvent.h
@@ -29,8 +29,8 @@ namespace xAOD {
    class TPyEvent : public TEvent {
 
    public:
-      /// Default constructor
-      TPyEvent();
+      /// Inherit the constructor(s) of @c xAOD::TEvent
+      using TEvent::TEvent;
 
       /// Function checking if an object is available from the store
       ::Bool_t contains( const std::string& key, const std::string& type );
diff --git a/Control/xAODRootAccess/xAODRootAccess/TPyStore.h b/Control/xAODRootAccess/xAODRootAccess/TPyStore.h
index b439318750246faf4fc101c498a0818459ff3cf2..442e10b116b3f919f285bc8fcd3915fd9331ea2a 100644
--- a/Control/xAODRootAccess/xAODRootAccess/TPyStore.h
+++ b/Control/xAODRootAccess/xAODRootAccess/TPyStore.h
@@ -30,8 +30,8 @@ namespace xAOD {
    class TPyStore : public TStore {
 
    public:
-      /// Default constructor
-      TPyStore();
+      /// Inherit the constructor(s) of @c xAOD::TStore
+      using TStore::TStore;
 
       /// Function checking if an object with a given key and type is available
       ::Bool_t contains( const std::string& key,
diff --git a/Control/xAODRootAccess/xAODRootAccess/TStore.h b/Control/xAODRootAccess/xAODRootAccess/TStore.h
index ce47b0d5e0fb2a5cd2125e0e650cd12b140c5203..9652657ad1ccb5d4c71bf4d0e8a45d868e2f8229 100644
--- a/Control/xAODRootAccess/xAODRootAccess/TStore.h
+++ b/Control/xAODRootAccess/xAODRootAccess/TStore.h
@@ -47,9 +47,14 @@ namespace xAOD {
    public:
       /// Default constructor
       TStore();
+      /// Disallow copying the object
+      TStore( const TStore& ) = delete;
       /// Destructor
       virtual ~TStore();
 
+      /// Disallow copying the object
+      TStore& operator=( const TStore& ) = delete;
+
       /// Set this as the active transient store in the application
       void setActive();
 
diff --git a/DataQuality/DCSCalculator2/CMakeLists.txt b/DataQuality/DCSCalculator2/CMakeLists.txt
index 828e03df1d321f6d4f05b088be3d5425fb397adf..5428b74761aca932feb39fbcef75331a2f66480c 100644
--- a/DataQuality/DCSCalculator2/CMakeLists.txt
+++ b/DataQuality/DCSCalculator2/CMakeLists.txt
@@ -1,17 +1,8 @@
-################################################################################
-# Package: DCSCalculator2
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( DCSCalculator2 )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PRIVATE
-                          Database/CoolRunQuery
-                          TileCalorimeter/TileCalib/TileCalibBlobObjs
-                          DataQuality/DQDefects
-                          DataQuality/DQUtils )
-
 # External dependencies:
 find_package( sqlalchemy )
 find_package( ipython )
diff --git a/DataQuality/DQDefects/CMakeLists.txt b/DataQuality/DQDefects/CMakeLists.txt
index 78af5128d1f22db445d1d3809339d08139d1b5d8..c852b89d64f51f810f7b98897a1be7abd2d7b421 100644
--- a/DataQuality/DQDefects/CMakeLists.txt
+++ b/DataQuality/DQDefects/CMakeLists.txt
@@ -1,14 +1,8 @@
-################################################################################
-# Package: DQDefects
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( DQDefects )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PRIVATE
-                          DataQuality/DQUtils )
-
 # External dependencies:
 find_package( Oracle )
 find_package( pyyaml )
diff --git a/DataQuality/DQUtils/CMakeLists.txt b/DataQuality/DQUtils/CMakeLists.txt
index 5ffbd7d58b04c4c0430311f157382a8679726773..70e8fd0e45dd84371f52580601f9ce90ffa2f625 100644
--- a/DataQuality/DQUtils/CMakeLists.txt
+++ b/DataQuality/DQUtils/CMakeLists.txt
@@ -1,14 +1,8 @@
-################################################################################
-# Package: DQUtils
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( DQUtils )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PRIVATE
-                          Database/CoraCool )
-
 # External dependencies:
 find_package( Boost COMPONENTS filesystem thread system )
 find_package( COOL COMPONENTS CoolKernel CoolApplication )
@@ -21,7 +15,6 @@ find_package( sqlalchemy )
 
 string(REPLACE "-Wl,--as-needed" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
 
-
 # Component(s) in the package:
 atlas_add_library( DQUtils
                    src/quick_retrieve.cxx
diff --git a/DataQuality/DataQualityConfigurations/CMakeLists.txt b/DataQuality/DataQualityConfigurations/CMakeLists.txt
index 4e11aa4cc5d6bd0511d9b265642564e0b9044ac0..2a673e40cd41459f98139f3b90708c5bcc07318d 100644
--- a/DataQuality/DataQualityConfigurations/CMakeLists.txt
+++ b/DataQuality/DataQualityConfigurations/CMakeLists.txt
@@ -1,14 +1,8 @@
-################################################################################
-# Package: DataQualityConfigurations
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( DataQualityConfigurations )
 
-# Requires DQI for binary build - this turns out not to do much, but keep for indication
-# Actual heavy lifting done by DEPENDS in add_custom_command
-atlas_depends_on_subdirs(PRIVATE DataQuality/DataQualityInterfaces)
-
 # Install files from the package:
 atlas_install_python_modules( python/*.py )
 atlas_install_scripts( scripts/MergeConfigs.py scripts/UploadDQAMITag.py
diff --git a/DataQuality/DataQualityConfigurations/config/AFP/collisions_run.config b/DataQuality/DataQualityConfigurations/config/AFP/collisions_run.config
new file mode 100644
index 0000000000000000000000000000000000000000..902fe0284263ff85a0dad4fc4500007dc5ce9429
--- /dev/null
+++ b/DataQuality/DataQualityConfigurations/config/AFP/collisions_run.config
@@ -0,0 +1,969 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+############################################################
+# AFP
+# Nikola Dikic
+############################################################
+
+############################################################
+ # Reference
+reference AFPBinContentReference {
+	 location = /eos/atlas/atlascerngroupdisk/data-dqm/references/Other/,root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/data-dqm/references/Other/
+	 file = data18_13TeV.00337176.physics_Main.merge.HIST.f940_h308.root
+	 path = run_337176
+	 name = same_name
+}
+############################################################
+
+############################################################
+# Output
+############################################################
+
+output top_level {
+	output AFP {
+		output SiT {
+			output pixelColRow2D {
+			}
+			output PixelColIDChip {
+			}
+			output PixelRowIDChip {
+			}
+			output SiTimeOverThreshold {
+			}
+			output Cluster {
+			}
+			output Track {
+			}
+			output clustersPerPlane {
+			}
+			output clustersPerStation {
+			}
+			output clustersPerPlaneFront {
+			}
+			output clustersPerPlaneEnd {
+			}
+			output clustersPerPlaneMiddle {
+			}
+		}
+		output ToF {
+			output HitBarvsTrain {
+			}
+		}
+	}
+}
+
+############################################################
+# Histogram Assessments
+############################################################
+
+dir AFP {
+	dir SiT {
+		dir pixelColRow2D {
+			hist pixelColIDChip_vs_pixelRowIDChip_nearAside_P0 {
+				algorithm = HNE
+				output = AFP/SiT/pixelColRow2D
+				display = LogZ,Draw=COLZ
+			}
+			hist pixelColIDChip_vs_pixelRowIDChip_nearAside_P1 {
+				algorithm = HNE
+				output = AFP/SiT/pixelColRow2D
+				display = LogZ,Draw=COLZ
+			}
+			hist pixelColIDChip_vs_pixelRowIDChip_nearAside_P2 {
+				algorithm = HNE
+				output = AFP/SiT/pixelColRow2D
+				display = LogZ,Draw=COLZ
+			}
+			hist pixelColIDChip_vs_pixelRowIDChip_nearAside_P3 {
+				algorithm = HNE
+				output = AFP/SiT/pixelColRow2D
+				display = LogZ,Draw=COLZ
+			}
+			hist pixelColIDChip_vs_pixelRowIDChip_nearCside_P0 {
+				algorithm = HNE
+				output = AFP/SiT/pixelColRow2D
+				display = LogZ,Draw=COLZ
+			}
+			hist pixelColIDChip_vs_pixelRowIDChip_nearCside_P1 {
+				algorithm = HNE
+				output = AFP/SiT/pixelColRow2D
+				display = LogZ,Draw=COLZ
+			}
+			hist pixelColIDChip_vs_pixelRowIDChip_nearCside_P2 {
+				algorithm = HNE
+				output = AFP/SiT/pixelColRow2D
+				display = LogZ,Draw=COLZ
+			}
+			hist pixelColIDChip_vs_pixelRowIDChip_nearCside_P3 {
+				algorithm = HNE
+				output = AFP/SiT/pixelColRow2D
+				display = LogZ,Draw=COLZ
+			}
+			hist pixelColIDChip_vs_pixelRowIDChip_farAside_P0 {
+				algorithm = HNE
+				output = AFP/SiT/pixelColRow2D
+				display = LogZ,Draw=COLZ
+			}
+			hist pixelColIDChip_vs_pixelRowIDChip_farAside_P1 {
+				algorithm = HNE
+				output = AFP/SiT/pixelColRow2D
+				display = LogZ,Draw=COLZ
+			}
+			hist pixelColIDChip_vs_pixelRowIDChip_farAside_P2 {
+				algorithm = HNE
+				output = AFP/SiT/pixelColRow2D
+				display = LogZ,Draw=COLZ
+			}
+			hist pixelColIDChip_vs_pixelRowIDChip_farAside_P3 {
+				algorithm = HNE
+				output = AFP/SiT/pixelColRow2D
+				display = LogZ,Draw=COLZ
+			}
+			hist pixelColIDChip_vs_pixelRowIDChip_farCside_P0 {
+				algorithm = HNE
+				output = AFP/SiT/pixelColRow2D
+				display = LogZ,Draw=COLZ
+			}
+			hist pixelColIDChip_vs_pixelRowIDChip_farCside_P1 {
+				algorithm = HNE
+				output = AFP/SiT/pixelColRow2D
+				display = LogZ,Draw=COLZ
+			}
+			hist pixelColIDChip_vs_pixelRowIDChip_farCside_P2 {
+				algorithm = HNE
+				output = AFP/SiT/pixelColRow2D
+				display = LogZ,Draw=COLZ
+			}
+			hist pixelColIDChip_vs_pixelRowIDChip_farCside_P3 {
+				algorithm = HNE
+				output = AFP/SiT/pixelColRow2D
+				display = LogZ,Draw=COLZ
+			}
+		}
+		dir PixelColIDChip {
+			hist pixelColIDChip_nearAside_P0 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelColIDChip
+				display = Draw=HIST
+			}
+			hist pixelColIDChip_nearAside_P1 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelColIDChip
+				display = Draw=HIST
+			}
+			hist pixelColIDChip_nearAside_P2 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelColIDChip
+				display = Draw=HIST
+			}
+			hist pixelColIDChip_nearAside_P3 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelColIDChip
+				display = Draw=HIST
+			}
+			hist pixelColIDChip_farAside_P0 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelColIDChip
+				display = Draw=HIST
+			}
+			hist pixelColIDChip_farAside_P1 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelColIDChip
+				display = Draw=HIST
+			}
+			hist pixelColIDChip_farAside_P2 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelColIDChip
+				display = Draw=HIST
+			}
+			hist pixelColIDChip_farAside_P3 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelColIDChip
+				display = Draw=HIST
+			}
+			hist pixelColIDChip_nearCside_P0 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelColIDChip
+				display = Draw=HIST
+			}
+			hist pixelColIDChip_nearCside_P1 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelColIDChip
+				display = Draw=HIST
+			}
+			hist pixelColIDChip_nearCside_P2 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelColIDChip
+				display = Draw=HIST
+			}
+			hist pixelColIDChip_nearCside_P3 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelColIDChip
+				display = Draw=HIST
+			}
+			hist pixelColIDChip_farCside_P0 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelColIDChip
+				display = Draw=HIST
+			}
+			hist pixelColIDChip_farCside_P1 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelColIDChip
+				display = Draw=HIST
+			}
+			hist pixelColIDChip_farCside_P2 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelColIDChip
+				display = Draw=HIST
+			}
+			hist pixelColIDChip_farCside_P3 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelColIDChip
+				display = Draw=HIST
+			}
+		}
+		dir PixelRowIDChip {
+			hist pixelRowIDChip_nearAside_P0 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelRowIDChip
+				display = Draw=HIST
+			}
+			hist pixelRowIDChip_nearAside_P1 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelRowIDChip
+				display = Draw=HIST
+			}
+			hist pixelRowIDChip_nearAside_P2 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelRowIDChip
+				display = Draw=HIST
+			}
+			hist pixelRowIDChip_nearAside_P3 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelRowIDChip
+				display = Draw=HIST
+			}
+			hist pixelRowIDChip_farAside_P0 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelRowIDChip
+				display = Draw=HIST
+			}
+			hist pixelRowIDChip_farAside_P1 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelRowIDChip
+				display = Draw=HIST
+			}
+			hist pixelRowIDChip_farAside_P2 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelRowIDChip
+				display = Draw=HIST
+			}
+			hist pixelRowIDChip_farAside_P3 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelRowIDChip
+				display = Draw=HIST
+			}
+			hist pixelRowIDChip_nearCside_P0 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelRowIDChip
+				display = Draw=HIST
+			}
+			hist pixelRowIDChip_nearCside_P1 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelRowIDChip
+				display = Draw=HIST
+			}
+			hist pixelRowIDChip_nearCside_P2 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelRowIDChip
+				display = Draw=HIST
+			}
+			hist pixelRowIDChip_nearCside_P3 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelRowIDChip
+				display = Draw=HIST
+			}
+			hist pixelRowIDChip_farCside_P0 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelRowIDChip
+				display = Draw=HIST
+			}
+			hist pixelRowIDChip_farCside_P1 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelRowIDChip
+				display = Draw=HIST
+			}
+			hist pixelRowIDChip_farCside_P2 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelRowIDChip
+				display = Draw=HIST
+			}
+			hist pixelRowIDChip_farCside_P3 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/PixelRowIDChip
+				display = Draw=HIST
+			}
+		}
+		dir SiTimeOverThreshold {
+			hist timeOverThreshold_nearAside_P0 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/SiTimeOverThreshold
+				display = Draw=HIST
+			}
+			hist timeOverThreshold_nearAside_P1 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/SiTimeOverThreshold
+				display = Draw=HIST
+			}
+			hist timeOverThreshold_nearAside_P2 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/SiTimeOverThreshold
+				display = Draw=HIST
+			}
+			hist timeOverThreshold_nearAside_P3 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/SiTimeOverThreshold
+				display = Draw=HIST
+			}
+			hist timeOverThreshold_farAside_P0 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/SiTimeOverThreshold
+				display = Draw=HIST
+			}
+			hist timeOverThreshold_farAside_P1 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/SiTimeOverThreshold
+				display = Draw=HIST
+			}
+			hist timeOverThreshold_farAside_P2 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/SiTimeOverThreshold
+				display = Draw=HIST
+			}
+			hist timeOverThreshold_farAside_P3 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/SiTimeOverThreshold
+				display = Draw=HIST
+			}
+			hist timeOverThreshold_nearCside_P0 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/SiTimeOverThreshold
+				display = Draw=HIST
+			}
+			hist timeOverThreshold_nearCside_P1 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/SiTimeOverThreshold
+				display = Draw=HIST
+			}
+			hist timeOverThreshold_nearCside_P2 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/SiTimeOverThreshold
+				display = Draw=HIST
+			}
+			hist timeOverThreshold_nearCside_P3 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/SiTimeOverThreshold
+				display = Draw=HIST
+			}
+			hist timeOverThreshold_farCside_P0 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/SiTimeOverThreshold
+				display = Draw=HIST
+			}
+			hist timeOverThreshold_farCside_P1 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/SiTimeOverThreshold
+				display = Draw=HIST
+			}
+			hist timeOverThreshold_farCside_P2 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/SiTimeOverThreshold
+				display = Draw=HIST
+			}
+			hist timeOverThreshold_farCside_P3 {
+				algorithm = AFPBinContentComp
+				output = AFP/SiT/SiTimeOverThreshold
+				display = Draw=HIST
+			}
+		}
+		dir Cluster {
+			hist clusterX_vs_clusterY_nearAside_P0 {
+				algorithm = HNE
+				output = AFP/SiT/Cluster
+				display = LogZ,Draw=COLZ
+			}
+			hist clusterX_vs_clusterY_nearAside_P1 {
+				algorithm = HNE
+				output = AFP/SiT/Cluster
+				display = LogZ,Draw=COLZ
+			}
+			hist clusterX_vs_clusterY_nearAside_P2 {
+				algorithm = HNE
+				output = AFP/SiT/Cluster
+				display = LogZ,Draw=COLZ
+			}
+			hist clusterX_vs_clusterY_nearAside_P3 {
+				algorithm = HNE
+				output = AFP/SiT/Cluster
+				display = LogZ,Draw=COLZ
+			}
+			hist clusterX_vs_clusterY_farAside_P0 {
+				algorithm = HNE
+				output = AFP/SiT/Cluster
+				display = LogZ,Draw=COLZ
+			}
+			hist clusterX_vs_clusterY_farAside_P1 {
+				algorithm = HNE
+				output = AFP/SiT/Cluster
+				display = LogZ,Draw=COLZ
+			}
+			hist clusterX_vs_clusterY_farAside_P2 {
+				algorithm = HNE
+				output = AFP/SiT/Cluster
+				display = LogZ,Draw=COLZ
+			}
+			hist clusterX_vs_clusterY_farAside_P3 {
+				algorithm = HNE
+				output = AFP/SiT/Cluster
+				display = LogZ,Draw=COLZ
+			}
+			hist clusterX_vs_clusterY_nearCside_P0 {
+				algorithm = HNE
+				output = AFP/SiT/Cluster
+				display = LogZ,Draw=COLZ
+			}
+			hist clusterX_vs_clusterY_nearCside_P1 {
+				algorithm = HNE
+				output = AFP/SiT/Cluster
+				display = LogZ,Draw=COLZ
+			}
+			hist clusterX_vs_clusterY_nearCside_P2 {
+				algorithm = HNE
+				output = AFP/SiT/Cluster
+				display = LogZ,Draw=COLZ
+			}
+			hist clusterX_vs_clusterY_nearCside_P3 {
+				algorithm = HNE
+				output = AFP/SiT/Cluster
+				display = LogZ,Draw=COLZ
+			}
+			hist clusterX_vs_clusterY_farCside_P0 {
+				algorithm = HNE
+				output = AFP/SiT/Cluster
+				display = LogZ,Draw=COLZ
+			}
+			hist clusterX_vs_clusterY_farCside_P1 {
+				algorithm = HNE
+				output = AFP/SiT/Cluster
+				display = LogZ,Draw=COLZ
+			}
+			hist clusterX_vs_clusterY_farCside_P2 {
+				algorithm = HNE
+				output = AFP/SiT/Cluster
+				display = LogZ,Draw=COLZ
+			}
+			hist clusterX_vs_clusterY_farCside_P3 {
+				algorithm = HNE
+				output = AFP/SiT/Cluster
+				display = LogZ,Draw=COLZ
+			}
+		}
+		dir Track {
+			hist trackX_vs_trackY_nearAside {
+				algorithm = HNE
+				output = AFP/SiT/Track
+				display = LogZ,Draw=COLZ
+			}
+			hist trackX_vs_trackY_nearCside {
+				algorithm = HNE
+				output = AFP/SiT/Track
+				display = LogZ,Draw=COLZ
+			}
+			hist trackX_vs_trackY_farAside {
+				algorithm = HNE
+				output = AFP/SiT/Track
+				display = LogZ,Draw=COLZ
+			}
+			hist trackX_vs_trackY_farCside {
+				algorithm = HNE
+				output = AFP/SiT/Track
+				display = LogZ,Draw=COLZ
+			}
+		}
+		dir clustersPerPlane {
+			hist clustersPerPlane_vs_lb_farAside_P0 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlane
+				display = Draw=COLZ
+			}
+			hist clustersPerPlane_vs_lb_farAside_P1 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlane
+				display = Draw=COLZ
+			}
+			hist clustersPerPlane_vs_lb_farAside_P2 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlane
+				display = Draw=COLZ
+			}
+			hist clustersPerPlane_vs_lb_farAside_P3 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlane
+				display = Draw=COLZ
+			}
+			hist clustersPerPlane_vs_lb_nearAside_P0 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlane
+				display = Draw=COLZ
+			}
+			hist clustersPerPlane_vs_lb_nearAside_P1 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlane
+				display = Draw=COLZ
+			}
+			hist clustersPerPlane_vs_lb_nearAside_P2 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlane
+				display = Draw=COLZ
+			}
+			hist clustersPerPlane_vs_lb_nearAside_P3 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlane
+				display = Draw=COLZ
+			}
+			hist clustersPerPlane_vs_lb_farCside_P0 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlane
+				display = Draw=COLZ
+			}
+			hist clustersPerPlane_vs_lb_farCside_P1 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlane
+				display = Draw=COLZ
+			}
+			hist clustersPerPlane_vs_lb_farCside_P2 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlane
+				display = Draw=COLZ
+			}
+			hist clustersPerPlane_vs_lb_farCside_P3 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlane
+				display = Draw=COLZ
+			}
+			hist clustersPerPlane_vs_lb_nearCside_P0 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlane
+				display = Draw=COLZ
+			}
+			hist clustersPerPlane_vs_lb_nearCside_P1 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlane
+				display = Draw=COLZ
+			}
+			hist clustersPerPlane_vs_lb_nearCside_P2 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlane
+				display = Draw=COLZ
+			}
+			hist clustersPerPlane_vs_lb_nearCside_P3 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlane
+				display = Draw=COLZ
+			}
+		}
+		dir clustersPerPlaneFront {
+			hist clustersPerPlaneFront_vs_lb_farAside_P0 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneFront
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneFront_vs_lb_farAside_P1 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneFront
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneFront_vs_lb_farAside_P2 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneFront
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneFront_vs_lb_farAside_P3 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneFront
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneFront_vs_lb_nearAside_P0 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneFront
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneFront_vs_lb_nearAside_P1 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneFront
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneFront_vs_lb_nearAside_P2 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneFront
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneFront_vs_lb_nearAside_P3 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneFront
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneFront_vs_lb_farCside_P0 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneFront
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneFront_vs_lb_farCside_P1 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneFront
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneFront_vs_lb_farCside_P2 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneFront
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneFront_vs_lb_farCside_P3 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneFront
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneFront_vs_lb_nearCside_P0 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneFront
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneFront_vs_lb_nearCside_P1 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneFront
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneFront_vs_lb_nearCside_P2 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneFront
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneFront_vs_lb_nearCside_P3 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneFront
+				display = Draw=COLZ
+			}
+		}
+		dir clustersPerPlaneEnd {
+			hist clustersPerPlaneEnd_vs_lb_farAside_P0 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneEnd
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneEnd_vs_lb_farAside_P1 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneEnd
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneEnd_vs_lb_farAside_P2 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneEnd
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneEnd_vs_lb_farAside_P3 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneEnd
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneEnd_vs_lb_nearAside_P0 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneEnd
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneEnd_vs_lb_nearAside_P1 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneEnd
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneEnd_vs_lb_nearAside_P2 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneEnd
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneEnd_vs_lb_nearAside_P3 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneEnd
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneEnd_vs_lb_farCside_P0 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneEnd
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneEnd_vs_lb_farCside_P1 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneEnd
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneEnd_vs_lb_farCside_P2 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneEnd
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneEnd_vs_lb_farCside_P3 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneEnd
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneEnd_vs_lb_nearCside_P0 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneEnd
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneEnd_vs_lb_nearCside_P1 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneEnd
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneEnd_vs_lb_nearCside_P2 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneEnd
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneEnd_vs_lb_nearCside_P3 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneEnd
+				display = Draw=COLZ
+			}
+		}
+		dir clustersPerPlaneMiddle {
+			hist clustersPerPlaneMiddle_vs_lb_farAside_P0 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneMiddle
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneMiddle_vs_lb_farAside_P1 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneMiddle
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneMiddle_vs_lb_farAside_P2 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneMiddle
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneMiddle_vs_lb_farAside_P3 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneMiddle
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneMiddle_vs_lb_nearAside_P0 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneMiddle
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneMiddle_vs_lb_nearAside_P1 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneMiddle
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneMiddle_vs_lb_nearAside_P2 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneMiddle
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneMiddle_vs_lb_nearAside_P3 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneMiddle
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneMiddle_vs_lb_farCside_P0 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneMiddle
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneMiddle_vs_lb_farCside_P1 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneMiddle
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneMiddle_vs_lb_farCside_P2 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneMiddle
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneMiddle_vs_lb_farCside_P3 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneMiddle
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneMiddle_vs_lb_nearCside_P0 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneMiddle
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneMiddle_vs_lb_nearCside_P1 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneMiddle
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneMiddle_vs_lb_nearCside_P2 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneMiddle
+				display = Draw=COLZ
+			}
+			hist clustersPerPlaneMiddle_vs_lb_nearCside_P3 {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerPlaneMiddle
+				display = Draw=COLZ
+			}
+		}
+		dir clustersPerStation {
+			hist clustersPerStation_vs_lb_farAside {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerStation
+				display = Draw=COLZ
+			}
+			hist clustersPerStation_vs_lb_farCside {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerStation
+				display = Draw=COLZ
+			}
+			hist clustersPerStation_vs_lb_nearAside {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerStation
+				display = Draw=COLZ
+			}
+			hist clustersPerStation_vs_lb_nearCside {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerStation
+				display = Draw=COLZ
+			}
+			hist clustersPerStationFront_vs_lb_farAside {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerStation
+				display = Draw=COLZ
+			}
+			hist clustersPerStationFront_vs_lb_farCside {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerStation
+				display = Draw=COLZ
+			}
+			hist clustersPerStationFront_vs_lb_nearAside {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerStation
+				display = Draw=COLZ
+			}
+			hist clustersPerStationFront_vs_lb_nearCside {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerStation
+				display = Draw=COLZ
+			}
+			hist clustersPerStationEnd_vs_lb_farAside {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerStation
+				display = Draw=COLZ
+			}
+			hist clustersPerStationEnd_vs_lb_farCside {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerStation
+				display = Draw=COLZ
+			}
+			hist clustersPerStationEnd_vs_lb_nearAside {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerStation
+				display = Draw=COLZ
+			}
+			hist clustersPerStationEnd_vs_lb_nearCside {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerStation
+				display = Draw=COLZ
+			}
+			hist clustersPerStationMiddle_vs_lb_farAside {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerStation
+				display = Draw=COLZ
+			}
+			hist clustersPerStationMiddle_vs_lb_farCside {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerStation
+				display = Draw=COLZ
+			}
+			hist clustersPerStationMiddle_vs_lb_nearAside {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerStation
+				display = Draw=COLZ
+			}
+			hist clustersPerStationMiddle_vs_lb_nearCside {
+				algorithm = HNE
+				output = AFP/SiT/clustersPerStation
+				display = Draw=COLZ
+			}
+		}
+		hist nSiHits_vs_lb {
+			algorithm = HNE
+			output = AFP/SiT
+			display = Draw=HIST
+		}
+		hist muPerBCID_vs_lb {
+			algorithm = HNE
+			output = AFP/SiT
+			display = Draw=HIST
+		}
+	}
+	dir ToF {
+		hist numberOfHit_S0 {
+			algorithm = HNE
+			output = AFP/ToF
+			display = Draw=HIST
+		}
+		hist numberOfHit_S3 {
+			algorithm = HNE
+			output = AFP/ToF
+			display = Draw=HIST
+		}
+		dir HitBarvsTrain {
+			hist trainID_vs_barInTrainID_farAside {
+				algorithm = HNE
+				output = AFP/ToF/HitBarvsTrain
+				display = Draw=COLZ
+			}
+			hist trainID_vs_barInTrainID_farCside {
+				algorithm = HNE
+				output = AFP/ToF/HitBarvsTrain
+				display = Draw=COLZ
+			}
+		}
+	}
+}
+
+############################################################
+# Algorithms
+
+algorithm HNE {
+	libname = libdqm_algorithms.so
+	name = Histogram_Not_Empty
+}
+
+algorithm AFPBinContentComp {
+	libname = libdqm_algorithms.so
+	name = BinContentComp
+	thresholds = AFPTestThreshold
+	NSigma = 3
+	reference = AFPBinContentReference
+	publish = 1
+	NormRef = 1
+}
+############################################################
+
+
+############################################################
+# Thresholds
+thresholds AFPTestThreshold {
+	limits NBins {
+		warning = 3
+		error = 5
+	}
+}
+###########################################################
diff --git a/DataQuality/DataQualityConfigurations/config/AFP/collisions_run.hcfg b/DataQuality/DataQualityConfigurations/config/AFP/collisions_run.hcfg
new file mode 100644
index 0000000000000000000000000000000000000000..df62dc20436da44684e8df4182b5dcaf9b9ce1f2
Binary files /dev/null and b/DataQuality/DataQualityConfigurations/config/AFP/collisions_run.hcfg differ
diff --git a/DataQuality/DataQualityInterfaces/CMakeLists.txt b/DataQuality/DataQualityInterfaces/CMakeLists.txt
index 380a68b28a7bb6134bba071d92242003888ab372..5082eaa1373918493ed92843cf5c8d6331d2a79b 100644
--- a/DataQuality/DataQualityInterfaces/CMakeLists.txt
+++ b/DataQuality/DataQualityInterfaces/CMakeLists.txt
@@ -1,6 +1,4 @@
-################################################################################
-# Package: DataQualityInterfaces
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( DataQualityInterfaces )
@@ -17,7 +15,7 @@ find_package( nlohmann_json )
 atlas_add_root_dictionary( DataQualityInterfaces
                            DataQualityInterfacesDictSource
                            ROOT_HEADERS DataQualityInterfaces/DatabaseConfig.h DataQualityInterfaces/MiniConfig.h DataQualityInterfaces/MiniConfigTreeNode.h DataQualityInterfaces/HanApp.h DataQualityInterfaces/HanConfig.h DataQualityInterfaces/HanConfigAlgLimit.h DataQualityInterfaces/HanConfigAlgPar.h DataQualityInterfaces/HanConfigParMap.h DataQualityInterfaces/HanConfigAssessor.h DataQualityInterfaces/HanConfigCompAlg.h DataQualityInterfaces/HanConfigGroup.h DataQualityInterfaces/HanConfigMetadata.h DataQualityInterfaces/ConditionsSingleton.h DataQualityInterfaces/LinkDef.h
-                           EXTERNAL_PACKAGES ROOT  Boost tdaq-common COOL CORAL nlohmann_json)
+                           EXTERNAL_PACKAGES ROOT Boost tdaq-common COOL CORAL nlohmann_json)
 
 atlas_add_library( DataQualityInterfaces
                    src/HanAlgorithmConfig.cxx
@@ -45,15 +43,12 @@ atlas_add_library( DataQualityInterfaces
 
 atlas_add_executable( han
                       src/han.cxx
-                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${TDAQ-COMMON_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES} ${Boost_LIBRARIES} ${TDAQ-COMMON_LIBRARIES} DataQualityInterfaces )
+                      LINK_LIBRARIES DataQualityInterfaces )
 
 atlas_add_executable( han-config-gen
                       src/han_config_gen.cxx
-                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${TDAQ-COMMON_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS}  nlohmann_json::nlohmann_json ${COOL_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES} ${Boost_LIBRARIES} ${TDAQ-COMMON_LIBRARIES} DataQualityInterfaces nlohmann_json::nlohmann_json ${CORAL_LIBRARIES} ${COOL_LIBRARIES} )
+                      LINK_LIBRARIES DataQualityInterfaces )
 
 atlas_add_executable( han-config-print
                       src/han_config_print.cxx
-                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${TDAQ-COMMON_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES} ${Boost_LIBRARIES} ${TDAQ-COMMON_LIBRARIES} DataQualityInterfaces )
+                      LINK_LIBRARIES DataQualityInterfaces )
diff --git a/DataQuality/DataQualityUtils/CMakeLists.txt b/DataQuality/DataQualityUtils/CMakeLists.txt
index 565713764670446a23d7975934fc08ad5a1427f6..efb1dc25eb00ec7a345f6515a408843720789567 100644
--- a/DataQuality/DataQualityUtils/CMakeLists.txt
+++ b/DataQuality/DataQualityUtils/CMakeLists.txt
@@ -1,15 +1,8 @@
-################################################################################
-# Package: DataQualityUtils
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( DataQualityUtils )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PRIVATE
-                          DataQuality/DataQualityInterfaces
-                          DataQuality/ZLumiScripts )
-
 # External dependencies:
 find_package( Boost COMPONENTS regex filesystem thread system )
 find_package( COOL COMPONENTS CoolKernel CoolApplication )
@@ -76,8 +69,7 @@ atlas_add_library( DataQualityUtils
 
 atlas_add_executable( han-results-print
                       src/han_results_print.cxx
-                      INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${COOL_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${Boost_LIBRARIES} ${COOL_LIBRARIES} ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} DataQualityInterfaces DataQualityUtils )
+                      LINK_LIBRARIES DataQualityUtils )
 
 # Install files from the package:
 atlas_install_python_modules( python/*.py
diff --git a/DataQuality/DataQualityUtils/src/MonitoringFile_CSCChamberEfficiency.cxx b/DataQuality/DataQualityUtils/src/MonitoringFile_CSCChamberEfficiency.cxx
index 0b955dae7fca8d5f5e050a2a0194fadfe61fd143..101f4ae329376e40dd4d8cd9301801f0a878defa 100644
--- a/DataQuality/DataQualityUtils/src/MonitoringFile_CSCChamberEfficiency.cxx
+++ b/DataQuality/DataQualityUtils/src/MonitoringFile_CSCChamberEfficiency.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
 */
 
 /* Methods to perform post-processing on run_nnnnnn/Muon/MuonSegmMonitoring/EndCapN/Detail/<Collection>/CSC* histograms
@@ -40,8 +40,6 @@ namespace dqutils {
     bool dbgLevel = false;
     if(dbgLevel) std::cout << "--> CSCChamberEfficiency: Calculate chamber efficiency by layer" << std::endl;
     std::string endc_label[2] = {"A","C"};
-    //std::string coll_dir_label[2] = {"ConvertedMBoySegments","MooreSegments"};
-    //std::string coll_hist_label[2] = {"MuBoy","Moore"};
     std::string coll_dir_label[1] = {"MuonSegments"};
     std::string coll_hist_label[1] = {"Muon"};
 
diff --git a/DataQuality/DataQualityUtils/src/MonitoringFile_CSCClusterFit.cxx b/DataQuality/DataQualityUtils/src/MonitoringFile_CSCClusterFit.cxx
index 5a526840e292a44cc3952662bf12af30ad34cffa..73e7d37cf2d47d83ffe97d4204bdd2dac76b0c29 100644
--- a/DataQuality/DataQualityUtils/src/MonitoringFile_CSCClusterFit.cxx
+++ b/DataQuality/DataQualityUtils/src/MonitoringFile_CSCClusterFit.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
 */
 
 /* Methods to perform post-processing on run_nnnnnn/Muon/MuonRawDataMonitoring/CSC/CSCE[AC]/Overview/lfitmean histograms
@@ -44,13 +44,9 @@ namespace dqutils {
     endc_label.push_back("C");
     
     std::vector<std::string> coll_dir_label;
-    //coll_dir_label.push_back("ConvertedMBoySegments");
-    //coll_dir_label.push_back("MooreSegments");
     coll_dir_label.push_back("MuonSegments");
 
     std::vector<std::string> coll_hist_label;
-    //coll_hist_label.push_back("MuBoy");
-    //coll_hist_label.push_back("Moore");
     coll_hist_label.push_back("Muon");
 
     f->cd("/");
@@ -62,8 +58,6 @@ namespace dqutils {
       if (!run_dir.Contains("run") )  { continue;}
 
       std::string run_dir2 = run_dir.Data();
-      //int run_number = atoi( (run_dir2.substr(4, run_dir2.size()-4 )).c_str() );
-      //run_number=run_number;
 
       for(std::size_t iec = 0; iec < endc_label.size(); iec++){
         for(std::size_t icoll = 0; icoll < coll_dir_label.size(); icoll++){
diff --git a/DataQuality/DataQualityUtils/src/MonitoringFile_MergeAlgs.cxx b/DataQuality/DataQualityUtils/src/MonitoringFile_MergeAlgs.cxx
index 21947a1f8bd6753c2943183d1cfa6c78cbef3797..13b37256212b9a57eebcc13e59885cb6065bccfb 100644
--- a/DataQuality/DataQualityUtils/src/MonitoringFile_MergeAlgs.cxx
+++ b/DataQuality/DataQualityUtils/src/MonitoringFile_MergeAlgs.cxx
@@ -80,7 +80,7 @@ void MonitoringFile::merge_effAsPerCent( TH2& a, const TH2& b )
   // a and b are efficiency histogramming with percentage stored
   // den/num are a number of events
   // BinContent = n/d*100 
-  // BinError   = (1/d2) * sqrt( d*n*(d-n) )
+  // BinError  =  (1/d2) * sqrt( d*n*(d-n) )
 
   // First extract the denominator
   // It is supposed to be the same for all bins
@@ -232,7 +232,7 @@ void MonitoringFile::merge_effAsPerCentAlt( TH1& a, const TH1& b )
   // a and b are efficiency histogramming with percentage stored
   // den/num are a number of events
   // BinContent = n/d*100
-  // BinError   = (1/d2) * sqrt( d*n*(d-n) )
+  // BinError  = (1/d2) * sqrt( d*n*(d-n) )
 
   // Verify histogram compatibility
   if (a.GetDimension() != b.GetDimension()) {
diff --git a/DataQuality/GoodRunsLists/CMakeLists.txt b/DataQuality/GoodRunsLists/CMakeLists.txt
index 8abe281e81d44adbad71375badb1525d5ac69f64..9683d2affca791902675e7fd3b35590c3629174e 100644
--- a/DataQuality/GoodRunsLists/CMakeLists.txt
+++ b/DataQuality/GoodRunsLists/CMakeLists.txt
@@ -1,36 +1,8 @@
-# $Id: CMakeLists.txt 777875 2016-10-11 17:17:13Z krasznaa $
-################################################################################
-# Package: GoodRunsLists
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( GoodRunsLists )
 
-# Declare the package's dependencies:
-if( XAOD_STANDALONE )
-   atlas_depends_on_subdirs(
-      PUBLIC
-      Control/AthToolSupport/AsgTools
-      Event/xAOD/xAODEventInfo
-      PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces
-      PRIVATE
-      Tools/PathResolver )
-else()
-   atlas_depends_on_subdirs(
-      PUBLIC
-      Control/AthToolSupport/AsgTools
-      Control/AthenaBaseComps
-      Control/AthenaKernel
-      Event/xAOD/xAODEventInfo
-      PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces
-      GaudiKernel
-      PRIVATE
-      Control/StoreGate
-      Event/EventInfo
-      Tools/PathResolver
-      AtlasTest/TestTools )
-endif()
-
 # External dependencies:
 find_package( ROOT COMPONENTS Core Tree TreePlayer XMLIO XMLParser )
 find_package( LibXml2 )
@@ -48,14 +20,13 @@ atlas_add_library( GoodRunsListsLib
    PUBLIC_HEADERS GoodRunsLists
    INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
    PRIVATE_INCLUDE_DIRS ${LIBXML2_INCLUDE_DIR}
-   LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools xAODEventInfo AsgAnalysisInterfaces
+   LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools AsgAnalysisInterfaces
    PRIVATE_LINK_LIBRARIES ${LIBXML2_LIBRARIES} PathResolver )
 
 if( NOT XAOD_STANDALONE )
    atlas_add_component( GoodRunsLists
       src/*.cxx src/components/*.cxx
-      LINK_LIBRARIES AthenaBaseComps AthenaKernel xAODEventInfo GaudiKernel
-      StoreGateLib EventInfo PathResolver GoodRunsListsLib )
+      LINK_LIBRARIES AthenaBaseComps AthenaKernel EventInfo GaudiKernel GoodRunsListsLib PathResolver StoreGateLib xAODEventInfo )
 endif()
 
 atlas_add_dictionary( GoodRunsListsDict
diff --git a/DataQuality/GoodRunsListsUser/CMakeLists.txt b/DataQuality/GoodRunsListsUser/CMakeLists.txt
index 092b549ae1301e041b4a4716716043455c5650fc..4aa54cc500023ef09b38c192d114cfbfc5c6772a 100644
--- a/DataQuality/GoodRunsListsUser/CMakeLists.txt
+++ b/DataQuality/GoodRunsListsUser/CMakeLists.txt
@@ -1,20 +1,8 @@
-################################################################################
-# Package: GoodRunsListsUser
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( GoodRunsListsUser )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Control/AthenaBaseComps
-                          Control/StoreGate
-                          DataQuality/GoodRunsLists
-                          Event/EventInfo
-                          GaudiKernel
-                          Trigger/TrigAnalysis/TrigDecisionTool
-                          Trigger/TrigEvent/TrigDecisionEvent )
-
 # External dependencies:
 find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread MathMore Minuit Minuit2 Matrix Physics HistPainter Rint )
 
@@ -25,7 +13,7 @@ atlas_add_component( GoodRunsListsUser
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaBaseComps StoreGateLib SGtests GoodRunsListsLib EventInfo GaudiKernel TrigDecisionToolLib TrigDecisionEvent )
+                     LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaBaseComps GoodRunsListsLib EventInfo GaudiKernel TrigDecisionToolLib TrigDecisionEvent )
 
 # Install files from the package:
 atlas_install_headers( GoodRunsListsUser )
diff --git a/DataQuality/ZLumiScripts/CMakeLists.txt b/DataQuality/ZLumiScripts/CMakeLists.txt
index b658acb5bba60af166e5ece565628c9b784817fd..5378b300298e51b01c4976ee62e071731036843d 100644
--- a/DataQuality/ZLumiScripts/CMakeLists.txt
+++ b/DataQuality/ZLumiScripts/CMakeLists.txt
@@ -1,13 +1,8 @@
-################################################################################
-# Package: ZLumiScripts
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( ZLumiScripts )
 
-# Declare the package's dependencies:
-#atlas_depends_on_subdirs( )
-
 # External dependencies:
 find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
 
diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaRootSharedWriterSvc.cxx b/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaRootSharedWriterSvc.cxx
index 410e4e4742b6c53630734295bc92faba8328304b..be51bbc79c3f06019db6d2bb0ae24d03cad3a028 100644
--- a/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaRootSharedWriterSvc.cxx
+++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaRootSharedWriterSvc.cxx
@@ -9,10 +9,12 @@
 
 #include "AthenaRootSharedWriterSvc.h"
 
+#include "TClass.h"
 #include "TFile.h"
 #include "TFileMerger.h"
-#include "TMessage.h"
+#include "TKey.h"
 #include "TMemFile.h"
+#include "TMessage.h"
 #include "TMonitor.h"
 #include "TServerSocket.h"
 #include "TSocket.h"
@@ -47,6 +49,15 @@ struct ParallelFileMerger : public TObject
    {
       fMerger.AddFile(input);
       Bool_t result = fMerger.PartialMerge(TFileMerger::kIncremental | TFileMerger::kResetable | TFileMerger::kKeepCompression);
+      TIter nextKey(input->GetListOfKeys());
+      while (TKey* key = static_cast<TKey*>(nextKey())) {
+         TClass *cl = TClass::GetClass(key->GetClassName());
+         if (0 != cl->GetResetAfterMerge()) {
+            key->Delete();
+            input->GetListOfKeys()->Remove(key);
+            delete key;
+         }
+      }
       return result;
    }
 };
@@ -106,7 +117,7 @@ StatusCode AthenaRootSharedWriterSvc::share(int numClients) {
                m_rootMonitor->Add(client);
                ATH_MSG_INFO("ROOT Monitor add client: " << m_rootClientIndex << ", " << client);
             } else {
-               TMessage* message;
+               TMessage* message = nullptr;
                socket->Recv(message);
                if (message == nullptr) {
                   ATH_MSG_WARNING("ROOT Monitor got no message from socket: " << socket);
@@ -139,6 +150,7 @@ StatusCode AthenaRootSharedWriterSvc::share(int numClients) {
                   }
                   info->MergeTrees(transient.get());
                }
+               delete message; message = nullptr;
             }
          }
       } else if (m_rootMonitor == nullptr) {
diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWrite.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWrite.ref
index c1dd45cb5593698a668913879ee05c93511e8c73..814f5dd5a1bdea2b0ebb0a57524a01fbc078de3d 100644
--- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWrite.ref
+++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWrite.ref
@@ -1,17 +1,17 @@
-Fri Sep 11 23:45:59 CEST 20?0
+Wed Sep 23 17:58:44 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 5568 configurables from 4 genConfDb files
+Py:ConfigurableDb    INFO Read module info for 5565 configurables from 45 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 v34r0)
-                                          running on aibuild028.cern.ch on Fri Sep 11 23:46:11 20?0
+                                          running on lxplus750.cern.ch on Wed Sep 23 17:58:51 20?0
 ====================================================================================================================================
 ApplicationMgr       INFO Application Manager Configured successfully
 AthDictLoaderSvc     INFO in initialize...
@@ -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-09-10T2101/Athena/22.0.18/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 10 servers found for host aibuild028.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
+DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/20?0-09-22T2101/Athena/22.0.18/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 10 servers found for host lxplus750.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
@@ -1835,6 +1835,7 @@ Stream1             DEBUG AthenaOutputStream Stream1 ::stop()
 MetaDataSvc         DEBUG MetaDataSvc::stop()
 Stream1             DEBUG slot 0  handle() incident type: MetaDataStop
 MetaDataSvc         DEBUG  calling metaDataStop for ToolSvc.IOVDbMetaDataTool
+MetaDataSvc         DEBUG Locking metadata tools
 Stream1             DEBUG metadataItemList: [EventStreamInfo#Stream1, IOVMetaDataContainer#*]
 Stream1             DEBUG addItemObjects(167728019,"Stream1") called
 Stream1             DEBUG            Key:Stream1
@@ -1873,6 +1874,7 @@ MetaDataHdrForm...  DEBUG Opened container MetaDataHdrForm(DataHeaderForm) of ty
 SimplePoolFile3...  DEBUG --->Adding Assoc :????/MetaDataHdrForm(DataHeaderForm) [20?]  (d , ffffffff)
 SimplePoolFile3...  DEBUG ---->ClassID:????
 Stream1              INFO Metadata records written: 21
+MetaDataSvc         DEBUG Unlocking metadata tools
 Stream1             DEBUG Leaving incident handler for MetaDataStop
 Domain[ROOT_All]     INFO ->  Deaccess DbDatabase   CREATE    [ROOT_All] ????
 Domain[ROOT_All]     INFO >   Deaccess DbDomain     UPDATE    [ROOT_All] 
@@ -1891,13 +1893,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=   10 [ms] Ave/Min/Max=   0.152(+-    1.22)/       0/      10 [ms] #= 66
-cObj_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.139(+-    1.66)/       0/      20 [ms] #=144
-fRep_ALL             INFO Time User   : Tot=   40 [ms] Ave/Min/Max=   0.645(+-    3.04)/       0/      20 [ms] #= 62
-ChronoStatSvc        INFO Time User   : Tot=  430 [ms]  #=  1
+cObjR_ALL            INFO Time User   : Tot=    0 [us] Ave/Min/Max=       0(+-       0)/       0/       0 [us] #= 66
+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
+fRep_ALL             INFO Time User   : Tot=   20 [ms] Ave/Min/Max=   0.323(+-    1.77)/       0/      10 [ms] #= 62
+cRepR_ALL            INFO Time User   : Tot=   20 [ms] Ave/Min/Max=   0.139(+-    1.17)/       0/      10 [ms] #=144
+ChronoStatSvc        INFO Time User   : Tot=  280 [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 43bdcbf6f6daa201cdbf6e9b9e7d16425e43a445..4ec01f4e859a4e072d09b64e053436aa9dead769 100644
--- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteAgain.ref
+++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteAgain.ref
@@ -1,17 +1,17 @@
-Fri Sep 11 23:46:44 CEST 20?0
+Wed Sep 23 17:41:03 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 5568 configurables from 4 genConfDb files
+Py:ConfigurableDb    INFO Read module info for 5565 configurables from 45 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 v34r0)
-                                          running on aibuild028.cern.ch on Fri Sep 11 23:46:56 20?0
+                                          running on lxplus750.cern.ch on Wed Sep 23 17:41:10 20?0
 ====================================================================================================================================
 ApplicationMgr       INFO Application Manager Configured successfully
 AthDictLoaderSvc     INFO in initialize...
@@ -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-09-10T2101/Athena/22.0.18/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 10 servers found for host aibuild028.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
+DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/20?0-09-22T2101/Athena/22.0.18/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 10 servers found for host lxplus750.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
@@ -1858,6 +1858,7 @@ Stream1             DEBUG AthenaOutputStream Stream1 ::stop()
 MetaDataSvc         DEBUG MetaDataSvc::stop()
 Stream1             DEBUG slot 0  handle() incident type: MetaDataStop
 MetaDataSvc         DEBUG  calling metaDataStop for ToolSvc.IOVDbMetaDataTool
+MetaDataSvc         DEBUG Locking metadata tools
 Stream1             DEBUG metadataItemList: [EventStreamInfo#Stream1, IOVMetaDataContainer#*]
 Stream1             DEBUG addItemObjects(167728019,"Stream1") called
 Stream1             DEBUG            Key:Stream1
@@ -1896,6 +1897,7 @@ MetaDataHdrForm...  DEBUG Opened container MetaDataHdrForm(DataHeaderForm) of ty
 SimplePoolFile3...  DEBUG --->Adding Assoc :????/MetaDataHdrForm(DataHeaderForm) [20?]  (d , ffffffff)
 SimplePoolFile3...  DEBUG ---->ClassID:????
 Stream1              INFO Metadata records written: 21
+MetaDataSvc         DEBUG Unlocking metadata tools
 Stream1             DEBUG Leaving incident handler for MetaDataStop
 Domain[ROOT_All]     INFO ->  Deaccess DbDatabase   CREATE    [ROOT_All] ????
 Domain[ROOT_All]     INFO >   Deaccess DbDomain     UPDATE    [ROOT_All] 
@@ -1917,10 +1919,10 @@ ToolSvc              INFO Removing all tools created by ToolSvc
 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
 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
 cRepR_ALL            INFO Time User   : Tot=   10 [ms] Ave/Min/Max=  0.0694(+-    0.83)/       0/      10 [ms] #=144
-cObj_ALL             INFO Time User   : Tot=   20 [ms] Ave/Min/Max=   0.317(+-    1.75)/       0/      10 [ms] #= 63
-fRep_ALL             INFO Time User   : Tot=   30 [ms] Ave/Min/Max=   0.484(+-    2.15)/       0/      10 [ms] #= 62
-ChronoStatSvc        INFO Time User   : Tot=  380 [ms]  #=  1
+fRep_ALL             INFO Time User   : Tot=   20 [ms] Ave/Min/Max=   0.323(+-    1.77)/       0/      10 [ms] #= 62
+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_ReWriteNext.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteNext.ref
index 680578f81ce0a6b84dae8c69a95666ee873f730f..51941979e8ecf7d93a05fdd48378a7ad1b70bdc5 100644
--- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteNext.ref
+++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteNext.ref
@@ -1,17 +1,17 @@
-Fri Sep 11 23:46:59 CEST 20?0
+Wed Sep 23 16:50:48 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 5568 configurables from 4 genConfDb files
+Py:ConfigurableDb    INFO Read module info for 5565 configurables from 45 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 v34r0)
-                                          running on aibuild028.cern.ch on Fri Sep 11 23:47:11 20?0
+                                          running on lxplus750.cern.ch on Wed Sep 23 16:50:56 20?0
 ====================================================================================================================================
 ApplicationMgr       INFO Application Manager Configured successfully
 AthDictLoaderSvc     INFO in initialize...
@@ -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-09-10T2101/Athena/22.0.18/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 10 servers found for host aibuild028.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
+DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/20?0-09-22T2101/Athena/22.0.18/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 10 servers found for host lxplus750.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
@@ -1193,6 +1193,7 @@ Stream1             DEBUG AthenaOutputStream Stream1 ::stop()
 MetaDataSvc         DEBUG MetaDataSvc::stop()
 Stream1             DEBUG slot 0  handle() incident type: MetaDataStop
 MetaDataSvc         DEBUG  calling metaDataStop for ToolSvc.IOVDbMetaDataTool
+MetaDataSvc         DEBUG Locking metadata tools
 Stream1             DEBUG metadataItemList: [EventStreamInfo#Stream1, IOVMetaDataContainer#*]
 Stream1             DEBUG addItemObjects(167728019,"Stream1") called
 Stream1             DEBUG            Key:Stream1
@@ -1231,6 +1232,7 @@ MetaDataHdrForm...  DEBUG Opened container MetaDataHdrForm(DataHeaderForm) of ty
 SimplePoolFile4...  DEBUG --->Adding Assoc :????/MetaDataHdrForm(DataHeaderForm) [20?]  (d , ffffffff)
 SimplePoolFile4...  DEBUG ---->ClassID:????
 Stream1              INFO Metadata records written: 21
+MetaDataSvc         DEBUG Unlocking metadata tools
 Stream1             DEBUG Leaving incident handler for MetaDataStop
 Domain[ROOT_All]     INFO ->  Deaccess DbDatabase   CREATE    [ROOT_All] ????
 Domain[ROOT_All]     INFO >   Deaccess DbDomain     UPDATE    [ROOT_All] 
@@ -1251,11 +1253,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
-cObjR_ALL            INFO Time User   : Tot=    0 [us] Ave/Min/Max=       0(+-       0)/       0/       0 [us] #= 65
+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
-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=   10 [ms] Ave/Min/Max=   0.159(+-    1.25)/       0/      10 [ms] #= 63
-ChronoStatSvc        INFO Time User   : Tot=  370 [ms]  #=  1
+ChronoStatSvc        INFO Time User   : Tot=  270 [ms]  #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
diff --git a/Database/AthenaPOOL/AthenaPoolUtilities/doc/packagedoc.h b/Database/AthenaPOOL/AthenaPoolUtilities/doc/packagedoc.h
index e0d322ba27f2aa4fb33526e996c208543a323de9..00b8bfe47e021e29ca5f5f754c48d0fb33fd126c 100644
--- a/Database/AthenaPOOL/AthenaPoolUtilities/doc/packagedoc.h
+++ b/Database/AthenaPOOL/AthenaPoolUtilities/doc/packagedoc.h
@@ -39,7 +39,7 @@ package as an example.
 @verbatim
    package InDetEventAthenaPool
 
-   author  Davide Costanzo <Davide.Costanzo@cern.ch>
+   author  Davide Costanzo <Davide.Costanzo@cern.ch>
 
    use AtlasPolicy          AtlasPolicy-* 
    use AthenaPoolUtilities  AthenaPoolUtilities-00-*   Database/AthenaPOOL
diff --git a/Database/CrestApi/CrestApi/CrestApi.h b/Database/CrestApi/CrestApi/CrestApi.h
index b63144f291596814a784759a9f2ae0c3b5eb58d1..634cfd081945250470193c2d0fcf668abfbead4b 100644
--- a/Database/CrestApi/CrestApi/CrestApi.h
+++ b/Database/CrestApi/CrestApi/CrestApi.h
@@ -143,7 +143,7 @@ namespace Crest {
 
 /**
  * General auxiliary method to make request to the CREST Server. This method is used by other methods realizing the
- * requests with the concrete kinds of data (iovs|payloads|tags…).
+ * requests with the concrete kinds of data (iovs|payloads|tags...).
  *
  * @param current_path - URL request path
  * @param action - Action (GET|POST|DELETE)
@@ -169,7 +169,7 @@ namespace Crest {
 
 /**
  * General auxillary method to make request to the CREST Server. This method is used by other methods realizing the
- * requests with the concrete kinds of data (iovs|payloads|tags…).
+ * requests with the concrete kinds of data (iovs|payloads|tags...).
  *
  * @param current_path - URL request path
  * @param action - Action (GET|POST|DELETE)
diff --git a/Database/IOVDbDataModel/CMakeLists.txt b/Database/IOVDbDataModel/CMakeLists.txt
index ac8ec282e2daf74520989a2cc9552d6ff7991a80..cd3bbcc1b3034c0d48b59b853d8c4dfcec51af91 100644
--- a/Database/IOVDbDataModel/CMakeLists.txt
+++ b/Database/IOVDbDataModel/CMakeLists.txt
@@ -5,11 +5,11 @@ atlas_subdir( IOVDbDataModel )
 
 # Component(s) in the package:
 atlas_add_library( IOVDbDataModel
-                   src/*.cxx
-                   PUBLIC_HEADERS IOVDbDataModel
-                   LINK_LIBRARIES AthenaKernel AthenaPoolUtilities GaudiKernel RootUtils )
+   IOVDbDataModel/*.h src/*.cxx
+   PUBLIC_HEADERS IOVDbDataModel
+   LINK_LIBRARIES AthenaKernel AthenaPoolUtilities GaudiKernel )
 
 atlas_add_dictionary( IOVDbDataModelDict
-                      IOVDbDataModel/IOVDbDataModelDict.h
-                      IOVDbDataModel/selection.xml
-                      LINK_LIBRARIES IOVDbDataModel )
+   IOVDbDataModel/IOVDbDataModelDict.h
+   IOVDbDataModel/selection.xml
+   LINK_LIBRARIES RootUtilsPyROOT IOVDbDataModel )
diff --git a/Database/IOVDbMetaDataTools/IOVDbMetaDataTools/IIOVDbMetaDataTool.h b/Database/IOVDbMetaDataTools/IOVDbMetaDataTools/IIOVDbMetaDataTool.h
index 0bc0733326c70dc42baecb80d9966cb52fcc5cbb..61827e45d42cb0bfc36f8c99e7b5bd453eae5367 100755
--- a/Database/IOVDbMetaDataTools/IOVDbMetaDataTools/IIOVDbMetaDataTool.h
+++ b/Database/IOVDbMetaDataTools/IOVDbMetaDataTools/IIOVDbMetaDataTool.h
@@ -18,11 +18,12 @@
 # define IOVDBMETADATATOOL_IIOVDBMETADATATOOL_H
 
 // Gaudi
-#include "GaudiKernel/IAlgTool.h"
+#include "AthenaKernel/IMetaDataTool.h"
 #include <string>
 
 //<<<<<< CLASS DECLARATIONS                                             >>>>>>
 class CondAttrListCollection;
+class IOVMetaDataContainer;
 
 /** 
  ** @class IIOVDbMetaDataTool
@@ -38,10 +39,11 @@ class CondAttrListCollection;
  **    - EndEvent:<pre>        End event number</pre>
  **/
 
-class IIOVDbMetaDataTool : virtual public IAlgTool 
+class IIOVDbMetaDataTool : virtual public IMetaDataTool,
+                           virtual public ILockableTool
 {
 
-public:    
+public:
   
     /// Retrieve interface ID
     static const InterfaceID& interfaceID() { 
@@ -69,6 +71,7 @@ public:
     /// occurs before BeginInputFile incident.
     virtual StatusCode  processInputFileMetaData(const std::string& fileName) = 0;
 
+    virtual IOVMetaDataContainer* findMetaDataContainer(const std::string& folderName) const = 0;
 };
 
 
diff --git a/Database/IOVDbMetaDataTools/src/IOVDbMetaDataTool.cxx b/Database/IOVDbMetaDataTools/src/IOVDbMetaDataTool.cxx
index 43ee27d70338b8c48ea05aa061609c4240736097..fd43710ca9f66c6df177b89951e1677d7e3a935a 100755
--- a/Database/IOVDbMetaDataTools/src/IOVDbMetaDataTool.cxx
+++ b/Database/IOVDbMetaDataTools/src/IOVDbMetaDataTool.cxx
@@ -231,10 +231,12 @@ StatusCode
 IOVDbMetaDataTool::registerFolder(const std::string& folderName, 
                                   const std::string& folderDescription) const
 {
+    // lock the tool before getMetaDataContainer() call
+    std::scoped_lock  guard( m_mutex );
+
     ATH_MSG_DEBUG("begin registerFolder ");
 
-    IOVMetaDataContainer* cont = getMetaDataContainer(folderName, folderDescription);
-    if (!cont) {
+    if( ! getMetaDataContainer(folderName, folderDescription) ) {
         ATH_MSG_ERROR("Unable to register folder " << folderName);
         return(StatusCode::FAILURE);
     } 
@@ -250,6 +252,9 @@ IOVDbMetaDataTool::registerFolder(const std::string& folderName,
 StatusCode IOVDbMetaDataTool::addPayload (const std::string& folderName
 					  , CondAttrListCollection* payload) const
 {
+  // lock the tool while it is modifying the folder
+  std::scoped_lock  guard( m_mutex );
+
   ATH_MSG_DEBUG("begin addPayload ");
   
   // Check if the  folder has already been found
@@ -302,6 +307,7 @@ StatusCode
 IOVDbMetaDataTool::modifyPayload ATLAS_NOT_THREAD_SAFE  (const std::string& folderName, 
                                                          CondAttrListCollection*& coll) const
 {
+    // protected by lock in processInputFileMetaData()
 
     /// Modify a Payload for a particular folder - replaces one of the
     /// internal attributes
@@ -384,10 +390,20 @@ IOVDbMetaDataTool::modifyPayload ATLAS_NOT_THREAD_SAFE  (const std::string& fold
 
 //--------------------------------------------------------------------------
 
+IOVMetaDataContainer*
+IOVDbMetaDataTool::findMetaDataContainer(const std::string& folderName) const
+{
+  // lock the tool before this call
+  // Return the folder if it is in the meta data store
+  return m_metaDataStore->tryRetrieve<IOVMetaDataContainer>(folderName);
+}
+
+
 IOVMetaDataContainer* 
 IOVDbMetaDataTool::getMetaDataContainer(const std::string& folderName
                                         , const std::string& folderDescription) const
 {
+  // protected by locks in addPayload() and registerFolder()
   ATH_MSG_DEBUG("begin getMetaDataContainer ");
 
   IOVMetaDataContainer* cont{nullptr};
@@ -419,6 +435,9 @@ IOVDbMetaDataTool::getMetaDataContainer(const std::string& folderName
 
 StatusCode IOVDbMetaDataTool::processInputFileMetaData(const std::string& fileName)
 {
+  // lock the tool while it is processing input metadata 
+  std::scoped_lock  guard( m_mutex );
+
   ATH_MSG_DEBUG("processInputFileMetaData: file name " << fileName);
 
   // Retrieve all meta data containers from InputMetaDataStore
diff --git a/Database/IOVDbMetaDataTools/src/IOVDbMetaDataTool.h b/Database/IOVDbMetaDataTools/src/IOVDbMetaDataTool.h
index 8e4ce5408dece9922ce551517ea01c0d7545ed1f..9c5a3aebfee3e6a9cc4ea333935db4c6bda23e13 100755
--- a/Database/IOVDbMetaDataTools/src/IOVDbMetaDataTool.h
+++ b/Database/IOVDbMetaDataTools/src/IOVDbMetaDataTool.h
@@ -20,10 +20,10 @@
 #include "AthenaBaseComps/AthAlgTool.h"
 #include "GaudiKernel/ServiceHandle.h"
 #include "GaudiKernel/IIncidentListener.h"
-#include "AthenaKernel/IMetaDataTool.h"
 #include "IOVDbMetaDataTools/IIOVDbMetaDataTool.h"
 
 #include <string>  
+#include <shared_mutex>
 
 class StoreGateSvc;
 class IOVMetaDataContainer;
@@ -37,7 +37,6 @@ class IOVMetaDataContainer;
  **/
 
 class IOVDbMetaDataTool : virtual public AthAlgTool,
-                          virtual public IMetaDataTool,
                           virtual public IIncidentListener,
                           virtual public IIOVDbMetaDataTool
 {
@@ -88,9 +87,15 @@ public:
     /// occurs before BegininputFile incident.
     virtual StatusCode processInputFileMetaData(const std::string& fileName) override;
 
+    virtual IOVMetaDataContainer* findMetaDataContainer(const std::string& folderName) const override final;
+
+    // ILockableTool API implementation
+    virtual void lock_shared() const override final { m_mutex.lock_shared(); }
+    virtual void unlock_shared() const override final { m_mutex.unlock_shared(); }
+
 private:
 
-    /// return meta data containerr from the meta data store
+    /// return meta data container from the meta data store
     IOVMetaDataContainer* getMetaDataContainer(const std::string& folderName, 
                                                const std::string& folderDescription) const;
 
@@ -145,6 +150,10 @@ private:
     StringArrayProperty  m_attributesToBeRemoved;
     bool                 m_modifyFolders;
 
+    // mutex for R/W locking of the entire tool (and supposedly all metadata objects it works with)
+    mutable std::shared_mutex    m_mutex  ATLAS_THREAD_SAFE;
 };
 
 #endif // IOVDBMETADATATOOLS_IOVDBMETADATATOOL_H
+
+
diff --git a/Database/IOVDbSvc/CMakeLists.txt b/Database/IOVDbSvc/CMakeLists.txt
index 555ab7d5b36ad04c0d51fcb2925b434689903ba9..e6144a92ce5243fabfb5826a582e19b77c3fcae3 100644
--- a/Database/IOVDbSvc/CMakeLists.txt
+++ b/Database/IOVDbSvc/CMakeLists.txt
@@ -96,6 +96,7 @@ atlas_add_test( ReadFromFileMetaData_test
    INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${COOL_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS}
    LINK_LIBRARIES ${Boost_LIBRARIES} ${COOL_LIBRARIES} ${CORAL_LIBRARIES}
    AthenaKernel IOVDbDataModel AthenaPoolUtilities CoraCool CxxUtils TestTools
+   IOVDbMetaDataToolsLib
    POST_EXEC_SCRIPT "nopost.sh" )
 
 atlas_add_test( IOVDbFolder_test
diff --git a/Database/IOVDbSvc/python/CondDB.py b/Database/IOVDbSvc/python/CondDB.py
index 61aea2f0846ec0348be4622adeaedf564d519bc1..fc854f8f1c8b0b385d1f59127965445611024eb7 100644
--- a/Database/IOVDbSvc/python/CondDB.py
+++ b/Database/IOVDbSvc/python/CondDB.py
@@ -231,7 +231,7 @@ This allows the possibility of later adding a new IOV using IOVSvc::setRange."""
         self.iovdbsvc.Folders+=[folderadd]
 
         if className:
-            key = (className, self.extractFolder(folder))
+            key = [className, self.extractFolder(folder)]
             if key not in condInputLoader.Load:
                 condInputLoader.Load += [ key ]
 
diff --git a/Database/IOVDbSvc/src/IOVDbFolder.cxx b/Database/IOVDbSvc/src/IOVDbFolder.cxx
index fa3bfb3c3355fa730f0ff0abb8040b0c736f4362..8adae94a0650f3b0b93c8f47f570b60c321b6fda 100644
--- a/Database/IOVDbSvc/src/IOVDbFolder.cxx
+++ b/Database/IOVDbSvc/src/IOVDbFolder.cxx
@@ -42,10 +42,8 @@
 #include "AthenaPoolUtilities/CondAttrListVecAddress.h"
 
 #include "GeoModelInterfaces/IGeoModelSvc.h"
-#include "EventInfo/TagInfo.h"
 
 #include "IOVDbMetaDataTools/IIOVDbMetaDataTool.h"
-#include "IOVDbDataModel/IOVMetaDataContainer.h"
 
 #include "IOVDbConn.h"
 
@@ -75,10 +73,12 @@ namespace{
 
 IOVDbFolder::IOVDbFolder(IOVDbConn* conn,
                          const IOVDbParser& folderprop, MsgStream& msg,
-                         IClassIDSvc* clidsvc, const bool checklock, const bool outputToFile,
+                         IClassIDSvc* clidsvc, IIOVDbMetaDataTool* metadatatool,
+                         const bool checklock, const bool outputToFile,
                          const std::string & source):
   AthMessaging(Athena::getMessageSvc(), "IOVDbFolder"),
   p_clidSvc(clidsvc),
+  p_metaDataTool(metadatatool),
   m_conn(conn),
   m_checklock(checklock),
   m_foldertype(AttrList),
@@ -155,9 +155,9 @@ IOVDbFolder::~IOVDbFolder() {
   if (m_cachespec!=0) m_cachespec->release();
 }
 
-void IOVDbFolder::setMetaCon(const IOVMetaDataContainer* metacon) {
+void IOVDbFolder::useFileMetaData() {
   // enable folder from FLMD at given connection
-  m_metacon=metacon;
+  m_useFileMetaData = true;
   // if previously connected to a real DB connection, remove association
   if (m_conn!=0) {
     m_conn->decUsage();
@@ -176,8 +176,7 @@ IOVDbFolder::setTagOverride(const std::string& tag,const bool setFlag) {
   m_jotag=IOVDbNamespace::spaceStrip(tag);
 }
 
-void IOVDbFolder::setWriteMeta(IIOVDbMetaDataTool* metadatatool) {
-  p_metaDataTool=metadatatool;
+void IOVDbFolder::setWriteMeta() {
   m_writemeta=true;
 }
 
@@ -638,8 +637,9 @@ IOVDbFolder::getAddress(const cool::ValidityKey reftime,
   CondAttrListVec* attrListVec=0;
   cool::ValidityKey naystart=0;
   cool::ValidityKey naystop=cool::ValidityKeyMax;
-  if (m_metacon) {    
-    IOVDbNamespace::ReadFromFileMetaData readFromMetaData(m_metacon, reftime, m_timestamp);
+  if( m_useFileMetaData ) {    
+    IOVDbNamespace::SafeReadFromFileMetaData
+       readFromMetaData(m_foldername, p_metaDataTool, reftime, m_timestamp);
     if (not readFromMetaData.isValid()){
       ATH_MSG_ERROR( "read:Could not find IOVPayloadContainer for folder "<< m_foldername );
       return false;
@@ -887,39 +887,37 @@ IOVDbFolder::preLoadFolder(StoreGateSvc* detStore, const unsigned int cacheRun,
   // and sets up cache length, taking into account optional overrides
   // returns null pointer in case of problem
   p_detStore=detStore;
-  std::string folderdesc;
-  if (not m_metacon) {
+  if( not m_useFileMetaData ) {
     if(m_source=="CREST"){
       const std::string  tagName=sanitiseCrestTag(m_foldername);
-      folderdesc=folderDescriptionForTag(tagName);
+      m_folderDescription = folderDescriptionForTag(tagName);
     } else {
       //folder desc from db
-      std::tie(m_multiversion, folderdesc) = IOVDbNamespace::folderMetadata(m_conn, m_foldername);
+      std::tie(m_multiversion, m_folderDescription) = IOVDbNamespace::folderMetadata(m_conn, m_foldername);
     }
   } else {
-    // folder from meta-data
-    folderdesc=m_metacon->folderDescription();
+    // folder description from meta-data set already earlier
   }
-  ATH_MSG_DEBUG( "Folder description " << folderdesc);
+  ATH_MSG_DEBUG( "Folder description " << m_folderDescription);
   // register folder with meta-data tool if writing metadata
   if (m_writemeta) {
-    if (StatusCode::SUCCESS!=p_metaDataTool->registerFolder(m_foldername,folderdesc)) {
+    if (StatusCode::SUCCESS!=p_metaDataTool->registerFolder(m_foldername,m_folderDescription)) {
       ATH_MSG_ERROR( "Failed to register folder " << m_foldername<< " for meta-data write" );
       return nullptr;
     }
   }
   // parse the description string
-  IOVDbParser folderpar(folderdesc,msg());
+  IOVDbParser folderpar(m_folderDescription, msg());
   //use the overrides in the folderdescription, return nullptr immediately if something went wrong
   if (not overrideOptionsFromParsedDescription(folderpar)) return nullptr;
   // setup channel list and folder type
-  if (not m_metacon) {
+  if( not m_useFileMetaData ) {
     if(m_source=="CREST"){
         const auto & crestTag=sanitiseCrestTag(m_foldername);
         m_channums=channelListForTag(crestTag);
         const std::string & payloadSpec = payloadSpecificationForTag(crestTag);
         //determine foldertype from the description, the spec and the number of channels
-        m_foldertype = IOVDbNamespace::determineFolderType(folderdesc, payloadSpec, m_channums);
+        m_foldertype = IOVDbNamespace::determineFolderType(m_folderDescription, payloadSpec, m_channums);
     } else {
       // data being read from COOL
       auto fldPtr=m_conn->getFolderPtr<cool::IFolderPtr>(m_foldername);
diff --git a/Database/IOVDbSvc/src/IOVDbFolder.h b/Database/IOVDbSvc/src/IOVDbFolder.h
index 987b1a763e9a88bb5f3467d05b7be73f775f25f6..dfa6181012186f80c5eef0404f132fc6ed3fc58b 100644
--- a/Database/IOVDbSvc/src/IOVDbFolder.h
+++ b/Database/IOVDbSvc/src/IOVDbFolder.h
@@ -30,7 +30,6 @@
 
 class MsgStream;
 class IOVDbConn;
-class IOVMetaDataContainer;
 class IOpaqueAddress;
 class IAddressCreator;
 class StoreGateSvc;
@@ -40,7 +39,8 @@ class CondAttrListCollection;
 class IOVDbFolder : public AthMessaging {
 public:
   IOVDbFolder(IOVDbConn* conn, const IOVDbParser& folderprop, MsgStream& msg,
-              IClassIDSvc* clidsvc,const bool checklock, const bool outputToFile=false,
+              IClassIDSvc* clidsvc, IIOVDbMetaDataTool* metadatatool,
+              const bool checklock, const bool outputToFile=false,
               const std::string & source="COOL_DATABASE");
   ~IOVDbFolder();
   
@@ -73,12 +73,16 @@ public:
   IOVRange currentRange() const;
 
   // set methods - used after folder creation to set properties externally
-  void setMetaCon(const IOVMetaDataContainer* con);
+
+  // mark this folder as using metadata from an input file
+  void useFileMetaData();
+  // set folder description
+  void setFolderDescription(const std::string& description);
   // set tag override, set override flag as well if setFlag is true
   // override flag prevents reading of FLMD for this folder if present
   void setTagOverride(const std::string& tag,const bool setFlag);
   // set writeMeta flag
-  void setWriteMeta(IIOVDbMetaDataTool* metadatatool);
+  void setWriteMeta();
   // set IOV overrides
   void setIOVOverride(const unsigned int run,const unsigned int lumiblock,
                       const unsigned int time);
@@ -212,19 +216,21 @@ private:
 
   void 
   specialCacheUpdate(const cool::IObject& obj,const ServiceHandle<IIOVSvc>& iovSvc);
- 
-  
+
+
   StoreGateSvc*        p_detStore{nullptr};     // pointer to detector store
   IClassIDSvc*         p_clidSvc{nullptr};      // pointer to CLID service
   IIOVDbMetaDataTool*  p_metaDataTool{nullptr}; // pointer to metadata tool (writing)
   IOVDbConn*           m_conn{nullptr};         // pointer to corresponding IOVDbConn object (=0 FLMD)
   std::string m_foldername;       // COOL foldername
   std::string m_key;              // SG key where data is loaded (unique)
+  std::string m_folderDescription;// folder description
   bool m_multiversion{false};     // is folder multiversion
   bool m_timestamp{false};        // is folder indexed by timestamp (else runLB)
   bool m_tagoverride{false};      // is tag reset from override (needed for FLMD)
   bool m_notagoverride{false};    // tag must not be overridden from input file
   bool m_writemeta{false};        // is writing to metadata
+  bool m_useFileMetaData{false};  // is using input File MetaData
   bool m_fromMetaDataOnly{false}; // to be read from metadata only
   bool m_extensible{false};       // is this an extensible folder?
   bool m_named{false};            // folder has named channels
@@ -235,7 +241,6 @@ private:
   bool m_checklock{true};         // indicates if global tags should be checked locked
   cool::ValidityKey m_iovoverride{0};             // validity key to use
   IOVDbNamespace::FolderType m_foldertype;        // type of data in folder (enum)
-  const IOVMetaDataContainer* m_metacon{nullptr}; // metadata container (=0 if not FLMD)
 
   cool::ValidityKey m_cachelength{0}; // length of cache
   int m_cachehint{0};                 // cachehint value (set initial size to Nxchan)
@@ -298,7 +303,10 @@ inline bool IOVDbFolder::retrieved() const { return m_retrieved; }
 inline IOVDbNamespace::FolderType IOVDbFolder::folderType() const 
 {return m_foldertype;}
 
-inline bool IOVDbFolder::readMeta() const { return (m_metacon!=0); }
+inline void IOVDbFolder::setFolderDescription(const std::string& description)
+{ m_folderDescription = description; }
+
+inline bool IOVDbFolder::readMeta() const { return m_useFileMetaData; }
 
 inline bool IOVDbFolder::writeMeta() const { return m_writemeta; }
 
diff --git a/Database/IOVDbSvc/src/IOVDbSvc.cxx b/Database/IOVDbSvc/src/IOVDbSvc.cxx
index 3ddd72691c6461b956da8444229cd36761aa2c6c..aec06b21e3a8e790dbab6470625457099837fa27 100644
--- a/Database/IOVDbSvc/src/IOVDbSvc.cxx
+++ b/Database/IOVDbSvc/src/IOVDbSvc.cxx
@@ -213,7 +213,8 @@ StatusCode IOVDbSvc::preLoadAddresses(StoreID::type storeID,tadList& tlist) {
         // take data from FLMD only if tag override is NOT set
         if (thisNamePtrPair.second->folderName()==fname && !(thisNamePtrPair.second->tagOverride())) {
           ATH_MSG_INFO( "Folder " << fname << " will be taken from file metadata" );
-          thisNamePtrPair.second->setMetaCon(&*cont);
+          thisNamePtrPair.second->useFileMetaData();
+          thisNamePtrPair.second->setFolderDescription( cont->folderDescription() );
           ++nused;
           break;
         }
@@ -905,7 +906,7 @@ StatusCode IOVDbSvc::setupFolders() {
     }
     // create the new folder, but only if a folder for this SG key has not
     // already been requested
-    IOVDbFolder* folder=new IOVDbFolder(conn,folderdata,msg(),&(*m_h_clidSvc),
+    IOVDbFolder* folder=new IOVDbFolder(conn,folderdata,msg(),&(*m_h_clidSvc), &(*m_h_metaDataTool),
                                         m_par_checklock, m_outputToFile.value(), m_par_source);
     const std::string& key=folder->key();
     if (m_foldermap.find(key)==m_foldermap.end()) {  //This check is too weak. For POOL-based folders, the SG key is in the folder description (not known at this point).
@@ -930,7 +931,7 @@ StatusCode IOVDbSvc::setupFolders() {
     for (const auto & thisFolder : m_foldermap) {
       IOVDbFolder* fptr=thisFolder.second;
       if ((fptr->folderName()).substr(0,match.size())==match) {
-        fptr->setWriteMeta(&(*m_h_metaDataTool));
+        fptr->setWriteMeta();
         ATH_MSG_INFO( "Folder " << fptr->folderName() << " will be written to file metadata" );
       }
     }//end loop over FolderMap
diff --git a/Database/IOVDbSvc/src/ReadFromFileMetaData.cxx b/Database/IOVDbSvc/src/ReadFromFileMetaData.cxx
index d6588dbbc443c903978db6fde7fee49759a54a05..740b9f4713d2f8204f79a4f98f5f4fb7cde8e783 100644
--- a/Database/IOVDbSvc/src/ReadFromFileMetaData.cxx
+++ b/Database/IOVDbSvc/src/ReadFromFileMetaData.cxx
@@ -9,14 +9,15 @@
 #include "IOVDbDataModel/IOVPayloadContainer.h"
 #include "AthenaPoolUtilities/CondAttrListCollection.h"
 #include "AthenaPoolUtilities/AthenaAttributeList.h"
+#include "IOVDbMetaDataTools/IIOVDbMetaDataTool.h"
 
 using IOVDbNamespace::makeEpochOrRunLumi;
 
 namespace IOVDbNamespace{
-  ReadFromFileMetaData::ReadFromFileMetaData( const IOVMetaDataContainer* container, 
-        const IOVTime & refTime, const bool useEpochTimestamp):
+  ReadFromFileMetaData::ReadFromFileMetaData( const IOVMetaDataContainer* container,
+        const IOVTime & refTime, const bool useEpochTimestamp) :
         m_metaContainer(container), 
-        m_referenceTime(refTime){
+        m_referenceTime(refTime) {
     m_payload = (container) ? (container->payloadContainer()) : (nullptr);
     if (m_payload){
       IOVPayloadContainer::const_iterator pitr=m_payload->find(m_referenceTime);
@@ -30,10 +31,12 @@ namespace IOVDbNamespace{
     }
   }
   //
-  ReadFromFileMetaData::ReadFromFileMetaData( const IOVMetaDataContainer* container, 
+  ReadFromFileMetaData::ReadFromFileMetaData( const IOVMetaDataContainer* container,
         const cool::ValidityKey & refTimeKey, const bool useEpochTimestamp)
-        :ReadFromFileMetaData(container,makeEpochOrRunLumi(refTimeKey,useEpochTimestamp),useEpochTimestamp){
-  }
+     : ReadFromFileMetaData( container,
+                             makeEpochOrRunLumi(refTimeKey,useEpochTimestamp),
+                             useEpochTimestamp )
+  { } 
   //
   ReadFromFileMetaData::~ReadFromFileMetaData(){
     if (m_newedPtr) delete m_pptr;
@@ -101,7 +104,36 @@ namespace IOVDbNamespace{
     return m_attrList;
   }
 
+//-----------------------------------------------------------------------
+   FMDReadLock::FMDReadLock( IIOVDbMetaDataTool* metadatatool )
+      : m_metadatatool(metadatatool)
+   {
+      m_metadatatool->lock_shared();
+   }
+
+   IOVMetaDataContainer* FMDReadLock::findFolder( const std::string& folderName )
+   {
+      return m_metadatatool->findMetaDataContainer( folderName );
+   }
+
+   FMDReadLock::~FMDReadLock() {
+      m_metadatatool->unlock_shared();
+   }
 
 
+  SafeReadFromFileMetaData::SafeReadFromFileMetaData(
+     const std::string& folderName,
+     IIOVDbMetaDataTool* metadatatool,
+     const IOVTime & refTime, const bool useEpochTimestamp )
+     :  FMDReadLock(metadatatool),
+        ReadFromFileMetaData( FMDReadLock::findFolder(folderName), refTime, useEpochTimestamp )
+  {  }
 
+  SafeReadFromFileMetaData::SafeReadFromFileMetaData(
+     const std::string& folderName,
+     IIOVDbMetaDataTool* metadatatool,
+     const cool::ValidityKey & refTimeKey, const bool useEpochTimestamp)
+     :  FMDReadLock(metadatatool),
+        ReadFromFileMetaData( FMDReadLock::findFolder(folderName), refTimeKey, useEpochTimestamp )
+  {  }
 }
diff --git a/Database/IOVDbSvc/src/ReadFromFileMetaData.h b/Database/IOVDbSvc/src/ReadFromFileMetaData.h
index 67eecee8946dbb26ef22674feb5c5347ff98f71a..e362f7812b7b3e4e9e561854da10f697907f26c7 100644
--- a/Database/IOVDbSvc/src/ReadFromFileMetaData.h
+++ b/Database/IOVDbSvc/src/ReadFromFileMetaData.h
@@ -17,6 +17,7 @@
 #include "IOVDbDataModel/IOVPayloadContainer.h"
 
 //fwd declarations
+class IIOVDbMetaDataTool;
 class IOVMetaDataContainer;
 class CondAttrListCollection;
 class AthenaAttributeList;
@@ -53,7 +54,30 @@ namespace IOVDbNamespace{
     CondAttrListCollection * m_attrListColl{};
     IOVDbNamespace::FolderType m_folderType{UNKNOWN};
     bool m_newedPtr{};
-  
   };
+
+
+   class FMDReadLock {
+   public:
+      FMDReadLock( const FMDReadLock& )=delete;
+      void operator=( const FMDReadLock& )=delete;
+      FMDReadLock( IIOVDbMetaDataTool* metadatatool );
+      ~FMDReadLock();
+      IOVMetaDataContainer* findFolder( const std::string& folderName );
+     private:
+      IIOVDbMetaDataTool* m_metadatatool {};
+   };
+
+   class SafeReadFromFileMetaData : private FMDReadLock, public ReadFromFileMetaData
+   {
+   public:
+      SafeReadFromFileMetaData( const std::string& folderName,
+                                IIOVDbMetaDataTool* metadatatool,
+                                const IOVTime & refTime, const bool useEpochTimestamp );
+      SafeReadFromFileMetaData( const std::string& folderName,
+                                IIOVDbMetaDataTool* metadatatool,
+                                const cool::ValidityKey & refTimeKey, const bool useEpochTimestamp);
+   };
+
 }//namespace
 #endif
diff --git a/Database/IOVDbSvc/test/IOVDbFolder_test.cxx b/Database/IOVDbSvc/test/IOVDbFolder_test.cxx
index b70a17f2b5a519bf86c64214248ba753f677c1af..98d6704b123b5822782fabc283d88ae2acd9c506 100644
--- a/Database/IOVDbSvc/test/IOVDbFolder_test.cxx
+++ b/Database/IOVDbSvc/test/IOVDbFolder_test.cxx
@@ -79,13 +79,13 @@ BOOST_FIXTURE_TEST_SUITE(IOVDbFolderTest , GaudiKernelFixture)
   //tests construction
   BOOST_AUTO_TEST_CASE(IOVDbFolderConstruction){
     //note:default construction is not explicitly deleted; perhaps it should be.
-    BOOST_CHECK_NO_THROW(IOVDbFolder f(&(connectionFixture.connection), parserFixture.parser, parserFixture.log, clidSvc.get(),false));
+    BOOST_CHECK_NO_THROW(IOVDbFolder f(&(connectionFixture.connection), parserFixture.parser, parserFixture.log, clidSvc.get(), nullptr, false));
   }
   BOOST_FIXTURE_TEST_SUITE(IOVDbFolderMethods, TestFolderFixture)
     BOOST_AUTO_TEST_CASE(PublicMethods){
       //preload tests
       IOVDbConn connection("sqlite://;schema=IOVDbFolderTest.db;dbname=OFLP200", true, parserFixture.log);
-      IOVDbFolder iovDbFolder(&connection, parserFixture.parser, parserFixture.log, clidSvc.get(),false,true);
+      IOVDbFolder iovDbFolder(&connection, parserFixture.parser, parserFixture.log, clidSvc.get(), nullptr, false, true);
       BOOST_TEST_CHECKPOINT("After instantiation, but before any loading method call");
       BOOST_TEST(iovDbFolder.folderName() == "/key1");
       BOOST_TEST(iovDbFolder.key() == "/key1");
diff --git a/DetectorDescription/GeoModel/AtlasGeoModel/python/GeoModelConfig.py b/DetectorDescription/GeoModel/AtlasGeoModel/python/GeoModelConfig.py
index 2da385b00cfd760c2ff64178aa71dbef734696bc..b6ee4e15d3978213da1ee3a16c5f8a789c800609 100644
--- a/DetectorDescription/GeoModel/AtlasGeoModel/python/GeoModelConfig.py
+++ b/DetectorDescription/GeoModel/AtlasGeoModel/python/GeoModelConfig.py
@@ -22,7 +22,7 @@ def GeoModelCfg(configFlags):
     if configFlags.Detector.Simulate:
         ## Protects GeoModelSvc in the simulation from the AlignCallbacks
         gms.AlignCallbacks = False
-    result.addService(gms,primary=True)
+    result.addService(gms, primary=True, create=True)
 
 
     #Get DetDescrCnvSvc (for identifier dictionaries (identifier helpers)
diff --git a/DetectorDescription/GeoModel/GeoAdaptors/GeoAdaptors/GeoSiHit.icc b/DetectorDescription/GeoModel/GeoAdaptors/GeoAdaptors/GeoSiHit.icc
index 7eb02a03cd25c526df448d645c5a166617acff7c..7a8b878e87b4ed740974e46cf10fb87ab00efc9b 100755
--- a/DetectorDescription/GeoModel/GeoAdaptors/GeoAdaptors/GeoSiHit.icc
+++ b/DetectorDescription/GeoModel/GeoAdaptors/GeoAdaptors/GeoSiHit.icc
@@ -32,7 +32,8 @@ inline void GeoSiHit::init() {
 
 inline GeoSiHit::GeoSiHit (const SiHit & h) {
   m_hit = &h;
-  if (!s_sct || ! s_pix) init();
+  //If neither manager exists, may need to re-initialize...
+  if (!s_sct && !s_pix) init();
 }
 
 inline HepGeom::Point3D<double> GeoSiHit::getGlobalPosition() const {
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/DumpGeo/DumpGeo/DumpGeo.h b/DetectorDescription/GeoModel/GeoModelStandalone/DumpGeo/DumpGeo/DumpGeo.h
index 076191d8870047849649178c1946139b75c8784a..85e8e6d99b0c3d4ab6c194eda06e1726334e6e0f 100755
--- a/DetectorDescription/GeoModel/GeoModelStandalone/DumpGeo/DumpGeo/DumpGeo.h
+++ b/DetectorDescription/GeoModel/GeoModelStandalone/DumpGeo/DumpGeo/DumpGeo.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
 */
 
 /////////////////////////////////////////////////////////////
@@ -13,7 +13,6 @@
 //                                                         //
 /////////////////////////////////////////////////////////////
 
-
 #ifndef DumpGeo_DumpGeo
 #define DumpGeo_DumpGeo
 
@@ -30,11 +29,10 @@ class DumpGeo: public AthAlgorithm,
 {
  public:
   DumpGeo(const std::string& name, ISvcLocator* pSvcLocator);
-  ~DumpGeo();
+  ~DumpGeo()=default;
 
   StatusCode initialize();
   StatusCode execute();
-  StatusCode finalize();
 
   void handle(const Incident& inc);
 
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/DumpGeo/share/dump-geo.py b/DetectorDescription/GeoModel/GeoModelStandalone/DumpGeo/share/dump-geo.py
index c80d81024135df383df0d0cbb50a03bebfb574e4..448174309dfb1a1cb08b4293f984f32d71f528d3 100644
--- a/DetectorDescription/GeoModel/GeoModelStandalone/DumpGeo/share/dump-geo.py
+++ b/DetectorDescription/GeoModel/GeoModelStandalone/DumpGeo/share/dump-geo.py
@@ -43,7 +43,7 @@ if not 'vp1MuonAGDD2GeoSwitches' in dir(): vp1MuonAGDD2GeoSwitches=[]
 if not 'vp1NSWAGDDFiles' in dir(): vp1NSWAGDDFiles=[]
 if not 'vp1MuonLayout' in dir(): vp1MuonLayout=""
 
-def vp1CfgErr(s): print "VP1 CONFIGURATION ERROR: %s" % s
+def vp1CfgErr(s): print ("VP1 CONFIGURATION ERROR: %s" % s)
 
 if (vp1Fatras and not vp1ID):
     vp1CfgErr("Fatras can not be enabled without inner detector. Turning off Fatras.")
@@ -64,13 +64,6 @@ if ( vp1FatrasTruthKey != "" and not vp1Fatras ):
     vp1CfgErr("FatrasTruthKey set but Fatras not enabled. Unsetting FatrasTruthKey.")
     vp1FatrasTruthKey=""
 
-#print "*** VP1 NOTE *** setting COIN_GLXGLUE env vars to make screenshots working remotely..."
-#print "*** VP1 NOTE *** COIN_GLXGLUE_NO_GLX13_PBUFFERS=1 - " + "COIN_GLXGLUE_NO_PBUFFERS=1"
-#os.putenv("COIN_GLXGLUE_NO_GLX13_PBUFFERS","1")
-#os.putenv("COIN_GLXGLUE_NO_PBUFFERS","1")
-
-
-
 #Set VP1ATLREL integer so we can do e.g. "if VP1ATLREL>=160002:"
 include('DumpGeo/vp1FragmentConstructVP1ATLREL.py')
 
@@ -181,9 +174,9 @@ if (vp1ZDC): DetFlags.ZDC_setOn()
 else:          DetFlags.ZDC_setOff()
 DetFlags.Print()
 if (vp1CustomGeometry):
-    print "Configuring Custom geometry."
+    print ("Configuring Custom geometry.")
 if (vp1SLHC):
-  print "Setting up SLHC configuration"
+  print ("Setting up SLHC configuration")
   rec.doTrigger.set_Value_and_Lock(False)
   from AthenaCommon.GlobalFlags import globalflags
   from AthenaCommon.GlobalFlags import jobproperties
@@ -221,16 +214,16 @@ from AtlasGeoModel import GeoModelInit
 from AthenaCommon.AppMgr import ServiceMgr as svcMgr
 
 if vp1GeoModelStats:
-  print "printing GeoModel stats to file (Svc.StatisticsToFile=TRUE)..."
+  print ("printing GeoModel stats to file (Svc.StatisticsToFile=TRUE)...")
   svcMgr.GeoModelSvc.StatisticsToFile = True
 
 if vp1Cavern:
-  print "vp1.py - Initializing the visualization of the Cavern Infrastructure..."
+  print ("vp1.py - Initializing the visualization of the Cavern Infrastructure...")
   from CavernInfraGeoModel.CavernInfraGeoModelConf import CavernInfraDetectorTool
   svcMgr.GeoModelSvc.DetectorTools += [ CavernInfraDetectorTool() ]
 
 if vp1ToyDetector:
-  print "vp1.py - Initializing the visualization of the GeoModelExamples 'ToyDetector'..."
+  print ("vp1.py - Initializing the visualization of the GeoModelExamples 'ToyDetector'...")
   from GeoModelExamples.GeoModelExamplesConf import ToyDetectorTool
   svcMgr.GeoModelSvc.DetectorTools += [ ToyDetectorTool() ]
 
@@ -283,30 +276,7 @@ if (vp1Muon):
                     b.ReadAGDD=False
                     b.XMLFiles=vp1NSWAGDDFiles
 
-    # if(vp1FullToroids or vp1NSW):
-    #     from AtlasGeoModel import Agdd2Geo
-    # else:
-    #     from AthenaCommon.GlobalFlags import globalflags
-    #     DDV = globalflags.DetDescrVersion()
-    #     if(DDV.__contains__('ATLAS-GEO')):
-    #         seconddash = DDV.find('-',8);
-    #         majorddversstr = DDV[seconddash+1:seconddash+3];
-    #         majorddversint = int(majorddversstr);
-    #         if(majorddversint>10):
-    #             # Additional material in the muon system
-    #             from AGDD2Geo.AGDD2GeoConf import AGDD2GeoSvc
-    #             AGDD2GeoSvc=AGDD2GeoSvc()
-    #             AGDD2GeoSvc.PrintSections=False
-    #             AGDD2GeoSvc.Sections += ["ATLAS Feet"]
-    #             AGDD2GeoSvc.Sections += ["Atlas Barrel Toroidal Magnets"]
-    #             AGDD2GeoSvc.Sections += ["Atlas ECT Toroidal Magnets"]
-    #             AGDD2GeoSvc.DisableSections = False
-    #             AGDD2GeoSvc.Locked = False
-    #             theApp.CreateSvc += ["AGDD2GeoSvc"]
-    #             svcMgr += AGDD2GeoSvc
-
 #MagneticField:
-#include("BFieldAth/BFieldAth_jobOptions.py") # OLD
 import MagFieldServices.SetupField # NEW
 
 if (vp1Fatras):
@@ -384,6 +354,10 @@ if (vp1InputFiles != []):
 else:
     vp1Extrapolator = False
 
+# do not need to run execute since layout is dumped during initialize
+from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
+athenaCommonFlags.EvtMax = 0
+
 #watch LAr HV:
 if ( vp1LarHvData ):
     from time import time
@@ -436,14 +410,14 @@ if vp1Extrapolator and (vp1ID or vp1Muon):
     #                                Propagators = [ VP1Propagator ] )
 
     ToolSvc += VP1Extrapolator
-    print VP1Extrapolator
+    print (VP1Extrapolator)
     #We should append to variable instead:
     os.putenv("VP1_JOBCFG_EXTRA_VP1_EXTRAPOLATORS","Trk::Extrapolator/"+VP1ExtraPolatorName)
 
     from TrkExEngine.AtlasExtrapolationEngine import AtlasExtrapolationEngine
     ExtrapolationEngine = AtlasExtrapolationEngine(name='Extrapolation', nameprefix='Atlas')
     ToolSvc += ExtrapolationEngine
-    print ExtrapolationEngine
+    print (ExtrapolationEngine)
 
 #Fitter:
 if vp1Fitter and vp1Extrapolator and (vp1ID or vp1Muon):
@@ -499,8 +473,8 @@ if vp1Fitter and vp1Extrapolator and (vp1ID or vp1Muon):
        ToolMuonDriftCircle = MdtTubeHitOnTrackCreator ,
                                                  Mode = 'all')
     ToolSvc += VP1RotCreator
-    print VP1RotCreator
-    print MdtTubeHitOnTrackCreator
+    print (VP1RotCreator)
+    print (MdtTubeHitOnTrackCreator)
 
     from TrkKalmanFitter.TrkKalmanFitterConf import Trk__KalmanFitter as ConfiguredKalmanFitter
     VP1KalmanFitter = ConfiguredKalmanFitter(name                           = 'VP1KalmanFitter',
@@ -515,7 +489,7 @@ if vp1Fitter and vp1Extrapolator and (vp1ID or vp1Muon):
 
     ToolSvc += VP1KalmanFitter
 
-    print VP1KalmanFitter
+    print (VP1KalmanFitter)
     os.putenv("VP1_JOBCFG_EXTRA_VP1_FITTERS",VP1KalmanFitter.name())
 
 
@@ -545,7 +519,7 @@ if vp1Fitter and vp1Extrapolator and (vp1ID or vp1Muon):
                                              SignedDriftRadius     = True,
                                              RecalculateDerivatives= True
                                              )
-    print VP1GlobalChi2Fitter
+    print (VP1GlobalChi2Fitter)
     ToolSvc += VP1GlobalChi2Fitter
 
     VP1GlobalChi2Fitter.OutputLevel=DEBUG
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/DumpGeo/share/vp1FragmentConstructVP1ATLREL.py b/DetectorDescription/GeoModel/GeoModelStandalone/DumpGeo/share/vp1FragmentConstructVP1ATLREL.py
index e0eb714e0fcd35ea91b69d73494550db31a56189..d3c8662e09a0040090c11947e43d3ca83cfaa530 100644
--- a/DetectorDescription/GeoModel/GeoModelStandalone/DumpGeo/share/vp1FragmentConstructVP1ATLREL.py
+++ b/DetectorDescription/GeoModel/GeoModelStandalone/DumpGeo/share/vp1FragmentConstructVP1ATLREL.py
@@ -1,3 +1,7 @@
+#/*
+#  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+#*/
+
 #Construct VP1ATLREL integer based on AtlasVersion environment
 #variable, needed to make script work across releases. As an example
 #14.0.1 becomes 140001. Any parts not recognised are replaced with 99.
@@ -17,4 +21,4 @@ if not 'VP1ATLREL' in dir():
         if versionMinor>99: versionMinor=99
         if versionMinor==99 or versionPatch>99: versionPatch=99
         VP1ATLREL=10000*versionMajor+100*versionMinor+versionPatch
-        print "VP1ATLREL: "+str(VP1ATLREL)
+        print ("VP1ATLREL: "+str(VP1ATLREL))
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/DumpGeo/share/vp1FragmentFixDBReplica.py b/DetectorDescription/GeoModel/GeoModelStandalone/DumpGeo/share/vp1FragmentFixDBReplica.py
index 7883ce348a7d4b35d4b735994a42855e62f1fa03..596940e127a22051f7f9cb35f92595af0c5e4709 100644
--- a/DetectorDescription/GeoModel/GeoModelStandalone/DumpGeo/share/vp1FragmentFixDBReplica.py
+++ b/DetectorDescription/GeoModel/GeoModelStandalone/DumpGeo/share/vp1FragmentFixDBReplica.py
@@ -1,5 +1,5 @@
 #/*
-#  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+#  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 #*/
 
 from AthenaCommon.GlobalFlags import globalflags
@@ -8,41 +8,41 @@ import os
 if globalflags.DataSource() == 'data' and os.getenv("FRONTIER_SERVER") == None :
 
     # Patch dblookup.xml to avoid any attempt to use sqlite replicas
-    print "VP1 Info: real data mode and Frontier environment not set - need to patch dblookup.xml to avoid using local sqlite replicas."
+    print ("VP1 Info: real data mode and Frontier environment not set - need to patch dblookup.xml to avoid using local sqlite replicas.")
     if os.path.exists("dblookup.xml"):
-        print "VP1 Warning: dblookup.xml already found in run directory. Will not attempt to created patched copy."
+        print ("VP1 Warning: dblookup.xml already found in run directory. Will not attempt to created patched copy.")
         os.putenv("CORAL_DBLOOKUP_PATH",".")
     else:
         if os.getenv("CORAL_AUTH_PATH") == None or not os.path.isdir(os.getenv("CORAL_AUTH_PATH")):
-            print "VP1 Warning: CORAL_AUTH_PATH is not set or does not point to directory. Can't create patched dblookup.xml."
+            print ("VP1 Warning: CORAL_AUTH_PATH is not set or does not point to directory. Can't create patched dblookup.xml.")
         else:
             dblookupFileLocation=os.getenv("CORAL_AUTH_PATH")+"/dblookup.xml"
             if not os.path.exists(dblookupFileLocation) or not os.path.isfile(dblookupFileLocation):
-                print "VP1 Warning: Did not find CORAL_AUTH_PATH/dblookup.xml. Can't create patched dblookup.xml."
+                print ("VP1 Warning: Did not find CORAL_AUTH_PATH/dblookup.xml. Can't create patched dblookup.xml.")
             else:
-                print "VP1 Warning: Attempting to create patched dblookup.xml in current directory"
+                print ("VP1 Warning: Attempting to create patched dblookup.xml in current directory")
                 os.system("cat $CORAL_AUTH_PATH/dblookup.xml |grep -v 'ALLP200.db'> dblookup.xml")
                 os.putenv("CORAL_DBLOOKUP_PATH",".")
 
     if os.getenv("ATLAS_CONDDB")==None and (os.getenv("HOSTNAME") == None or os.getenv("HOSTNAME").find('.')<=0):
-        print "VP1 Warning: Unable to determine domain from runtime environment. Disabling attempt to find nearest replica."
+        print ("VP1 Warning: Unable to determine domain from runtime environment. Disabling attempt to find nearest replica.")
         PoolSvc = Service( "PoolSvc" )
         PoolSvc.SortReplicas = False
 
-        print ""
-        print "  ==========>"
-        print "  ========>"
-        print "  ======>"
-        print "  ====>"
-        print "  ====> VP1 Warning: Can't find nearest Oracle replica and you are running on real data."
-        print "  ====> Thus conditions data will have to come from the default, CERN (or you might crash!)."
-        print "  ====>"
-        print "  ====> Notice that this might SIGNIFICANTLY slow down (or even time-out) your job depending"
-        print "  ====> on your location and connection! You can avoid the issue (and this warning) by fixing"
-        print "  ====> your environment: either ATLAS_CONDDB or HOSTNAME. Alternatively you can edit a dblookup.xml file in your2"
-        print "  ====> directory to only leave in references to a closer replica in sections where such a replica is available."
-        print "  ====>"
-        print "  ======>"
-        print "  ========>"
-        print "  ==========>"
-        print ""
+        print ("")
+        print ("  ==========>")
+        print ("  ========>")
+        print ("  ======>")
+        print ("  ====>")
+        print ("  ====> VP1 Warning: Can't find nearest Oracle replica and you are running on real data.")
+        print ("  ====> Thus conditions data will have to come from the default, CERN (or you might crash!).")
+        print ("  ====>")
+        print ("  ====> Notice that this might SIGNIFICANTLY slow down (or even time-out) your job depending")
+        print ("  ====> on your location and connection! You can avoid the issue (and this warning) by fixing")
+        print ("  ====> your environment: either ATLAS_CONDDB or HOSTNAME. Alternatively you can edit a dblookup.xml file in your2")
+        print ("  ====> directory to only leave in references to a closer replica in sections where such a replica is available.")
+        print ("  ====>")
+        print ("  ======>")
+        print ("  ========>")
+        print ("  ==========>")
+        print ("")
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/DumpGeo/src/DumpGeo.cxx b/DetectorDescription/GeoModel/GeoModelStandalone/DumpGeo/src/DumpGeo.cxx
index a87a10bfabbd1d912f519ec01713d08e4e2385e8..75e3e5cf38508357537c4f00fe719ee760467c62 100755
--- a/DetectorDescription/GeoModel/GeoModelStandalone/DumpGeo/src/DumpGeo.cxx
+++ b/DetectorDescription/GeoModel/GeoModelStandalone/DumpGeo/src/DumpGeo.cxx
@@ -1,8 +1,7 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
-
 #include "DumpGeo/DumpGeo.h"
 
 #include "GeoExporter/GeoExporter.h"
@@ -13,7 +12,6 @@
 #include <iomanip>
 #include <cstdlib> //For setenv
 
-
 //____________________________________________________________________
 DumpGeo::DumpGeo(const std::string& name, ISvcLocator* svcLocator):
   AthAlgorithm(name, svcLocator),
@@ -24,11 +22,6 @@ DumpGeo::DumpGeo(const std::string& name, ISvcLocator* svcLocator):
   ::setenv("LCGPATCH_COINMULTISELECT","1",1);
 }
 
-//____________________________________________________________________
-DumpGeo::~DumpGeo()
-{
-}
-
 //____________________________________________________________________
 StatusCode DumpGeo::initialize()
 {
@@ -60,17 +53,9 @@ StatusCode DumpGeo::initialize()
 StatusCode DumpGeo::execute()
 {
   msg(MSG::DEBUG) <<" in execute() " << endmsg;
-  return StatusCode::FAILURE;
-}
-
-//____________________________________________________________________
-StatusCode DumpGeo::finalize()
-{
-  msg(MSG::INFO) <<" in finalize() " << endmsg;
   return StatusCode::SUCCESS;
 }
 
-
 //____________________________________________________________________
 void DumpGeo::handle(const Incident& inc)
 {
diff --git a/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/ATLAS_CHECK_THREAD_SAFETY b/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..ae22b41cc180e7e3ac21755f6adb00b4504117a2
--- /dev/null
+++ b/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+DetectorDescription/GeoModel/GeoModelUtilities
diff --git a/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoBorderSurface.h b/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoBorderSurface.h
index 12bf856954db9886a3a8415a8a194e39d0c0f3a0..932296603fe7a6318a1133adce177870b28d378f 100644
--- a/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoBorderSurface.h
+++ b/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoBorderSurface.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 GeoBorderSurface_h
@@ -13,7 +13,7 @@ class GeoOpticalSurface;
 class GeoBorderSurface 
 {
  public:
-  GeoBorderSurface(std::string name,
+  GeoBorderSurface(const std::string& name,
 		   GeoOpticalPhysVol* pv1,
 		   GeoOpticalPhysVol* pv2,
 		   GeoOpticalSurface* opticalSurface);
diff --git a/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoExtendedMaterial.h b/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoExtendedMaterial.h
index bae62e432664dbb7bb7a2ce8c028c1cc1c5818d6..3f758275312ea0b0ea534ea319ac9027f36e4b4c 100755
--- a/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoExtendedMaterial.h
+++ b/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoExtendedMaterial.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 GeoExtendedMaterial_h
@@ -37,7 +37,8 @@ class GeoExtendedMaterial : public GeoMaterial
   const double& getPressure() const;
   
   void SetMaterialPropertiesTable(GeoMaterialPropertiesTable* MPT);
-  GeoMaterialPropertiesTable* GetMaterialPropertiesTable() const;
+  GeoMaterialPropertiesTable* GetMaterialPropertiesTable();
+  const GeoMaterialPropertiesTable* GetMaterialPropertiesTable() const;
 
  private:
   GeoExtendedMaterial(const GeoExtendedMaterial &right);
@@ -72,7 +73,12 @@ inline void GeoExtendedMaterial::SetMaterialPropertiesTable(GeoMaterialPropertie
   m_properties->ref();
 }
 
-inline GeoMaterialPropertiesTable* GeoExtendedMaterial::GetMaterialPropertiesTable() const
+inline GeoMaterialPropertiesTable* GeoExtendedMaterial::GetMaterialPropertiesTable()
+{
+  return m_properties;
+}
+
+inline const GeoMaterialPropertiesTable* GeoExtendedMaterial::GetMaterialPropertiesTable() const
 {
   return m_properties;
 }
diff --git a/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoModelTool.h b/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoModelTool.h
index 8772c2a4f31b1fc0669d17caa528466b1747bfaf..fe5933ccf30957e584f8d23c0088060e47224f18 100755
--- a/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoModelTool.h
+++ b/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoModelTool.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 GEOMODELSVC_GEOMODELTOOL_H
@@ -9,6 +9,7 @@
 
 #include "GeoModelInterfaces/IGeoModelTool.h"
 #include "AthenaBaseComps/AthAlgTool.h"
+#include "CxxUtils/checker_macros.h"
 
 class GeoVDetectorManager;
 
@@ -22,10 +23,11 @@ public:
     // Standard Destructor
     virtual ~GeoModelTool();
 
-    virtual GeoVDetectorManager* manager() const;
+    virtual GeoVDetectorManager* manager();
+    virtual const GeoVDetectorManager* manager() const;
 
     virtual StatusCode clear() override;	
-    virtual StatusCode registerCallback() override;
+    virtual StatusCode registerCallback ATLAS_NOT_THREAD_SAFE () override;
     virtual StatusCode align(IOVSVC_CALLBACK_ARGS) override;
 
 protected:
diff --git a/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoOpticalSurface.h b/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoOpticalSurface.h
index f9f66d4caa1e8f4b72e2336b42230db427a04288..463a23d7dbb9023d53c4a557de29012ab91ccdcd 100644
--- a/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoOpticalSurface.h
+++ b/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoOpticalSurface.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 GeoOpticalSurface_h
@@ -57,7 +57,9 @@ class GeoOpticalSurface : public RCBase
   void SetMaterialPropertiesTable(GeoMaterialPropertiesTable *mpt)
   { m_materialPropertiesTable = mpt; if(mpt) m_materialPropertiesTable->ref(); };
 
-  GeoMaterialPropertiesTable* GetMaterialPropertiesTable() const
+  GeoMaterialPropertiesTable* GetMaterialPropertiesTable()
+    { return m_materialPropertiesTable;};
+  const GeoMaterialPropertiesTable* GetMaterialPropertiesTable() const
     { return m_materialPropertiesTable;};
  
  private:
diff --git a/DetectorDescription/GeoModel/GeoModelUtilities/src/GeoBorderSurface.cxx b/DetectorDescription/GeoModel/GeoModelUtilities/src/GeoBorderSurface.cxx
index 746570e8c4f29bc879a8aac821fa56bca427be44..adcac3a7dd727ee9e19c4ca752c2b53a0c366056 100644
--- a/DetectorDescription/GeoModel/GeoModelUtilities/src/GeoBorderSurface.cxx
+++ b/DetectorDescription/GeoModel/GeoModelUtilities/src/GeoBorderSurface.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 "GeoModelUtilities/GeoBorderSurface.h"
@@ -8,7 +8,7 @@
 
 #include <exception>
 
-GeoBorderSurface::GeoBorderSurface(std::string name,
+GeoBorderSurface::GeoBorderSurface(const std::string& name,
 				   GeoOpticalPhysVol* pv1,
 				   GeoOpticalPhysVol* pv2,
 				   GeoOpticalSurface* opticalSurface):
diff --git a/DetectorDescription/GeoModel/GeoModelUtilities/src/GeoMaterialPropertiesTable.cxx b/DetectorDescription/GeoModel/GeoModelUtilities/src/GeoMaterialPropertiesTable.cxx
index 6f08401d0486207fb29c2a0d8aa743db9f450bab..5e902c5c3e152d51dcc07852abe2390af1f871e5 100644
--- a/DetectorDescription/GeoModel/GeoModelUtilities/src/GeoMaterialPropertiesTable.cxx
+++ b/DetectorDescription/GeoModel/GeoModelUtilities/src/GeoMaterialPropertiesTable.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 "GeoModelUtilities/GeoMaterialPropertiesTable.h"
@@ -89,7 +89,7 @@ GeoMaterialPropertiesTable::GeoMatPMap_ConstIt GeoMaterialPropertiesTable::endPM
 
 void GeoMaterialPropertiesTable::DumpTable() const
 {
-  for(GeoMatPVMap_ConstIt i=m_MPT.begin(); i!=m_MPT.end(); i++) 
+  for(GeoMatPVMap_ConstIt i=m_MPT.begin(); i!=m_MPT.end(); ++i) 
   {
     std::cout << (*i).first << "\n";
     if((*i).second != 0)
diff --git a/DetectorDescription/GeoModel/GeoModelUtilities/src/GeoModelExperiment.cxx b/DetectorDescription/GeoModel/GeoModelUtilities/src/GeoModelExperiment.cxx
index 69c4a0fc21e32314015bcb192e66463b62ceb3b5..0357f770867b9be992045fd3e7d9cc1c81d444ce 100755
--- a/DetectorDescription/GeoModel/GeoModelUtilities/src/GeoModelExperiment.cxx
+++ b/DetectorDescription/GeoModel/GeoModelUtilities/src/GeoModelExperiment.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 "GeoModelUtilities/GeoModelExperiment.h"
@@ -23,7 +23,7 @@ GeoModelExperiment::GeoModelExperiment( GeoPhysVol * physVol )
 GeoModelExperiment::~GeoModelExperiment()  {
   // Unref all temporary volumes
   std::vector<GeoPhysVol*>::iterator it = m_tmpVolumes.begin();
-  for(; it!=m_tmpVolumes.end(); it++) 
+  for(; it!=m_tmpVolumes.end(); ++it) 
     (*it)->unref();
 
   m_physVol->unref();
diff --git a/DetectorDescription/GeoModel/GeoModelUtilities/src/GeoModelTool.cxx b/DetectorDescription/GeoModel/GeoModelUtilities/src/GeoModelTool.cxx
index 1728281c98dc7bc1e2657aa000e09c28bb0d17d2..95b06ef427d2c612fc143bdd341411682029615a 100755
--- a/DetectorDescription/GeoModel/GeoModelUtilities/src/GeoModelTool.cxx
+++ b/DetectorDescription/GeoModel/GeoModelUtilities/src/GeoModelTool.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
 */
 
 #ifndef BUILDVP1LIGHT
@@ -25,7 +25,10 @@ GeoModelTool::~GeoModelTool()  {
 /**
  ** The Detector Node corresponding to this tool
  **/
-GeoVDetectorManager* GeoModelTool::manager() const {
+GeoVDetectorManager* GeoModelTool::manager() {
+  return m_detector;
+}
+const GeoVDetectorManager* GeoModelTool::manager() const {
   return m_detector;
 }
 
diff --git a/DetectorDescription/IdDictParser/data/IdDictMuonSpectrometer_R.09.02.Asym.xml b/DetectorDescription/IdDictParser/data/IdDictMuonSpectrometer_R.09.02.Asym.xml
new file mode 100755
index 0000000000000000000000000000000000000000..993e6f7403fbfa31d660ecbec5234ff1e5fd8384
--- /dev/null
+++ b/DetectorDescription/IdDictParser/data/IdDictMuonSpectrometer_R.09.02.Asym.xml
@@ -0,0 +1,2897 @@
+<!-- Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -->
+
+<IdDictionary name="MuonSpectrometer" version="R.09.02.Asym">
+
+  <!--  IdDictionary for asymmetric layout wrt NSW/BIS78: NSW and BIS78 only on Aside, while old small wheel (EI+CSC+TGC4F) and old BIS7 and BIS8 MDTs stay on Cside  -->
+
+  <field name="stationName" >
+    <label name="BIL" value="0" />
+    <label name="BIS" value="1" />
+    <label name="BML" value="2" />
+    <label name="BMS" value="3" />
+    <label name="BOL" value="4" />
+    <label name="BOS" value="5" />
+    <label name="BEE" value="6" />
+    <label name="BIR" value="7" />
+    <label name="BMF" value="8" />
+    <label name="BOF" value="9" />
+    <label name="BOG" value="10" />
+    <label name="BME" value="53" />
+    <label name="EIL" value="13" />
+    <label name="EEL" value="14" />
+    <label name="EES" value="15" />
+    <label name="EML" value="17" />
+    <label name="EMS" value="18" />
+    <label name="EOL" value="20" />
+    <label name="EOS" value="21" />
+    <label name="T1F" value="41" />
+    <label name="T1E" value="42" />
+    <label name="T2F" value="43" />
+    <label name="T2E" value="44" />
+    <label name="T3F" value="45" />
+    <label name="T3E" value="46" />
+    <label name="T4F" value="47" />
+    <label name="T4E" value="48" />
+    <label name="EIS" value="49" />
+    <label name="CSS" value="50" />
+    <label name="CSL" value="51" />
+    <label name="BIM" value="52" />
+    <label name="BMG" value="54" />
+    <label name="MMS" value="55" />
+    <label name="MML" value="56" />
+    <label name="STS" value="57" />
+    <label name="STL" value="58" />
+  </field>
+
+  <field name="technology" >
+    <label name="MDT"  value="0" />
+    <label name="CSC"  value="1" />
+    <label name="RPC"  value="2" />
+    <label name="TGC"  value="3" />
+    <label name="STGC" value="4" />
+    <label name="MM"   value="5" />
+  </field>
+
+     <!--  MDT  -->
+
+  <region group="mdt">
+    <range field="stationName" value="BIL" />
+    <range field="stationEta" value="1" />
+    <range field="stationPhi" values="1 2 3 5 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="30" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIL" />
+    <range field="stationEta" value="1" />
+    <range field="stationPhi" value="4" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="24" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIL" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" values="1 2 3 5" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="30" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIL" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="4" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="24" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIL" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="36" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIL" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="1 2 3 4 5 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="36" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIL" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="1 2 4 5 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="30" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIL" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" value="3" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="36" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIL" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="1 2 3 4 5" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="36" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIL" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" value="7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="30" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIL" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" values="1 2 3 4 5 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="30" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIL" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" values="1 2 3 5" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="36" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIL" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" values="4 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="30" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIM" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="36" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIM" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="36" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIM" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="36" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIM" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="36" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIM" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="36" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIR" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" value="1" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="24" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIR" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" value="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="30" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIR" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" value="1" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="27" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIR" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" value="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="30" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIR" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="33" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIR" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" value="1" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="27" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIR" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" value="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="30" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIR" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" value="1" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="21" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIR" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" value="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="24" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIR" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="36" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIS" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="36" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BIS" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="30" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BIS" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="30" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BIS" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="30" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BIS" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="30" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BIS" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="30" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIS" />
+    <range field="stationEta" values="-7" />
+    <range field="stationPhi" minvalue="4" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="30" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIS" />
+    <range field="stationEta" values="-7" />
+    <range field="stationPhi" minvalue="1" maxvalue="3" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="36" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIS" />
+    <range field="stationEta" values="-8" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" value="1" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="16" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIS" />
+    <range field="stationEta" values="7" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="110" />
+  </region>
+
+  
+  <region group="mdt">
+    <range field="stationName" value="BEE" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" value="1" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BEE" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" value="1" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="1" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="32" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="2" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="5" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="1" />
+    <range field="stationPhi" minvalue="1" maxvalue="2" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="1" />
+    <range field="stationPhi" values="3 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="3" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="1" />
+    <range field="stationPhi" minvalue="4" maxvalue="5" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="32" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="4" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-3 -2 2 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" values="1 2 3 4 5 6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" value="7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" values="1 2 3 4 5 6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" value="7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="16" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" value="1" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" value="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="32" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" value="1" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" value="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BMF" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="72" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BMF" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="64" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BMF" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3"/>
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" value="1" />
+    <range field="stationPhi" minvalue="1" maxvalue="2" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="72" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" value="1" />
+    <range field="stationPhi" value="3" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="64" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" value="1" />
+    <range field="stationPhi" values="4 5" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="4" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" value="1" />
+    <range field="stationPhi" values="6 7 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" values="1 2 3" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="5" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="72" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" value="2" />
+    <range field="stationPhi" values="1 2 3 4 5 6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="72" />
+  </region>
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" value="-2" />
+    <range field="stationPhi" values="1 2 4 5 6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="72" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" value="7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" value="-2" />
+    <range field="stationPhi" value="3" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="1 2 3 4 5 6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" value="7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="72" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="72" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BOS" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="1 2 3 5 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="72" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOS" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" value="4" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOS" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="72" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOS" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="72" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOS" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="72" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOS" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="72" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOS" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="64" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BOF" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="72" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOF" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="64" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOF" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOF" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BOG" />
+    <range field="stationEta" value="0" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOG" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOG" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOG" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOG" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="EIL" />
+    <range field="stationEta" values="-1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="36" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EIL" />
+    <range field="stationEta" values="-2" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="36" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EIL" />
+    <range field="stationEta" values="-3" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="12" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EIL" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="1 5" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="12" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EIL" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="2 3 4 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="54" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="EIL" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="42" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EIL" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" values="1 5" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="42" />
+  </region>
+  
+   <region group="mdt">
+    <range field="stationName" value="EIS" />
+    <range field="stationEta" values="-1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="42" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EIS" />
+    <range field="stationEta" values="-2" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="36" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="EEL" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="1 2 4 5 6 7 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EEL" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="1 2 4 5 6 7 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+
+ <region group="mdt">
+    <range field="stationName" value="EEL" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" value="3" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="EES" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+    <region group="mdt">
+    <range field="stationName" value="EES" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="EML" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EML" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="64" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EML" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="64" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EML" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="64" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EML" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="64" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="EMS" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="64" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EMS" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="64" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EMS" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="64" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EMS" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="64" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EMS" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="64" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="EOL" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EOL" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="EOL" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EOL" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EOL" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EOL" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="EOS" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EOS" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EOS" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EOS" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EOS" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EOS" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+
+  <!-- BME mdt --> 
+  <region group="mdt">
+    <range field="stationName" value="BME" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="78" />
+  </region>
+
+  <!-- BOE mdt --> 
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" values="-7 7" />
+    <range field="stationPhi" values="7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="72" />
+  </region>
+
+   <!-- BMG mdt -->
+   <region group="mdt">
+     <range field="stationName" value="BMG" />
+     <range field="stationEta" values="-1 1" />
+     <range field="stationPhi" values="6 7" />
+     <range field="technology" value="MDT" />
+     <range field="multiLayer" minvalue="1" maxvalue="2" />
+     <range field="tubeLayer" minvalue="1" maxvalue="4" />
+     <range field="tube" minvalue="1" maxvalue="54" />
+   </region>
+ 
+   <region group="mdt">
+     <range field="stationName" value="BMG" />
+     <range field="stationEta" values="-2 2" />
+     <range field="stationPhi" values="6 7" />
+     <range field="technology" value="MDT" />
+     <range field="multiLayer" minvalue="1" maxvalue="2" />
+     <range field="tubeLayer" minvalue="1" maxvalue="4" />
+     <range field="tube" minvalue="1" maxvalue="54" />
+   </region>
+ 
+   <region group="mdt">
+     <range field="stationName" value="BMG" />
+     <range field="stationEta" values="-3 3" />
+     <range field="stationPhi" values="6 7" />
+     <range field="technology" value="MDT" />
+     <range field="multiLayer" minvalue="1" maxvalue="2" />
+     <range field="tubeLayer" minvalue="1" maxvalue="4" />
+     <range field="tube" minvalue="1" maxvalue="54" />
+   </region>
+
+     <!--  CSC  -->
+
+
+  <region group="csc">
+    <range field="stationName" value="CSS" />
+    <range field="stationEta" values="-1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="CSC" />
+    <range field="chamberLayer" minvalue="2" maxvalue="2" />
+    <range field="wireLayer" minvalue="1" maxvalue="4" />
+    <range field="cscMeasuresPhi" value="0" />
+    <range field="cscStrip" minvalue="1" maxvalue="192" />
+  </region>
+
+  <region group="csc">
+    <range field="stationName" value="CSS" />
+    <range field="stationEta" values="-1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="CSC" />
+    <range field="chamberLayer" minvalue="2" maxvalue="2" />
+    <range field="wireLayer" minvalue="1" maxvalue="4" />
+    <range field="cscMeasuresPhi" value="1" />
+    <range field="cscStrip" minvalue="1" maxvalue="48" />
+  </region>
+
+  <region group="csc">
+    <range field="stationName" value="CSL" />
+    <range field="stationEta" values="-1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="CSC" />
+    <range field="chamberLayer" minvalue="2" maxvalue="2" />
+    <range field="wireLayer" minvalue="1" maxvalue="4" />
+    <range field="cscMeasuresPhi" value="0" />
+    <range field="cscStrip" minvalue="1" maxvalue="192" />
+  </region>
+
+  <region group="csc">
+    <range field="stationName" value="CSL" />
+    <range field="stationEta" values="-1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="CSC" />
+    <range field="chamberLayer" minvalue="2" maxvalue="2" />
+    <range field="wireLayer" minvalue="1" maxvalue="4" />
+    <range field="cscMeasuresPhi" value="1" />
+    <range field="cscStrip" minvalue="1" maxvalue="48" />
+  </region>
+
+     <!--  RPC  -->
+     <!--  RPC BML  -->
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="1" />
+    <range field="stationPhi" values="1 2" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" values="1 2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="1" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="2" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" values="1 2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="1" />
+    <range field="stationPhi" values="3 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" values="1 2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="3" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" values="1 2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+ 
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" values="1 2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="1" />
+    <range field="stationPhi" values="4 5" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="4" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="5" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" values="1 2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" values="1 2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="1 2 3 4 5 6 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" values="1 2 3 4 5 6 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" value="7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" values="1 2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" values="1 2 3 4 5 6 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" values="1 2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" value="7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-7 7" />
+    <range field="stationPhi" values="1 2 3 4 5 6 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+     <!--  RPC BMS  -->
+
+  <region group="rpc">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" values="1 2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" values="1 2 3" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+
+  <region group="rpc">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="2" />
+    <range field="doubletZ" minvalue="1" maxvalue="3" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+
+  <region group="rpc">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" values="1 2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" values="1 2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+     <!--  RPC BOL  -->
+
+  <region group="rpc">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" values="1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+
+     <!--  RPC BOS  -->
+  
+   <region group="rpc">
+    <range field="stationName" value="BOS" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOS" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOS" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOS" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOS" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOS" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+     <!--  RPC BMF  -->
+
+  <region group="rpc">
+    <range field="stationName" value="BMF" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BMF" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BMF" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  <region group="rpc">
+    <range field="stationName" value="BMF" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="2" />
+    <range field="doubletZ" values="1 2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+     <!--  RPC BOF  -->
+
+  <region group="rpc">
+    <range field="stationName" value="BOF" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOF" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOF" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BOF" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+     <!--  RPC BOG  -->
+
+  <region group="rpc">
+    <range field="stationName" value="BOG" />
+    <range field="stationEta" values="0" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOG" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOG" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOG" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOG" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+
+  <!-- BME rpc --> 
+  <region group="rpc">
+    <range field="stationName" value="BME" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" minvalue="1" maxvalue="2" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <!-- BOE rpc --> 
+  <region group="rpc">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" values="-8 8" />
+    <range field="stationPhi" values="7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <!-- BIS rpc -->
+  <region group="rpc">
+    <range field="stationName" value="BIS" />
+    <range field="stationEta" values="7" />
+    <range field="stationPhi"  minvalue="1" maxvalue="8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" values="1 2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="3" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+     <!-- The following is a dummy region needed to make bit
+     allocation uniform between mdt and rpc down to the technoloy
+     level (region name "dummy" is used to suppress this region
+     from being used other than adjusting the bit allocation) -->
+
+   <region group="rpc" name="dummy" >
+    <range field="stationName" value="BOG" />
+    <range field="stationEta" values="-8 -7 7 8" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="3" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+     <!--  TGC  -->
+
+  <region group="tgc">
+    <range field="stationName" value="T1F" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="24" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="3" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="105" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T1F" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="24" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="3" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T1E" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="3" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="92" />
+  </region>
+  
+  <region group="tgc">
+    <range field="stationName" value="T1E" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="3" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="62" />
+  </region>
+  
+  <region group="tgc">
+    <range field="stationName" value="T1E" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="3" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="23" />
+  </region>
+  
+  <region group="tgc">
+    <range field="stationName" value="T1E" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="3" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="24" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T1E" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="3" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T1E" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="3" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T1E" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="3" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T1E" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="3" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T2F" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="24" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="125" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T2F" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="24" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T2E" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="110" />
+  </region>
+  
+  <region group="tgc">
+    <range field="stationName" value="T2E" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="103" />
+  </region>
+  
+  <region group="tgc">
+    <range field="stationName" value="T2E" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+  
+  <region group="tgc">
+    <range field="stationName" value="T2E" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+  
+  <region group="tgc">
+    <range field="stationName" value="T2E" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T2E" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T2E" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T2E" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T2E" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T2E" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T3F" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="24" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="122" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T3F" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="24" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T3E" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="96" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T3E" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="106" />
+  </region>
+  
+  <region group="tgc">
+    <range field="stationName" value="T3E" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+  
+  <region group="tgc">
+    <range field="stationName" value="T3E" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+  
+  <region group="tgc">
+    <range field="stationName" value="T3E" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="31" />
+  </region>
+  
+  <region group="tgc">
+    <range field="stationName" value="T3E" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T3E" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T3E" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T3E" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T3E" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T4F" />
+    <range field="stationEta" values="-1" />
+    <range field="stationPhi" minvalue="1" maxvalue="24" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T4F" />
+    <range field="stationEta" values="-1" />
+    <range field="stationPhi" minvalue="1" maxvalue="24" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T4E" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="21" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="24" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T4E" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="21" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+     <!--  sTGC  -->
+
+  <field name="stgcChannelType" >
+    <label name="sTgcPad"   value="0" />
+    <label name="sTgcStrip" value="1" />
+    <label name="sTgcWire"  value="2" />
+  </field>
+
+     <!--  sTGC  Pads (stgcChannelType=0) -->
+
+  <region group="stgc">
+    <range field="stationName" value="STS" />
+    <range field="stationEta" values="2 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="STGC" />
+    <range field="stgcMultilayer" minvalue="1" maxvalue="2" />
+    <range field="stgcGasGap" minvalue="1" maxvalue="4" />
+    <range field="stgcChannelType" value="sTgcPad" />
+    <range field="stgcChannel" minvalue="1" maxvalue="128" />
+  </region>
+  
+  <region group="stgc">
+    <range field="stationName" value="STL" />
+    <range field="stationEta" values="2 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="STGC" />
+    <range field="stgcMultilayer" minvalue="1" maxvalue="2" />
+    <range field="stgcGasGap" minvalue="1" maxvalue="4" />
+    <range field="stgcChannelType" value="sTgcPad" />
+    <range field="stgcChannel" minvalue="1" maxvalue="128" />
+  </region> 
+
+  <region group="stgc">
+    <range field="stationName" value="STS" />
+    <range field="stationEta" values="1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="STGC" />
+    <range field="stgcMultilayer" minvalue="1" maxvalue="2" />
+    <range field="stgcGasGap" minvalue="1" maxvalue="4" />
+    <range field="stgcChannelType" value="sTgcPad" />
+    <range field="stgcChannel" minvalue="1" maxvalue="128" />
+  </region>
+
+  <region group="stgc">
+    <range field="stationName" value="STL" />
+    <range field="stationEta" values="1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="STGC" />
+    <range field="stgcMultilayer" minvalue="1" maxvalue="2" />
+    <range field="stgcGasGap" minvalue="1" maxvalue="4" />
+    <range field="stgcChannelType" value="sTgcPad" />
+    <range field="stgcChannel" minvalue="1" maxvalue="128" />
+  </region>
+
+     <!--  sTGC  Strips (stgcChannelType=1) -->
+
+  <region group="stgc">
+    <range field="stationName" value="STS" />
+    <range field="stationEta" values="2 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="STGC" />
+    <range field="stgcMultilayer" minvalue="1" maxvalue="2" />
+    <range field="stgcGasGap" minvalue="1" maxvalue="4" />
+    <range field="stgcChannelType" value="sTgcStrip" />
+    <range field="stgcChannel" minvalue="1" maxvalue="512" />
+  </region>
+
+  <region group="stgc">
+    <range field="stationName" value="STL" />
+    <range field="stationEta" values="2 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="STGC" />
+    <range field="stgcMultilayer" minvalue="1" maxvalue="2" />
+    <range field="stgcGasGap" minvalue="1" maxvalue="4" />
+    <range field="stgcChannelType" value="sTgcStrip" />
+    <range field="stgcChannel" minvalue="1" maxvalue="512" />
+  </region>
+
+  <region group="stgc">
+    <range field="stationName" value="STS" />
+    <range field="stationEta" values="1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="STGC" />
+    <range field="stgcMultilayer" minvalue="1" maxvalue="2" />
+    <range field="stgcGasGap" minvalue="1" maxvalue="4" />
+    <range field="stgcChannelType" value="sTgcStrip" />
+    <range field="stgcChannel" minvalue="1" maxvalue="512" />
+  </region>
+
+  <region group="stgc">
+    <range field="stationName" value="STL" />
+    <range field="stationEta" values="1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="STGC" />
+    <range field="stgcMultilayer" minvalue="1" maxvalue="2" />
+    <range field="stgcGasGap" minvalue="1" maxvalue="4" />
+    <range field="stgcChannelType" value="sTgcStrip" />
+    <range field="stgcChannel" minvalue="1" maxvalue="512" />
+  </region>
+
+     <!--  sTGC  Wire (stgcChannelType=2) -->
+  <region group="stgc">
+    <range field="stationName" value="STS" />
+    <range field="stationEta" values="2 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="STGC" />
+    <range field="stgcMultilayer" minvalue="1" maxvalue="2" />
+    <range field="stgcGasGap" minvalue="1" maxvalue="4" />
+    <range field="stgcChannelType" value="sTgcWire" />
+    <range field="stgcChannel" minvalue="1" maxvalue="64" />
+  </region>
+
+  <region group="stgc">
+    <range field="stationName" value="STL" />
+    <range field="stationEta" values="2 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="STGC" />
+    <range field="stgcMultilayer" minvalue="1" maxvalue="2" />
+    <range field="stgcGasGap" minvalue="1" maxvalue="4" />
+    <range field="stgcChannelType" value="sTgcWire" />
+    <range field="stgcChannel" minvalue="1" maxvalue="64" />
+  </region>
+
+  <region group="stgc">
+    <range field="stationName" value="STS" />
+    <range field="stationEta" values="1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="STGC" />
+    <range field="stgcMultilayer" minvalue="1" maxvalue="2" />
+    <range field="stgcGasGap" minvalue="1" maxvalue="4" />
+    <range field="stgcChannelType" value="sTgcWire" />
+    <range field="stgcChannel" minvalue="1" maxvalue="64" />
+  </region>
+
+  <region group="stgc">
+    <range field="stationName" value="STL" />
+    <range field="stationEta" values="1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="STGC" />
+    <range field="stgcMultilayer" minvalue="1" maxvalue="2" />
+    <range field="stgcGasGap" minvalue="1" maxvalue="4" />
+    <range field="stgcChannelType" value="sTgcWire" />
+    <range field="stgcChannel" minvalue="1" maxvalue="64" />
+  </region>
+
+     <!--  MicroMegas  -->
+
+     <!--  MicroMegas Small Sector -->     
+     <!--  Nominal position abs(stationEta) 1-->
+  <region group="mm">
+    <range field="stationName" value="MMS" />
+    <range field="stationEta" values="1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MM" />
+    <range field="mmMultilayer" minvalue="1" maxvalue="2" />
+    <range field="mmGasGap" values="1 2" />
+    <range field="mmChannel" minvalue="1" maxvalue="5120" />
+  </region>
+     <!--  Stereoangle position abs(stationEta) 1-->
+  <region group="mm">
+    <range field="stationName" value="MMS" />
+    <range field="stationEta" values="1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MM" />
+    <range field="mmMultilayer" minvalue="1" maxvalue="2" />
+    <range field="mmGasGap" values="3 4" />
+    <range field="mmChannel" minvalue="1" maxvalue="5120" />
+  </region>
+
+     <!--  Nominal position abs(stationEta) 2-->
+  <region group="mm">
+    <range field="stationName" value="MMS" />
+    <range field="stationEta" values="2" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MM" />
+    <range field="mmMultilayer" minvalue="1" maxvalue="2" />
+    <range field="mmGasGap" values="1 2" />
+    <range field="mmChannel" minvalue="1" maxvalue="3072" />
+  </region>
+     <!--  Stereoangle position abs(stationEta) 2-->
+  <region group="mm">
+    <range field="stationName" value="MMS" />
+    <range field="stationEta" values="2" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MM" />
+    <range field="mmMultilayer" minvalue="1" maxvalue="2" />
+    <range field="mmGasGap" values="3 4" />
+    <range field="mmChannel" minvalue="1" maxvalue="3072" />
+  </region>
+
+
+     <!--  MicroMegas Large Sector -->
+     <!--  Nominal position abs(stationEta) 1-->
+  <region group="mm">
+    <range field="stationName" value="MML" />
+    <range field="stationEta" values="1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MM" />
+    <range field="mmMultilayer" minvalue="1" maxvalue="2" />
+    <range field="mmGasGap" values="1 2" />
+    <range field="mmChannel" minvalue="1" maxvalue="5120" />
+  </region>
+     <!--  Stereoangle position abs(stationEta) 1-->
+  <region group="mm">
+    <range field="stationName" value="MML" />
+    <range field="stationEta" values="1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MM" />
+    <range field="mmMultilayer" minvalue="1" maxvalue="2" />
+    <range field="mmGasGap" values="3 4" />
+    <range field="mmChannel" minvalue="1" maxvalue="5120" />
+  </region>
+
+     <!--  Nominal position abs(stationEta) 2-->
+  <region group="mm">
+    <range field="stationName" value="MML" />
+    <range field="stationEta" values="2" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MM" />
+    <range field="mmMultilayer" minvalue="1" maxvalue="2" />
+    <range field="mmGasGap" values="1 2" />
+    <range field="mmChannel" minvalue="1" maxvalue="3072" />
+  </region>
+     <!--  Stereoangle position abs(stationEta) 2-->
+  <region group="mm">
+    <range field="stationName" value="MML" />
+    <range field="stationEta" values="2" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MM" />
+    <range field="mmMultilayer" minvalue="1" maxvalue="2" />
+    <range field="mmGasGap" values="3 4" />
+    <range field="mmChannel" minvalue="1" maxvalue="3072" />
+  </region>
+
+</IdDictionary>
diff --git a/DetectorDescription/IdDictParser/data/IdDictMuonSpectrometer_R.09.02.xml b/DetectorDescription/IdDictParser/data/IdDictMuonSpectrometer_R.09.02.xml
new file mode 100755
index 0000000000000000000000000000000000000000..3893e236d5d69122e10fb255edb5a059eaf432c4
--- /dev/null
+++ b/DetectorDescription/IdDictParser/data/IdDictMuonSpectrometer_R.09.02.xml
@@ -0,0 +1,2746 @@
+<!-- Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -->
+
+<IdDictionary name="MuonSpectrometer" version="R.09.02">
+
+  <!--  IdDictionary for symmetric layout wrt NSW/BIS78: NSW and BIS78 on both sides, no EI+CSC+TGC4F  -->
+
+  <field name="stationName" >
+    <label name="BIL" value="0" />
+    <label name="BIS" value="1" />
+    <label name="BML" value="2" />
+    <label name="BMS" value="3" />
+    <label name="BOL" value="4" />
+    <label name="BOS" value="5" />
+    <label name="BEE" value="6" />
+    <label name="BIR" value="7" />
+    <label name="BMF" value="8" />
+    <label name="BOF" value="9" />
+    <label name="BOG" value="10" />
+    <label name="BME" value="53" />
+    <label name="EIL" value="13" />
+    <label name="EEL" value="14" />
+    <label name="EES" value="15" />
+    <label name="EML" value="17" />
+    <label name="EMS" value="18" />
+    <label name="EOL" value="20" />
+    <label name="EOS" value="21" />
+    <label name="T1F" value="41" />
+    <label name="T1E" value="42" />
+    <label name="T2F" value="43" />
+    <label name="T2E" value="44" />
+    <label name="T3F" value="45" />
+    <label name="T3E" value="46" />
+    <label name="T4E" value="48" />
+    <label name="BIM" value="52" />
+    <label name="BMG" value="54" />
+    <label name="MMS" value="55" />
+    <label name="MML" value="56" />
+    <label name="STS" value="57" />
+    <label name="STL" value="58" />
+  </field>
+
+  <field name="technology" >
+    <label name="MDT"  value="0" />
+    <label name="CSC"  value="1" />
+    <label name="RPC"  value="2" />
+    <label name="TGC"  value="3" />
+    <label name="STGC" value="4" />
+    <label name="MM"   value="5" />
+  </field>
+
+     <!--  MDT  -->
+
+  <region group="mdt">
+    <range field="stationName" value="BIL" />
+    <range field="stationEta" value="1" />
+    <range field="stationPhi" values="1 2 3 5 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="30" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIL" />
+    <range field="stationEta" value="1" />
+    <range field="stationPhi" value="4" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="24" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIL" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" values="1 2 3 5" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="30" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIL" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="4" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="24" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIL" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="36" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIL" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="1 2 3 4 5 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="36" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIL" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="1 2 4 5 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="30" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIL" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" value="3" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="36" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIL" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="1 2 3 4 5" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="36" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIL" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" value="7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="30" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIL" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" values="1 2 3 4 5 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="30" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIL" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" values="1 2 3 5" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="36" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIL" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" values="4 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="30" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIM" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="36" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIM" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="36" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIM" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="36" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIM" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="36" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIM" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="36" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIR" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" value="1" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="24" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIR" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" value="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="30" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIR" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" value="1" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="27" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIR" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" value="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="30" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIR" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="33" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIR" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" value="1" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="27" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIR" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" value="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="30" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIR" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" value="1" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="21" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIR" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" value="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="24" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIR" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="36" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIS" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="36" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BIS" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="30" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BIS" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="30" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BIS" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="30" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BIS" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="30" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BIS" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="30" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BIS" />
+    <range field="stationEta" values="-7 7" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="110" />
+  </region>
+
+  
+  <region group="mdt">
+    <range field="stationName" value="BEE" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" value="1" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BEE" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" value="1" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="1" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="32" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="2" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="5" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="1" />
+    <range field="stationPhi" minvalue="1" maxvalue="2" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="1" />
+    <range field="stationPhi" values="3 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="3" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="1" />
+    <range field="stationPhi" minvalue="4" maxvalue="5" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="32" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="4" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-3 -2 2 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" values="1 2 3 4 5 6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" value="7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" values="1 2 3 4 5 6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" value="7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="16" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" value="1" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" value="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="32" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" value="1" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" value="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BMF" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="72" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BMF" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="64" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BMF" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3"/>
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" value="1" />
+    <range field="stationPhi" minvalue="1" maxvalue="2" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="72" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" value="1" />
+    <range field="stationPhi" value="3" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="64" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" value="1" />
+    <range field="stationPhi" values="4 5" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="4" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" value="1" />
+    <range field="stationPhi" values="6 7 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" values="1 2 3" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="5" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="72" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" value="2" />
+    <range field="stationPhi" values="1 2 3 4 5 6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="72" />
+  </region>
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" value="-2" />
+    <range field="stationPhi" values="1 2 4 5 6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="72" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" value="7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" value="-2" />
+    <range field="stationPhi" value="3" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="1 2 3 4 5 6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" value="7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="72" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="72" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BOS" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="1 2 3 5 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="72" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOS" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" value="4" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOS" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="72" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOS" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="72" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOS" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="72" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOS" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="72" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOS" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="64" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BOF" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="72" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOF" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="64" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOF" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOF" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="BOG" />
+    <range field="stationEta" value="0" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOG" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOG" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOG" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="BOG" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="EIL" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="1 5" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="12" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EIL" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="2 3 4 7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="54" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="EIL" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="42" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EIL" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" values="1 5" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="42" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="EEL" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="1 2 4 5 6 7 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EEL" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="1 2 4 5 6 7 8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+
+ <region group="mdt">
+    <range field="stationName" value="EEL" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" value="3" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="EES" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+    <region group="mdt">
+    <range field="stationName" value="EES" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="40" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="EML" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EML" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="64" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EML" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="64" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EML" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="64" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EML" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="64" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="EMS" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="64" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EMS" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="64" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EMS" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="64" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EMS" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="64" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EMS" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="64" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="EOL" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EOL" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="EOL" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EOL" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EOL" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EOL" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+
+  <region group="mdt">
+    <range field="stationName" value="EOS" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EOS" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EOS" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="56" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EOS" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EOS" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+  
+  <region group="mdt">
+    <range field="stationName" value="EOS" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="48" />
+  </region>
+
+  <!-- BME mdt --> 
+  <region group="mdt">
+    <range field="stationName" value="BME" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="4" />
+    <range field="tube" minvalue="1" maxvalue="78" />
+  </region>
+
+  <!-- BOE mdt --> 
+  <region group="mdt">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" values="-7 7" />
+    <range field="stationPhi" values="7" />
+    <range field="technology" value="MDT" />
+    <range field="multiLayer" minvalue="1" maxvalue="2" />
+    <range field="tubeLayer" minvalue="1" maxvalue="3" />
+    <range field="tube" minvalue="1" maxvalue="72" />
+  </region>
+
+   <!-- BMG mdt -->
+   <region group="mdt">
+     <range field="stationName" value="BMG" />
+     <range field="stationEta" values="-1 1" />
+     <range field="stationPhi" values="6 7" />
+     <range field="technology" value="MDT" />
+     <range field="multiLayer" minvalue="1" maxvalue="2" />
+     <range field="tubeLayer" minvalue="1" maxvalue="4" />
+     <range field="tube" minvalue="1" maxvalue="54" />
+   </region>
+ 
+   <region group="mdt">
+     <range field="stationName" value="BMG" />
+     <range field="stationEta" values="-2 2" />
+     <range field="stationPhi" values="6 7" />
+     <range field="technology" value="MDT" />
+     <range field="multiLayer" minvalue="1" maxvalue="2" />
+     <range field="tubeLayer" minvalue="1" maxvalue="4" />
+     <range field="tube" minvalue="1" maxvalue="54" />
+   </region>
+ 
+   <region group="mdt">
+     <range field="stationName" value="BMG" />
+     <range field="stationEta" values="-3 3" />
+     <range field="stationPhi" values="6 7" />
+     <range field="technology" value="MDT" />
+     <range field="multiLayer" minvalue="1" maxvalue="2" />
+     <range field="tubeLayer" minvalue="1" maxvalue="4" />
+     <range field="tube" minvalue="1" maxvalue="54" />
+   </region>
+
+     <!--  RPC  -->
+     <!--  RPC BML  -->
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="1" />
+    <range field="stationPhi" values="1 2" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" values="1 2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="1" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="2" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" values="1 2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="1" />
+    <range field="stationPhi" values="3 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" values="1 2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="3" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" values="1 2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+ 
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" values="1 2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="1" />
+    <range field="stationPhi" values="4 5" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="4" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" value="5" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="6 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" values="1 2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" values="1 2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="1 2 3 4 5 6 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" values="1 2 3 4 5 6 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" value="7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" values="1 2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" values="1 2 3 4 5 6 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" values="1 2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" value="7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BML" />
+    <range field="stationEta" values="-7 7" />
+    <range field="stationPhi" values="1 2 3 4 5 6 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+     <!--  RPC BMS  -->
+
+  <region group="rpc">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" values="1 2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" values="1 2 3" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+
+  <region group="rpc">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="2" />
+    <range field="doubletZ" minvalue="1" maxvalue="3" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+
+  <region group="rpc">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" values="1 2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BMS" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" values="1 2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+     <!--  RPC BOL  -->
+
+  <region group="rpc">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" values="1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" value="-1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+
+     <!--  RPC BOS  -->
+  
+   <region group="rpc">
+    <range field="stationName" value="BOS" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOS" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOS" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOS" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOS" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOS" />
+    <range field="stationEta" values="-6 6" />
+    <range field="stationPhi" values="1 2 3 4 5 8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+     <!--  RPC BMF  -->
+
+  <region group="rpc">
+    <range field="stationName" value="BMF" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BMF" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BMF" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  <region group="rpc">
+    <range field="stationName" value="BMF" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="2" />
+    <range field="doubletZ" values="1 2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+     <!--  RPC BOF  -->
+
+  <region group="rpc">
+    <range field="stationName" value="BOF" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOF" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOF" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" minvalue="1" maxvalue="2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <region group="rpc">
+    <range field="stationName" value="BOF" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+     <!--  RPC BOG  -->
+
+  <region group="rpc">
+    <range field="stationName" value="BOG" />
+    <range field="stationEta" values="0" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOG" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOG" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOG" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+  
+  <region group="rpc">
+    <range field="stationName" value="BOG" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" values="1 2" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+
+  <!-- BME rpc --> 
+  <region group="rpc">
+    <range field="stationName" value="BME" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" values="7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" minvalue="1" maxvalue="2" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <!-- BOE rpc --> 
+  <region group="rpc">
+    <range field="stationName" value="BOL" />
+    <range field="stationEta" values="-8 8" />
+    <range field="stationPhi" values="7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" value="1" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+  <!-- BIS rpc -->
+  <region group="rpc">
+    <range field="stationName" value="BIS" />
+    <range field="stationEta" values="-7 7" />
+    <range field="stationPhi"  minvalue="1" maxvalue="8" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" values="1 2" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="3" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+     <!-- The following is a dummy region needed to make bit
+     allocation uniform between mdt and rpc down to the technoloy
+     level (region name "dummy" is used to suppress this region
+     from being used other than adjusting the bit allocation) -->
+
+   <region group="rpc" name="dummy" >
+    <range field="stationName" value="BOG" />
+    <range field="stationEta" values="-8 -7 7 8" />
+    <range field="stationPhi" values="6 7" />
+    <range field="technology" value="RPC" />
+    <range field="doubletR" value="1" />
+    <range field="doubletZ" minvalue="1" maxvalue="3" />
+    <range field="doubletPhi" minvalue="1" maxvalue="2" />
+    <range field="rpcGasGap" minvalue="1" maxvalue="2" />
+    <range field="rpcMeasuresPhi" minvalue="0" maxvalue="1" />
+    <range field="rpcStrip" minvalue="1" maxvalue="99" />
+  </region>
+
+     <!--  TGC  -->
+
+  <region group="tgc">
+    <range field="stationName" value="T1F" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="24" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="3" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="105" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T1F" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="24" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="3" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T1E" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="3" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="92" />
+  </region>
+  
+  <region group="tgc">
+    <range field="stationName" value="T1E" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="3" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="62" />
+  </region>
+  
+  <region group="tgc">
+    <range field="stationName" value="T1E" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="3" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="23" />
+  </region>
+  
+  <region group="tgc">
+    <range field="stationName" value="T1E" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="3" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="24" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T1E" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="3" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T1E" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="3" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T1E" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="3" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T1E" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="3" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T2F" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="24" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="125" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T2F" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="24" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T2E" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="110" />
+  </region>
+  
+  <region group="tgc">
+    <range field="stationName" value="T2E" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="103" />
+  </region>
+  
+  <region group="tgc">
+    <range field="stationName" value="T2E" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+  
+  <region group="tgc">
+    <range field="stationName" value="T2E" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+  
+  <region group="tgc">
+    <range field="stationName" value="T2E" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T2E" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T2E" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T2E" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T2E" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T2E" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T3F" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="24" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="122" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T3F" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="24" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T3E" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="96" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T3E" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="106" />
+  </region>
+  
+  <region group="tgc">
+    <range field="stationName" value="T3E" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+  
+  <region group="tgc">
+    <range field="stationName" value="T3E" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+  
+  <region group="tgc">
+    <range field="stationName" value="T3E" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="31" />
+  </region>
+  
+  <region group="tgc">
+    <range field="stationName" value="T3E" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T3E" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T3E" />
+    <range field="stationEta" values="-3 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T3E" />
+    <range field="stationEta" values="-4 4" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T3E" />
+    <range field="stationEta" values="-5 5" />
+    <range field="stationPhi" minvalue="1" maxvalue="48" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T4E" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="21" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="0" />
+    <range field="channel" minvalue="1" maxvalue="24" />
+  </region>
+
+  <region group="tgc">
+    <range field="stationName" value="T4E" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="21" />
+    <range field="technology" value="TGC" />
+    <range field="tgcGasGap" minvalue="1" maxvalue="2" />
+    <range field="isStrip" value="1" />
+    <range field="channel" minvalue="1" maxvalue="32" />
+  </region>
+
+     <!--  sTGC  -->
+
+  <field name="stgcChannelType" >
+    <label name="sTgcPad"   value="0" />
+    <label name="sTgcStrip" value="1" />
+    <label name="sTgcWire"  value="2" />
+  </field>
+
+     <!--  sTGC  Pads (stgcChannelType=0) -->
+
+  <region group="stgc">
+    <range field="stationName" value="STS" />
+    <range field="stationEta" values="-3 -2 2 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="STGC" />
+    <range field="stgcMultilayer" minvalue="1" maxvalue="2" />
+    <range field="stgcGasGap" minvalue="1" maxvalue="4" />
+    <range field="stgcChannelType" value="sTgcPad" />
+    <range field="stgcChannel" minvalue="1" maxvalue="128" />
+  </region>
+  
+  <region group="stgc">
+    <range field="stationName" value="STL" />
+    <range field="stationEta" values="-3 -2 2 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="STGC" />
+    <range field="stgcMultilayer" minvalue="1" maxvalue="2" />
+    <range field="stgcGasGap" minvalue="1" maxvalue="4" />
+    <range field="stgcChannelType" value="sTgcPad" />
+    <range field="stgcChannel" minvalue="1" maxvalue="128" />
+  </region> 
+
+  <region group="stgc">
+    <range field="stationName" value="STS" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="STGC" />
+    <range field="stgcMultilayer" minvalue="1" maxvalue="2" />
+    <range field="stgcGasGap" minvalue="1" maxvalue="4" />
+    <range field="stgcChannelType" value="sTgcPad" />
+    <range field="stgcChannel" minvalue="1" maxvalue="128" />
+  </region>
+
+  <region group="stgc">
+    <range field="stationName" value="STL" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="STGC" />
+    <range field="stgcMultilayer" minvalue="1" maxvalue="2" />
+    <range field="stgcGasGap" minvalue="1" maxvalue="4" />
+    <range field="stgcChannelType" value="sTgcPad" />
+    <range field="stgcChannel" minvalue="1" maxvalue="128" />
+  </region>
+
+     <!--  sTGC  Strips (stgcChannelType=1) -->
+
+  <region group="stgc">
+    <range field="stationName" value="STS" />
+    <range field="stationEta" values="-3 -2 2 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="STGC" />
+    <range field="stgcMultilayer" minvalue="1" maxvalue="2" />
+    <range field="stgcGasGap" minvalue="1" maxvalue="4" />
+    <range field="stgcChannelType" value="sTgcStrip" />
+    <range field="stgcChannel" minvalue="1" maxvalue="512" />
+  </region>
+
+  <region group="stgc">
+    <range field="stationName" value="STL" />
+    <range field="stationEta" values="-3 -2 2 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="STGC" />
+    <range field="stgcMultilayer" minvalue="1" maxvalue="2" />
+    <range field="stgcGasGap" minvalue="1" maxvalue="4" />
+    <range field="stgcChannelType" value="sTgcStrip" />
+    <range field="stgcChannel" minvalue="1" maxvalue="512" />
+  </region>
+
+  <region group="stgc">
+    <range field="stationName" value="STS" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="STGC" />
+    <range field="stgcMultilayer" minvalue="1" maxvalue="2" />
+    <range field="stgcGasGap" minvalue="1" maxvalue="4" />
+    <range field="stgcChannelType" value="sTgcStrip" />
+    <range field="stgcChannel" minvalue="1" maxvalue="512" />
+  </region>
+
+  <region group="stgc">
+    <range field="stationName" value="STL" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="STGC" />
+    <range field="stgcMultilayer" minvalue="1" maxvalue="2" />
+    <range field="stgcGasGap" minvalue="1" maxvalue="4" />
+    <range field="stgcChannelType" value="sTgcStrip" />
+    <range field="stgcChannel" minvalue="1" maxvalue="512" />
+  </region>
+
+     <!--  sTGC  Wire (stgcChannelType=2) -->
+  <region group="stgc">
+    <range field="stationName" value="STS" />
+    <range field="stationEta" values="-3 -2 2 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="STGC" />
+    <range field="stgcMultilayer" minvalue="1" maxvalue="2" />
+    <range field="stgcGasGap" minvalue="1" maxvalue="4" />
+    <range field="stgcChannelType" value="sTgcWire" />
+    <range field="stgcChannel" minvalue="1" maxvalue="64" />
+  </region>
+
+  <region group="stgc">
+    <range field="stationName" value="STL" />
+    <range field="stationEta" values="-3 -2 2 3" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="STGC" />
+    <range field="stgcMultilayer" minvalue="1" maxvalue="2" />
+    <range field="stgcGasGap" minvalue="1" maxvalue="4" />
+    <range field="stgcChannelType" value="sTgcWire" />
+    <range field="stgcChannel" minvalue="1" maxvalue="64" />
+  </region>
+
+  <region group="stgc">
+    <range field="stationName" value="STS" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="STGC" />
+    <range field="stgcMultilayer" minvalue="1" maxvalue="2" />
+    <range field="stgcGasGap" minvalue="1" maxvalue="4" />
+    <range field="stgcChannelType" value="sTgcWire" />
+    <range field="stgcChannel" minvalue="1" maxvalue="64" />
+  </region>
+
+  <region group="stgc">
+    <range field="stationName" value="STL" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="STGC" />
+    <range field="stgcMultilayer" minvalue="1" maxvalue="2" />
+    <range field="stgcGasGap" minvalue="1" maxvalue="4" />
+    <range field="stgcChannelType" value="sTgcWire" />
+    <range field="stgcChannel" minvalue="1" maxvalue="64" />
+  </region>
+
+     <!--  MicroMegas  -->
+
+     <!--  MicroMegas Small Sector -->     
+     <!--  Nominal position abs(stationEta) 1-->
+  <region group="mm">
+    <range field="stationName" value="MMS" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MM" />
+    <range field="mmMultilayer" minvalue="1" maxvalue="2" />
+    <range field="mmGasGap" values="1 2" />
+    <range field="mmChannel" minvalue="1" maxvalue="5120" />
+  </region>
+     <!--  Stereoangle position abs(stationEta) 1-->
+  <region group="mm">
+    <range field="stationName" value="MMS" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MM" />
+    <range field="mmMultilayer" minvalue="1" maxvalue="2" />
+    <range field="mmGasGap" values="3 4" />
+    <range field="mmChannel" minvalue="1" maxvalue="5120" />
+  </region>
+
+     <!--  Nominal position abs(stationEta) 2-->
+  <region group="mm">
+    <range field="stationName" value="MMS" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MM" />
+    <range field="mmMultilayer" minvalue="1" maxvalue="2" />
+    <range field="mmGasGap" values="1 2" />
+    <range field="mmChannel" minvalue="1" maxvalue="3072" />
+  </region>
+     <!--  Stereoangle position abs(stationEta) 2-->
+  <region group="mm">
+    <range field="stationName" value="MMS" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MM" />
+    <range field="mmMultilayer" minvalue="1" maxvalue="2" />
+    <range field="mmGasGap" values="3 4" />
+    <range field="mmChannel" minvalue="1" maxvalue="3072" />
+  </region>
+
+
+     <!--  MicroMegas Large Sector -->
+     <!--  Nominal position abs(stationEta) 1-->
+  <region group="mm">
+    <range field="stationName" value="MML" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MM" />
+    <range field="mmMultilayer" minvalue="1" maxvalue="2" />
+    <range field="mmGasGap" values="1 2" />
+    <range field="mmChannel" minvalue="1" maxvalue="5120" />
+  </region>
+     <!--  Stereoangle position abs(stationEta) 1-->
+  <region group="mm">
+    <range field="stationName" value="MML" />
+    <range field="stationEta" values="-1 1" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MM" />
+    <range field="mmMultilayer" minvalue="1" maxvalue="2" />
+    <range field="mmGasGap" values="3 4" />
+    <range field="mmChannel" minvalue="1" maxvalue="5120" />
+  </region>
+
+     <!--  Nominal position abs(stationEta) 2-->
+  <region group="mm">
+    <range field="stationName" value="MML" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MM" />
+    <range field="mmMultilayer" minvalue="1" maxvalue="2" />
+    <range field="mmGasGap" values="1 2" />
+    <range field="mmChannel" minvalue="1" maxvalue="3072" />
+  </region>
+     <!--  Stereoangle position abs(stationEta) 2-->
+  <region group="mm">
+    <range field="stationName" value="MML" />
+    <range field="stationEta" values="-2 2" />
+    <range field="stationPhi" minvalue="1" maxvalue="8" />
+    <range field="technology" value="MM" />
+    <range field="mmMultilayer" minvalue="1" maxvalue="2" />
+    <range field="mmGasGap" values="3 4" />
+    <range field="mmChannel" minvalue="1" maxvalue="3072" />
+  </region>
+
+</IdDictionary>
diff --git a/DetectorDescription/RegionSelector/python/RegSelToolConfig.py b/DetectorDescription/RegionSelector/python/RegSelToolConfig.py
index a55964df9e6a754f8bc8776a77bae9a17965de0d..aee84b9695e5f279ae190ec9f3059f39a0391c22 100644
--- a/DetectorDescription/RegionSelector/python/RegSelToolConfig.py
+++ b/DetectorDescription/RegionSelector/python/RegSelToolConfig.py
@@ -190,6 +190,9 @@ def regSelToolCfg(flags, detector, CondAlg, CablingConfigCfg=0):
 def regSelTool_SCT_Cfg(flags):
     return regSelToolCfg(flags, "SCT", CompFactory.SiRegSelCondAlg)
 
+def regSelTool_Pixel_Cfg(flags):
+    return regSelToolCfg(flags, "Pixel", CompFactory.SiRegSelCondAlg)
+
 # muon spectrometer
 
 def regSelTool_MDT_Cfg(flags):
diff --git a/Event/EventContainers/EventContainers/I_InternalIDC.h b/Event/EventContainers/EventContainers/I_InternalIDC.h
index 71d7a0f2550d103ec661fa52e21ebe7174ca1398..1919de5f68c52d8a7968188b1e2846a76e23618e 100644
--- a/Event/EventContainers/EventContainers/I_InternalIDC.h
+++ b/Event/EventContainers/EventContainers/I_InternalIDC.h
@@ -14,7 +14,7 @@ class IDC_WriteHandleBase;
 /*
 The intention of the IdentifiableContainer is to provide a key-value map
 for collection pointers. To increase memory and cpu efficiency the online trigger 
-system different “views” can share collection that are created concurrently.
+system different ''views'' can share collection that are created concurrently.
 To efficiently support these different uses while not imposing overhead on the
 offline case and to maintain a consistent interface the internals of the class are
 virtualised.
diff --git a/Event/EventInfoUtils/EventInfoUtils/ATLAS_CHECK_THREAD_SAFETY b/Event/EventInfoUtils/EventInfoUtils/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..d37d44670034def48d5bcf82ded9662fc77a6fb0
--- /dev/null
+++ b/Event/EventInfoUtils/EventInfoUtils/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Event/EventInfoUtils
diff --git a/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_CONDBR2-BLKPA-2015-12.py b/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_CONDBR2-BLKPA-2015-12.py
index 3c0d0f16074bc5962eb8d8cd1751421f58974d45..8aff6fb2e8364b5f3235ceb3dfdfc161c15ebf00 100644
--- a/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_CONDBR2-BLKPA-2015-12.py
+++ b/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_CONDBR2-BLKPA-2015-12.py
@@ -127,6 +127,13 @@ conddb.addFolderSplitMC("SCT","/SCT/DAQ/Config/Chip","/SCT/DAQ/Config/Chip",forc
 conddb.blockFolder("/SCT/DAQ/Config/Module")
 conddb.addFolderSplitMC("SCT","/SCT/DAQ/Config/Module","/SCT/DAQ/Config/Module",force=True)
 
+conddb.blockFolder("/LAR/BadChannels/BadChannels")
+conddb.blockFolder("/LAR/BadChannelsOfl/BadChannels")
+conddb.addFolderWithTag("LAR_OFL","/LAR/BadChannels/BadChannels","LARBadChannelsBadChannels-HECAQ3Missing",force=True,forceMC=True)
+conddb.blockFolder("/LAR/BadChannels/MissingFEBs")
+conddb.blockFolder("/LAR/BadChannelsOfl/MissingFEBs")
+conddb.addFolderWithTag("LAR_OFL","/LAR/BadChannels/MissingFEBs","LArBadChannelsMissingFEBs-IOVDEP-04",force=True,forceMC=True)
+
 dofolderoverrides = True
 if dofolderoverrides:
 	printfunc ("ACH - overriding folder access patterns")
diff --git a/Event/PyDumper/python/Dumpers.py b/Event/PyDumper/python/Dumpers.py
index 21f328527e0f525bc32aac69459c699881fe3f53..53450f2afc932f7cbc52e8ef1495090b209bd7a1 100644
--- a/Event/PyDumper/python/Dumpers.py
+++ b/Event/PyDumper/python/Dumpers.py
@@ -44,8 +44,11 @@ getattr (ROOT.xAOD, 'TrackParticleContainer_v1', None)
 getattr (ROOT.xAOD, 'Jet_v1', None)
 
 #Typed nullptr:
-jetAssocNull=cppyy.bind_object(cppyy.nullptr,cppyy.gbl.JetAssociationBase)
-muonNull=cppyy.bind_object(cppyy.nullptr,cppyy.gbl.Analysis.Muon)
+JetAssociationBase = getattr (cppyy.gbl, 'JetAssociationBase', None)
+Analysis = getattr (cppyy.gbl, 'Analysis', None)
+Muon = getattr (Analysis, 'Muon', None) if Analysis else None
+jetAssocNull = cppyy.bind_object(cppyy.nullptr, JetAssociationBase) if JetAssociationBase else None
+muonNull = cppyy.bind_object(cppyy.nullptr, Muon) if Muon else None
 
 
 # Work around a cling bug.
diff --git a/Event/xAOD/xAODCaloRings/xAODCaloRings/versions/CaloRings_v1.h b/Event/xAOD/xAODCaloRings/xAODCaloRings/versions/CaloRings_v1.h
index d3083b8cf5890194fddb703c40f4cb3e6ecd9b9c..7bcde6feec5001184448c5a07d8abdf84a15af3d 100644
--- a/Event/xAOD/xAODCaloRings/xAODCaloRings/versions/CaloRings_v1.h
+++ b/Event/xAOD/xAODCaloRings/xAODCaloRings/versions/CaloRings_v1.h
@@ -193,7 +193,7 @@ class CaloRings_v1 : public SG::AuxElement {
 
     
     /// Print @name CaloRings_v1 methods:
-    /// @{
+    /// @{
     /**
      * @brief Print @name CaloRings_v1 using ostream:
      **/
diff --git a/Event/xAOD/xAODCaloRings/xAODCaloRings/versions/RingSetConf_v1.h b/Event/xAOD/xAODCaloRings/xAODCaloRings/versions/RingSetConf_v1.h
index 945e16e963c25a8bc3fbecb014b765c65b4a43b0..a51ed8df0123268b49f0c2cf4c1ccfbf23c220bc 100644
--- a/Event/xAOD/xAODCaloRings/xAODCaloRings/versions/RingSetConf_v1.h
+++ b/Event/xAOD/xAODCaloRings/xAODCaloRings/versions/RingSetConf_v1.h
@@ -434,7 +434,7 @@ class RingSetConf_v1 : public SG::AuxElement {
     void setSectionEndIdx(unsigned sectionEndIdx);
     /// @}
  
-    /// @{ Print @name RingSetConf_v1 methods:
+    /// @{ Print @name RingSetConf_v1 methods:
     /**
      * @brief Print @name RingSetConf_v1 using ostream:
      **/
diff --git a/Event/xAOD/xAODCaloRings/xAODCaloRings/versions/RingSet_v1.h b/Event/xAOD/xAODCaloRings/xAODCaloRings/versions/RingSet_v1.h
index 0587e51e1405351659f4149e6eb8b5c98403ba79..e3102c3675679d62e328b8306d5fbad2272dc2f6 100644
--- a/Event/xAOD/xAODCaloRings/xAODCaloRings/versions/RingSet_v1.h
+++ b/Event/xAOD/xAODCaloRings/xAODCaloRings/versions/RingSet_v1.h
@@ -132,7 +132,7 @@ class RingSet_v1 : public SG::AuxElement {
     RingSet_v1& operator=(const RingSet_v1& clrings);
     /// @}
 
-    /// @{ Print @name RingSet_v1 methods:
+    /// @{ Print @name RingSet_v1 methods:
     /**
      * @brief Print @name RingSet_v1 using ostream:
      **/
diff --git a/Event/xAOD/xAODEgamma/xAODEgamma/versions/EgammaAuxContainer_v1.h b/Event/xAOD/xAODEgamma/xAODEgamma/versions/EgammaAuxContainer_v1.h
index 7e42e218572a842334f0288011e206537439c318..f11be1325b7d5b8df56149246a45215cf83c5078 100644
--- a/Event/xAOD/xAODEgamma/xAODEgamma/versions/EgammaAuxContainer_v1.h
+++ b/Event/xAOD/xAODEgamma/xAODEgamma/versions/EgammaAuxContainer_v1.h
@@ -132,7 +132,7 @@ namespace xAOD {
     std::vector< float >  e2ts1;    
     /// @brief energy of the cell corresponding to second energy maximum in the first sampling
     std::vector< float >  e2tsts1;  
-    /// @brief shower shape in the shower core : [E(+/-3)-E(+/-1)]/E(+/-1), where E(+/-n) is the energy in ± n strips around the strip with highest energy
+    /// @brief shower shape in the shower core : [E(+/-3)-E(+/-1)]/E(+/-1), where E(+/-n) is the energy in +- n strips around the strip with highest energy
     std::vector< float >  fracs1;   
     /// @brief same as egammaParameters::weta1 but without corrections  on particle impact point inside the cell
     std::vector< float >  widths1;  
@@ -155,7 +155,7 @@ namespace xAOD {
     std::vector< float >  pos7; 
     /// @brief  barycentre in sampling 1 calculated in 3 strips
     std::vector< float >  barys1;   
-    /// @brief shower width is determined in a window detaxdphi = 0,0625 ×~0,2, corresponding typically to 20 strips in eta : wtot1=sqrt{sum Ei x ( i-imax)^2 / sum Ei}, where i is the strip number and imax the strip number of the first local maximum
+    /// @brief shower width is determined in a window detaxdphi = 0,0625 x~0,2, corresponding typically to 20 strips in eta : wtot1=sqrt{sum Ei x ( i-imax)^2 / sum Ei}, where i is the strip number and imax the strip number of the first local maximum
     std::vector< float >  wtots1;   
     /// @brief energy reconstructed in the strip with the minimal value between the first and second maximum
     std::vector< float >  emins1;   
diff --git a/Event/xAOD/xAODPFlow/CMakeLists.txt b/Event/xAOD/xAODPFlow/CMakeLists.txt
index c230887d74cc90e39d6fd476be623432c5b5b2ab..aad1df5cc8821a989496f804d7fe67ec1d385b9c 100644
--- a/Event/xAOD/xAODPFlow/CMakeLists.txt
+++ b/Event/xAOD/xAODPFlow/CMakeLists.txt
@@ -18,7 +18,7 @@ atlas_add_library( xAODPFlow
 atlas_add_xaod_smart_pointer_dicts(
    INPUT xAODPFlow/selection.xml
    OUTPUT _selectionFile
-   CONTAINERS "xAOD::PFOContainer_v1" "xAOD::TrackCaloClusterContainer_v1" )
+   CONTAINERS "xAOD::PFOContainer_v1" "xAOD::TrackCaloClusterContainer_v1"  "xAOD::FlowElementContainer_v1")
 
 atlas_add_dictionary( xAODPFlowDict
    xAODPFlow/xAODPFlowDict.h
diff --git a/Event/xAOD/xAODPFlow/xAODPFlow/xAODPFlowDict.h b/Event/xAOD/xAODPFlow/xAODPFlow/xAODPFlowDict.h
index 11b944665f6ac200060c4a6b054cda7b846fc840..4829da63e9a1e00cf26ee9c14a1062233c1f556a 100644
--- a/Event/xAOD/xAODPFlow/xAODPFlow/xAODPFlowDict.h
+++ b/Event/xAOD/xAODPFlow/xAODPFlow/xAODPFlowDict.h
@@ -43,12 +43,11 @@ namespace {
      XAOD_INSTANTIATE_NS_CONTAINER_TYPES( xAOD, IParticleContainer );
      // Weird/bad types used by the PFO reconstruction as attributes on
      // xAOD::PFO objects. :-(
-     std::pair< ElementLink< xAOD::CaloClusterContainer >, double > dummy1;
-     std::vector< std::pair< ElementLink< xAOD::CaloClusterContainer >, double > >
-     dummy2;
-     std::vector< std::vector< std::pair< ElementLink< xAOD::CaloClusterContainer >, double > > >
-     dummy3;
-     std::vector< xAOD::PFODetails::PFOLeptonType > dummy4;
+     std::pair< ElementLink< xAOD::CaloClusterContainer >, double > FlowElemdummy1;
+     std::vector< std::pair< ElementLink< xAOD::CaloClusterContainer >, double > > FlowElemdummy2;
+     std::vector< std::vector< std::pair< ElementLink< xAOD::CaloClusterContainer >, double > > > FlowElemdummy3;
+     std::vector< xAOD::PFODetails::PFOLeptonType > FlowElemdummy4;
+     
 
    };
 }
diff --git a/Event/xAOD/xAODTau/Root/TauJetAccessors_v3.icc b/Event/xAOD/xAODTau/Root/TauJetAccessors_v3.icc
index 7c47d7168287db43083e59bf1a8baf0fbfbf5676..34c935fffec362d2cf62a9ecc5d05f9fcb5fc644 100644
--- a/Event/xAOD/xAODTau/Root/TauJetAccessors_v3.icc
+++ b/Event/xAOD/xAODTau/Root/TauJetAccessors_v3.icc
@@ -32,10 +32,12 @@ break;
       DEFINE_TAUJETPARAMETER_ACCESSOR( float, EleMatchLikelihoodScore );
       DEFINE_TAUJETPARAMETER_ACCESSOR( float, BDTJetScore );	
       DEFINE_TAUJETPARAMETER_ACCESSOR( float, RNNJetScore );	
+      DEFINE_TAUJETPARAMETER_ACCESSOR( float, RNNEleScore );	
       DEFINE_TAUJETPARAMETER_ACCESSOR( float, BDTEleScore );	
       DEFINE_TAUJETPARAMETER_ACCESSOR( float, PanTauScore );   
       DEFINE_TAUJETPARAMETER_ACCESSOR( float, BDTJetScoreSigTrans );   
       DEFINE_TAUJETPARAMETER_ACCESSOR( float, RNNJetScoreSigTrans );   
+      DEFINE_TAUJETPARAMETER_ACCESSOR( float, RNNEleScoreSigTrans );   
       //DEFINE_TAUJETPARAMETER_ACCESSOR( float, BDTJetScoreBkgTrans );   
 
     default:
diff --git a/Event/xAOD/xAODTau/Root/TauJetAuxContainer_v3.cxx b/Event/xAOD/xAODTau/Root/TauJetAuxContainer_v3.cxx
index e868ef0507fda444f442cbf7023b14848105cbb7..32dc32e9af27cbcd9e23eebe6d079ea0d00c1544 100644
--- a/Event/xAOD/xAODTau/Root/TauJetAuxContainer_v3.cxx
+++ b/Event/xAOD/xAODTau/Root/TauJetAuxContainer_v3.cxx
@@ -266,6 +266,10 @@ namespace xAOD {
     // RNN tau ID
     AUX_VARIABLE( RNNJetScore );
     AUX_VARIABLE( RNNJetScoreSigTrans ); 
+
+    //RNN tau eVeto
+    AUX_VARIABLE( RNNEleScore );
+    AUX_VARIABLE( RNNEleScoreSigTrans ); 
     
   }
   
diff --git a/Event/xAOD/xAODTau/xAODTau/TauDefs.h b/Event/xAOD/xAODTau/xAODTau/TauDefs.h
index f8c7bbea70ad21745ab5f50096091b65b3c3878d..67715716a56ed27fce210d24e59235c410f815e8 100644
--- a/Event/xAOD/xAODTau/xAODTau/TauDefs.h
+++ b/Event/xAOD/xAODTau/xAODTau/TauDefs.h
@@ -90,7 +90,11 @@ namespace TauJetParameters
         //! RNN score for Jet rejection (not transformed)
         RNNJetScore           = 21,
         //! RNN score which is signal transformed/flattened
-        RNNJetScoreSigTrans   = 22 // new
+        RNNJetScoreSigTrans   = 22, // new
+        //! RNN score for Ele rejection (not transformed)
+        RNNEleScore           = 23,
+        //! RNN score which is signal transformed/flattened
+        RNNEleScoreSigTrans   = 24 // new
       };
 
     //-------------------------------------------------------------------------
@@ -144,6 +148,9 @@ namespace TauJetParameters
         JetRNNSigLoose          = 29,
         JetRNNSigMedium         = 30,
         JetRNNSigTight          = 31,
+        EleRNNLoose          = 32,
+        EleRNNMedium         = 33,
+        EleRNNTight          = 34,	
       };
 
     //-------------------------------------------------------------------------
diff --git a/Event/xAOD/xAODTau/xAODTau/versions/TauJetAuxContainer_v3.h b/Event/xAOD/xAODTau/xAODTau/versions/TauJetAuxContainer_v3.h
index cad0612b9fdbdfa3f297f28a04e67a2a2ed08b77..58fa1316fe762f6772f00b882afda8ec06d21a6b 100644
--- a/Event/xAOD/xAODTau/xAODTau/versions/TauJetAuxContainer_v3.h
+++ b/Event/xAOD/xAODTau/xAODTau/versions/TauJetAuxContainer_v3.h
@@ -318,6 +318,10 @@ namespace xAOD {
     // RNN tau ID
     std::vector< float > RNNJetScore;
     std::vector< float > RNNJetScoreSigTrans;
+
+    // RNN tau eVeto
+    std::vector< float > RNNEleScore;
+    std::vector< float > RNNEleScoreSigTrans;
     
   }; // class TauJetAuxContainer_v3
 
diff --git a/Event/xAOD/xAODTruth/test/ut_xaodtruth_helpers_test.py b/Event/xAOD/xAODTruth/test/ut_xaodtruth_helpers_test.py
index 327f904731e1339e1a257fe7924d7f702e374650..a510da3fba49ff4c78724b87158e45fe6a009a27 100755
--- a/Event/xAOD/xAODTruth/test/ut_xaodtruth_helpers_test.py
+++ b/Event/xAOD/xAODTruth/test/ut_xaodtruth_helpers_test.py
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
-
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+#
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 #
 # This is a simple unit test for checking the health of the truth helper
 # functions in the standalone analysis environment.
@@ -33,7 +33,7 @@ def main():
     t = treeMgr.eventTree()
 
     # Loop on the first few events:
-    for entry in xrange( 10 ):
+    for entry in range( 10 ):
         # Load the event:
         if t.GetEntry( entry ) < 0:
             print( "Couldn't load entry %i from the input!" % entry )
@@ -56,7 +56,7 @@ def main():
             pass
         pass
 
-    return 0;
+    return 0
 
 # Execute the main function:
 if __name__ == "__main__":
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt b/ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt
index 1d99ae5b68e4626ce900ac04543c14774f6c003d..5811b24dd26c985c62283b877ecdbf863b2779b5 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/CMakeLists.txt
@@ -1,5 +1,6 @@
 ################################################################################
 # Package: Run3AFPMonitoring
+# Author: N. Dikic 
 ################################################################################
 
 # Declare the package name:
@@ -12,9 +13,9 @@ atlas_depends_on_subdirs(
         Control/AthenaBaseComps
         Control/AthenaMonitoringKernel
         GaudiKernel
-	Event/xAOD/xAODForward
-	xAODForward/AFPSiHit
-	xAODForward/AFPToFHit	
+        Event/xAOD/xAODForward
+        xAODForward/AFPSiHit
+        xAODForward/AFPToFHit
         LumiBlock/LumiBlockComps
         LumiBlock/LumiBlockData
         Trigger/TrigEvent/TrigDecisionInterface
@@ -31,6 +32,10 @@ atlas_depends_on_subdirs(
         Trigger/TrigAnalysis/TrigDecisionTool
         Trigger/TrigAnalysis/TrigAnalysisInterfaces
         MuonSpectrometer/MuonAlignment/MuonAlignmentData
+        
+        Event/EventContainers
+        #Tools/PathResolver
+        #Control/StoreGate
 )
 
 # External dependencies:
@@ -50,7 +55,10 @@ atlas_add_component( Run3AFPMonitoring
         LumiBlockCompsLib
         LumiBlockData
         TrigDecisionToolLib
+        TrigAnalysisInterfaces
         xAODForward
+        xAODTrigger
+        #Trigger
         AthenaKernel
         SGAudCore
         AthenaPoolUtilities
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPFastReco.h b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPFastReco.h
index 38080060f69bb2c4eb623f60ddfe2d860e9aea7d..411b81998f88abafed11ca0ae0fb1da06bc50e29 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPFastReco.h
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPFastReco.h
@@ -11,118 +11,129 @@
 
 namespace AFPMon {
 
-  struct AFPCluster {
-    AFPCluster(float x_, float y_, float z_, int s, int l)
+struct AFPCluster 
+{
+	AFPCluster(float x_, float y_, float z_, int s, int l)
         : x {x_}, y {y_}, z {z_}, station {s}, layer {l} {}
 
-    float x;
-    float y;
-    float z;
-    int station;
-    int layer;
-  };
-
-  inline bool operator==(const AFPCluster& lhs, const AFPCluster& rhs) {
-    if (lhs.x != rhs.x) return false;
-    if (lhs.y != rhs.y) return false;
-    if (lhs.z != rhs.z) return false;
-    if (lhs.station != rhs.station) return false;
-    if (lhs.layer != rhs.layer) return false;
-
-    return true;
-  }
-
-  struct AFPTrack {
-    AFPTrack(float x_, float y_, int s, std::array<int, 4> a)
+	float x;
+	float y;
+	float z;
+	int station;
+	int layer;
+ };
+
+inline bool operator==(const AFPCluster& lhs, const AFPCluster& rhs) 
+{
+	if (lhs.x != rhs.x) return false;
+	if (lhs.y != rhs.y) return false;
+	if (lhs.z != rhs.z) return false;
+	if (lhs.station != rhs.station) return false;
+	if (lhs.layer != rhs.layer) return false;
+
+	return true;
+}
+
+struct AFPTrack 
+{
+	AFPTrack(float x_, float y_, int s, std::array<int, 4> a)
         : x {x_}, y {y_}, station {s}, layerClusters {std::move(a)} {}
 
-    float x;
-    float y;
-    int station;
-    std::array<int, 4> layerClusters;
-  };
+	float x;
+	float y;
+	int station;
+	std::array<int, 4> layerClusters;
+};
 
-  class AFPFastReco {
-  public:
-    /// Constructor. Sets input hit container
-    AFPFastReco(const xAOD::AFPSiHitContainer* hits) : m_hitContainer {hits} {}
+class AFPFastReco 
+{
+	public:
+	/// Constructor. Sets input hit container
+	AFPFastReco(const xAOD::AFPSiHitContainer* hits) : m_hitContainer {hits} {}
 
-    /// Performs fast reconstruction of clusters and tracks
-    void reco();
+	/// Performs fast reconstruction of clusters and tracks
+	void reco();
 
-    /// Returns vector of clusters
-    std::vector<AFPCluster> clusters() const { return m_clusters; }
+	/// Returns vector of clusters
+	std::vector<AFPCluster> clusters() const { return m_clusters; }
 
-    /// Returns vector of tracks
-    std::vector<AFPTrack> tracks() const { return m_tracks; }
+	/// Returns vector of tracks
+	std::vector<AFPTrack> tracks() const { return m_tracks; }
 
-  private:
-    /// Performs fast cluster reconstruction
-    void recoClusters();
+  	private:
+	/// Performs fast cluster reconstruction
+	void recoClusters();
 
-    /// Performs fast track reconstruction
-    void recoTracks();
+	/// Performs fast track reconstruction
+	void recoTracks();
 
-    /// Returns parameters of fitted line
-    std::pair<double, double> linReg(std::vector<std::pair<double, double>> YX) const;
+	/// Returns parameters of fitted line
+	std::pair<double, double> linReg(std::vector<std::pair<double, double>> YX) const;
 
-    /// Finds hits/clusters around given init element
-    template <class T>
-    std::vector<T> findAround(T init, std::list<T>& toJoin) const;
+	/// Finds hits/clusters around given init element
+	template <class T>
+	std::vector<T> findAround(T init, std::list<T>& toJoin) const;
 
-    /// Checks if given hits are neighbours
-    bool areNeighbours(const xAOD::AFPSiHit* lhs, const xAOD::AFPSiHit* rhs) const;
+	/// Checks if given hits are neighbours
+	bool areNeighbours(const xAOD::AFPSiHit* lhs, const xAOD::AFPSiHit* rhs) const;
 
-    /// Checks if given clusters are neighbours
-    bool areNeighbours(const AFPCluster& lhs, const AFPCluster& rhs) const;
+	/// Checks if given clusters are neighbours
+	bool areNeighbours(const AFPCluster& lhs, const AFPCluster& rhs) const;
 
-    /// Pointer to hit container
-    const xAOD::AFPSiHitContainer* m_hitContainer;
+	/// Pointer to hit container
+	const xAOD::AFPSiHitContainer* m_hitContainer;
 
-    /// Vector of clusters
-    std::vector<AFPCluster> m_clusters;
+	/// Vector of clusters
+	std::vector<AFPCluster> m_clusters;
 
-    /// Vector of tracks
-    std::vector<AFPTrack> m_tracks;
+	/// Vector of tracks
+	std::vector<AFPTrack> m_tracks;
 
-    /// Number of AFP stations
-    static constexpr int s_afpStations = 4;
+	/// Number of AFP stations
+	static constexpr int s_afpStations = 4;
 
-    /// Number of layers in each station
-    static constexpr int s_afpLayers = 4;
+	/// Number of layers in each station
+	static constexpr int s_afpLayers = 4;
 
-    /// Minimum number of clusters in track
-    static constexpr int s_trackSize = 3;
+	/// Minimum number of clusters in track
+	static constexpr int s_trackSize = 3;
 
-    /// Maximum distance between cluster
-    static constexpr float s_clusterDistance = 0.4;
-  };
+	/// Maximum distance between cluster
+	static constexpr float s_clusterDistance = 0.4;
+ };
 
-  template <class T>
-  std::vector<T> AFPFastReco::findAround(T init, std::list<T>& toJoin) const {
-    std::vector<T> element;
-    element.push_back(init);
+template <class T> std::vector<T> AFPFastReco::findAround(T init, std::list<T>& toJoin) const 
+{
+	std::vector<T> element;
+	element.push_back(init);
 
-    std::vector<T> newNeighbours;
-    do {
-      newNeighbours.clear();
-      for (auto& b : toJoin) {
-        bool isNew = false;
-        for (auto& a : element)
-          if (areNeighbours(a, b)) isNew = true;
+	std::vector<T> newNeighbours;
+	do 
+	{
+		newNeighbours.clear();
+		for (auto& b : toJoin) 
+		{
+			bool isNew = false;
+			for (auto& a : element)
+			if (areNeighbours(a, b)) 
+			{
+				isNew = true;
+				break;
+ 			}
 
-        if (isNew) {
-          newNeighbours.push_back(b);
-          element.push_back(b);
-        }
-      }
+			if (isNew) 
+			{
+				newNeighbours.push_back(b);
+				element.push_back(b);
+			}
+		}
 
-      for (auto& t : newNeighbours)
-        toJoin.remove(t);
+		for (auto& t : newNeighbours)
+			toJoin.remove(t);
 
-    } while (newNeighbours.size() > 0);
+	} while (newNeighbours.size() > 0);
 
-    return element;
+	return element;
   }
 
 }  // namespace AFPMon
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
index 463d7bbf1b5b35fd858c80b1eeba40c6b0dfb404..c35cf6b4240a69c12326706c4e060a3b397b0a44 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPSiLayerAlgorithm.h
@@ -10,24 +10,33 @@
 #include "StoreGate/ReadHandleKey.h"
 #include "xAODForward/AFPSiHitContainer.h"
 #include "xAODForward/AFPSiHit.h"
+#include "LumiBlockData/BunchCrossingCondData.h"
+#include <Run3AFPMonitoring/AFPFastReco.h>
 
 #include "TRandom3.h"
 
+class BunchCrossingCondData;
+
 class AFPSiLayerAlgorithm : public AthMonitorAlgorithm {
 public:
-    AFPSiLayerAlgorithm( const std::string& name, ISvcLocator* pSvcLocator );
-    virtual ~AFPSiLayerAlgorithm();
-    virtual StatusCode initialize() override;
-    virtual StatusCode fillHistograms( const EventContext& ctx ) const override;
+	AFPSiLayerAlgorithm( const std::string& name, ISvcLocator* pSvcLocator );
+	virtual ~AFPSiLayerAlgorithm();
+	virtual StatusCode initialize() override;
+	virtual StatusCode fillHistograms( const EventContext& ctx ) const override;
 
 private:
-    std::map<std::string,std::map<std::string,int>> m_HitmapGroups;
-    std::map<std::string,int> m_TrackGroup; 
-    SG::ReadHandleKey<xAOD::AFPSiHitContainer> m_afpHitContainerKey;
+
+	std::map<std::string,std::map<std::string,int>> m_StationPlaneGroup;
+	std::map<std::string,int> m_StationGroup; 
+	SG::ReadHandleKey<xAOD::AFPSiHitContainer> m_afpHitContainerKey;
+	SG::ReadCondHandleKey<BunchCrossingCondData> m_bunchCrossingKey{this, "BunchCrossingKey", "BunchCrossingData", "Key BunchCrossing CDO" };
+	
+	void fillSynchHistogramsStation(Monitored::Scalar<int> &lb, int &previouslbStationA, std::vector<std::vector<unsigned int>> &clusterCounterStationA, unsigned int &counterForEventsStationA, float &muPerBCID, char histogramType, AFPMon::AFPFastReco& fast) const;
+	void fillSynchHistogramsPlane(Monitored::Scalar<int> &lb, int &previouslbPlane, std::vector<std::vector<std::vector<unsigned int>>> &clusterCounterPlane, unsigned int &counterForEventsPlane, float &muPerBCID, char histogramType, AFPMon::AFPFastReco& fast) const;
 
 protected:
-    std::vector<std::string> m_pixlayers = { "P0", "P1", "P2", "P3"};
-    std::vector<std::string> m_stationnames = { "farAside", "nearAside" , "nearCside" , "farCside"};
+	std::vector<std::string> m_pixlayers = { "P0", "P1", "P2", "P3"};
+	std::vector<std::string> m_stationnames = { "farAside", "nearAside" , "nearCside" , "farCside"};
 
 };
 #endif
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPToFAlgorithm.h b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPToFAlgorithm.h
index fea6a733f502e10374ef79dfa6c109eb374b2559..05dd2d8cbd0ce9329687839e2a92b5b0e8bef5d2 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPToFAlgorithm.h
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPToFAlgorithm.h
@@ -15,20 +15,20 @@
 
 class AFPToFAlgorithm : public AthMonitorAlgorithm {
 public:
-    AFPToFAlgorithm( const std::string& name, ISvcLocator* pSvcLocator );
-    virtual ~AFPToFAlgorithm();
-    virtual StatusCode initialize() override;
-    virtual StatusCode fillHistograms( const EventContext& ctx ) const override;
+	AFPToFAlgorithm( const std::string& name, ISvcLocator* pSvcLocator );
+	virtual ~AFPToFAlgorithm();
+	virtual StatusCode initialize() override;
+	virtual StatusCode fillHistograms( const EventContext& ctx ) const override;
 
 private:
-   std::map<std::string,int> m_HitmapGroupsToF;
-   
-   SG::ReadHandleKey<xAOD::AFPToFHitContainer> m_afpToFHitContainerKey;
+	std::map<std::string,int> m_StationNamesGroup;
+	std::map<std::string,int> m_TrainsToFGroup;
+	SG::ReadHandleKey<xAOD::AFPToFHitContainer> m_afpToFHitContainerKey;
 
 protected:
-   // Only 0 and 3 are ToF stations (farAside and farCside)
-   std::vector<std::string> m_stationNamesToF = { "farAside", "nearAside" , "nearCside" , "farCside" };
-   
+	// Only 0 and 3 are ToF stations (farAside and farCside)
+	std::vector<std::string> m_stationNamesToF = { "farAside", "nearAside" , "nearCside" , "farCside" };
+	std::vector<std::string> m_trainsToF = { "train0", "train1" , "train2" , "train3" };
 };
 #endif
 
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
index 99fc57844329f443a86879a81cdb4f53b3cfafa0..5a1c07c50c2c0806ab7934ed9b1d3e80b9750b24 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py
@@ -3,15 +3,18 @@
 #
 
 '''@file Run3AFPExampleMonitorAlgorithm.py
-@author C. D. Burton
-@author P. Onyisi
-@date 2018-01-11
-@brief Example python configuration for the Run III AthenaMonitoring package
+@author N. Dikic
+@date 2020-08-12
 '''
 
 def Run3AFPExampleMonitoringConfig(inputFlags):
     '''Function to configures some algorithms in the monitoring system.'''
+    from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+    result = ComponentAccumulator()
 
+    from LumiBlockComps.BunchCrossingCondAlgConfig import BunchCrossingCondAlgCfg
+    result.merge(BunchCrossingCondAlgCfg(inputFlags))
+    
     from AthenaMonitoring import AthMonitorCfgHelper
     helper = AthMonitorCfgHelper(inputFlags,'Run3AFPMonitorCfg')
     
@@ -30,35 +33,57 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
     AFPSiGroup = helper.addGroup(afpSiLayerAlgorithm, 'AFPSiLayerTool', 'AFP/') 
     AFPToFGroup = helper.addGroup(afpToFAlgorithm, 'AFPToFTool', 'AFP/')
 
-    AFPSiGroup.defineHistogram('lb,nSiHits', title='Luminosity Block;lb;total number of Hits', type='TProfile', path='SiT/',xbins=1000,xmin=-0.5,xmax=999.5 ) 
-    AFPToFGroup.defineHistogram('lb,nTofHits', title='Luminosity Block;lb;total number of Hits', type='TProfile',  path='ToF/',xbins=1000,xmin=-0.5,xmax=999.5) 
-
-    AFPToFGroup.defineHistogram('numberOfHit_S0', title='Number of hit per bar station 0;total number of Hits', path='ToF/',xbins=4,xmin=-0.5,xmax=3.5)
-    AFPToFGroup.defineHistogram('numberOfHit_S3', title='Number of hit per bar station 3;total number of Hits', path='ToF/',xbins=4,xmin=-0.5,xmax=3.5)
+    AFPSiGroup.defineHistogram('lb,nSiHits', title='Total number of hits;lb;total number of Hits', type='TProfile', path='SiT/', xbins=1000, xmin=-0.5, xmax=999.5)
+    AFPSiGroup.defineHistogram('lb,muPerBCID', title='<mu>;lumiBlock;<mu>', type='TProfile', path='SiT/', xbins=1000, xmin=-0.5, xmax=999.5)
+    AFPSiGroup.defineHistogram('planeHitsAll', title='Number of hits per plane;plane; hits', type='TH1F', path='SiT/HitsPerPlanes', xbins=16, xmin=-0.5, xmax=15.5)
+    #AFPSiGroup.defineHistogram('layerNumber,layerEfficiency', title='LayerEfficiency;layerNumber', path='SiT/', xbins = 16, xmin=0.5, xmax=16.5, ybins=100, ymin=0, ymax=1)
+    #AFPSiGroup.defineHistogram('layerEfficiency', type='TH1F', title='1D layer efficiency;layerEfficiency', path='SiT/', xbins=16, xmin=0.5, xmax=16.5)
 
+    AFPToFGroup.defineHistogram('lb,nTofHits', title='Multiplicity;lb;total number of Hits', type='TProfile', path='ToF/', xbins=1000, xmin=-0.5, xmax=999.5) 
+    AFPToFGroup.defineHistogram('numberOfHit_S0', title='Number of hit per bar station 0;bar', path='ToF/', xbins=4, xmin=-0.5, xmax=3.5)
+    AFPToFGroup.defineHistogram('numberOfHit_S3', title='Number of hit per bar station 3;bar', path='ToF/', xbins=4, xmin=-0.5, xmax=3.5)
+    AFPToFGroup.defineHistogram('barInTrainAllA', title='Number of hits in bar per plane; barInTrain;hits',type='TH1F', path='ToF/HitsPerBarsInTrain', xbins=16, xmin=-0.5, xmax=15.5)
+    AFPToFGroup.defineHistogram('barInTrainAllC', title='Number of hits in bar per plane; barInTrain;hits',type='TH1F', path='ToF/HitsPerBarsInTrain', xbins=16, xmin=-0.5, xmax=15.5)
 
     # Using a map of groups
     layerList = ['P0','P1', 'P2', 'P3'] ## TODO XXX adapt to the enum/xAOD namespace names
-    combinedList = ['farAside', 'nearAside', 'nearCside', 'farCside']
-
-    array = helper.addArray([combinedList,layerList], afpSiLayerAlgorithm, 'AFPSiLayerTool', topPath = 'AFP/SiT/')
-    array.defineHistogram('pixelColIDChip', title='1D hitmap for {0} Layer {1};pixelColIDChip', path='PixelColIDChip', xbins=80, xmin=0.5, xmax=80.5)
-    array.defineHistogram('pixelRowIDChip', title='1D hitmap for {0} Layer {1};pixelRowIDChip', path='PixelRowIDChip', xbins=336, xmin=0.5, xmax=336.5)
-    array.defineHistogram('pixelColIDChip,pixelRowIDChip', title='hitmap for {0} Layer {1};pixelColIDChip;pixelRowIDChip', type='TH2F', path='pixelColRow2D', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)
-    array.defineHistogram('timeOverThreshold', type='TH1F', title='1D Time over threshold for {0} Layer {1};timeOverThreshold', path='SiTimeOverThreshold', xbins=60, xmin=0, xmax=20)
-    array.defineHistogram('clusterX,clusterY', title='Cluster position in station {0} Layer {1};clusterX;clusterY', type='TH2F', path='Cluster', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)
+    stationList = ['farAside', 'nearAside', 'nearCside', 'farCside']
+    trainList = ['train0', 'train1', 'train2', 'train3']
 
+    array = helper.addArray([stationList,layerList], afpSiLayerAlgorithm, 'AFPSiLayerTool', topPath = 'AFP/SiT/')
 
-    array = helper.addArray([combinedList], afpSiLayerAlgorithm, 'AFPSiLayerTool', topPath='AFP/Track/')
-    array.defineHistogram('trackX,trackY', title='Track posistion position in station {0};trackX;trackY', type='TH2F', path='Track', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)
+    array.defineHistogram('pixelColIDChip', title='Hits per column for station {0}, layer {1};pixelColIDChip; entries', path='PixelColIDChip/{0}', xbins=80, xmin=0.5, xmax=80.5)
+    array.defineHistogram('pixelRowIDChip', title='Hits per row for station {0}, layer {1};pixelRowIDChip; entries', path='PixelRowIDChip/{0}', xbins=336, xmin=0.5, xmax=336.5)
+    array.defineHistogram('pixelRowIDChip,pixelColIDChip', title='Hitmap for station {0}, layer {1};pixelRowIDChip;pixelColIDChip', type='TH2F', path='pixelColRow2D/{0}', xbins=336, xmin=0.5, xmax=336.5, ybins=80, ymin=0.5, ymax=80.5)
+    array.defineHistogram('timeOverThreshold', type='TH1F', title='Time over threshold for station {0}, layer {1};timeOverThreshold; entries', path='SiTimeOverThreshold/{0}', xbins=16, xmin=0.5, xmax=16.5)
+    
+    array.defineHistogram('clusterY,clusterX', title='Cluster position in station {0} Layer {1};x [mm];y [mm]', type='TH2F', path='Cluster/{0}', xbins=336, xmin=0.0, xmax=17.0, ybins=80, ymin=0.0, ymax=20.0)
+    array.defineHistogram('lb,clustersPerPlane', title='Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clusters per event / <mu>', type='TH2F', path='clustersPerPlane/{0}', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
+    array.defineHistogram('lb,clustersPerPlaneFront', title='(Front BCID) Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clusters per event / <mu>', type='TH2F', path='clustersPerPlaneFront/{0}', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
+    array.defineHistogram('lb,clustersPerPlaneEnd', title='(End BCID) Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clusters per event / <mu>', type='TH2F', path='clustersPerPlaneEnd/{0}', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
+    array.defineHistogram('lb,clustersPerPlaneMiddle', title='(Middle BCID) Number of clusters per event divided by <mu> in station {0}, layer {1};lb; clusters per event / <mu>', type='TH2F', path='clustersPerPlaneMiddle/{0}', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
 
 
+    array = helper.addArray([stationList], afpSiLayerAlgorithm, 'AFPSiLayerTool', topPath='AFP/SiT/')
+    
+    array.defineHistogram('planeHits', type='TH1F', title='Number of hits per plane, station {0};plane; hits', path='HitsPerPlanes', xbins=4, xmin=-0.5, xmax=3.5)
+    array.defineHistogram('trackY,trackX', title='Track in AFP station {0};x [mm];y [mm]', type='TH2F', path='Track', xbins=336, xmin=0.0, xmax=17.0, ybins=80, ymin=0.0, ymax=20.0)
+    array.defineHistogram('lb,clustersPerStation', title ='Number of clusters per event divided by <mu> in station {0};lb; clustersPerStation', type='TH2F', path='clustersPerStation', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
+    array.defineHistogram('lb,clustersPerStationFront', title ='(Front) Number of clusters per event divided by <mu> in station {0};lb; clustersPerStation', type='TH2F', path='clustersPerStation', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
+    array.defineHistogram('lb,clustersPerStationEnd', title ='(End) Number of clusters per event divided by <mu> in station {0};lb; clustersPerStation', type='TH2F', path='clustersPerStation', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
+    array.defineHistogram('lb,clustersPerStationMiddle', title ='(Middle) Number of clusters per event divided by <mu> in station {0};lb; clustersPerStation', type='TH2F', path='clustersPerStation', xbins=1000, xmin=-0.5, xmax=999.5, ybins=1000, ymin=-0.2, ymax=1.0)
 
-    arrayOneList = helper.addArray([combinedList], afpToFAlgorithm, 'AFPToFTool', topPath='AFP/ToF/')
-    arrayOneList.defineHistogram('trainID,barInTrainID', title='ToF hit bar vs train {0};trainID;barInTrainID', type='TH2F', path='HitBarvsTrain/',xbins=4,xmin=-0.5,xmax=3.5,ybins=4,ymin=-0.5,ymax=3.5)
 
+    arrayToF = helper.addArray([stationList], afpToFAlgorithm, 'AFPToFTool', topPath='AFP/ToF/')
+    
+    arrayToF.defineHistogram('barInTrainID,trainID', title='ToF hit bar vs train {0};barInTrainID;trainID', type='TH2F', path='HitBarvsTrain/',xbins=4,xmin=-0.5,xmax=3.5,ybins=4,ymin=-0.5,ymax=3.5)
+    arrayToF = helper.addArray([trainList], afpToFAlgorithm, 'AFPToFTool', topPath='AFP/ToF/')
+    arrayToF.defineHistogram('barInTrainIDA', title='Total hits per bars in {}; barID; hits', type='TH1F', path='HitsPerBarsInTrain/farAside', xbins=4,xmin=-0.5,xmax=3.5)
+    arrayToF.defineHistogram('barInTrainIDC', title='Total hits per bars in {}; barID; hits', type='TH1F', path='HitsPerBarsInTrain/farCside', xbins=4,xmin=-0.5,xmax=3.5)
+    
     # Finalize. The return value should be a tuple of the ComponentAccumulator
-    return helper.result()
+    result.merge(helper.result())
+    return result
     
 
 if __name__=='__main__':
@@ -73,13 +98,10 @@ if __name__=='__main__':
 
     # Set the Athena configuration flags
     from AthenaConfiguration.AllConfigFlags import ConfigFlags
-    nightly = ''
-    file ='/afs/cern.ch/work/k/kristin/dataAFP/data17_13TeV.00337176.physics_Main.merge.AOD.r10258_p3399_tid13243079_00/AOD.13243079._000003.pool.root.1' 
 
-    
-    ConfigFlags.Input.Files = [nightly+file]
+    ConfigFlags.Input.Files = ['/eos/atlas/atlascerngroupdisk/det-afp/xAODCalibrationStream/2017/user.ladamczy.00337371.calibration_AFP.daq.AOD_EXT0/user.ladamczy.22326990.EXT0._000001.xAOD.root']
     ConfigFlags.Input.isMC = False
-    ConfigFlags.Output.HISTFileName = 'AFPOutput.root'
+    ConfigFlags.Output.HISTFileName = 'AFPOutput63-test.root'
     
     ConfigFlags.lock()
 
@@ -88,10 +110,10 @@ if __name__=='__main__':
     from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
     cfg = MainServicesCfg(ConfigFlags)
     cfg.merge(PoolReadCfg(ConfigFlags))
-
+    
     exampleMonitorAcc = Run3AFPExampleMonitoringConfig(ConfigFlags)
     cfg.merge(exampleMonitorAcc)
 
-    cfg.run(10000) #use cfg.run(20) to only run on first 20 events
+    cfg.run(10000)
 
 
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPFastReco.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPFastReco.cxx
index 217c1dc607fb499a56b5bdf5352bbb7c807bb2ef..9234e1c3a024bad69471204a13bc8545ae8bbe7e 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPFastReco.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPFastReco.cxx
@@ -11,124 +11,136 @@
 
 namespace AFPMon {
 
-  void AFPFastReco::reco() {
-    recoClusters();
-    recoTracks();
-  }
-
-  void AFPFastReco::recoClusters() {
-    constexpr float dx   = 0.25;  // [mm]
+void AFPFastReco::reco() 
+{
+	recoClusters();
+	recoTracks();
+}
+
+void AFPFastReco::recoClusters() 
+{
+	constexpr float dx   = 0.25;  // [mm]
     constexpr float dy   = 0.05;  // [mm]
     constexpr float dz   = 9.00;  // [mm]
     constexpr float tilt = 14. / 180. * 3.14159;
 
     std::list toCluster(m_hitContainer->begin(), m_hitContainer->end());
 
-    while (toCluster.size() > 0) {
-      auto init = *(toCluster.begin());
-      toCluster.pop_front();
-      auto clusteredHits = findAround(init, toCluster);
-
-      float sumX      = 0;
-      float sumY      = 0;
-      float sumCharge = 0;
-      for (const xAOD::AFPSiHit* h : clusteredHits) {
-        const float charge = h->depositedCharge();
-        const float pixX   = dx * h->pixelColIDChip();
-        const float pixY   = dy * h->pixelRowIDChip();
-        sumX += charge * pixX;
-        sumY += charge * pixY;
-        sumCharge += charge;
-      }
-
-      const float xPlane = sumX / sumCharge;
-      const float yPlane = sumY / sumCharge;
-
-      const int stationID = init->stationID();
-      const int layerID   = init->pixelLayerID();
-
-      const float x = xPlane;
-      const float y = yPlane * cos(tilt);
-      const float z = yPlane * sin(tilt) + dz * layerID;
-
-      m_clusters.emplace_back(x, y, z, stationID, layerID);
+    while (toCluster.size() > 0) 
+	{
+		auto init = *(toCluster.begin());
+		toCluster.pop_front();
+		auto clusteredHits = findAround(init, toCluster);
+
+		float sumX      = 0;
+		float sumY      = 0;
+		float sumCharge = 0;
+		for (const xAOD::AFPSiHit* h : clusteredHits) 
+		{
+        	const float charge = h->depositedCharge();
+			const float pixX   = dx * h->pixelColIDChip();
+			const float pixY   = dy * h->pixelRowIDChip();
+			sumX += charge * pixX;
+			sumY += charge * pixY;
+			sumCharge += charge;
+		}
+
+		const float xPlane = sumX / sumCharge;
+		const float yPlane = sumY / sumCharge;
+
+		const int stationID = init->stationID();
+		const int layerID   = init->pixelLayerID();
+
+		const float x = xPlane;
+		const float y = yPlane * cos(tilt);
+		const float z = yPlane * sin(tilt) + dz * layerID;
+
+		m_clusters.emplace_back(x, y, z, stationID, layerID);
     }
-  }
+}
 
-  void AFPFastReco::recoTracks() {
-    std::list toTrack(m_clusters.begin(), m_clusters.end());
+void AFPFastReco::recoTracks() 
+{
+	std::list toTrack(m_clusters.begin(), m_clusters.end());
 
-    while (toTrack.size() > 0) {
-      auto init = *(toTrack.begin());
-      toTrack.pop_front();
-      auto trackCandidate = findAround(init, toTrack);
+	while (toTrack.size() > 0) 
+	{
+		auto init = *(toTrack.begin());
+		toTrack.pop_front();
+		auto trackCandidate = findAround(init, toTrack);
 
-      if (trackCandidate.size() < s_trackSize) continue;
+		if (trackCandidate.size() < s_trackSize) continue;
 
-      std::array<int, 4> clusters {};
+		std::array<int, 4> clusters {};
 
-      std::vector<std::pair<double, double>> XZ;
-      std::vector<std::pair<double, double>> YZ;
+		std::vector<std::pair<double, double>> XZ;
+		std::vector<std::pair<double, double>> YZ;
 
-      for (const auto& cluster : trackCandidate) {
-        clusters[cluster.layer]++;
+		for (const auto& cluster : trackCandidate) 
+		{
+			clusters[cluster.layer]++;
 
-        XZ.emplace_back(cluster.x, cluster.z);
-        YZ.emplace_back(cluster.y, cluster.z);
-      }
+			XZ.emplace_back(cluster.x, cluster.z);
+			YZ.emplace_back(cluster.y, cluster.z);
+		}
 
-      const auto [x, xSlope] = linReg(XZ);
-      const auto [y, ySlope] = linReg(YZ);
-      const int station      = trackCandidate[0].station;
+		const auto [x, xSlope] = linReg(XZ);
+		const auto [y, ySlope] = linReg(YZ);
+		const int station      = trackCandidate[0].station;
 
-      m_tracks.emplace_back(x, y, station, clusters);
+		m_tracks.emplace_back(x, y, station, clusters);
     }
-  }
+}
 
-  std::pair<double, double> AFPFastReco::linReg(std::vector<std::pair<double, double>> YX) const {
+std::pair<double, double> AFPFastReco::linReg(std::vector<std::pair<double, double>> YX) const 
+{
     double meanx = 0;
     double meany = 0;
-    for (const auto& yx : YX) {
-      meany += yx.first;
-      meanx += yx.second;
+    for (const auto& yx : YX) 
+	{
+		meany += yx.first;
+		meanx += yx.second;
     }
 
-    meanx /= YX.size();
+	meanx /= YX.size();
     meany /= YX.size();
 
     double numerator   = 0;
     double denumerator = 0;
-    for (const auto& yx : YX) {
-      const double dy = yx.first - meany;
-      const double dx = yx.second - meanx;
-      numerator += dx * dy;
-      denumerator += dx * dx;
-    }
-
-    const double slope    = numerator / denumerator;
-    const double position = meany - slope * meanx;
-
-    return {position, slope};
-  }
-
-  bool AFPFastReco::areNeighbours(const xAOD::AFPSiHit* lhs, const xAOD::AFPSiHit* rhs) const {
-    if (lhs->stationID() != rhs->stationID()) return false;
-    if (lhs->pixelLayerID() != rhs->pixelLayerID()) return false;
-    if (lhs->pixelColIDChip() != rhs->pixelColIDChip()) return false;
-    if (abs(lhs->pixelRowIDChip() - rhs->pixelRowIDChip()) != 1) return false;
-
-    return true;
-  }
-
-  bool AFPFastReco::areNeighbours(const AFPCluster& lhs, const AFPCluster& rhs) const {
-    if (lhs.station != rhs.station) return false;
-
-    const float dx = lhs.x - rhs.x;
-    const float dy = lhs.y - rhs.y;
-    if (dx * dx + dy * dy > s_clusterDistance) return false;
-
-    return true;
-  }
+    for (const auto& yx : YX) 
+	{
+		const double dy = yx.first - meany;
+		const double dx = yx.second - meanx;
+		numerator += dx * dy;
+		denumerator += dx * dx;
+	}
+
+	const double slope    = numerator / denumerator;
+	const double position = meany - slope * meanx;
+
+	return {position, slope};
+}
+
+bool AFPFastReco::areNeighbours(const xAOD::AFPSiHit* lhs, const xAOD::AFPSiHit* rhs) const 
+{
+	if (lhs->stationID() != rhs->stationID()) return false;
+	if (lhs->pixelLayerID() != rhs->pixelLayerID()) return false;
+	if (lhs->pixelColIDChip() != rhs->pixelColIDChip()) return false;
+	if (abs(lhs->pixelRowIDChip() - rhs->pixelRowIDChip()) != 1) return false;
+
+	return true;
+}
+
+bool AFPFastReco::areNeighbours(const AFPCluster& lhs, const AFPCluster& rhs) const 
+{
+	if (lhs.station != rhs.station) return false;
+
+	const float dx = lhs.x - rhs.x;
+	const float dy = lhs.y - rhs.y;
+	if (dx * dx + dy * dy > s_clusterDistance) return false;
+
+	return true;
+}
 
 }  // namespace AFPMon
 
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
index 280dd3b541b1dc72922740ff68d455c7057cb196..f2a9bc75a9e567282a4b83f2cd07e7e571e43289 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx
@@ -10,16 +10,58 @@
 #include "Run3AFPMonitoring/AFPSiLayerAlgorithm.h"
 #include "StoreGate/ReadHandleKey.h"
 #include "xAODForward/AFPStationID.h"
+#include "EventInfo/EventID.h"
 
-#include <Run3AFPMonitoring/AFPFastReco.h>
 
+#include <vector>
+
+	std::vector<std::vector<std::vector<unsigned int>>> clusterCounter (1000, std::vector<std::vector<unsigned int>> (4, std::vector <unsigned int> (4)));
+	std::vector<std::vector<std::vector<unsigned int>>> clusterCounterFront (1000, std::vector<std::vector<unsigned int>> (4, std::vector <unsigned int> (4)));
+	std::vector<std::vector<std::vector<unsigned int>>> clusterCounterEnd (1000, std::vector<std::vector<unsigned int>> (4, std::vector <unsigned int> (4)));
+	std::vector<std::vector<std::vector<unsigned int>>> clusterCounterMiddle (1000, std::vector<std::vector<unsigned int>> (4, std::vector <unsigned int> (4)));
+
+	std::vector<std::vector<unsigned int>> clusterCounterStation(1000, std::vector<unsigned int>(4));
+	std::vector<std::vector<unsigned int>> clusterCounterStationFront(1000, std::vector<unsigned int>(4));
+	std::vector<std::vector<unsigned int>> clusterCounterStationEnd(1000, std::vector<unsigned int>(4));
+	std::vector<std::vector<unsigned int>> clusterCounterStationMiddle(1000, std::vector<unsigned int>(4));
+
+	int previouslb = 0;
+	int previouslbFront = 0;
+	int previouslbEnd = 0;
+	int previouslbMiddle = 0;
+	
+	int previouslbStation = 0;
+	int previouslbStationFront = 0;
+	int previouslbStationEnd = 0;
+	int previouslbStationMiddle = 0;
+
+	unsigned int counterForEvents = 0;
+	unsigned int counterForEventsFront = 0;
+	unsigned int counterForEventsEnd = 0;
+	unsigned int counterForEventsMiddle = 0;
+	
+	unsigned int counterForEventsStation = 0;
+	unsigned int counterForEventsStationFront = 0;
+	unsigned int counterForEventsStationEnd = 0;
+	unsigned int counterForEventsStationMiddle = 0;
+	
+	std::vector<int> frontBCIDsVector;
+	std::vector<int> middleBCIDsVector;
+	std::vector<int> endBCIDsVector;
+	
+	unsigned int efficiencyHistogramCounter=0;
+	
+	bool isInListVector(const int bcid, const std::vector<int>&arr)
+	{
+		return std::find_if(arr.begin(),arr.end(),[&bcid](const int& ele){return ele==bcid;})!= arr.end();
+	}
+	
 
 AFPSiLayerAlgorithm::AFPSiLayerAlgorithm( const std::string& name, ISvcLocator* pSvcLocator )
 :AthMonitorAlgorithm(name,pSvcLocator)
 , m_afpHitContainerKey("AFPSiHitContainer")
-
 {
-    declareProperty( "AFPSiHitContainer", m_afpHitContainerKey );
+	declareProperty("AFPSiHitContainer", m_afpHitContainerKey);
 }
 
 
@@ -27,80 +69,293 @@ AFPSiLayerAlgorithm::~AFPSiLayerAlgorithm() {}
 
 
 StatusCode AFPSiLayerAlgorithm::initialize() {
-    using namespace Monitored;
- 
-    m_HitmapGroups = buildToolMap<std::map<std::string,int>>(m_tools,"AFPSiLayerTool", m_stationnames, m_pixlayers);
-    m_TrackGroup = buildToolMap<int>(m_tools, "AFPSiLayerTool", m_stationnames);
-    // We must declare to the framework in initialize what SG objects we are going to use:
-    SG::ReadHandleKey<xAOD::AFPSiHitContainer> afpHitContainerKey("AFPSiHits");
-    ATH_CHECK(m_afpHitContainerKey.initialize());
-
-    return AthMonitorAlgorithm::initialize();
-}
 
+	using namespace Monitored;
+
+	m_StationPlaneGroup = buildToolMap<std::map<std::string,int>>(m_tools,"AFPSiLayerTool", m_stationnames, m_pixlayers);
+	m_StationGroup = buildToolMap<int>(m_tools, "AFPSiLayerTool", m_stationnames);
+
+
+	// We must declare to the framework in initialize what SG objects we are going to use:
+	SG::ReadHandleKey<xAOD::AFPSiHitContainer> afpHitContainerKey("AFPSiHits");
+	ATH_CHECK(m_afpHitContainerKey.initialize());
+	
+	ATH_MSG_INFO( "BunchCrossingKey initialization" );
+	ATH_CHECK(m_bunchCrossingKey.initialize());
+	ATH_MSG_INFO( "initialization completed" );
+	return AthMonitorAlgorithm::initialize();
+}
 
 StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const {
-    using namespace Monitored;
-
-    // Declare the quantities which should be monitored:
-    auto lb = Monitored::Scalar<int>("lb", 0); 
-    auto nSiHits = Monitored::Scalar<int>("nSiHits", 1);
-    auto pixelRowIDChip = Monitored::Scalar<int>("pixelRowIDChip", 0); 
-    auto pixelColIDChip = Monitored::Scalar<int>("pixelColIDChip", 0); 
-    auto timeOverThreshold = Monitored::Scalar<float>("timeOverThreshold", 0.0);
-    auto clusterX = Monitored::Scalar<float>("clusterX", 0.0);
-    auto clusterY = Monitored::Scalar<float>("clusterY", 0.0); 
-    auto trackX = Monitored::Scalar<float>("trackX", 0.0);
-    auto trackY = Monitored::Scalar<float>("trackY", 0.0);
-    
-    lb = GetEventInfo(ctx)->lumiBlock();
- 
-    SG::ReadHandle<xAOD::AFPSiHitContainer> afpHitContainer(m_afpHitContainerKey, ctx);
-    if(! afpHitContainer.isValid())
-    {
-	ATH_MSG_WARNING("evtStore() does not contain hits collection with name " << m_afpHitContainerKey);
+	using namespace Monitored;
+
+	// BCX handler
+	unsigned int temp = GetEventInfo(ctx)->bcid();
+	SG::ReadCondHandle<BunchCrossingCondData> bcidHdl(m_bunchCrossingKey,ctx);
+	if (!bcidHdl.isValid()) {
+		ATH_MSG_ERROR( "Unable to retrieve BunchCrossing conditions object" );
+	}
+	const BunchCrossingCondData* bcData{*bcidHdl};
+
+	// Classifying bunches by position in train (Front, Middle, End)
+	if(bcData->isFilled(temp))
+	{
+		if(!bcData->isFilled(temp-1))
+		{
+			frontBCIDsVector.push_back(temp);
+			++counterForEventsFront;
+			++counterForEventsStationFront;
+		}
+		else
+		{
+			if(bcData->isFilled(temp+1))
+			{
+				middleBCIDsVector.push_back(temp);
+				++counterForEventsMiddle;
+				++counterForEventsStationMiddle;
+			}
+			else
+			{
+				endBCIDsVector.push_back(temp);
+				++counterForEventsEnd;
+				++counterForEventsStationEnd;
+			}
+		}
+	}
+	
+	// Declare the quantities which should be monitored:
+	auto lb = Monitored::Scalar<int>("lb", 0);
+	auto muPerBCID = Monitored::Scalar<float>("muPerBCID", 0.0);
+	//auto run = Monitored::Scalar<int>("run",0);
+	auto weight = Monitored::Scalar<float>("weight", 1.0);
+
+	auto nSiHits = Monitored::Scalar<int>("nSiHits", 1);
+
+	auto pixelRowIDChip = Monitored::Scalar<int>("pixelRowIDChip", 0); 
+	auto pixelColIDChip = Monitored::Scalar<int>("pixelColIDChip", 0); 
+
+	auto timeOverThreshold = Monitored::Scalar<float>("timeOverThreshold", 0.0);
+
+	auto clusterX = Monitored::Scalar<float>("clusterX", 0.0);
+	auto clusterY = Monitored::Scalar<float>("clusterY", 0.0); 
+
+	auto trackX = Monitored::Scalar<float>("trackX", 0.0);
+	auto trackY = Monitored::Scalar<float>("trackY", 0.0);
+
+	auto layerEfficiency = Monitored::Scalar<float>("layerEfficiency", 0.0);
+	auto layerNumber = Monitored::Scalar<int>("layerNumber", 0);
+	
+	auto planeHits = Monitored::Scalar<int>("planeHits", 0);
+	auto planeHitsAll = Monitored::Scalar<int>("planeHitsAll", 0);
+	
+	
+	lb = GetEventInfo(ctx)->lumiBlock();
+	muPerBCID = lbAverageInteractionsPerCrossing(ctx);
+	//run = GetEventInfo(ctx)->runNumber();
+	fill("AFPSiLayerTool", lb, muPerBCID);
+	
+
+	++counterForEvents;
+	++counterForEventsStation;
+	
+	SG::ReadHandle<xAOD::AFPSiHitContainer> afpHitContainer(m_afpHitContainerKey, ctx);
+	if(! afpHitContainer.isValid())
+	{
+		ATH_MSG_WARNING("evtStore() does not contain hits collection with name " << m_afpHitContainerKey);
+		return StatusCode::SUCCESS;
+	}
+
+	ATH_CHECK( afpHitContainer.initialize() );
+
+	nSiHits = afpHitContainer->size();
+	fill("AFPSiLayerTool", lb, nSiHits);
+
+	for(const xAOD::AFPSiHit *hitsItr: *afpHitContainer)
+	{
+		lb = GetEventInfo(ctx)->lumiBlock();
+		pixelRowIDChip = hitsItr->pixelRowIDChip();
+		pixelColIDChip = hitsItr->pixelColIDChip();
+		timeOverThreshold = hitsItr->timeOverThreshold();
+		
+		if (hitsItr->stationID()<4 && hitsItr->stationID()>=0 && hitsItr->pixelLayerID()<4 && hitsItr->pixelLayerID()>=0) 
+		{
+			fill(m_tools[m_StationPlaneGroup.at(m_stationnames.at(hitsItr->stationID())).at(m_pixlayers.at(hitsItr->pixelLayerID()))], pixelRowIDChip, pixelColIDChip);
+			fill(m_tools[m_StationPlaneGroup.at(m_stationnames.at(hitsItr->stationID())).at(m_pixlayers.at(hitsItr->pixelLayerID()))], pixelRowIDChip);
+			fill(m_tools[m_StationPlaneGroup.at(m_stationnames.at(hitsItr->stationID())).at(m_pixlayers.at(hitsItr->pixelLayerID()))], pixelColIDChip);
+			fill(m_tools[m_StationPlaneGroup.at(m_stationnames.at(hitsItr->stationID())).at(m_pixlayers.at(hitsItr->pixelLayerID()))], timeOverThreshold);
+			
+			planeHits = hitsItr->pixelLayerID();
+			fill(m_tools[m_StationGroup.at(m_stationnames.at(hitsItr->stationID()))], planeHits);
+			planeHitsAll = (hitsItr->stationID())*4+hitsItr->pixelLayerID();
+			fill("AFPSiLayerTool", planeHitsAll);
+			
+		}
+		else ATH_MSG_WARNING("Unrecognised station index: " << hitsItr->stationID());
+	}
+	
+	// Filling of cluster and track 2D histograms
+	AFPMon::AFPFastReco fast(afpHitContainer.get());
+	fast.reco();
+
+	// Track histograms:
+	for (const auto& track : fast.tracks()) 
+	{
+		trackX = track.x;
+		trackY = track.y;
+		fill(m_tools[m_StationGroup.at(m_stationnames.at(track.station))], trackY, trackX);
+	}
+
+	// Cluster histograms 
+	for(const auto& cluster : fast.clusters()) 
+	{
+		clusterX = cluster.x;
+		clusterY = cluster.y;
+		fill(m_tools[m_StationPlaneGroup.at(m_stationnames.at(cluster.station)).at(m_pixlayers.at(cluster.layer))], clusterY, clusterX);
+	}
+	
+	// Synch histograms:
+	lb = GetEventInfo(ctx)->lumiBlock();
+	
+	fillSynchHistogramsStation(lb, previouslbStation, clusterCounterStation, counterForEventsStation, muPerBCID, 'S', fast);
+	fillSynchHistogramsPlane(lb, previouslb, clusterCounter, counterForEvents, muPerBCID, 'P', fast);
+	
+	if (isInListVector(GetEventInfo(ctx)->bcid(), frontBCIDsVector))
+	{
+		fillSynchHistogramsStation(lb, previouslbStationFront, clusterCounterStationFront, counterForEventsStationFront, muPerBCID, 'F', fast);
+		fillSynchHistogramsPlane(lb, previouslbFront, clusterCounterFront, counterForEventsFront, muPerBCID, 'F', fast);
+	}
+	else if (isInListVector(GetEventInfo(ctx)->bcid(), middleBCIDsVector))
+	{
+		fillSynchHistogramsStation(lb, previouslbStationMiddle, clusterCounterStationMiddle, counterForEventsStationMiddle, muPerBCID, 'M', fast);
+		fillSynchHistogramsPlane(lb, previouslbMiddle, clusterCounterMiddle, counterForEventsMiddle, muPerBCID, 'M', fast);
+	}
+	else if (isInListVector(GetEventInfo(ctx)->bcid(), endBCIDsVector))
+	{
+		fillSynchHistogramsStation(lb, previouslbStationEnd, clusterCounterStationEnd, counterForEventsStationEnd, muPerBCID, 'E', fast);
+		fillSynchHistogramsPlane(lb, previouslbEnd, clusterCounterEnd, counterForEventsEnd, muPerBCID, 'E', fast);
+	}
+
 	return StatusCode::SUCCESS;
-    }
-
-    ATH_CHECK( afpHitContainer.initialize() );
-
-    nSiHits = afpHitContainer->size();
-    fill("AFPSiLayerTool", lb, nSiHits);    
-
-    for(const xAOD::AFPSiHit *hitsItr: *afpHitContainer)
-    {
-      pixelRowIDChip = hitsItr->pixelRowIDChip();
-      pixelColIDChip = hitsItr->pixelColIDChip();
-      timeOverThreshold = hitsItr->timeOverThreshold();
-	
-      if (hitsItr->stationID()<4 && hitsItr->stationID()>=0 && hitsItr->pixelLayerID()<4 && hitsItr->pixelLayerID()>=0) 
-      {
-        fill(m_tools[m_HitmapGroups.at(m_stationnames.at(hitsItr->stationID())).at(m_pixlayers.at(hitsItr->pixelLayerID()))], pixelRowIDChip, pixelColIDChip);
-	fill(m_tools[m_HitmapGroups.at(m_stationnames.at(hitsItr->stationID())).at(m_pixlayers.at(hitsItr->pixelLayerID()))], pixelRowIDChip);
-	fill(m_tools[m_HitmapGroups.at(m_stationnames.at(hitsItr->stationID())).at(m_pixlayers.at(hitsItr->pixelLayerID()))], pixelColIDChip);
-	fill(m_tools[m_HitmapGroups.at(m_stationnames.at(hitsItr->stationID())).at(m_pixlayers.at(hitsItr->pixelLayerID()))], timeOverThreshold);
-	
-      }
-	else ATH_MSG_WARNING("Unrecognised station index: " << hitsItr->stationID());
-      }
-
-    AFPMon::AFPFastReco fast(afpHitContainer.get());
-    fast.reco();
-
-    for (const auto& cluster : fast.clusters()) {
-      clusterX = cluster.x;
-      clusterY = cluster.y;
-      fill(m_tools[m_HitmapGroups.at(m_stationnames.at(cluster.station)).at(m_pixlayers.at(cluster.layer))], clusterX, clusterY);
-    }
-
-    for (const auto& track : fast.tracks()) {
-      trackX = track.x;
-      trackY = track.y;
-      fill(m_tools[m_TrackGroup.at(m_stationnames.at(track.station))], trackX, trackY);
-    }
- 
-
-    return StatusCode::SUCCESS;
+} // end of fillHistograms
+
+void AFPSiLayerAlgorithm::fillSynchHistogramsStation(Monitored::Scalar<int> &lb, int &previouslbStationA, std::vector<std::vector<unsigned int>> &clusterCounterStationA, unsigned int &counterForEventsStationA, float &muPerBCID, char histogramType, AFPMon::AFPFastReco& fast) const
+{
+	float clustersPerStationFloat = 0;
+	for(const auto& cluster : fast.clusters()) 
+	{
+		if(lb > previouslbStationA && previouslbStationA != 0)
+		{
+			for(int i = 0; i < 4; i++)
+			{
+				clustersPerStationFloat = clusterCounterStationA[previouslbStationA][i];
+				clusterCounterStationA[previouslbStationA][i] = 0;
+				if(muPerBCID != 0 && clustersPerStationFloat!=0)
+				{
+					clustersPerStationFloat = clustersPerStationFloat/(muPerBCID*counterForEventsStationA*4);
+				}
+				else{clustersPerStationFloat = -0.1;}
+	
+				if(histogramType == 'S')
+				{
+					auto clustersPerStation = Monitored::Scalar<float>("clustersPerStation", 0.0);
+					clustersPerStation = clustersPerStationFloat;
+					fill(m_tools[m_StationGroup.at(m_stationnames.at(i))], lb, clustersPerStation);
+				}
+				else if (histogramType == 'F')
+				{
+					auto clustersPerStationFront = Monitored::Scalar<float>("clustersPerStationFront", 0.0);
+					clustersPerStationFront = clustersPerStationFloat;
+					fill(m_tools[m_StationGroup.at(m_stationnames.at(i))], lb, clustersPerStationFront);
+				}
+				else if (histogramType == 'M')
+				{
+					auto clustersPerStationMiddle = Monitored::Scalar<float>("clustersPerStationMiddle", 0.0);
+					clustersPerStationMiddle = clustersPerStationFloat;
+					fill(m_tools[m_StationGroup.at(m_stationnames.at(i))], lb, clustersPerStationMiddle);
+				}
+				else if (histogramType == 'E')
+				{
+					auto clustersPerStationEnd = Monitored::Scalar<float>("clustersPerStationEnd", 0.0);
+					clustersPerStationEnd = clustersPerStationFloat;
+					fill(m_tools[m_StationGroup.at(m_stationnames.at(i))], lb, clustersPerStationEnd);
+				}
+			}
+			previouslbStationA=lb;
+			++clusterCounterStationA[lb][cluster.station];
+			counterForEventsStationA=1;
+		}
+		else if (clusterCounterStationA[lb][cluster.station] == 0)
+		{
+			++clusterCounterStationA[lb][cluster.station];
+			previouslbStationA = lb;
+		}
+		else if (lb==previouslbStationA)
+		{++clusterCounterStationA[lb][cluster.station];}
+	}
+}
+
+void AFPSiLayerAlgorithm::fillSynchHistogramsPlane(Monitored::Scalar<int> &lb, int &previouslbPlane, std::vector<std::vector<std::vector<unsigned int>>> &clusterCounterPlane, unsigned int &counterForEventsPlane, float &muPerBCID, char histogramType, AFPMon::AFPFastReco& fast) const
+{
+	float clustersPerPlaneFloat = 0;
+	for(const auto& cluster : fast.clusters()) 
+	{
+		if(lb > previouslbPlane && previouslbPlane != 0)
+		{
+			for(int i=0; i<4; i++)
+			{
+				for(int j=0; j<4; j++)
+				{
+					clustersPerPlaneFloat = clusterCounterPlane[previouslbPlane][i][j];
+					clusterCounterPlane[previouslbPlane][i][j] = 0;
+					if(muPerBCID != 0 && clustersPerPlaneFloat != 0)
+					{
+						clustersPerPlaneFloat = clustersPerPlaneFloat/(muPerBCID*counterForEventsPlane);
+					}
+					else
+					{
+						clustersPerPlaneFloat = -0.1;
+					}
+				
+					if(histogramType == 'P')
+					{
+						auto clustersPerPlane = Monitored::Scalar<float>("clustersPerPlane", 0.0);
+						clustersPerPlane = clustersPerPlaneFloat;
+						fill(m_tools[m_StationPlaneGroup.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlane);
+					}
+					else if(histogramType == 'F')
+					{
+						auto clustersPerPlaneFront = Monitored::Scalar<float>("clustersPerPlaneFront", 0.0);
+						clustersPerPlaneFront = clustersPerPlaneFloat;
+						fill(m_tools[m_StationPlaneGroup.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlaneFront);
+					}
+					else if(histogramType == 'M')
+					{
+						auto clustersPerPlaneMiddle = Monitored::Scalar<float>("clustersPerPlaneMiddle", 0.0);
+						clustersPerPlaneMiddle = clustersPerPlaneFloat;
+						fill(m_tools[m_StationPlaneGroup.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlaneMiddle);
+					}
+					else if(histogramType == 'E')
+					{
+						auto clustersPerPlaneEnd = Monitored::Scalar<float>("clustersPerPlaneEnd", 0.0);
+						clustersPerPlaneEnd = clustersPerPlaneFloat;
+						fill(m_tools[m_StationPlaneGroup.at(m_stationnames.at(i)).at(m_pixlayers.at(j))], lb, clustersPerPlaneEnd);
+					}
+				}
+			}
+			previouslbPlane = lb;
+			++clusterCounterPlane[lb][cluster.station][cluster.layer];
+			counterForEventsPlane=1;
+		}
+		// First time in lumiblock (in plane)
+		else if(clusterCounterPlane[lb][cluster.station][cluster.layer] == 0) 
+		{
+			++clusterCounterPlane[lb][cluster.station][cluster.layer];
+			previouslbPlane = lb;
+		}	
+		// Lumiblock is same, so proceed
+		else if(lb==previouslbPlane)	// Same lumiblock
+		{++clusterCounterPlane[lb][cluster.station][cluster.layer];}
+	}
 }
 
 
diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
index 9d8fb4668222d3e53e75a8f7495856077b429265..8bf07a93bb176afd6a691710fd97f86cae0d7d52 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx
@@ -17,7 +17,7 @@ AFPToFAlgorithm::AFPToFAlgorithm( const std::string& name, ISvcLocator* pSvcLoca
 , m_afpToFHitContainerKey("AFPToFHitContainer")
 
 {
-    declareProperty( "AFPToFHitContainer", m_afpToFHitContainerKey );
+	declareProperty( "AFPToFHitContainer", m_afpToFHitContainerKey );
 }
 
 
@@ -25,65 +25,80 @@ AFPToFAlgorithm::~AFPToFAlgorithm() {}
 
 
 StatusCode AFPToFAlgorithm::initialize() {
-    using namespace Monitored;
+	using namespace Monitored;
 
-    m_HitmapGroupsToF = buildToolMap<int>(m_tools,"AFPToFTool", m_stationNamesToF);
+	m_StationNamesGroup = buildToolMap<int>(m_tools,"AFPToFTool", m_stationNamesToF);
+	m_TrainsToFGroup = buildToolMap<int>(m_tools, "AFPToFTool", m_trainsToF);
 
-    // We must declare to the framework in initialize what SG objects we are going to use
-    SG::ReadHandleKey<xAOD::AFPToFHitContainer> afpToFHitContainerKey("AFPToFHits");
-    ATH_CHECK(m_afpToFHitContainerKey.initialize());
-    
-    return AthMonitorAlgorithm::initialize();
+	// We must declare to the framework in initialize what SG objects we are going to use
+	SG::ReadHandleKey<xAOD::AFPToFHitContainer> afpToFHitContainerKey("AFPToFHits");
+	ATH_CHECK(m_afpToFHitContainerKey.initialize());
+
+	return AthMonitorAlgorithm::initialize();
 }
 
 
 StatusCode AFPToFAlgorithm::fillHistograms( const EventContext& ctx ) const {
-    using namespace Monitored;
-
-    // Declare the quantities which should be monitored
-    auto lb = Monitored::Scalar<int>("lb", 0);
-    auto nTofHits = Monitored::Scalar<int>("nTofHits", 1);
-    auto numberOfHit_S0 = Monitored::Scalar<int>("numberOfHit_S0", 0); 
-    auto numberOfHit_S3 = Monitored::Scalar<int>("numberOfHit_S3", 0);
-    auto trainID = Monitored::Scalar<int>("trainID", 0); 
-    auto barInTrainID = Monitored::Scalar<int>("barInTrainID", 0); 
+	using namespace Monitored;
+
+	// Declare the quantities which should be monitored
+	auto lb = Monitored::Scalar<int>("lb", 0);
+	auto nTofHits = Monitored::Scalar<int>("nTofHits", 1);
+	auto numberOfHit_S0 = Monitored::Scalar<int>("numberOfHit_S0", 0); 
+	auto numberOfHit_S3 = Monitored::Scalar<int>("numberOfHit_S3", 0);
+	auto trainID = Monitored::Scalar<int>("trainID", 0); 
+	auto barInTrainID = Monitored::Scalar<int>("barInTrainID", 0); 
+	auto barInTrainAllA = Monitored::Scalar<int>("barInTrainAllA", 0);
+	auto barInTrainIDA = Monitored::Scalar<int>("barInTrainIDA", 0); 
+	auto barInTrainAllC = Monitored::Scalar<int>("barInTrainAllC", 0);
+	auto barInTrainIDC = Monitored::Scalar<int>("barInTrainIDC", 0); 
     
-    lb = GetEventInfo(ctx)->lumiBlock();
+	lb = GetEventInfo(ctx)->lumiBlock();
  
-    SG::ReadHandle<xAOD::AFPToFHitContainer> afpToFHitContainer(m_afpToFHitContainerKey, ctx);
-    if(! afpToFHitContainer.isValid())
-    {
-	ATH_MSG_WARNING("evtStore() does not contain hits collection with name " << m_afpToFHitContainerKey);
-	return StatusCode::SUCCESS;
-    }
-
-    ATH_CHECK( afpToFHitContainer.initialize() );
-
-    nTofHits = afpToFHitContainer->size();
-    fill("AFPToFTool", lb, nTofHits);
+	SG::ReadHandle<xAOD::AFPToFHitContainer> afpToFHitContainer(m_afpToFHitContainerKey, ctx);
+	if(! afpToFHitContainer.isValid())
+	{
+		ATH_MSG_WARNING("evtStore() does not contain hits collection with name " << m_afpToFHitContainerKey);
+		return StatusCode::SUCCESS;
+	}
 
+	ATH_CHECK( afpToFHitContainer.initialize() );
 
-    for(const xAOD::AFPToFHit *hitsItr: *afpToFHitContainer)
-    {
-	trainID = hitsItr->trainID();
-        barInTrainID = hitsItr->barInTrainID();
+	nTofHits = afpToFHitContainer->size();
+	fill("AFPToFTool", lb, nTofHits);
 
-	if(hitsItr->isSideA())
-	{
-	    numberOfHit_S0 = hitsItr->trainID();
-            fill("AFPToFTool", numberOfHit_S0);
-	}
-	else if(hitsItr->isSideC())
+	for(const xAOD::AFPToFHit *hitsItr: *afpToFHitContainer)
 	{
-	    numberOfHit_S3 = hitsItr->trainID();
-            fill("AFPToFTool", numberOfHit_S3);
+		trainID = hitsItr->trainID();
+		barInTrainID = hitsItr->barInTrainID();
+
+		if(hitsItr->isSideA())
+		{
+			numberOfHit_S0 = hitsItr->trainID();
+			fill("AFPToFTool", numberOfHit_S0);
+			
+			barInTrainIDA = hitsItr->barInTrainID();
+			fill(m_tools[m_TrainsToFGroup.at(m_trainsToF.at(hitsItr->trainID()))], barInTrainIDA);
+			barInTrainAllA = (hitsItr->trainID()*4)+barInTrainIDA;
+			fill("AFPToFTool", barInTrainAllA);
+		}
+		else if(hitsItr->isSideC())
+		{
+			numberOfHit_S3 = hitsItr->trainID();
+			fill("AFPToFTool", numberOfHit_S3);
+			
+			barInTrainIDC = hitsItr->barInTrainID();
+			fill(m_tools[m_TrainsToFGroup.at(m_trainsToF.at(hitsItr->trainID()))], barInTrainIDC);
+			barInTrainAllC = (hitsItr->trainID()*4)+barInTrainIDC;
+			fill("AFPToFTool", barInTrainAllC);
+		}
+
+		if (hitsItr->stationID() == 0 || hitsItr->stationID() == 3)
+		{
+			fill(m_tools[m_StationNamesGroup.at(m_stationNamesToF.at(hitsItr->stationID()))], barInTrainID, trainID);
+		}
 	}
 
-	if (hitsItr->stationID() == 0 || hitsItr->stationID() == 3)
-	    fill(m_tools[m_HitmapGroupsToF.at(m_stationNamesToF.at(hitsItr->stationID()))], trainID, barInTrainID);
-	
-    }
-
-    return StatusCode::SUCCESS;
+	return StatusCode::SUCCESS;
 }
 
diff --git a/Generators/EvgenJobTransforms/test/test_gen_pythia8_minbias.sh b/Generators/EvgenJobTransforms/test/test_gen_pythia8_minbias.sh
index cb25c5ba70abd63869856aeb788cab1f04fc834c..2c28dbba22eb1110407a9c00942c723a1e03759c 100755
--- a/Generators/EvgenJobTransforms/test/test_gen_pythia8_minbias.sh
+++ b/Generators/EvgenJobTransforms/test/test_gen_pythia8_minbias.sh
@@ -7,7 +7,7 @@
 
 ## Any arguments are considered overrides, and will be added at the end
 export TRF_ECHO=True;
-Gen_tf.py --ecmEnergy=13000 --jobConfig=421113 --maxEvents=10 \
+Gen_tf.py --ecmEnergy=13000 --jobConfig=421113 --maxEvents=100 \
     --outputEVNTFile=test_minbias_inelastic.EVNT.pool.root \
 
 echo "art-result: $? generate"
diff --git a/Generators/GeneratorFilters/share/common/BSignalFilter.py b/Generators/GeneratorFilters/share/common/BSignalFilter.py
new file mode 100644
index 0000000000000000000000000000000000000000..4fc335b8a88ea0748e503a9b52858c5dc78a7dda
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/BSignalFilter.py
@@ -0,0 +1,15 @@
+## Example configuration for MultiLeptonFilter setting up defaults
+
+if not hasattr( filtSeq, "BSignalFilter" ):
+    from GeneratorFilters.GeneratorFiltersConf import BSignalFilter
+    filtSeq += BSignalFilter()
+    pass
+
+"""
+BSignalFilter.LVL1MuonCutOn = True
+BSignalFilter.LVL2MuonCutOn = True
+BSignalFilter.LVL1MuonCutPT = 3500
+BSignalFilter.LVL1MuonCutEta = 2.6
+BSignalFilter.LVL2MuonCutPT = 3500
+BSignalFilter.LVL2MuonCutEta = 2.6
+"""
diff --git a/Generators/GeneratorFilters/share/common/Base_Fragment.py b/Generators/GeneratorFilters/share/common/Base_Fragment.py
new file mode 100644
index 0000000000000000000000000000000000000000..acb690d89d7b6f0b6cd9f298cfbf4e6979a4caa9
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/Base_Fragment.py
@@ -0,0 +1,131 @@
+## Base config for Sherpa
+from Sherpa_i.Sherpa_iConf import Sherpa_i
+genSeq += Sherpa_i()
+evgenConfig.generators = ["Sherpa"]
+genSeq.Sherpa_i.PluginCode = ""
+
+## Tell Sherpa to read its run card sections from the jO
+## TODO: write out Run.dat from genSeq.Sherpa_i.RunCard and read from it
+## instead of the JO
+genSeq.Sherpa_i.Parameters += [ 'RUNDATA=%s' % runArgs.jobConfig[0] ]
+
+## Tell Sherpa to write logs into a separate file
+## (need for production, looping job detection, Wolfgang Ehrenfeld)
+genSeq.Sherpa_i.Parameters += [ 'LOG_FILE=sherpa.log' ]
+
+## General ATLAS parameters
+genSeq.Sherpa_i.Parameters += [
+    "BEAM_1=2212",
+    "BEAM_2=2212",
+    "MAX_PROPER_LIFETIME=10.0",
+    "HEPMC_TREE_LIKE=1",
+    "PRETTY_PRINT=Off",
+    ]
+
+## Cap event weights at |w|<10 in unweighted evgen; set H-event shower mode
+## in the soft region to avoid instable weights 
+genSeq.Sherpa_i.Parameters += [
+    "OVERWEIGHT_THRESHOLD=10",
+    "PP_HPSMODE=0"
+]
+
+## Enable scale variations by default
+genSeq.Sherpa_i.Parameters += [
+    "HEPMC_USE_NAMED_WEIGHTS=1",
+    "CSS_REWEIGHT=1",
+    "REWEIGHT_SPLITTING_PDF_SCALES=1",
+    "REWEIGHT_SPLITTING_ALPHAS_SCALES=1",
+    "CSS_REWEIGHT_SCALE_CUTOFF=5.0",
+    "HEPMC_INCLUDE_ME_ONLY_VARIATIONS=1",
+    "SCALE_VARIATIONS=0.25,0.25 0.25,1. 1.,0.25 1.,1. 1.,4. 4.,1. 4.,4.",
+]
+
+## Switch to EW_SCHEME=0 to be able to set PDG value of thetaW
+genSeq.Sherpa_i.Parameters += [ "EW_SCHEME=0" ]
+
+try:
+    USE_PDG_VALUES
+except NameError:
+    USE_PDG_VALUES = False
+## if USE_PDG_VALUES = True, load PDG value 
+## of sin2thetaW and particle masses/widths 
+## from parameter dictionary located in 
+## EvgenProdTools/python/offline_dict.py 
+## ToDo: Include partial widths for H/W/Z?
+recorded = []
+if USE_PDG_VALUES:
+    from EvgenProdTools.offline_dict import parameters
+    for k,v in parameters.items():
+        if k == 'particles':
+            for key,value in v.items():
+                if 5 < int(key) and int(key) < 26:
+                    ## This includes now the top quark, 
+                    ## the leptons and the bosons
+                    genSeq.Sherpa_i.Parameters += [ 
+                        'MASS['+key+']='+ value['mass'],
+                        'WIDTH['+key+']='+ value['width'],
+                    ]
+                    recorded.append(key)
+        elif k == 'EW_parameters':
+            for key,value in v.items():
+                if key[0] == 'SIN2THETAW':
+                    genSeq.Sherpa_i.Parameters += [
+                        str(key[0])+'='+str(value),
+                    ]
+                    recorded.append(str(key[0]))
+                    break
+
+# Fall-back to the MC15 default values if need be
+defaults = {
+    '6'  : [ "MASS[6]=172.5",    "WIDTH[6]=1.32"         ],
+    '15' : [ "MASS[15]=1.777",   "WIDTH[15]=2.26735e-12" ],
+    '23' : [ "MASS[23]=91.1876", "WIDTH[23]=2.4952"      ],
+    '24' : [ "MASS[24]=80.399",  "WIDTH[24]=2.085"       ],
+    'SIN2THETAW' : [ "SIN2THETAW=0.23113" ],
+}
+for key, value in defaults.items():
+  if key not in recorded:
+    genSeq.Sherpa_i.Parameters += value
+
+
+
+## set/add partial widths for H, W, Z to PDG values
+## cf. https://sherpa.hepforge.org/doc/SHERPA-MC-2.2.4.html#HDH_005fWIDTH
+genSeq.Sherpa_i.Parameters += [
+    "HDH_WIDTH[6,24,5]=1.32",    #updated to comply latest updated top results
+    "HDH_WIDTH[-6,-24,-5]=1.32",  #updated to comply latest updated top results
+    "HDH_WIDTH[25,5,-5]=2.35e-3",
+    "HDH_WIDTH[25,15,-15]=2.57e-4",
+    "HDH_WIDTH[25,13,-13]=8.91e-7",
+    "HDH_WIDTH[25,4,-4]=1.18e-4",
+    "HDH_WIDTH[25,3,-3]=1.00e-6",
+    "HDH_WIDTH[25,21,21]=3.49e-4",
+    "HDH_WIDTH[25,22,22]=9.28e-6",
+    "HDH_WIDTH[24,2,-1]=0.7041",
+    "HDH_WIDTH[24,4,-3]=0.7041",
+    "HDH_WIDTH[24,12,-11]=0.2256",
+    "HDH_WIDTH[24,14,-13]=0.2256",
+    "HDH_WIDTH[24,16,-15]=0.2256",
+    "HDH_WIDTH[-24,-2,1]=0.7041",
+    "HDH_WIDTH[-24,-4,3]=0.7041",
+    "HDH_WIDTH[-24,-12,11]=0.2256",
+    "HDH_WIDTH[-24,-14,13]=0.2256",
+    "HDH_WIDTH[-24,-16,15]=0.2256",
+    "HDH_WIDTH[23,1,-1]=0.3828",
+    "HDH_WIDTH[23,2,-2]=0.2980",
+    "HDH_WIDTH[23,3,-3]=0.3828",
+    "HDH_WIDTH[23,4,-4]=0.2980",
+    "HDH_WIDTH[23,5,-5]=0.3828",
+    "HDH_WIDTH[23,11,-11]=0.0840",
+    "HDH_WIDTH[23,12,-12]=0.1663",
+    "HDH_WIDTH[23,13,-13]=0.0840",
+    "HDH_WIDTH[23,14,-14]=0.1663",
+    "HDH_WIDTH[23,15,-15]=0.0840",
+    "HDH_WIDTH[23,16,-16]=0.1663",
+    ]
+
+## OpenLoops parameters
+genSeq.Sherpa_i.Parameters += [
+    "OL_PREFIX=/cvmfs/sft.cern.ch/lcg/releases/LCG_88/MCGenerators/openloops/2.0.0/x86_64-slc6-gcc62-opt",
+    "OL_PARAMETERS=preset=2 write_parameters=1",
+]
diff --git a/Generators/GeneratorFilters/share/common/BoostedHadTopAndTopPair.py b/Generators/GeneratorFilters/share/common/BoostedHadTopAndTopPair.py
new file mode 100644
index 0000000000000000000000000000000000000000..91cbf50c4c654d7adfcf3ae837a70ffa1870e00b
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/BoostedHadTopAndTopPair.py
@@ -0,0 +1,14 @@
+if not hasattr(filtSeq, "BoostedHadTopAndTopPair"):
+    from GeneratorFilters.GeneratorFiltersConf import BoostedHadTopAndTopPair
+    filtSeq += BoostedHadTopAndTopPair("BoostedHadTopAndTopPair")
+
+
+## Choose to cut on the pT of the top on the list for m_cutPtOf = 0,
+## or to cut on the pT of the top decay products (b, q, q'bar) on the list for m_cutPtOf = 1
+filtSeq.BoostedHadTopAndTopPair.cutPtOf    = 1
+
+## Default cut params (in MeV)
+filtSeq.BoostedHadTopAndTopPair.tHadPtMin    =       0.0 # if -1 : all decay modes, if >= 0 : at least 1 hadronic top
+filtSeq.BoostedHadTopAndTopPair.tHadPtMax    = 6000000.0
+filtSeq.BoostedHadTopAndTopPair.tPairPtMin   =       0.0
+filtSeq.BoostedHadTopAndTopPair.tPairPtMax   = 6000000.0
diff --git a/Generators/GeneratorFilters/share/common/ChargedTrackFilter.py b/Generators/GeneratorFilters/share/common/ChargedTrackFilter.py
new file mode 100644
index 0000000000000000000000000000000000000000..8cc52a4484bbfdd401ee0f662936895f972d4906
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/ChargedTrackFilter.py
@@ -0,0 +1,10 @@
+## Default truth ncharged filter setup
+      
+from GeneratorFilters.GeneratorFiltersConf import ChargedTracksFilter             
+if "ChargedTracksFilter" not in filtSeq:
+   filtSeq += ChargedTracksFilter()
+ 
+filtSeq.ChargedTracksFilter.Ptcut = 100.
+filtSeq.ChargedTracksFilter.Etacut = 2.5
+
+  
diff --git a/Generators/GeneratorFilters/share/common/DecaysFinalStateFilter.py b/Generators/GeneratorFilters/share/common/DecaysFinalStateFilter.py
new file mode 100644
index 0000000000000000000000000000000000000000..7462154db62844c388d787123d36aa5bfbe7b010
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/DecaysFinalStateFilter.py
@@ -0,0 +1,13 @@
+# Example JO to filter with DecaysFinalStateFilter
+
+if not hasattr( filtSeq, "DecaysFinalStateFilter" ):
+    from GeneratorFilters.GeneratorFiltersConf import DecaysFinalStateFilter
+    filtSeq += DecaysFinalStateFilter()
+    pass
+
+"""
+DecaysFinalStateFilter = filtSeq.DecaysFinalStateFilter
+DecaysFinalStateFilter.NQuarks = 2
+DecaysFinalStateFilter.MinNChargedLeptons = 2
+DecaysFinalStateFilter.PDGAllowedParents = [ 23, 24, -24 ]
+"""
diff --git a/Generators/GeneratorFilters/share/common/DiBJetFilter.py b/Generators/GeneratorFilters/share/common/DiBJetFilter.py
new file mode 100644
index 0000000000000000000000000000000000000000..bcb779399a98dd0e341e88f02b3a106854e4f533
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/DiBJetFilter.py
@@ -0,0 +1,24 @@
+## Example configuration for DiBJet filter setting up defaults                                                                                                                                   
+
+include("GeneratorFilters/AntiKt4TruthJets_pileup.py")
+include("GeneratorFilters/AntiKt6TruthJets_pileup.py")
+include("GeneratorFilters/JetFilter_Fragment.py")
+
+if not hasattr( filtSeq, "DiBjetFilter" ):
+    from GeneratorFilters.GeneratorFiltersConf import DiBjetFilter
+    filtSeq += DiBjetFilter()
+    pass
+
+"""
+DiBjetFilter = filtSeq.DiBjetFilter
+DiBjetFilter.LeadJetPtMin = 0
+DiBjetFilter.LeadJetPtMax = 50000
+DiBjetFilter.BottomPtMin = 5.0
+DiBjetFilter.BottomEtaMax = 3.0
+DiBjetFilter.JetPtMin = 15.0
+DiBjetFilter.JetEtaMax = 2.7
+DiBjetFilter.DeltaRFromTruth = 0.3
+DiBjetFilter.TruthContainerName = "AntiKt4TruthJets" 
+DiBjetFilter.LightJetSuppressionFactor = 10
+DiBjetFilter.AcceptSomeLightEvents = False
+"""
diff --git a/Generators/GeneratorFilters/share/common/DiLeptonMassFilter.py b/Generators/GeneratorFilters/share/common/DiLeptonMassFilter.py
new file mode 100644
index 0000000000000000000000000000000000000000..4378f11caab767c2c989ca79e75842a7bc1dcbde
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/DiLeptonMassFilter.py
@@ -0,0 +1,16 @@
+## Example configuration for DiLeptonMassFilter setting up defaults
+
+if not hasattr( filtSeq, "DiLeptonMassFilter" ):
+    from GeneratorFilters.GeneratorFiltersConf import DiLeptonMassFilter
+    filtSeq += DiLeptonMassFilter()
+    pass
+
+"""
+DiLeptonMassFilter = filtSeq.DiLeptonMassFilter
+DiLeptonMassFilter.MinPt = 3500.
+DiLeptonMassFilter.MaxEta = 3.0
+DiLeptonMassFilter.MinMass = 4000.
+DiLeptonMassFilter.MaxMass = 10000.
+DiLeptonMassFilter.AllowSameCharge = False
+"""
+ 
diff --git a/Generators/GeneratorFilters/share/common/DirectPhotonFilter.py b/Generators/GeneratorFilters/share/common/DirectPhotonFilter.py
new file mode 100644
index 0000000000000000000000000000000000000000..adbb662582dacf8084a85483581b842288f72fc0
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/DirectPhotonFilter.py
@@ -0,0 +1,29 @@
+## Example configuration for DirectPhotonFilter setting up defaults
+
+if not hasattr( filtSeq, "DirectPhotonFilter" ):
+    from GeneratorFilters.GeneratorFiltersConf import DirectPhotonFilter
+    filtSeq += DirectPhotonFilter()
+    pass
+
+"""
+DirectPhotonFilter = filtSeq.DirectPhotonFilter
+
+DirectPhotonFilter.NPhotons = 1
+
+# apply cut inclusively for any photon in the event (False) or 
+# ordered by pT for the given number of photons (True, default)
+DirectPhotonFilter.OrderPhotons = True
+
+# if OrderPhotons=True: can contain multiple values for leading, subleading, ...
+# if OrderPhotons=False: the first value will be used for the inclusive cut
+DirectPhotonFilter.Ptmin = [ 10000. ]
+
+# optional, unlimited by default
+DirectPhotonFilter.Ptmax = [ 100000000. ]
+
+# eta range
+DirectPhotonFilter.Etacut = 2.50
+
+# Accept also prompt photons from SUSY decays
+DirectPhotonFilter.AllowSUSYDecay = True
+"""
diff --git a/Generators/GeneratorFilters/share/common/EW_scheme_sinthetaW_mZ.py b/Generators/GeneratorFilters/share/common/EW_scheme_sinthetaW_mZ.py
new file mode 100644
index 0000000000000000000000000000000000000000..01379742979f04dfd1826f92f2179808e9e84932
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/EW_scheme_sinthetaW_mZ.py
@@ -0,0 +1,38 @@
+# Use EW scheme which allows specifying sinThetaW and mZ simultaneously at the expense of mW.
+# Three sub-options for specifying the QED coupling are introduced:
+#
+#    EW_SCHEME=20 for alpha(0), mZ, sinThetaW
+#    EW_SCHEME=21 for Gmu, mZ, sinThetaW
+#    EW_SCHEME=22 for alpha(mZ), mZ, sinThetaW
+
+genSeq.Sherpa_i.Parameters += [ "EW_SCHEME=22" ]
+
+try:
+    USE_PDG_VALUES
+except NameError:
+    USE_PDG_VALUES = False
+## if USE_PDG_VALUES = True, load PDG value of 
+## sin2thetaW from parameter dictionary located
+## in EvgenProdTools/python/offline_dict.py 
+if USE_PDG_VALUES:
+    from EvgenProdTools.offline_dict import parameters
+    for k,v in parameters.items():
+        if k == 'EW_parameters':
+            for key,value in v.items():
+                if key[0] == 'SIN2THETAW':
+                    genSeq.Sherpa_i.Parameters += [
+                        str(key[0])+'='+str(value),
+                    ]
+                    break
+            break
+if 'SIN2THETAW' not in genSeq.Sherpa_i.Parameters[-1]:
+    genSeq.Sherpa_i.Parameters += [ "SIN2THETAW=0.23113" ]
+
+
+## Overwrite OL_PREFIX to not use it from cvmfs (which doesn't have this scheme implemented yet)
+## Also adding OL_IGNORE_MODEL (default to SM) since the scheme names aren't synchronised yet
+genSeq.Sherpa_i.Parameters += [
+    "OL_PREFIX=./Process/OpenLoops",
+    "OL_PARAMETERS=ew_renorm_scheme 22 write_parameters 1",
+    "OL_IGNORE_MODEL=1",
+]
diff --git a/Generators/GeneratorFilters/share/common/FindJets.py b/Generators/GeneratorFilters/share/common/FindJets.py
new file mode 100644
index 0000000000000000000000000000000000000000..0c78dd232ae6914712050a1d8494e01b58b0d60a
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/FindJets.py
@@ -0,0 +1,35 @@
+from xAODTruthCnv.xAODTruthCnvConf import xAODMaker__xAODTruthCnvAlg
+if not hasattr(prefiltSeq, 'xAODCnv'):
+    prefiltSeq += xAODMaker__xAODTruthCnvAlg('xAODCnv',WriteTruthMetaData=False)
+prefiltSeq.xAODCnv.AODContainerName = 'GEN_EVENT'
+
+#CreateTruthJets(prefiltSeq,filtSeq,runArgs.ecmEnergy,0.6)
+
+# Turn off ghost association algorithms
+#include("GeneratorFilters/JetFilter_JZX.py")
+#from JetFilter_JZX import JZSlice
+
+#JZSlice(0,prefiltSeq,filtSeq,runArgs.ecmEnergy,0.6)
+
+# Min and max momenta for the slices
+minDict = {0:-1,1:20,2:60,3:160,4:400,5:800,6:1300,7:1800,8:2500,9:3200,10:3900,11:4600,12:5300}
+maxDict = {0:20,1:60,2:160,3:400,4:800,5:1300,6:1800,7:2500,8:3200,9:3900,10:4600,11:5300,12:7000}
+
+def CreateJets(prefiltSeq, jetR, mods=""):
+       include("GeneratorFilters/GenerateTruthJets.py")
+
+       PrepareTruthJetInputs(prefiltSeq)
+       ScheduleAntiKtTruthJets(jetradius=jetR,algseq=prefiltSeq,mods=mods)
+       jetcollname = 'AntiKt{0}{1}TruthJets'.format(int(jetR*10),mods)
+
+def AddJetsFilter(filtSeq,ecmEnergy, jetR, mods=""):       
+       include("GeneratorFilters/QCDJetFilter.py")
+#    from QCDJetFilter import AddJetFilter
+       AddJetFilter(filtSeq,ecmEnergy)
+       jetcollname = 'AntiKt{0}{1}TruthJets'.format(int(jetR*10),mods)
+       filtSeq.QCDTruthJetFilter.TruthJetContainer = jetcollname
+
+def JZSlice(x,filtSeq):
+    from AthenaCommon.SystemOfUnits import GeV
+    filtSeq.QCDTruthJetFilter.MinPt = minDict[x]*GeV
+    filtSeq.QCDTruthJetFilter.MaxPt = maxDict[x]*GeV
diff --git a/Generators/GeneratorFilters/share/common/FourLeptonInvMassFilter.py b/Generators/GeneratorFilters/share/common/FourLeptonInvMassFilter.py
new file mode 100644
index 0000000000000000000000000000000000000000..297926508c89355d32df07c423f3864c2c049d8c
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/FourLeptonInvMassFilter.py
@@ -0,0 +1,8 @@
+## Example configuration for FourLeptonMassFilter setting up defaults
+
+
+if not hasattr( filtSeq, "FourLeptonInvMassFilter" ):
+    from GeneratorFilters.GeneratorFiltersConf import FourLeptonInvMassFilter
+    filtSeq += FourLeptonInvMassFilter()
+    pass
+
diff --git a/Generators/GeneratorFilters/share/common/FourLeptonMassFilter.py b/Generators/GeneratorFilters/share/common/FourLeptonMassFilter.py
new file mode 100644
index 0000000000000000000000000000000000000000..6421dad991fec46e876d93656fb7c41caad21444
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/FourLeptonMassFilter.py
@@ -0,0 +1,20 @@
+## Example configuration for FourLeptonMassFilter setting up defaults
+
+
+if not hasattr( filtSeq, "FourLeptonMassFilter" ):
+    from GeneratorFilters.GeneratorFiltersConf import FourLeptonMassFilter
+    filtSeq += FourLeptonMassFilter()
+    pass
+
+## Setup Defaults as example
+"""
+FourLeptonMassFilter = filtSeq.FourLeptonMassFilter
+FourLeptonMassFilter.MinPt = 5000.
+FourLeptonMassFilter.MaxEta = 3.
+FourLeptonMassFilter.MinMass1 = 60000.
+FourLeptonMassFilter.MaxMass1 = 14000000.
+FourLeptonMassFilter.MinMass2 = 12000.
+FourLeptonMassFilter.MaxMass2 = 14000000.
+FourLeptonMassFilter.AllowElecMu = True
+FourLeptonMassFilter.AllowSameCharge = True
+"""
diff --git a/Generators/GeneratorFilters/share/common/Fusing_Direct.py b/Generators/GeneratorFilters/share/common/Fusing_Direct.py
new file mode 100644
index 0000000000000000000000000000000000000000..d88da593d53668ea809cdda59887da8d4122fb10
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/Fusing_Direct.py
@@ -0,0 +1,10 @@
+# CAUTION: when including this, you have to set the following process-dependent setting in your JO:
+# If two strong couplings are involved at Born level, `FUSING_DIRECT_FACTOR=1` (e.g. Zbb).
+# If there are four such couplings, `FUSING_DIRECT_FACTOR=2` (e.g. ttbb).
+
+# taken from Sherpa examples: Examples/V_plus_Bs/LHC_Fusing/
+
+genSeq.Sherpa_i.Parameters += [ "SHERPA_LDADD=SherpaFusing",
+                                "USERHOOK=Fusing_Direct",
+                                "CSS_SCALE_SCHEME=20",
+                                "CSS_EVOLUTION_SCHEME=30", ]
diff --git a/Generators/GeneratorFilters/share/common/Fusing_Fragmentation.py b/Generators/GeneratorFilters/share/common/Fusing_Fragmentation.py
new file mode 100644
index 0000000000000000000000000000000000000000..a3739a60ff02d0ef5b5ce2c70e59ba2e8d5298b1
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/Fusing_Fragmentation.py
@@ -0,0 +1,8 @@
+# taken from Sherpa examples: Examples/V_plus_Bs/LHC_Fusing/
+
+genSeq.Sherpa_i.Parameters += [ "SHERPA_LDADD=SherpaFusing",
+                                "USERHOOK=Fusing_Fragmentation",
+                                "CSS_SCALE_SCHEME=20",
+                                "CSS_EVOLUTION_SCHEME=30",
+                                "FUSING_FRAGMENTATION_STORE_AS_WEIGHT=1",
+]
diff --git a/Generators/GeneratorFilters/share/common/GenerateTruthJets.py b/Generators/GeneratorFilters/share/common/GenerateTruthJets.py
new file mode 100644
index 0000000000000000000000000000000000000000..4aa6de3cd9b94f7595fd4dc8aee1dcaaa9308bb1
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/GenerateTruthJets.py
@@ -0,0 +1,118 @@
+from AthenaCommon import Logging
+jetlog = Logging.logging.getLogger("GenerateTruthJets")
+
+# Attach jet algorithms
+def PrepareTruthJetInputs(algseq):
+    if hasattr( algseq, "JetTruthCopyAlg" ): 
+        "JetTruthCopyAlg already present, no need to add again"
+        return
+    from AthenaCommon.AppMgr import ToolSvc
+    from MCTruthClassifier import MCTruthClassifierConf
+    from ParticleJetTools import ParticleJetToolsConf
+    from JetRec import JetRecConf
+
+    ToolSvc += MCTruthClassifierConf.MCTruthClassifier("JetMCTruthClassifier",
+                                                       barcodeG4Shift=1000000) # or 200k? Doesn't matter anyway?
+                                                       #barcodeG4Shift=firstSimCreatedBarcode())
+
+    ToolSvc += ParticleJetToolsConf.CopyTruthJetParticles("truthpartcopy",
+                                                          OutputName="JetInputTruthParticles",
+                                                          MCTruthClassifier=ToolSvc.JetMCTruthClassifier,
+                                                          BarCodeFromMetadata=0)
+
+    ToolSvc += ParticleJetToolsConf.CopyTruthJetParticles("truthpartcopywz",
+                                                          OutputName="JetInputTruthParticlesNoWZ",
+                                                          MCTruthClassifier=ToolSvc.JetMCTruthClassifier,
+                                                          IncludePromptLeptons=False,
+                                                          #IncludePromptPhotons=False,
+                                                          BarCodeFromMetadata=0)
+
+    ToolSvc += ParticleJetToolsConf.CopyTruthPartons("truthpartonscopy",
+                                                     OutputName="TruthLabelPartons",
+                                                     PtMin=5000)
+
+    algseq += JetRecConf.JetAlgorithm("JetTruthCopyAlg", Tools=[ToolSvc.truthpartcopy,ToolSvc.truthpartcopywz,ToolSvc.truthpartonscopy])
+
+def ScheduleAntiKtTruthJets(jetradius,algseq,mods=""):
+    jetcollname = 'AntiKt{0}{1}TruthJets'.format(int(jetradius*10),mods)
+    if jetcollname in algseq: return
+    from AthenaCommon.AppMgr import ToolSvc
+    from JetRec import JetRecConf
+
+    if hasattr(algseq, 'JetAlg'+jetcollname):
+        jetlog.warning("Jet algorithm \"{0}\" already scheduled! Skipping...".format(jetcollname))
+        return
+
+    # Set up the PseudoJetGetter
+    pjget = None
+    if mods=="":
+        if "truthget" in ToolSvc:
+            pjget = ToolSvc.truthget
+        else:
+            pjget = JetRecConf.PseudoJetGetter("truthget",
+                                               Label = "Truth",
+                                               InputContainer = ToolSvc.truthpartcopy.OutputName,
+                                               OutputContainer = "PseudoJetTruth",
+                                               GhostScale = 0.0,
+                                               SkipNegativeEnergy = True
+                                               )
+    elif mods=="WZ":
+        if "truthwzget" in ToolSvc:
+            pjget = ToolSvc.truthwzget
+        else:
+            pjget = JetRecConf.PseudoJetGetter("truthwzget",
+                                               Label = "TruthWZ",
+                                               InputContainer = ToolSvc.truthpartcopywz.OutputName,
+                                               OutputContainer = "PseudoJetTruthWZ",
+                                               GhostScale = 0.0,
+                                               SkipNegativeEnergy = True,
+                                               )        
+    if pjget:
+        ToolSvc += pjget
+    else:
+        jetlog.error("Unsupported jet collection \"{0}\" requested!".format(jetcollname))
+
+    # Set up the jet builder (no area moments)
+    if not "jbld" in ToolSvc:
+        ToolSvc += JetRecConf.JetFromPseudojet("jbld")
+
+    # Set up the jet finder
+    finder = JetRecConf.JetFinder(jetcollname+"Finder",
+                                  JetAlgorithm = "AntiKt",
+                                  JetRadius = jetradius,
+                                  JetBuilder = ToolSvc.jbld,
+                                  GhostArea = 0.01,
+                                  PtMin = 5000
+                                  )
+    ToolSvc += finder
+
+    if "truthpartonget" in ToolSvc:
+        truthpartonget = ToolSvc.truthpartonget
+    else:
+        truthpartonget = JetRecConf.PseudoJetGetter("truthpartonget",
+                                                    Label = "GhostPartons",
+                                                    InputContainer = ToolSvc.truthpartonscopy.OutputName,
+                                                    OutputContainer = "PseudoJetGhostPartons",
+                                                    GhostScale = 1e-40,
+                                                    SkipNegativeEnergy = True,
+                                                    )
+        ToolSvc += truthpartonget
+
+
+    from ParticleJetTools import ParticleJetToolsConf
+    partontruthlabel = ParticleJetToolsConf.Analysis__JetPartonTruthLabel("partontruthlabel")
+    ToolSvc += partontruthlabel
+
+    #Now we setup a JetRecTool which will use the above JetFinder
+    jetrectool = JetRecConf.JetRecTool(jetcollname+"Rec",
+                                       JetFinder = finder,
+                                       PseudoJetGetters = [pjget,truthpartonget],
+                                       OutputContainer = jetcollname,
+                                       JetModifiers = [partontruthlabel]
+                                       )
+    ToolSvc += jetrectool
+
+    algseq += JetRecConf.JetAlgorithm(jetcollname+"Alg", Tools=[jetrectool])
+
+def ScheduleAntiKtTruthWZJets(jetradius,algseq):
+    ScheduleAntiKtTruthJets(jetradius,algseq,mods="WZ")
diff --git a/Generators/GeneratorFilters/share/common/HTFilter.py b/Generators/GeneratorFilters/share/common/HTFilter.py
new file mode 100644
index 0000000000000000000000000000000000000000..0ff5ecab542163f7bffcce4ac96a8a9f3a5725ac
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/HTFilter.py
@@ -0,0 +1,16 @@
+## HT filter setup for anti-kT R=0.4 truth jets
+#include("GeneratorFilters/AntiKt4TruthWZJets.py")
+include ("GeneratorFilters/FindJets.py")
+CreateJets(prefiltSeq, 0.4,"WZ")
+
+from GeneratorFilters.GeneratorFiltersConf import HTFilter
+if "HTFilter" not in filtSeq:
+    filtSeq += HTFilter()
+
+filtSeq.HTFilter.MinJetPt = 20.*GeV # Min pT to consider jet in HT
+filtSeq.HTFilter.MaxJetEta = 999. # Max eta to consider jet in HT
+filtSeq.HTFilter.MinHT = 200.*GeV # Min HT to keep event
+filtSeq.HTFilter.MaxHT = 1000.*GeV # Max HT to keep event
+filtSeq.HTFilter.TruthJetContainer = "AntiKt4WZTruthJets" # Which jets to use for HT
+filtSeq.HTFilter.UseNeutrinosFromWZTau = False # Include neutrinos from W/Z/tau in the HT
+filtSeq.HTFilter.UseLeptonsFromWZTau = True # Include e/mu from W/Z/tau in the HT
diff --git a/Generators/GeneratorFilters/share/common/HeavyFlavorHadronFilter.py b/Generators/GeneratorFilters/share/common/HeavyFlavorHadronFilter.py
new file mode 100644
index 0000000000000000000000000000000000000000..117eb72cc1536da44580288dc53d36a8444ed1e4
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/HeavyFlavorHadronFilter.py
@@ -0,0 +1,37 @@
+## Example configuration for HeavyFlavorHadronFilter setting up defaults
+
+include("GeneratorFilters/AntiKt4TruthJets_pileup.py")
+include("GeneratorFilters/AntiKt6TruthJets_pileup.py")
+include("GeneratorFilters/JetFilter_Fragment.py")
+
+if not hasattr( filtSeq, "HeavyFlavorHadronFilter" ):
+    from GeneratorFilters.GeneratorFiltersConf import HeavyFlavorHadronFilter
+    filtSeq += HeavyFlavorHadronFilter()
+    pass
+
+# Setup defaults as example
+"""
+HeavyFlavorHadronFilter = filtSeq.HeavyFlavorHadronFilter
+HeavyFlavorHadronFilter.CharmPtMin = 2.0 * Gaudi::Units::GeV
+HeavyFlavorHadronFilter.BottomPtMin = 5.0 * Gaudi::Units::GeV
+HeavyFlavorHadronFilter.CharmEtaMax = 3.0
+HeavyFlavorHadronFilter.BottomEtaMax = 3.0
+HeavyFlavorHadronFilter.cPtMin = 0.0 * Gaudi::Units::GeV
+HeavyFlavorHadronFilter.bPtMin = 0.0 * Gaudi::Units::GeV
+HeavyFlavorHadronFilter.cEtaMax = 5.0
+HeavyFlavorHadronFilter.bEtaMax = 5.0
+HeavyFlavorHadronFilter.JetPtMin = 20.0 * Gaudi::Units::GeV
+HeavyFlavorHadronFilter.JetEtaMax = 2.5
+HeavyFlavorHadronFilter.PDGPtMin = 2.0 * Gaudi::Units::GeV
+HeavyFlavorHadronFilter.PDGEtaMax = 2.5
+HeavyFlavorHadronFilter.PDGID = 0
+HeavyFlavorHadronFilter.PDGAntiParticleToo = True
+HeavyFlavorHadronFilter.RequestCharm = True
+HeavyFlavorHadronFilter.RequestBottom = True
+HeavyFlavorHadronFilter.Request_cQuark = True
+HeavyFlavorHadronFilter.Request_bQuark = True
+HeavyFlavorHadronFilter.RequestSpecificPDGID = False
+HeavyFlavorHadronFilter.RequireTruthJet = False
+HeavyFlavorHadronFilter.DeltaRFromTruth = 0.4
+HeavyFlavorHadronFilter.TruthContainerName = "AntiKt4TruthJets"
+"""
diff --git a/Generators/GeneratorFilters/share/common/JetFilter_JZX.py b/Generators/GeneratorFilters/share/common/JetFilter_JZX.py
new file mode 100644
index 0000000000000000000000000000000000000000..ee49f4ec0c9a707c0ec8a91f2aa7d441a69de576
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/JetFilter_JZX.py
@@ -0,0 +1,25 @@
+## Truth jet filter common config for all JZx and JZxW
+
+#from xAODTruthCnv.xAODTruthCnvConf import xAODMaker__xAODTruthCnvAlg
+#if not hasattr(prefiltSeq, 'xAODCnv'):
+#    prefiltSeq += xAODMaker__xAODTruthCnvAlg('xAODCnv',WriteTruthMetaData=False)
+#prefiltSeq.xAODCnv.AODContainerName = 'GEN_EVENT'
+
+# Min and max momenta for the slices
+minDict = {0:-1,1:20,2:60,3:160,4:400,5:800,6:1300,7:1800,8:2500,9:3200,10:3900,11:4600,12:5300}
+maxDict = {0:20,1:60,2:160,3:400,4:800,5:1300,6:1800,7:2500,8:3200,9:3900,10:4600,11:5300,12:7000}
+
+def JZSlice(x,filtSeq):
+#    include("GeneratorFilters/GenerateTruthJets.py")
+##    from GenerateTruthJets import PrepareTruthJetInputs, ScheduleAntiKtTruthJets
+#    PrepareTruthJetInputs(prefiltSeq)
+#    ScheduleAntiKtTruthJets(jetradius=jetR,algseq=prefiltSeq)
+
+#    include("GeneratorFilters/QCDJetFilter.py") 
+##    from QCDJetFilter import AddJetFilter
+#    AddJetFilter(filtSeq,ecmEnergy)
+    
+    from AthenaCommon.SystemOfUnits import GeV
+#    filtSeq.QCDTruthJetFilter.TruthJetContainer = "AntiKt6TruthJets"
+    filtSeq.QCDTruthJetFilter.MinPt = minDict[x]*GeV
+    filtSeq.QCDTruthJetFilter.MaxPt = maxDict[x]*GeV
diff --git a/Generators/GeneratorFilters/share/common/LeadingDiBjetFilter.py b/Generators/GeneratorFilters/share/common/LeadingDiBjetFilter.py
new file mode 100644
index 0000000000000000000000000000000000000000..acce303417bbd98ce1a85177f64ecc18454a1dc9
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/LeadingDiBjetFilter.py
@@ -0,0 +1,24 @@
+## Example configuration for LeadingDiBjetFilter setting up defaults
+
+include("GeneratorFilters/AntiKt4TruthJets_pileup.py")
+include("GeneratorFilters/AntiKt6TruthJets_pileup.py")
+include("GeneratorFilters/JetFilter_Fragment.py")
+
+if not hasattr( filtSeq, "LeadingDiBjetFilter" ):
+    from GeneratorFilters.GeneratorFiltersConf import LeadingDiBjetFilter
+    filtSeq += LeadingDiBjetFilter()
+    pass
+
+"""
+LeadingDiBjetFilter = filtSeq.LeadingDiBjetFilter
+LeadingDiBjetFilter.LeadJetPtMin = 0 * GeV 
+LeadingDiBjetFilter.LeadJetPtMax = 50000 *CLHEP::GeV
+LeadingDiBjetFilter.BottomPtMin = 5.0 *CLHEP::GeV
+LeadingDiBjetFilter.BottomEtaMax = 3.0
+LeadingDiBjetFilter.JetPtMin = 15.0 *CLHEP::GeV
+LeadingDiBjetFilter.JetEtaMax = 2.7
+LeadingDiBjetFilter.DeltaRFromTruth = 0.3
+LeadingDiBjetFilter.TruthContainerName = "AntiKt4TruthJets"
+LeadingDiBjetFilter.LightJetSuppressionFactor = 10
+LeadingDiBjetFilter.AcceptSomeLightEvents = False
+"""
diff --git a/Generators/GeneratorFilters/share/common/LeptonFilter.py b/Generators/GeneratorFilters/share/common/LeptonFilter.py
new file mode 100644
index 0000000000000000000000000000000000000000..33a3212806e4e5d9f9f83651cc82e9f2101d257d
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/LeptonFilter.py
@@ -0,0 +1,14 @@
+## Instantiate the lepton filter, including adding it to the stream 
+## Configuration of the filter cuts is left to the specific JO
+if not hasattr(filtSeq, "LeptonFilter"):
+    from GeneratorFilters.GeneratorFiltersConf import LeptonFilter
+    filtSeq += LeptonFilter()
+
+## Add this filter to the algs required to be successful for streaming
+#if "LeptonFilter" not in StreamEVGEN.RequireAlgs:
+#    StreamEVGEN.RequireAlgs += ["LeptonFilter"]
+
+## Default cut params
+filtSeq.LeptonFilter.Ptcut = 10000.
+filtSeq.LeptonFilter.Etacut = 2.8
+
diff --git a/Generators/GeneratorFilters/share/common/LeptonPairFilterExample.py b/Generators/GeneratorFilters/share/common/LeptonPairFilterExample.py
new file mode 100644
index 0000000000000000000000000000000000000000..e83128ee86bc775f77e93699f712811f4415fa68
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/LeptonPairFilterExample.py
@@ -0,0 +1,25 @@
+# Example of LeptonPairFilter configuration as used in MadGraphControl_SimplifiedModel_BB_tC1.py
+
+evgenLog.info('Using LeptonPairFilter accepting SS lepton pairs with massive parents')
+from GeneratorFilters.GeneratorFiltersConf import LeptonPairFilter
+filtSeq += LeptonPairFilter('SS3LFilter')
+myFilter = filtSeq.SS3LFilter
+myFilter.NLeptons_Min = 0
+myFilter.NLeptons_Max = -1
+myFilter.Ptcut = 10000
+myFilter.Etacut = 2.8
+myFilter.NSFOS_Min = -1
+myFilter.NSFOS_Max = -1
+myFilter.NOFOS_Min = -1
+myFilter.NOFOS_Max = -1
+myFilter.NSFSS_Min = -1
+myFilter.NSFSS_Max = -1
+myFilter.NOFSS_Min = -1
+myFilter.NOFSS_Max = -1
+myFilter.NPairSum_Max = -1
+myFilter.NPairSum_Min = 1
+myFilter.UseSFOSInSum = False
+myFilter.UseSFSSInSum = True
+myFilter.UseOFOSInSum = False
+myFilter.UseOFSSInSum = True
+myFilter.OnlyMassiveParents = True
diff --git a/Generators/GeneratorFilters/share/common/Lund_Hadronisation.py b/Generators/GeneratorFilters/share/common/Lund_Hadronisation.py
new file mode 100644
index 0000000000000000000000000000000000000000..00461907d6bdb8035c20e54c30e20b28807d5fa3
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/Lund_Hadronisation.py
@@ -0,0 +1,7 @@
+genSeq.Sherpa_i.Parameters += [
+  "FRAGMENTATION=Lund",
+  "DECAYMODEL=Lund",
+  "PARJ(21)=0.36",
+  "PARJ(41)=0.3",
+  "PARJ(42)=0.6"
+]
diff --git a/Generators/GeneratorFilters/share/common/MassRangeFilter.py b/Generators/GeneratorFilters/share/common/MassRangeFilter.py
new file mode 100644
index 0000000000000000000000000000000000000000..fe5353642dd3894540e62eb76751ab9c3005aace
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/MassRangeFilter.py
@@ -0,0 +1,19 @@
+## Example configuration for MassRangeFilter setting up defaults
+
+if not hasattr( filtSeq, "MassRangeFilter" ):
+    from GeneratorFilters.GeneratorFiltersConf import MassRangeFilter
+    filtSeq += MassRangeFilter()
+    pass
+
+"""
+MassRangeFilter = filtSeq.MassRangeFilter
+MassRangeFilter.PtCut = 10000.
+MassRangeFilter.PtCut2 = 10000.
+MassRangeFilter.EtaCut = 10.
+MassRangeFilter.EtaCut2 = 10.
+MassRangeFilter.InvMassMin = 0.
+MassRangeFilter.InvMassMax = 14000000.
+MassRangeFilter.PartId = 13
+MassRangeFilter.PartId2 = 13
+MassRangeFilter.PartStatus = 1
+"""
diff --git a/Generators/GeneratorFilters/share/common/MissingEtFilter.py b/Generators/GeneratorFilters/share/common/MissingEtFilter.py
new file mode 100644
index 0000000000000000000000000000000000000000..a65a40582d117bb7c01d1c88b74b957f13f24dd6
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/MissingEtFilter.py
@@ -0,0 +1,12 @@
+if not hasattr(filtSeq, "MissingEtFilter"):
+    from GeneratorFilters.GeneratorFiltersConf import MissingEtFilter
+    filtSeq += MissingEtFilter("MissingEtFilter")
+    
+if not hasattr(filtSeq, "MissingEtFilterUpperCut"):
+    filtSeq += MissingEtFilter("MissingEtFilterUpperCut")
+    
+filtSeq.MissingEtFilter.METCut = 60*GeV
+filtSeq.MissingEtFilterUpperCut.METCut = 100000*GeV
+
+
+filtSeq.Expression = "(MissingEtFilter and not MissingEtFilterUpperCut)"
diff --git a/Generators/GeneratorFilters/share/common/MultiElecMuTauFilter.py b/Generators/GeneratorFilters/share/common/MultiElecMuTauFilter.py
new file mode 100644
index 0000000000000000000000000000000000000000..42a7cea45754ccb2266389d6f3cad975df16c48a
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/MultiElecMuTauFilter.py
@@ -0,0 +1,18 @@
+##
+## Example configuration for MultiElecMuTauFilter setting up defaults
+##
+ 
+if not hasattr(filtSeq, "MultiElecMuTauFilter" ):
+    from GeneratorFilters.GeneratorFiltersConf import MultiElecMuTauFilter
+    filtSeq += MultiElecMuTauFilter()
+    pass
+
+# Setup defaults as example
+"""
+MultiElecMuTauFilter = filtSeq.MultiElecMuTauFilter
+MultiElecMuTauFilter.NLeptons  = 3
+MultiElecMuTauFilter.MaxEta = 10.0
+MultiElecMuTauFilter.MinPt = 5000.0
+MultiElecMuTauFilter.MinVisPtHadTau = 10000.0
+MultiElecMuTauFilter.IncludeHadTaus = True
+"""
diff --git a/Generators/GeneratorFilters/share/common/MultiLeptonFilter.py b/Generators/GeneratorFilters/share/common/MultiLeptonFilter.py
new file mode 100644
index 0000000000000000000000000000000000000000..61b52f64994ac372ff93608ebcb46283a4418bd2
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/MultiLeptonFilter.py
@@ -0,0 +1,13 @@
+## Example configuration for MultiLeptonFilter setting up defaults
+
+if not hasattr( filtSeq, "MultiLeptonFilter" ):
+    from GeneratorFilters.GeneratorFiltersConf import MultiLeptonFilter
+    filtSeq += MultiLeptonFilter()
+    pass
+
+"""
+MultiLeptonFilter = filtSeq.MultiLeptonFilter
+MultiLeptonFilter.Ptcut = 10000.
+MultiLeptonFilter.Etacut = 10.0
+MultiLeptonFilter.NLeptons = 4
+"""
diff --git a/Generators/GeneratorFilters/share/common/MultiMuonFilter.py b/Generators/GeneratorFilters/share/common/MultiMuonFilter.py
new file mode 100644
index 0000000000000000000000000000000000000000..2aa4b5d5da541a29c18cf75175f4a4620d62d683
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/MultiMuonFilter.py
@@ -0,0 +1,14 @@
+## Example configuration for MultiMuonFilter setting up defaults
+
+if not hasattr( filtSeq, "MultiMuonFilter" ):
+    from GeneratorFilters.GeneratorFiltersConf import MultiMuonFilter
+    filtSeq += MultiMuonFilter()
+    pass
+
+"""
+MultiMuonFilter = filtSeq.MultiMuonFilter
+MultiMuonFilter.Ptcut = 4000.
+MultiMuonFilter.Etacut = 2.7
+MultiMuonFilter.NMuons = 4
+"""
+ 
diff --git a/Generators/GeneratorFilters/share/common/MultiParticleFilter.py b/Generators/GeneratorFilters/share/common/MultiParticleFilter.py
new file mode 100644
index 0000000000000000000000000000000000000000..f2d67c0a3a446c694aaab0fe57759d212775ac94
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/MultiParticleFilter.py
@@ -0,0 +1,17 @@
+## Example configuration for MultiParticleFilter setting up defaults
+
+if not hasattr( filtSeq, "MultiParticleFilter" ):
+    from GeneratorFilters.GeneratorFiltersConf import MultiParticleFilter
+    filtSeq += MultiParticleFilter()
+    pass
+
+## Setup defaults as example
+"""
+MultiParticleFilter = filtSeq.MultiParticleFilter
+MultiParticleFilter.Np = 1
+MultiParticleFilter.ptMinParticle = 105000.
+MultiParticleFilter.etaRangeParticle = 4.9
+MultiParticleFilter.particlePDG = [11,-11,22]
+MultiParticleFilter.particleStatus = [1]
+"""
+
diff --git a/Generators/GeneratorFilters/share/common/NNPDF30NNLO.py b/Generators/GeneratorFilters/share/common/NNPDF30NNLO.py
new file mode 100644
index 0000000000000000000000000000000000000000..8ed2075b408a0b87842b2eebea0f8b681a42d955
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/NNPDF30NNLO.py
@@ -0,0 +1,8 @@
+evgenConfig.tune = "NNPDF3.0 NNLO"
+
+genSeq.Sherpa_i.Parameters += [
+    "PDF_LIBRARY=LHAPDFSherpa",
+    "USE_PDF_ALPHAS=1",
+    "PDF_SET=NNPDF30_nnlo_as_0118_hessian",
+    "PDF_VARIATIONS=NNPDF30_nnlo_as_0118_hessian[all] NNPDF30_nnlo_as_0117 NNPDF30_nnlo_as_0119 MMHT2014nnlo68cl CT14nnlo PDF4LHC15_nnlo_30_pdfas[all] NNPDF31_nnlo_as_0118_hessian",
+    ]
diff --git a/Generators/GeneratorFilters/share/common/NNPDF30NNLO_nf_4.py b/Generators/GeneratorFilters/share/common/NNPDF30NNLO_nf_4.py
new file mode 100644
index 0000000000000000000000000000000000000000..44bdff859c515566ef5608e4352175c764e830f0
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/NNPDF30NNLO_nf_4.py
@@ -0,0 +1,8 @@
+evgenConfig.tune = "NNPDF3.0 NNLO"
+
+genSeq.Sherpa_i.Parameters += [
+    "PDF_LIBRARY=LHAPDFSherpa",
+    "USE_PDF_ALPHAS=1",
+    "PDF_SET=NNPDF30_nnlo_as_0118_nf_4",
+    "PDF_VARIATIONS=NNPDF30_nnlo_as_0118_nf_4[all] NNPDF30_nnlo_as_0117_nf_4 NNPDF30_nnlo_as_0119_nf_4 MMHT2014nnlo68cl_nf4 CT14nnlo_NF4 PDF4LHC15_nlo_nf4_30[all]",
+    ]
diff --git a/Generators/GeneratorFilters/share/common/ParentChildwStatusFilter.py b/Generators/GeneratorFilters/share/common/ParentChildwStatusFilter.py
new file mode 100644
index 0000000000000000000000000000000000000000..ccdd94608b91ecf04d8f045b415e1aada5ae90f1
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/ParentChildwStatusFilter.py
@@ -0,0 +1,15 @@
+if not hasattr(filtSeq, "ParentChildwStatusFilter"):
+    from GeneratorFilters.GeneratorFiltersConf import ParentChildwStatusFilter
+    filtSeq += ParentChildwStatusFilter("ParentChildwStatusFilter")
+
+## Example usage for Z leptonic decay from Pythia8
+#filtSeq.ParentChildwStatusFilter.PDGParent  = [23]
+#filtSeq.ParentChildwStatusFilter.StatusParent = [22,52]
+#filtSeq.ParentChildwStatusFilter.PtMinParent =  -1e12
+#filtSeq.ParentChildwStatusFilter.PtMaxParent = 1e12
+#filtSeq.ParentChildwStatusFilter.EtaRangeParent = 1e12
+#filtSeq.ParentChildwStatusFilter.MassMinParent = -1e12
+#filtSeq.ParentChildwStatusFilter.MassMaxParent = 1e12
+#filtSeq.ParentChildwStatusFilter.PDGChild = [11,13,15]
+#filtSeq.ParentChildwStatusFilter.PtMinChild = -1e12
+#filtSeq.ParentChildwStatusFilter.EtaRangeChild = 1e12
diff --git a/Generators/GeneratorFilters/share/common/ParticleFilter.py b/Generators/GeneratorFilters/share/common/ParticleFilter.py
new file mode 100644
index 0000000000000000000000000000000000000000..a5eaeb003bc92662b5c32ba02362f455b1a79b49
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/ParticleFilter.py
@@ -0,0 +1,11 @@
+if not hasattr(filtSeq, "ParticleFilter"):
+    from GeneratorFilters.GeneratorFiltersConf import ParticleFilter
+    filtSeq += ParticleFilter("ParticleFilter")
+
+# Example usage of this filter
+#ParticleFilter = filtSeq.ParticleFilter
+#ParticleFilter.Ptcut = 0.0
+#ParticleFilter.Etacut = 10.0
+#ParticleFilter.PDG = 1000022
+#ParticleFilter.MinParts = 2
+#ParticleFilter.StatusReq = 11
diff --git a/Generators/GeneratorFilters/share/common/QCDJetFilter.py b/Generators/GeneratorFilters/share/common/QCDJetFilter.py
new file mode 100644
index 0000000000000000000000000000000000000000..9cd14f069cc6640389f4e0b79c3914deee2441cc
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/QCDJetFilter.py
@@ -0,0 +1,11 @@
+## Default truth jet filter setup
+## The specified truth jet container must exist
+
+def AddJetFilter(filtSeq,ecmEnergy):	
+    from GeneratorFilters.GeneratorFiltersConf import QCDTruthJetFilter
+    if "QCDTruthJetFilter" not in filtSeq:
+        from AthenaCommon.SystemOfUnits import GeV
+        filtSeq += QCDTruthJetFilter()
+        filtSeq.QCDTruthJetFilter.MaxPt = float(ecmEnergy)*GeV
+
+
diff --git a/Generators/GeneratorFilters/share/common/QCDTruthJetFilter.py b/Generators/GeneratorFilters/share/common/QCDTruthJetFilter.py
new file mode 100644
index 0000000000000000000000000000000000000000..ba32f597cba6f8313bd03462c8893abe61a85a39
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/QCDTruthJetFilter.py
@@ -0,0 +1,7 @@
+## Example configuration for QCDTruthJetFilter setting up defaults
+
+include("GeneratorFilters/AntiKt4TruthJets_pileup.py")
+include("GeneratorFilters/AntiKt6TruthJets_pileup.py")
+include("GeneratorFilters/JetFilter_Fragment.py")
+
+
diff --git a/Generators/GeneratorFilters/share/common/QCDTruthMultiJetFilter.py b/Generators/GeneratorFilters/share/common/QCDTruthMultiJetFilter.py
new file mode 100644
index 0000000000000000000000000000000000000000..e3404db150e9f940f3fedf20aad6e91891e74b1f
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/QCDTruthMultiJetFilter.py
@@ -0,0 +1,21 @@
+## Example configuration for QCDTruthMultiJetFilter setting up defaults
+
+include("GeneratorFilters/AntiKt4TruthJets_pileup.py")
+include("GeneratorFilters/AntiKt6TruthJets_pileup.py")
+include("GeneratorFilters/JetFilter_Fragment.py")
+
+if not hasattr( filtSeq, "QCDTruthMultiJetFilter" ):
+    from GeneratorFilters.GeneratorFiltersConf import QCDTruthMultiJetFilter
+    filtSeq += QCDTruthMultiJetFilter()
+    pass
+
+"""
+QCDTruthMultiJetFilter = filtSeq.QCDTruthMultiJetFilter
+QCDTruthMultiJetFilter.Njet = -1
+QCDTruthMultiJetFilter.NjetMinPt = 0. *Gaudi::Units::GeV
+QCDTruthMultiJetFilter.MinLeadJetPt = 0. *Gaudi::Units::GeV
+QCDTruthMultiJetFilter.MaxLeadJetPt = 7000. *Gaudi::Units::GeV # , LHC kinematic limit...
+QCDTruthMultiJetFilter.MaxEta = 10.0
+QCDTruthMultiJetFilter.TruthJetContainer = "AntiKt4TruthJets"
+QCDTruthMultiJetFilter.DoShape = True
+"""
diff --git a/Generators/GeneratorFilters/share/common/TTbarLJetsVptFilter.py b/Generators/GeneratorFilters/share/common/TTbarLJetsVptFilter.py
new file mode 100644
index 0000000000000000000000000000000000000000..e52756aa412c9248875996d11a6b6b19e145cfb4
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/TTbarLJetsVptFilter.py
@@ -0,0 +1,12 @@
+## Instantiate the TTbarWToLeptonFilter, including adding it to the stream requirement
+
+if not hasattr(filtSeq, "TTbarLJetsVptFilter"):
+    from GeneratorFilters.GeneratorFiltersConf import TTbarLJetsVptFilter
+    filtSeq += TTbarLJetsVptFilter()
+
+filtSeq.TTbarLJetsVptFilter.NumLeptons = 1
+filtSeq.TTbarLJetsVptFilter.Ptcut =  22000.
+filtSeq.TTbarLJetsVptFilter.Etacut=  3.0
+filtSeq.TTbarLJetsVptFilter.VptMin= 100000
+#filtSeq.TTbarLJetsVptFilter.VptMax= 300000
+filtSeq.TTbarLJetsVptFilter.FollowTaus=True
diff --git a/Generators/GeneratorFilters/share/common/TTbarWToLeptonFilter.py b/Generators/GeneratorFilters/share/common/TTbarWToLeptonFilter.py
new file mode 100644
index 0000000000000000000000000000000000000000..ed13b82c58db3b26fab63209bc1f3df1b1d92d6b
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/TTbarWToLeptonFilter.py
@@ -0,0 +1,15 @@
+## Instantiate the TTbarWToLeptonFilter, including adding it to the stream requirement
+## Filter passed if top, antitop and t->W->e/mu/tau in truth chain
+## Configuration of the filter cuts is left to the specific JO
+## christoph.wasicki@cern.ch
+
+if not hasattr(filtSeq, "TTbarWToLeptonFilter"):
+    from GeneratorFilters.GeneratorFiltersConf import TTbarWToLeptonFilter
+    filtSeq += TTbarWToLeptonFilter()
+
+## Add this filter to the algs required to be successful for streaming
+#if "TTbarWToLeptonFilter" not in StreamEVGEN.RequireAlgs:
+#    StreamEVGEN.RequireAlgs += ["TTbarWToLeptonFilter"]
+
+## Default cut params
+filtSeq.TTbarWToLeptonFilter.Ptcut = 1.
diff --git a/Generators/GeneratorFilters/share/common/TTbarWithJpsimumuFilter.py b/Generators/GeneratorFilters/share/common/TTbarWithJpsimumuFilter.py
new file mode 100644
index 0000000000000000000000000000000000000000..d6756a0a954d6821f5b0f50a1fd385d16b0c80b7
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/TTbarWithJpsimumuFilter.py
@@ -0,0 +1,10 @@
+## Instantiate the TTbarWithJpsimumuFilter, including adding it to the stream requirement
+## Filter passed if top, antitop and t->b->J/psi->mumu in truth chain
+## Configuration of the filter cuts is left to the specific JO
+
+if not hasattr(filtSeq, "TTbarWithJpsimumuFilter"):
+    from GeneratorFilters.GeneratorFiltersConf import TTbarWithJpsimumuFilter
+    filtSeq += TTbarWithJpsimumuFilter()
+
+## Default cut params
+filtSeq.TTbarWithJpsimumuFilter.JpsipTMinCut = 5000.
\ No newline at end of file
diff --git a/Generators/GeneratorFilters/share/common/TransverseMassVVFilter.py b/Generators/GeneratorFilters/share/common/TransverseMassVVFilter.py
new file mode 100644
index 0000000000000000000000000000000000000000..a61c059e8a6f278352a14ad39738835966de9765
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/TransverseMassVVFilter.py
@@ -0,0 +1,13 @@
+## Example configuration for TransverseMassVVFilter setting up defaults
+
+if not hasattr( filtSeq, "TransverseMassVVFilter" ):
+    from GeneratorFilters.GeneratorFiltersConf import TransverseMassVVFilter
+    filtSeq += TransverseMassVVFilter()
+    pass
+
+"""
+TransverseMassVVFilter = filtSeq.TransverseMassVVFilter
+TransverseMassVVFilter.MinMass = 4000.
+TransverseMassVVFilter.MaxMass = 10000.
+"""
+ 
diff --git a/Generators/GeneratorFilters/share/common/VBFForwardJetsFilter.py b/Generators/GeneratorFilters/share/common/VBFForwardJetsFilter.py
new file mode 100644
index 0000000000000000000000000000000000000000..a0e5327192332fd725d5eac2ca9b85d977d68c88
--- /dev/null
+++ b/Generators/GeneratorFilters/share/common/VBFForwardJetsFilter.py
@@ -0,0 +1,33 @@
+## Example configuration for VBFForwardJetsFilter setting up defaults
+
+#include("GeneratorFilters/AntiKt4TruthJets_pileup.py")
+#include("GeneratorFilters/AntiKt6TruthJets_pileup.py")
+#include("GeneratorFilters/JetFilter_Fragment.py")
+include ("GeneratorFilters/FindJets.py")
+CreateJets(prefiltSeq, 0.6)
+AddJetsFilter(filtSeq,runArgs.ecmEnergy, 0.6)
+
+if not hasattr( filtSeq, "VBFForwardJetsFilter" ):
+    from GeneratorFilters.GeneratorFiltersConf import VBFForwardJetsFilter
+    filtSeq += VBFForwardJetsFilter()
+    pass
+
+"""
+VBFForwardJetsFilter = filtSeq.VBFForwardJetsFilter
+VBFForwardJetsFilter.JetMinPt = 10.*Gaudi::Units::GeV
+VBFForwardJetsFilter.JetMaxEta = 5.
+VBFForwardJetsFilter.NJets = 2
+VBFForwardJetsFilter.Jet1MinPt = 20.*Gaudi::Units::GeV
+VBFForwardJetsFilter.Jet1MaxEta = 5.
+VBFForwardJetsFilter.Jet2MinPt = 10.*Gaudi::Units::GeV
+VBFForwardJetsFilter.Jet2MaxEta = 5.
+VBFForwardJetsFilter.UseOppositeSignEtaJet1Jet2 = False
+VBFForwardJetsFilter.MassJJ = 300.*Gaudi::Units::GeV
+VBFForwardJetsFilter.DeltaEtaJJ = 2.0
+VBFForwardJetsFilter.UseLeadingJJ = False
+VBFForwardJetsFilter.TruthJetContainer = "AntiKt4TruthJets"
+VBFForwardJetsFilter.LGMinPt = 10.*Gaudi::Units::GeV
+VBFForwardJetsFilter.LGMaxEta = 2.5
+VBFForwardJetsFilter.DeltaRJLG = 0.05
+VBFForwardJetsFilter.RatioPtJLG = 0.3
+"""
diff --git a/Generators/GeneratorObjects/GeneratorObjects/McEventDict.h b/Generators/GeneratorObjects/GeneratorObjects/McEventDict.h
index 58b8b0605e44d4c076398735b47c310e537b8efa..3b6701b3e82f1086d4c2b98c2532058faf00676f 100644
--- a/Generators/GeneratorObjects/GeneratorObjects/McEventDict.h
+++ b/Generators/GeneratorObjects/GeneratorObjects/McEventDict.h
@@ -13,6 +13,7 @@
 #include "GeneratorObjects/HijingEventParams.h"
 #include "RootUtils/PyROOTIteratorFuncs.h"
 
+#include "AtlasHepMC/GenEvent.h"
 namespace GeneratorObjectsMcEventDict {
   
   struct tmp {
@@ -25,8 +26,12 @@ namespace GeneratorObjectsMcEventDict {
     std::iterator<std::forward_iterator_tag,HepMC::GenVertex*,int,HepMC::GenVertex**,HepMC::GenVertex*&> m_1;
     std::iterator<std::forward_iterator_tag,HepMC::GenParticle*,int,HepMC::GenParticle**,HepMC::GenParticle*&> m_2;
     
+#ifdef HEPMC3 
+    RootUtils::PyROOTIteratorFuncs<std::vector<HepMC::GenVertex>::const_iterator> m_it;
+#else    
     RootUtils::PyROOTIteratorFuncs<
       HepMC::GenVertex::particles_out_const_iterator> m_it;
+#endif
   };
 
 }
diff --git a/Generators/GeneratorObjects/share/HepMcParticleLink_test.ref b/Generators/GeneratorObjects/share/HepMcParticleLink_test.ref
index d811c94b30f3e02f2da90cea4e0e2c305acada53..3483c9b21c379c0aa6d5c57bffe0fb514b2ca0df 100644
--- a/Generators/GeneratorObjects/share/HepMcParticleLink_test.ref
+++ b/Generators/GeneratorObjects/share/HepMcParticleLink_test.ref
@@ -1,9 +1,9 @@
-[==========] Running 9 tests from 1 test case.
+[==========] Running 9 tests from 1 test suite.
 [----------] Global test environment set-up.
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
-                                                   Welcome to ApplicationMgr (GaudiCoreSvc v33r1)
-                                          running on pc-camb05 on Wed Apr 29 13:48:28 2020
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v34r0)
+                                          running on 36d5a1e47246 on Sat Sep 12 19:54:17 2020
 ====================================================================================================================================
 ApplicationMgr       INFO Application Manager Configured successfully
 EventLoopMgr      WARNING Unable to locate service "EventSelector" 
@@ -13,12 +13,12 @@ ApplicationMgr Ready
 [----------] 9 tests from HepMcParticleLink_test
 [ RUN      ] HepMcParticleLink_test.old_test
 *** HepMcParticleLink_test starts ***
-ClassIDSvc           INFO  getRegistryEntries: read 817 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 821 CLIDRegistry entries for module ALL
 HepMcParticleLink    INFO find_proxy: Using TruthEvent as McEventCollection key for this job 
 *** HepMcParticleLink_test OK ***
-[       OK ] HepMcParticleLink_test.old_test (53 ms)
+[       OK ] HepMcParticleLink_test.old_test (45 ms)
 [ RUN      ] HepMcParticleLink_test.broken_event_link
-ClassIDSvc           INFO  getRegistryEntries: read 1070 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 1086 CLIDRegistry entries for module ALL
 [       OK ] HepMcParticleLink_test.broken_event_link (1 ms)
 [ RUN      ] HepMcParticleLink_test.truth_event_link_first_event
 [       OK ] HepMcParticleLink_test.truth_event_link_first_event (0 ms)
@@ -37,8 +37,8 @@ HepMcParticleLink WARNING cptr: Mc Truth not stored for event with event number
 [       OK ] HepMcParticleLink_test.truth_event_link_cut_events (0 ms)
 [ RUN      ] HepMcParticleLink_test.max_event_number
 [       OK ] HepMcParticleLink_test.max_event_number (0 ms)
-[----------] 9 tests from HepMcParticleLink_test (54 ms total)
+[----------] 9 tests from HepMcParticleLink_test (46 ms total)
 
 [----------] Global test environment tear-down
-[==========] 9 tests from 1 test case ran. (176 ms total)
+[==========] 9 tests from 1 test suite ran. (255 ms total)
 [  PASSED  ] 9 tests.
diff --git a/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/McEventCollectionCnv_p4.h b/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/McEventCollectionCnv_p4.h
index 19ba716047d09374eb5bc509e929ad6890b1447c..3615633b6724cb8b039618266a8425c39f7fb59f 100755
--- a/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/McEventCollectionCnv_p4.h
+++ b/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/McEventCollectionCnv_p4.h
@@ -129,17 +129,27 @@ class McEventCollectionCnv_p4 : public T_AthenaPoolTPCnvBase<
    *  vertex is added to the persistent is added to the persistent
    *  @c GenEvent.
    */
+#ifdef HEPMC3
+  void writeGenVertex( HepMC::ConstGenVertexPtr vtx,
+                       McEventCollection_p4& persEvt ) const;
+#else
   void writeGenVertex( const HepMC::GenVertex& vtx,
                        McEventCollection_p4& persEvt ) const;
+#endif
 
   /** @brief Method to write a persistent @c GenParticle object
    *  It returns the index of the persistent @c GenParticle into the
    *  collection of persistent of @c GenParticles from the
    *  persistent @c GenEvent
    */
+#ifdef HEPMC3   
+  int writeGenParticle( HepMC::ConstGenParticlePtr p,
+                        McEventCollection_p4& persEvt ) const;
+#else
   int writeGenParticle( const HepMC::GenParticle& p,
                         McEventCollection_p4& persEvt ) const;
 
+#endif
   ///////////////////////////////////////////////////////////////////
   // Protected data:
   ///////////////////////////////////////////////////////////////////
diff --git a/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/McEventCollectionCnv_p5.h b/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/McEventCollectionCnv_p5.h
index c5649ca6fd448c6d4db866e18a9266767751546d..59701c3de5f4d72a12e39dd670d8ce8e38783039 100755
--- a/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/McEventCollectionCnv_p5.h
+++ b/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/McEventCollectionCnv_p5.h
@@ -130,16 +130,26 @@ class McEventCollectionCnv_p5 : public T_AthenaPoolTPCnvBase<
    *  vertex is added to the persistent is added to the persistent
    *  @c GenEvent.
    */
+#ifdef HEPMC3
+  void writeGenVertex( HepMC::ConstGenVertexPtr vtx,
+                       McEventCollection_p5& persEvt ) const;
+#else
   void writeGenVertex( const HepMC::GenVertex& vtx,
                        McEventCollection_p5& persEvt ) const;
 
+#endif
   /** @brief Method to write a persistent @c GenParticle object
    *  It returns the index of the persistent @c GenParticle into the
    *  collection of persistent of @c GenParticles from the
    *  persistent @c GenEvent
    */
+#ifdef HEPMC3
+  int writeGenParticle( HepMC::ConstGenParticlePtr p,
+                        McEventCollection_p5& persEvt ) const;
+#else
   int writeGenParticle( const HepMC::GenParticle& p,
                         McEventCollection_p5& persEvt ) const;
+#endif
 
   ///////////////////////////////////////////////////////////////////
   // Protected data:
diff --git a/Generators/GeneratorObjectsTPCnv/src/GenEventCnv_p1.cxx b/Generators/GeneratorObjectsTPCnv/src/GenEventCnv_p1.cxx
index fd88e5a0df015142d516e9f9590c70de59ced464..ea04b2c8fd0ac9a554eb704f4939d79f6142c107 100755
--- a/Generators/GeneratorObjectsTPCnv/src/GenEventCnv_p1.cxx
+++ b/Generators/GeneratorObjectsTPCnv/src/GenEventCnv_p1.cxx
@@ -62,6 +62,16 @@ void GenEventCnv_p1::persToTrans( const GenEvent_p1* persObj,
     m_pool->part.reserve( m_pool->part.allocated() + nParts );
   }
 
+#ifdef HEPMC3
+  transObj->add_attribute("signal_process_id",std::make_shared<HepMC3::IntAttribute>(persObj->m_signalProcessId ));
+  transObj->set_event_number(persObj->m_eventNbr);
+  transObj->add_attribute("event_scale",std::make_shared<HepMC3::DoubleAttribute>(persObj->m_eventScale));
+  transObj->add_attribute("alphaQCD",std::make_shared<HepMC3::DoubleAttribute>(persObj->m_alphaQCD));
+  transObj->add_attribute("alphaQED",std::make_shared<HepMC3::DoubleAttribute>(persObj->m_alphaQED));
+  transObj->weights()= persObj->m_weights;
+  transObj->add_attribute("random_states",std::make_shared<HepMC3::VectorLongIntAttribute>(persObj->m_randomStates));
+
+#else  
   transObj->set_signal_process_id( persObj->m_signalProcessId );
   transObj->set_event_number( persObj->m_eventNbr );
   transObj->set_event_scale ( persObj->m_eventScale );
@@ -78,6 +88,7 @@ void GenEventCnv_p1::persToTrans( const GenEvent_p1* persObj,
 
   transObj->m_pdf_info = 0;         //> not available at that time...
 
+#endif
   // create a temporary map associating the barcode of an end-vtx to its 
   // particle.
   // As not all particles are stable (d'oh!) we take 50% of the number of
@@ -142,6 +153,12 @@ GenEventCnv_p1::createGenVertex( const GenEvent_p1& persEvt,
 				 const GenVertex_p1& persVtx,
 				 ParticlesMap_t& partToEndVtx ) const
 {
+#ifdef HEPMC3
+  HepMC::GenVertexPtr vtx = *(m_pool->vtx.nextElementPtr());
+  vtx->set_position( HepMC::FourVector(persVtx.m_x,persVtx.m_y,persVtx.m_z,persVtx.m_t) );
+  vtx->add_attribute("weights",std::make_shared<HepMC3::VectorDoubleAttribute>(persVtx.m_weights));
+  vtx->add_attribute("barcode",std::make_shared<HepMC3::IntAttribute>(persVtx.m_barcode));
+#else
   HepMC::GenVertexPtr vtx = m_pool->vtx.nextElementPtr();
   vtx->m_position.setX( persVtx.m_x );
   vtx->m_position.setY( persVtx.m_y );
@@ -153,6 +170,7 @@ GenEventCnv_p1::createGenVertex( const GenEvent_p1& persEvt,
   vtx->m_weights = persVtx.m_weights;
   vtx->m_event   = 0;
   vtx->m_barcode = persVtx.m_barcode;
+#endif
   
   // handle the in-going (orphans) particles
   const unsigned int nPartsIn = persVtx.m_particlesIn.size();
@@ -175,6 +193,23 @@ HepMC::GenParticlePtr
 GenEventCnv_p1::createGenParticle( const GenParticle_p1& persPart,
 				   ParticlesMap_t& partToEndVtx ) const
 {
+#ifdef HEPMC3
+  HepMC::GenParticlePtr p = *(m_pool->part.nextElementPtr());
+  p->set_momentum( HepMC::FourVector(persPart.m_px,persPart.m_py,persPart.m_pz,persPart.m_ene));
+  p->set_pdg_id(persPart.m_pdgId);
+  p->set_status(persPart.m_status);
+  p->add_attribute("phi",std::make_shared<HepMC3::DoubleAttribute>(persPart.m_phiPolarization));
+  p->add_attribute("theta",std::make_shared<HepMC3::DoubleAttribute>(persPart.m_thetaPolarization));
+  p->add_attribute("barcode",std::make_shared<HepMC3::IntAttribute>(persPart.m_barcode));
+  // fillin' the flow
+  std::vector<int> flows;
+  const unsigned int nFlow = persPart.m_flow.size();
+  for ( unsigned int iFlow= 0; iFlow != nFlow; ++iFlow ) {
+  flows.push_back(persPart.m_flow[iFlow].second );
+  }
+  //We construct it here as vector w/o gaps.
+  p->add_attribute("flows", std::make_shared<HepMC3::VectorIntAttribute>(flows));
+#else
 
 
   HepMC::GenParticlePtr p = m_pool->part.nextElementPtr();
@@ -196,6 +231,7 @@ GenEventCnv_p1::createGenParticle( const GenParticle_p1& persPart,
     p->m_flow.set_icode( persPart.m_flow[iFlow].first, 
 			 persPart.m_flow[iFlow].second );
   }
+#endif
 
   if ( persPart.m_endVtx != 0 ) {
     partToEndVtx[p] = persPart.m_endVtx;
diff --git a/Generators/GeneratorObjectsTPCnv/src/HepMcDataPool.h b/Generators/GeneratorObjectsTPCnv/src/HepMcDataPool.h
index be051d1fbb405777b6c5251a460626ac291e441e..3bc40ae512b38fc7bdf140d1f3dc1f8476d17683 100755
--- a/Generators/GeneratorObjectsTPCnv/src/HepMcDataPool.h
+++ b/Generators/GeneratorObjectsTPCnv/src/HepMcDataPool.h
@@ -35,6 +35,33 @@
 // various DataPool<Xyz>.
 namespace SG {
 
+#ifdef HEPMC3
+
+
+  template<>
+  inline void
+  ArenaAllocatorBase::destroy_fcn<HepMC::GenParticlePtr>(ArenaAllocatorBase::pointer p)
+  {
+  //GenParticlePtr is smart pointer
+  }
+
+  template<>
+  inline void
+  ArenaAllocatorBase::destroy_fcn<HepMC::GenVertexPtr>(ArenaAllocatorBase::pointer p)
+  {
+  //GenVertexPtr is smart pointer
+  }
+
+  template<>
+  inline void
+  ArenaAllocatorBase::destroy_fcn<HepMC::GenEvent>(ArenaAllocatorBase::pointer p)
+  {
+    HepMC::GenEvent* evt = reinterpret_cast<HepMC::GenEvent*>(p);
+    evt->~GenEvent();
+  }
+
+#else
+
   template<>
   inline void
   ArenaAllocatorBase::destroy_fcn<HepMC::GenParticle>(ArenaAllocatorBase::pointer p)
@@ -66,9 +93,26 @@ namespace SG {
     delete evt->m_pdf_info; evt->m_pdf_info = 0;
     evt->~GenEvent();
   }
+#endif  
 } // end namespace SG
 
 namespace HepMC {
+ #ifdef HEPMC3
+  struct DataPool {
+
+    typedef ::DataPool<HepMC::GenEvent> GenEvtPool_t;
+    /// an arena of @c HepMC::GenEvent for efficient object instantiation
+    GenEvtPool_t evt;
+
+    typedef ::DataPool<HepMC::GenVertexPtr> GenVtxPool_t;
+    /// an arena of @c HepMC::GenVertex for efficient object instantiation
+    GenVtxPool_t vtx;
+
+    typedef ::DataPool<HepMC::GenParticlePtr> GenPartPool_t;
+    /// an arena of @c HepMC::GenParticle for efficient object instantiation
+    GenPartPool_t part;
+  };
+#else
   struct DataPool {
 
     typedef ::DataPool<HepMC::GenEvent> GenEvtPool_t;
@@ -84,6 +128,7 @@ namespace HepMC {
     GenPartPool_t part;
   };
 
+#endif
 } // end namespace HepMC
 
 #endif // GENERATOROBJECTSATHENAPOOL_HEPMCDATAPOOL_H
diff --git a/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p2.cxx b/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p2.cxx
index aa4cb45c00dbb945f9cd656f8af3697abc3f0e2d..2c18a9775d960ee6d7d5b701e28faec8b1ec454b 100755
--- a/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p2.cxx
+++ b/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p2.cxx
@@ -79,6 +79,46 @@ void McEventCollectionCnv_p2::persToTrans( const McEventCollection_p2* persObj,
         ++itr ) {
     const GenEvent_p2& persEvt = *itr;
     HepMC::GenEvent * genEvt        = poolOfEvents.nextElementPtr();
+#ifdef HEPMC3
+    genEvt->add_attribute("signal_process_id",std::make_shared<HepMC3::IntAttribute>(persEvt.m_signalProcessId));
+    genEvt->set_event_number(persEvt.m_eventNbr);
+    genEvt->add_attribute("event_scale",std::make_shared<HepMC3::DoubleAttribute>(persEvt.m_eventScale));
+    genEvt->add_attribute("alphaQCD",std::make_shared<HepMC3::DoubleAttribute>(persEvt.m_alphaQCD));
+    genEvt->add_attribute("alphaQED",std::make_shared<HepMC3::DoubleAttribute>(persEvt.m_alphaQED));
+    genEvt->weights()= persEvt.m_weights;
+    genEvt->add_attribute("random_states",std::make_shared<HepMC3::VectorLongIntAttribute>(persEvt.m_randomStates));
+
+    transObj->push_back( genEvt );
+
+    // create a temporary map associating the barcode of an end-vtx to its
+    // particle.
+    // As not all particles are stable (d'oh!) we take 50% of the number of
+    // particles as an initial size of the hash-map (to prevent re-hash)
+    ParticlesMap_t partToEndVtx( (persEvt.m_particlesEnd-persEvt.m_particlesBegin)/2 );
+
+    // create the vertices
+    const unsigned int endVtx = persEvt.m_verticesEnd;
+    for ( unsigned int iVtx= persEvt.m_verticesBegin; iVtx != endVtx; ++iVtx ) {
+      genEvt->add_vertex( createGenVertex( *persObj,
+                                           persObj->m_genVertices[iVtx],
+                                           partToEndVtx,
+                                           &datapools ) );
+    } //> end loop over vertices
+
+    // set the signal process vertex
+    const int sigProcVtx = persEvt.m_signalProcessVtx;
+    if ( sigProcVtx ) HepMC::set_signal_process_vertex(genEvt, HepMC::barcode_to_vertex(genEvt, sigProcVtx ) );
+
+    // connect particles to their end vertices
+    for ( auto p:  partToEndVtx) {
+      auto decayVtx = HepMC::barcode_to_vertex(genEvt, p.second );
+      if ( decayVtx ) {
+        decayVtx->add_particle_in( p.first );
+      } else {
+        msg << MSG::ERROR<< "GenParticle points to null end vertex !!"<< endmsg;
+      }
+    }
+#else
     genEvt->m_signal_process_id     = persEvt.m_signalProcessId;
     genEvt->m_event_number          = persEvt.m_eventNbr;
     genEvt->m_event_scale           = persEvt.m_eventScale;
@@ -129,6 +169,7 @@ void McEventCollectionCnv_p2::persToTrans( const McEventCollection_p2* persObj,
             << endmsg;
       }
     }
+#endif    
   } //> end loop over m_genEvents
 
   msg << MSG::DEBUG << "Loaded McEventCollection from persistent state [OK]"
@@ -160,6 +201,31 @@ McEventCollectionCnv_p2::createGenVertex( const McEventCollection_p2& persEvt,
                                           const GenVertex_p2& persVtx,
                                           ParticlesMap_t& partToEndVtx, HepMC::DataPool* datapools ) const
 {
+#ifdef HEPMC3
+  DataPool<HepMC::GenVertexPtr>& poolOfVertices = datapools->vtx;
+  HepMC::GenVertexPtr vtx = *(poolOfVertices.nextElementPtr());
+  vtx->set_position( HepMC::FourVector(persVtx.m_x,persVtx.m_y, persVtx.m_z, persVtx.m_t) );
+  //AV ID cannot be assigned in HepMC3. And its meaning in HepMC2 is not clear.
+  // vtx->m_id      = persVtx.m_id;
+  vtx->add_attribute("weights",std::make_shared<HepMC3::VectorFloatAttribute>(persVtx.m_weights));
+  vtx->add_attribute("barcode",std::make_shared<HepMC3::IntAttribute>(persVtx.m_barcode));
+
+  // handle the in-going (orphans) particles
+  const unsigned int nPartsIn = persVtx.m_particlesIn.size();
+  for ( unsigned int i = 0; i != nPartsIn; ++i ) {
+    createGenParticle( persEvt.m_genParticles[persVtx.m_particlesIn[i]],
+                       partToEndVtx,
+                       datapools );
+  }
+
+  // now handle the out-going particles
+  const unsigned int nPartsOut = persVtx.m_particlesOut.size();
+  for ( unsigned int i = 0; i != nPartsOut; ++i ) {
+    vtx->add_particle_out( createGenParticle( persEvt.m_genParticles[persVtx.m_particlesOut[i]],
+                                              partToEndVtx,
+                                              datapools ) );
+  }
+#else
   DataPool<HepMC::GenVertex>& poolOfVertices = datapools->vtx;
   HepMC::GenVertexPtr vtx = poolOfVertices.nextElementPtr();
   vtx->m_position.setX( persVtx.m_x );
@@ -190,6 +256,7 @@ McEventCollectionCnv_p2::createGenVertex( const McEventCollection_p2& persEvt,
                                               partToEndVtx,
                                               datapools ) );
   }
+#endif
 
   return vtx;
 }
@@ -198,6 +265,26 @@ HepMC::GenParticlePtr
 McEventCollectionCnv_p2::createGenParticle( const GenParticle_p2& persPart,
                                             ParticlesMap_t& partToEndVtx, HepMC::DataPool* datapools ) const
 {
+#ifdef HEPMC3
+  DataPool<HepMC::GenParticlePtr>& poolOfParticles = datapools->part;
+  HepMC::GenParticlePtr p    = *(poolOfParticles.nextElementPtr());
+  p->set_momentum( HepMC::FourVector(persPart.m_px,persPart.m_py,persPart.m_pz, persPart.m_ene ));
+  p->set_pdg_id(               persPart.m_pdgId);
+  p->set_status(               persPart.m_status);
+  p->add_attribute("phi",std::make_shared<HepMC3::DoubleAttribute>(persPart.m_phiPolarization));
+  p->add_attribute("theta",std::make_shared<HepMC3::DoubleAttribute>(persPart.m_thetaPolarization));
+  p->add_attribute("barcode",std::make_shared<HepMC3::IntAttribute>(persPart.m_barcode));
+
+  // fillin' the flow
+  std::vector<int> flows;
+  const unsigned int nFlow = persPart.m_flow.size();
+  for ( unsigned int iFlow= 0; iFlow != nFlow; ++iFlow ) {
+  flows.push_back(persPart.m_flow[iFlow].second );
+  }
+  //We construct it here as vector w/o gaps.
+  p->add_attribute("flows", std::make_shared<HepMC3::VectorIntAttribute>(flows));
+  
+#else
   DataPool<HepMC::GenParticle>& poolOfParticles = datapools->part;
   HepMC::GenParticlePtr p    = poolOfParticles.nextElementPtr();
   p->m_momentum.setPx( persPart.m_px  );
@@ -218,6 +305,7 @@ McEventCollectionCnv_p2::createGenParticle( const GenParticle_p2& persPart,
     p->m_flow.set_icode( persPart.m_flow[iFlow].first,
                          persPart.m_flow[iFlow].second );
   }
+#endif
 
   if ( persPart.m_endVtx != 0 ) {
     partToEndVtx[p] = persPart.m_endVtx;
diff --git a/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p3.cxx b/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p3.cxx
index 6a6383de3e96a53b8e55811a10f839a4a427ae42..950c671058a0d733bbc03e27b5be30b248224f24 100755
--- a/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p3.cxx
+++ b/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p3.cxx
@@ -83,6 +83,16 @@ void McEventCollectionCnv_p3::persToTrans( const McEventCollection_p3* persObj,
     const GenEvent_p3& persEvt = *itr;
 
     HepMC::GenEvent * genEvt        = poolOfEvents.nextElementPtr();
+#ifdef HEPMC3
+    genEvt->add_attribute("signal_process_id",std::make_shared<HepMC3::IntAttribute>(persEvt.m_signalProcessId));
+    genEvt->set_event_number(persEvt.m_eventNbr);
+    genEvt->add_attribute("event_scale",std::make_shared<HepMC3::DoubleAttribute>(persEvt.m_eventScale));
+    genEvt->add_attribute("alphaQCD",std::make_shared<HepMC3::DoubleAttribute>(persEvt.m_alphaQCD));
+    genEvt->add_attribute("alphaQED",std::make_shared<HepMC3::DoubleAttribute>(persEvt.m_alphaQED));
+    genEvt->weights()= persEvt.m_weights;
+    genEvt->add_attribute("random_states",std::make_shared<HepMC3::VectorLongIntAttribute>(persEvt.m_randomStates));
+
+#else
     genEvt->m_signal_process_id     = persEvt.m_signalProcessId;
     genEvt->m_event_number          = persEvt.m_eventNbr;
     genEvt->m_event_scale           = persEvt.m_eventScale;
@@ -94,6 +104,7 @@ void McEventCollectionCnv_p3::persToTrans( const McEventCollection_p3* persObj,
     genEvt->m_vertex_barcodes.clear();
     genEvt->m_particle_barcodes.clear();
     genEvt->m_pdf_info = 0;         //> not available at that time...
+#endif
 
     transObj->push_back( genEvt );
 
@@ -163,6 +174,16 @@ McEventCollectionCnv_p3::createGenVertex( const McEventCollection_p3& persEvt,
                                           ParticlesMap_t& partToEndVtx,
                                           HepMC::DataPool* datapools ) const
 {
+
+#ifdef HEPMC3
+  DataPool<HepMC::GenVertexPtr>& poolOfVertices = datapools->vtx;
+  HepMC::GenVertexPtr vtx=*(poolOfVertices.nextElementPtr());
+  vtx->set_position( HepMC::FourVector(persVtx.m_x,persVtx.m_y,persVtx.m_z,persVtx.m_t) );
+  //AV ID cannot be assigned in HepMC3. And its meaning in HepMC2 is not clear.
+  // vtx->m_id      = persVtx.m_id;
+  vtx->add_attribute("weights",std::make_shared<HepMC3::VectorFloatAttribute>(persVtx.m_weights));
+  vtx->add_attribute("barcode",std::make_shared<HepMC3::IntAttribute>(persVtx.m_barcode));
+#else
   DataPool<HepMC::GenVertex>& poolOfVertices = datapools->vtx;
   HepMC::GenVertexPtr vtx = poolOfVertices.nextElementPtr();
   vtx->m_position.setX( persVtx.m_x );
@@ -177,6 +198,7 @@ McEventCollectionCnv_p3::createGenVertex( const McEventCollection_p3& persEvt,
                                     persVtx.m_weights.end() );
   vtx->m_event   = 0;
   vtx->m_barcode = persVtx.m_barcode;
+#endif
 
   // handle the in-going (orphans) particles
   const unsigned int nPartsIn = persVtx.m_particlesIn.size();
@@ -202,6 +224,44 @@ McEventCollectionCnv_p3::createGenParticle( const GenParticle_p3& persPart,
                                             ParticlesMap_t& partToEndVtx,
                                             HepMC::DataPool* datapools ) const
 {
+
+#ifdef HEPMC3
+  DataPool<HepMC::GenParticlePtr>& poolOfParticles = datapools->part;
+  HepMC::GenParticlePtr p    = *(poolOfParticles.nextElementPtr());
+  p->set_pdg_id(persPart.m_pdgId);
+  p->set_status(persPart.m_status);
+  // Note: do the E calculation in extended (long double) precision.
+  // That happens implicitly on x86 with optimization on; saying it
+  // explicitly ensures that we get the same results with and without
+  // optimization.  (If this is a performance issue for platforms
+  // other than x86, one could change to double for those platforms.)
+  double temp_e=0.0;
+  if ( 0 == persPart.m_recoMethod ) {
+    temp_e = std::sqrt( (long double)(persPart.m_px)*persPart.m_px +
+                          (long double)(persPart.m_py)*persPart.m_py +
+                          (long double)(persPart.m_pz)*persPart.m_pz +
+                          (long double)(persPart.m_m) *persPart.m_m );
+  } else {
+    const int signM2 = ( persPart.m_m >= 0. ? 1 : -1 );
+    const double persPart_ene =
+      std::sqrt( std::abs((long double)(persPart.m_px)*persPart.m_px +
+                (long double)(persPart.m_py)*persPart.m_py +
+                (long double)(persPart.m_pz)*persPart.m_pz +
+                signM2* (long double)(persPart.m_m)* persPart.m_m));
+    const int signEne = ( persPart.m_recoMethod == 1 ? 1 : -1 );
+    temp_e=signEne * persPart_ene;
+  }
+  p->set_momentum(HepMC::FourVector(persPart.m_px,persPart.m_py,persPart.m_pz,temp_e));
+  // setup flow
+  // fillin' the flow
+  std::vector<int> flows;
+  const unsigned int nFlow = persPart.m_flow.size();
+  for ( unsigned int iFlow= 0; iFlow != nFlow; ++iFlow ) {
+  flows.push_back(persPart.m_flow[iFlow].second );
+  }
+  //We construct it here as vector w/o gaps.
+  p->add_attribute("flows", std::make_shared<HepMC3::VectorIntAttribute>(flows));
+#else
   DataPool<HepMC::GenParticle>& poolOfParticles = datapools->part;
   HepMC::GenParticlePtr p    = poolOfParticles.nextElementPtr();
   p->m_pdg_id              = persPart.m_pdgId;
@@ -246,6 +306,7 @@ McEventCollectionCnv_p3::createGenParticle( const GenParticle_p3& persPart,
     p->m_flow.set_icode( persPart.m_flow[iFlow].first,
                          persPart.m_flow[iFlow].second );
   }
+#endif
 
   if ( persPart.m_endVtx != 0 ) {
     partToEndVtx[p] = persPart.m_endVtx;
diff --git a/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p4.cxx b/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p4.cxx
index db580216dada75be74dcccb20254b414ee99b4e3..38b204417a7e3c4c671077b05e001ecf1ee55268 100755
--- a/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p4.cxx
+++ b/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p4.cxx
@@ -107,6 +107,37 @@ void McEventCollectionCnv_p4::persToTrans( const McEventCollection_p4* persObj,
         {
           genEvt        =  poolOfEvents.nextElementPtr();
         }
+#ifdef HEPMC3
+      genEvt->add_attribute("signal_process_id",std::make_shared<HepMC3::IntAttribute>(persEvt.m_signalProcessId));
+      genEvt->set_event_number(persEvt.m_eventNbr);
+      genEvt->add_attribute("event_scale",std::make_shared<HepMC3::DoubleAttribute>(persEvt.m_eventScale));
+      genEvt->add_attribute("alphaQCD",std::make_shared<HepMC3::DoubleAttribute>(persEvt.m_alphaQCD));
+      genEvt->add_attribute("alphaQED",std::make_shared<HepMC3::DoubleAttribute>(persEvt.m_alphaQED));
+
+      genEvt->add_attribute("signal_process_vertex",std::make_shared<HepMC3::IntAttribute>(0));
+      genEvt->weights()= persEvt.m_weights;
+      genEvt->add_attribute("random_states",std::make_shared<HepMC3::VectorLongIntAttribute>(persEvt.m_randomStates));
+      //restore weight names from the dedicated svc (which was keeping them in metadata for efficiency)
+      if(genEvt->run_info()) genEvt->run_info()->set_weight_names(name_index_map_to_names(m_hepMCWeightSvc->weightNames()));
+      else msg << MSG::WARNING << "No run info!" << endmsg;
+
+
+       // pdfinfo restore
+      if (!persEvt.m_pdfinfo.empty())
+        {
+          const std::vector<double>& pdf = persEvt.m_pdfinfo;
+              HepMC3::GenPdfInfoPtr pi;
+              pi->set(
+              static_cast<int>(pdf[6]), // id1
+              static_cast<int>(pdf[5]), // id2
+              pdf[4],                   // x1
+              pdf[3],                   // x2
+              pdf[2],                   // scalePDF
+              pdf[1],                   // pdf1
+              pdf[0] );                 // pdf2
+              genEvt->set_pdf_info(pi);
+        }
+#else
       genEvt->m_signal_process_id     = persEvt.m_signalProcessId;
       genEvt->m_event_number          = persEvt.m_eventNbr;
       genEvt->m_event_scale           = persEvt.m_eventScale;
@@ -134,6 +165,7 @@ void McEventCollectionCnv_p4::persToTrans( const McEventCollection_p4* persObj,
               pdf[1],                   // pdf1
               pdf[0] );                 // pdf2
         }
+#endif
 
       transObj->push_back( genEvt );
 
@@ -205,6 +237,56 @@ void McEventCollectionCnv_p4::transToPers( const McEventCollection* transObj,
         itr != itrEnd;
         ++itr )
     {
+#ifdef HEPMC3 
+      const unsigned int nPersVtx   = persObj->m_genVertices.size();
+      const unsigned int nPersParts = persObj->m_genParticles.size();
+      const HepMC::GenEvent* genEvt = *itr;
+      //save the weight names to metadata via the HepMCWeightSvc
+      m_hepMCWeightSvc->setWeightNames(  names_to_name_index_map(genEvt->weight_names()) ).ignore(); 
+      auto A_signal_process_id=genEvt->attribute<HepMC3::IntAttribute>("signal_process_id");    
+      auto A_event_scale=genEvt->attribute<HepMC3::DoubleAttribute>("event_scale");    
+      auto A_alphaQCD=genEvt->attribute<HepMC3::DoubleAttribute>("alphaQCD");    
+      auto A_alphaQED=genEvt->attribute<HepMC3::DoubleAttribute>("alphaQED");    
+      auto A_signal_process_vertex=genEvt->attribute<HepMC3::IntAttribute>("signal_process_vertex");    
+      auto A_random_states=genEvt->attribute<HepMC3::VectorLongIntAttribute>("random_states");    
+
+      persObj->m_genEvents.
+      push_back( GenEvent_p4( A_signal_process_id?(A_signal_process_id->value()):0,
+                                genEvt->event_number(),
+                                A_event_scale?(A_event_scale->value()):0.0, 
+                                A_alphaQCD?(A_alphaQCD->value()):0.0, 
+                                A_alphaQED?(A_alphaQED->value()):0.0, 
+                                A_signal_process_vertex?(A_signal_process_vertex->value()):0, 
+                                genEvt->weights(), 
+                                std::vector<double>(),//No idea why it is empty 
+                                A_random_states?(A_random_states->value()):std::vector<long>(), 
+                                nPersVtx,
+                                nPersVtx + genEvt->vertices().size(),
+                                nPersParts,
+                                nPersParts + genEvt->particles().size() ) );
+
+      //PdfInfo encoding
+   if (genEvt->pdf_info())
+        {
+          auto pi=genEvt->pdf_info();
+          GenEvent_p4& persEvt = persObj->m_genEvents.back();
+          std::vector<double>& pdfinfo = persEvt.m_pdfinfo;
+          pdfinfo.resize(7);
+          pdfinfo[6] = static_cast<double>(pi->parton_id[0]);
+          pdfinfo[5] = static_cast<double>(pi->parton_id[1]);
+          pdfinfo[4] = pi->x[0];
+          pdfinfo[3] = pi->x[1];
+          pdfinfo[2] = pi->scale;
+          pdfinfo[1] = pi->xf[0];
+          pdfinfo[0] = pi->xf[1];
+        }
+      // create vertices
+      for ( auto v: genEvt->vertices())
+        {
+          writeGenVertex( v, *persObj );
+        }
+
+#else
       const unsigned int nPersVtx   = persObj->m_genVertices.size();
       const unsigned int nPersParts = persObj->m_genParticles.size();
       const HepMC::GenEvent* genEvt = *itr;
@@ -250,6 +332,7 @@ void McEventCollectionCnv_p4::transToPers( const McEventCollection* transObj,
         {
           writeGenVertex( **i, *persObj );
         }
+#endif
 
     } //> end loop over GenEvents
 
@@ -265,6 +348,24 @@ McEventCollectionCnv_p4::createGenVertex( const McEventCollection_p4& persEvt,
                                           ParticlesMap_t& partToEndVtx,
                                           HepMC::DataPool* datapools ) const
 {
+#ifdef HEPMC3
+  DataPool<HepMC::GenVertexPtr>& poolOfVertices = datapools->vtx;
+  HepMC::GenVertexPtr vtx(0);
+  if(m_isPileup)
+    {
+      vtx=HepMC::newGenVertexPtr();
+    }
+  else
+    {
+      vtx = *(poolOfVertices.nextElementPtr());
+    }
+  vtx->set_position(HepMC::FourVector( persVtx.m_x , persVtx.m_y , persVtx.m_z ,persVtx.m_t ));
+  //AV ID cannot be assigned in HepMC3. And its meaning in HepMC2 is not clear.
+  // vtx->m_id      = persVtx.m_id;
+  vtx->add_attribute("weights",std::make_shared<HepMC3::VectorFloatAttribute>(persVtx.m_weights));
+  vtx->add_attribute("barcode",std::make_shared<HepMC3::IntAttribute>(persVtx.m_barcode));
+
+#else
   DataPool<HepMC::GenVertex>& poolOfVertices = datapools->vtx;
   HepMC::GenVertexPtr vtx(0);
   if(m_isPileup)
@@ -287,6 +388,7 @@ McEventCollectionCnv_p4::createGenVertex( const McEventCollection_p4& persEvt,
                                     persVtx.m_weights.end() );
   vtx->m_event   = 0;
   vtx->m_barcode = persVtx.m_barcode;
+#endif
 
   // handle the in-going (orphans) particles
   const unsigned int nPartsIn = persVtx.m_particlesIn.size();
@@ -314,6 +416,60 @@ McEventCollectionCnv_p4::createGenParticle( const GenParticle_p4& persPart,
                                             ParticlesMap_t& partToEndVtx,
                                             HepMC::DataPool* datapools ) const
 {
+#ifdef HEPMC3
+  DataPool<HepMC::GenParticlePtr>& poolOfParticles = datapools->part;
+  HepMC::GenParticlePtr p(0);
+  if (m_isPileup)
+    {
+      p = HepMC::newGenParticlePtr();
+    }
+  else
+    {
+      p    = *(poolOfParticles.nextElementPtr());
+    }
+  p->set_pdg_id(              persPart.m_pdgId);
+  p->set_status(              persPart.m_status);
+  p->add_attribute("phi",std::make_shared<HepMC3::DoubleAttribute>(persPart.m_phiPolarization));
+  p->add_attribute("theta",std::make_shared<HepMC3::DoubleAttribute>(persPart.m_thetaPolarization));
+  p->add_attribute("barcode",std::make_shared<HepMC3::IntAttribute>(persPart.m_barcode));  
+
+  // Note: do the E calculation in extended (long double) precision.
+  // That happens implicitly on x86 with optimization on; saying it
+  // explicitly ensures that we get the same results with and without
+  // optimization.  (If this is a performance issue for platforms
+  // other than x86, one could change to double for those platforms.)
+  if ( 0 == persPart.m_recoMethod )
+    {
+      double temp_e = std::sqrt( (long double)(persPart.m_px)*persPart.m_px +
+                            (long double)(persPart.m_py)*persPart.m_py +
+                            (long double)(persPart.m_pz)*persPart.m_pz +
+                            (long double)(persPart.m_m) *persPart.m_m );
+      p->set_momentum( HepMC::FourVector(persPart.m_px,persPart.m_px,persPart.m_px,temp_e));
+    }
+  else
+    {
+      const int signM2 = ( persPart.m_m >= 0. ? 1 : -1 );
+      const double persPart_ene =
+        std::sqrt( std::abs((long double)(persPart.m_px)*persPart.m_px +
+                  (long double)(persPart.m_py)*persPart.m_py +
+                  (long double)(persPart.m_pz)*persPart.m_pz +
+                  signM2* (long double)(persPart.m_m)* persPart.m_m));
+      const int signEne = ( persPart.m_recoMethod == 1 ? 1 : -1 );
+     p->set_momentum( HepMC::FourVector( persPart.m_px,
+                         persPart.m_py,
+                         persPart.m_pz,
+                         signEne * persPart_ene ));
+    }
+
+  // setup flow
+  std::vector<int> flows;
+  const unsigned int nFlow = persPart.m_flow.size();
+  for ( unsigned int iFlow= 0; iFlow != nFlow; ++iFlow ) {
+  flows.push_back(persPart.m_flow[iFlow].second );
+  }
+  //We construct it here as vector w/o gaps.
+  p->add_attribute("flows", std::make_shared<HepMC3::VectorIntAttribute>(flows));
+#else
   DataPool<HepMC::GenParticle>& poolOfParticles = datapools->part;
   HepMC::GenParticlePtr p(0);
   if (m_isPileup)
@@ -339,10 +495,6 @@ McEventCollectionCnv_p4::createGenParticle( const GenParticle_p4& persPart,
   // other than x86, one could change to double for those platforms.)
   if ( 0 == persPart.m_recoMethod )
     {
-      //    p->m_momentum.setVectM(Hep4Vector( persPart.m_px,
-      //					persPart.m_py,
-      //					persPart.m_pz ),
-      //                            persPart.m_m );
 
       p->m_momentum.setPx( persPart.m_px);
       p->m_momentum.setPy( persPart.m_py);
@@ -375,6 +527,7 @@ McEventCollectionCnv_p4::createGenParticle( const GenParticle_p4& persPart,
       p->m_flow.set_icode( persPart.m_flow[iFlow].first,
                            persPart.m_flow[iFlow].second );
     }
+#endif
 
   if ( persPart.m_endVtx != 0 )
     {
@@ -384,6 +537,42 @@ McEventCollectionCnv_p4::createGenParticle( const GenParticle_p4& persPart,
   return p;
 }
 
+#ifdef HEPMC3
+void McEventCollectionCnv_p4::writeGenVertex( HepMC::ConstGenVertexPtr vtx,
+                                              McEventCollection_p4& persEvt ) const
+{                                              
+  const HepMC::FourVector& position = vtx->position();
+  auto A_weights=vtx->attribute<HepMC3::VectorDoubleAttribute>("weights"); 
+  auto A_barcode=vtx->attribute<HepMC3::IntAttribute>("barcode"); 
+  std::vector<double> weights=A_weights?(A_weights->value()):std::vector<double>();
+  persEvt.m_genVertices.push_back(
+                                  GenVertex_p4( position.x(),
+                                                position.y(),
+                                                position.z(),
+                                                position.t(),
+                                                vtx->id(),
+                                                weights.begin(),
+                                                weights.end(),
+                                                A_barcode?(A_barcode->value()):vtx->id()
+                                                ) );
+  GenVertex_p4& persVtx = persEvt.m_genVertices.back();
+  // we write only the orphans in-coming particles
+  persVtx.m_particlesIn.reserve(vtx->particles_in().size());
+  for ( auto p: vtx->particles_in())
+    {
+      if ( !p->production_vertex() )
+        {
+          persVtx.m_particlesIn.push_back( writeGenParticle(p, persEvt ));
+        }
+    }
+  persVtx.m_particlesOut.reserve(vtx->particles_out().size());
+  for ( auto p: vtx->particles_out())
+    {
+      persVtx.m_particlesOut.push_back( writeGenParticle(p, persEvt ) );
+    }
+  return;
+}
+#else
 void McEventCollectionCnv_p4::writeGenVertex( const HepMC::GenVertex& vtx,
                                               McEventCollection_p4& persEvt ) const
 {
@@ -423,7 +612,49 @@ void McEventCollectionCnv_p4::writeGenVertex( const HepMC::GenVertex& vtx,
 
   return;
 }
+#endif
 
+#ifdef HEPMC3
+int McEventCollectionCnv_p4::writeGenParticle( HepMC::ConstGenParticlePtr p,
+                                               McEventCollection_p4& persEvt ) const
+{                                               
+  const HepMC::FourVector& mom = p->momentum();
+  const double ene = mom.e();
+  const double m2  = mom.m2();
+
+  // Definitions of Bool isTimeLilike, isSpacelike and isLightlike according to HepLorentzVector definition
+  const bool useP2M2 = !(m2 > 0) &&   // !isTimelike
+    (m2 < 0) &&   //  isSpacelike
+    !(std::abs(m2) < 2.0*DBL_EPSILON*ene*ene); // !isLightlike
+
+    const short recoMethod = ( !useP2M2 ? 0: ( ene >= 0. ? 1 : 2 ) );
+    auto A_theta=p->attribute<HepMC3::DoubleAttribute>("theta"); 
+    auto A_phi=p->attribute<HepMC3::DoubleAttribute>("phi"); 
+    auto A_flows=p->attribute<HepMC3::VectorIntAttribute>("flows"); 
+    
+    
+    persEvt.m_genParticles.push_back( GenParticle_p4( mom.px(),
+                               mom.py(),
+                               mom.pz(),
+                               mom.m(),
+                               p->pdg_id(),
+                               p->status(),
+                               A_flows?(A_flows->value().size()):0,
+                               A_theta?(A_theta->value()):0.0,
+                               A_phi?(A_phi->value()):0.0,
+                               p->production_vertex()?(HepMC::barcode(p->production_vertex())):0,
+                               p->end_vertex()?(HepMC::barcode(p->end_vertex())):0,
+                               HepMC::barcode(p),
+                               recoMethod ) );
+  
+  std::vector< std::pair<int,int> > flow_hepmc2;
+  if(A_flows) flow_hepmc2=vector_to_vector_int_int(A_flows->value());
+  persEvt.m_genParticles.back().m_flow.assign( flow_hepmc2.begin(),flow_hepmc2.end() );
+  // we return the index of the particle in the big vector of particles
+  // (contained by the persistent GenEvent)
+  return (persEvt.m_genParticles.size() - 1);
+}                                               
+#else
 int McEventCollectionCnv_p4::writeGenParticle( const HepMC::GenParticle& p,
                                                McEventCollection_p4& persEvt ) const
 {
@@ -467,6 +698,7 @@ int McEventCollectionCnv_p4::writeGenParticle( const HepMC::GenParticle& p,
   // (contained by the persistent GenEvent)
   return (persEvt.m_genParticles.size() - 1);
 }
+#endif
 
 void McEventCollectionCnv_p4::setPileup()
 {
diff --git a/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p5.cxx b/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p5.cxx
index a769cb98d3f46c7388ceee45f2456fd7345b0ab1..bdf12ec5494c4f3f606de5944b3b05b2166bced1 100755
--- a/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p5.cxx
+++ b/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p5.cxx
@@ -93,6 +93,119 @@ void McEventCollectionCnv_p5::persToTrans( const McEventCollection_p5* persObj,
     } else {
       genEvt        =  poolOfEvents.nextElementPtr();
     }
+#ifdef HEPMC3
+    genEvt->add_attribute("signal_process_id",std::make_shared<HepMC3::IntAttribute>(persEvt.m_signalProcessId));
+    genEvt->set_event_number(persEvt.m_eventNbr);
+    genEvt->add_attribute("mpi",std::make_shared<HepMC3::IntAttribute>(persEvt.m_mpi));
+    genEvt->add_attribute("event_scale",std::make_shared<HepMC3::DoubleAttribute>(persEvt.m_eventScale));
+    genEvt->add_attribute("alphaQCD",std::make_shared<HepMC3::DoubleAttribute>(persEvt.m_alphaQCD));
+    genEvt->add_attribute("alphaQED",std::make_shared<HepMC3::DoubleAttribute>(persEvt.m_alphaQED));
+    genEvt->weights()= persEvt.m_weights;
+    genEvt->add_attribute("random_states",std::make_shared<HepMC3::VectorLongIntAttribute>(persEvt.m_randomStates));
+
+    genEvt->set_units(static_cast<HepMC3::Units::MomentumUnit>(persEvt.m_momentumUnit),
+                      static_cast<HepMC3::Units::LengthUnit>(persEvt.m_lengthUnit));
+
+    //restore weight names from the dedicated svc (which was keeping them in metadata for efficiency)
+    if(genEvt->run_info()) genEvt->run_info()->set_weight_names(name_index_map_to_names(m_hepMCWeightSvc->weightNames()));
+    else msg << MSG::WARNING << "No run info!" << endmsg;
+    // cross-section restore
+
+    auto cs = std::make_shared<HepMC3::GenCrossSection>();
+    if (!persEvt.m_crossSection.empty()) {
+      const std::vector<double>& xsection = persEvt.m_crossSection;
+      if( static_cast<bool>(xsection[0]) )
+        cs->set_cross_section(xsection[2],xsection[1]);
+    genEvt->set_cross_section(cs);
+    }
+    
+    // heavyIon restore
+    auto hi = std::make_shared<HepMC3::GenHeavyIon>();
+    if (!persEvt.m_heavyIon.empty()) {
+      const std::vector<float>& hIon = persEvt.m_heavyIon;
+      //AV NOTE THE ORDER
+      hi->set(
+         static_cast<int>(hIon[12]), // Ncoll_hard
+         static_cast<int>(hIon[11]), // Npart_proj
+         static_cast<int>(hIon[10]), // Npart_targ
+         static_cast<int>(hIon[9]), // Ncoll
+         static_cast<int>(hIon[8]), // spectator_neutrons
+         static_cast<int>(hIon[7]), // spectator_protons
+         static_cast<int>(hIon[6]), // N_Nwounded_collisions
+         static_cast<int>(hIon[5]), // Nwounded_N_collisions
+         static_cast<int>(hIon[4]), // Nwounded_Nwounded_collisions
+         hIon[3],                   // impact_parameter
+         hIon[2],                  // event_plane_angle
+         hIon[1],                  // eccentricity
+         hIon[0]         );         // sigma_inel_NN
+    genEvt->set_heavy_ion(hi);
+    }
+
+
+
+       // pdfinfo restore
+      if (!persEvt.m_pdfinfo.empty())
+        {
+          const std::vector<double>& pdf = persEvt.m_pdfinfo;
+              HepMC3::GenPdfInfoPtr pi;
+              pi->set(
+              static_cast<int>(pdf[6]), // id1
+              static_cast<int>(pdf[5]), // id2
+              pdf[4],                   // x1
+              pdf[3],                   // x2
+              pdf[2],                   // scalePDF
+              pdf[1],                   // pdf1
+              pdf[0] );                 // pdf2
+              genEvt->set_pdf_info(pi);
+        }
+    transObj->push_back( genEvt );
+
+    // create a temporary map associating the barcode of an end-vtx to its
+    // particle.
+    // As not all particles are stable (d'oh!) we take 50% of the number of
+    // particles as an initial size of the hash-map (to prevent re-hash)
+    ParticlesMap_t partToEndVtx( (persEvt.m_particlesEnd-
+                                  persEvt.m_particlesBegin)/2 );
+
+    // create the vertices
+    const unsigned int endVtx = persEvt.m_verticesEnd;
+    for ( unsigned int iVtx= persEvt.m_verticesBegin; iVtx != endVtx; ++iVtx ) {
+      genEvt->add_vertex( createGenVertex( *persObj,
+                                           persObj->m_genVertices[iVtx],
+                                           partToEndVtx,
+                                           &datapools ) );
+    } //> end loop over vertices
+
+    // set the signal process vertex
+    const int sigProcVtx = persEvt.m_signalProcessVtx;
+    if ( sigProcVtx != 0 ) {
+     HepMC::set_signal_process_vertex(genEvt,HepMC::barcode_to_vertex(genEvt, sigProcVtx ) );
+    }
+
+    // connect particles to their end vertices
+    for ( ParticlesMap_t::iterator
+            p = partToEndVtx.begin(),
+            endItr = partToEndVtx.end();
+          p != endItr;
+          ++p ) {
+      auto decayVtx = HepMC::barcode_to_vertex(genEvt, p->second );
+      if ( decayVtx ) {
+        decayVtx->add_particle_in( p->first );
+      } else {
+        msg << MSG::ERROR
+            << "GenParticle points to null end vertex !!"
+            << endmsg;
+      }
+    }
+    // set the beam particles
+    const int beamPart1 = persEvt.m_beamParticle1;
+    const int beamPart2 = persEvt.m_beamParticle2;
+    if (  beamPart1 != 0  &&  beamPart2 !=0 ) {
+      genEvt->set_beam_particles(HepMC::barcode_to_particle(genEvt,beamPart1),
+                                 HepMC::barcode_to_particle(genEvt,beamPart2));
+    }
+
+#else  
     genEvt->m_signal_process_id     = persEvt.m_signalProcessId;
     genEvt->m_event_number          = persEvt.m_eventNbr;
     genEvt->m_mpi                   = persEvt.m_mpi;
@@ -217,6 +330,7 @@ void McEventCollectionCnv_p5::persToTrans( const McEventCollection_p5* persObj,
                                  genEvt->barcode_to_particle(beamPart2));
     }
 
+#endif
 
 
   } //> end loop over m_genEvents
@@ -246,6 +360,95 @@ void McEventCollectionCnv_p5::transToPers( const McEventCollection* transObj,
     const unsigned int nPersVtx   = persObj->m_genVertices.size();
     const unsigned int nPersParts = persObj->m_genParticles.size();
     const HepMC::GenEvent* genEvt = *itr;
+#ifdef HEPMC3
+   //save the weight names to metadata via the HepMCWeightSvc 
+      m_hepMCWeightSvc->setWeightNames(  names_to_name_index_map(genEvt->weight_names()) ).ignore();
+   
+      auto A_mpi=genEvt->attribute<HepMC3::IntAttribute>("mpi");    
+      auto A_signal_process_id=genEvt->attribute<HepMC3::IntAttribute>("signal_process_id");    
+      auto A_event_scale=genEvt->attribute<HepMC3::DoubleAttribute>("event_scale");    
+      auto A_alphaQCD=genEvt->attribute<HepMC3::DoubleAttribute>("alphaQCD");    
+      auto A_alphaQED=genEvt->attribute<HepMC3::DoubleAttribute>("alphaQED");    
+      auto A_signal_process_vertex=genEvt->attribute<HepMC3::IntAttribute>("signal_process_vertex");    
+      auto A_random_states=genEvt->attribute<HepMC3::VectorLongIntAttribute>("random_states");    
+      auto beams=genEvt->beams();
+      persObj->m_genEvents.
+      push_back( GenEvent_p5(A_signal_process_id?(A_signal_process_id->value()):0,
+                              genEvt->event_number(),
+                              A_mpi?(A_mpi->value()):-1, 
+                              A_event_scale?(A_event_scale->value()):0.0, 
+                              A_alphaQCD?(A_alphaQCD->value()):0.0, 
+                              A_alphaQED?(A_alphaQED->value()):0.0, 
+                              A_signal_process_vertex?(A_signal_process_vertex->value()):0, 
+                              HepMC::barcode(beams[0]),
+                              HepMC::barcode(beams[1]),
+                              genEvt->weights(),
+                              A_random_states?(A_random_states->value()):std::vector<long>(), 
+                              std::vector<double>(),      // cross section
+                              std::vector<float>(),       // heavyion
+                              std::vector<double>(),      // pdf info
+                              genEvt->momentum_unit(),
+                              genEvt->length_unit(),
+                              nPersVtx,
+                              nPersVtx + genEvt->vertices().size(),
+                              nPersParts,
+                              nPersParts + genEvt->particles().size() ) );
+    
+                                    
+    //HepMC::GenCrossSection encoding
+    if (genEvt->cross_section()) {
+      auto cs=genEvt->cross_section();
+      GenEvent_p5& persEvt = persObj->m_genEvents.back();
+      std::vector<double>& crossSection = persEvt.m_crossSection;
+      crossSection.resize(3);
+      crossSection[2] = cs->xsec();
+      crossSection[1] = cs->xsec_err();
+      crossSection[0] = static_cast<double>(cs->is_valid());
+    }
+
+    //HepMC::HeavyIon encoding
+    if (genEvt->heavy_ion()) {
+      auto hi=genEvt->heavy_ion();
+      GenEvent_p5& persEvt = persObj->m_genEvents.back();
+      std::vector<float>& heavyIon = persEvt.m_heavyIon;
+      heavyIon.resize(13);
+      heavyIon[12]  = static_cast<float>(hi->Ncoll_hard);
+      heavyIon[11]  = static_cast<float>(hi->Npart_proj);
+      heavyIon[10]  = static_cast<float>(hi->Npart_targ);
+      heavyIon[9]   = static_cast<float>(hi->Ncoll);
+      heavyIon[8]   = static_cast<float>(hi->spectator_neutrons);
+      heavyIon[7]   = static_cast<float>(hi->spectator_protons);
+      heavyIon[6]   = static_cast<float>(hi->N_Nwounded_collisions);
+      heavyIon[5]   = static_cast<float>(hi->Nwounded_N_collisions);
+      heavyIon[4]   = static_cast<float>(hi->Nwounded_Nwounded_collisions);
+      heavyIon[3]   = hi->impact_parameter;
+      heavyIon[2]   = hi->event_plane_angle;
+      heavyIon[1]   = hi->eccentricity;
+      heavyIon[0]   = hi->sigma_inel_NN;
+    }
+
+    //PdfInfo encoding
+    if (genEvt->pdf_info()) {
+      auto pi=genEvt->pdf_info();
+      GenEvent_p5& persEvt = persObj->m_genEvents.back();
+      std::vector<double>& pdfinfo = persEvt.m_pdfinfo;
+      pdfinfo.resize(9);
+      pdfinfo[8] = static_cast<double>(pi->parton_id[0]);
+      pdfinfo[7] = static_cast<double>(pi->parton_id[1]);
+      pdfinfo[6] = static_cast<double>(pi->pdf_id[0]);
+      pdfinfo[5] = static_cast<double>(pi->pdf_id[1]);
+      pdfinfo[4] = pi->x[0];
+      pdfinfo[3] = pi->x[1];
+      pdfinfo[2] = pi->scale;
+      pdfinfo[1] = pi->xf[0];
+      pdfinfo[0] = pi->xf[1];
+    }
+
+    // create vertices
+    for (auto v: genEvt->vertices()) {
+      writeGenVertex( v, *persObj );
+    }
+#else
     const int signalProcessVtx = genEvt->m_signal_process_vertex
       ? genEvt->m_signal_process_vertex->barcode()
       : 0;
@@ -334,6 +537,7 @@ void McEventCollectionCnv_p5::transToPers( const McEventCollection* transObj,
           ++i ) {
       writeGenVertex( **i, *persObj );
     }
+#endif
 
   } //> end loop over GenEvents
 
@@ -349,6 +553,20 @@ McEventCollectionCnv_p5::createGenVertex( const McEventCollection_p5& persEvt,
                                           ParticlesMap_t& partToEndVtx, HepMC::DataPool* datapools
                                           ) const
 {
+#ifdef HEPMC3
+  HepMC::GenVertexPtr vtx(0);
+  DataPool<HepMC::GenVertexPtr>& poolOfVertices = datapools->vtx;
+  if(m_isPileup) {
+    vtx=HepMC::newGenVertexPtr();
+  } else {
+    vtx = *(poolOfVertices.nextElementPtr());
+  }
+  vtx->set_position(HepMC::FourVector( persVtx.m_x , persVtx.m_y , persVtx.m_z ,persVtx.m_t ));
+  //AV ID cannot be assigned in HepMC3. And its meaning in HepMC2 is not clear.
+  // vtx->m_id      = persVtx.m_id;
+  vtx->add_attribute("weights",std::make_shared<HepMC3::VectorFloatAttribute>(persVtx.m_weights));
+  vtx->add_attribute("barcode",std::make_shared<HepMC3::IntAttribute>(persVtx.m_barcode));
+#else
   DataPool<HepMC::GenVertex>& poolOfVertices = datapools->vtx;
   HepMC::GenVertexPtr vtx(0);
   if(m_isPileup) {
@@ -368,6 +586,7 @@ McEventCollectionCnv_p5::createGenVertex( const McEventCollection_p5& persEvt,
                                     persVtx.m_weights.end() );
   vtx->m_event   = 0;
   vtx->m_barcode = persVtx.m_barcode;
+#endif
 
   // handle the in-going (orphans) particles
   const unsigned int nPartsIn = persVtx.m_particlesIn.size();
@@ -392,6 +611,55 @@ HepMC::GenParticlePtr
 McEventCollectionCnv_p5::createGenParticle( const GenParticle_p5& persPart,
                                             ParticlesMap_t& partToEndVtx, HepMC::DataPool* datapools ) const
 {
+#ifdef HEPMC3
+  DataPool<HepMC::GenParticlePtr>& poolOfParticles = datapools->part;
+  HepMC::GenParticlePtr p(0);
+    if (m_isPileup) {
+    p = HepMC::newGenParticlePtr();
+  } else {
+    p    = *(poolOfParticles.nextElementPtr());
+  }
+  p->set_pdg_id(              persPart.m_pdgId);
+  p->set_status(              persPart.m_status);
+  p->add_attribute("phi",std::make_shared<HepMC3::DoubleAttribute>(persPart.m_phiPolarization));
+  p->add_attribute("theta",std::make_shared<HepMC3::DoubleAttribute>(persPart.m_thetaPolarization));
+  p->add_attribute("barcode",std::make_shared<HepMC3::IntAttribute>(persPart.m_barcode));  
+  p->set_generated_mass(persPart.m_generated_mass);
+
+  // Note: do the E calculation in extended (long double) precision.
+  // That happens implicitly on x86 with optimization on; saying it
+  // explicitly ensures that we get the same results with and without
+  // optimization.  (If this is a performance issue for platforms
+  // other than x86, one could change to double for those platforms.)
+  if ( 0 == persPart.m_recoMethod ) {
+    double temp_e = std::sqrt( (long double)(persPart.m_px)*persPart.m_px +
+                          (long double)(persPart.m_py)*persPart.m_py +
+                          (long double)(persPart.m_pz)*persPart.m_pz +
+                          (long double)(persPart.m_m) *persPart.m_m );
+      p->set_momentum( HepMC::FourVector(persPart.m_px,persPart.m_px,persPart.m_px,temp_e));
+  } else {
+    const int signM2 = ( persPart.m_m >= 0. ? 1 : -1 );
+    const double persPart_ene =
+      std::sqrt( std::abs((long double)(persPart.m_px)*persPart.m_px +
+                (long double)(persPart.m_py)*persPart.m_py +
+                (long double)(persPart.m_pz)*persPart.m_pz +
+                signM2* (long double)(persPart.m_m)* persPart.m_m));
+    const int signEne = ( persPart.m_recoMethod == 1 ? 1 : -1 );
+    p->set_momentum(HepMC::FourVector( persPart.m_px,
+                       persPart.m_py,
+                       persPart.m_pz,
+                       signEne * persPart_ene ));
+  }
+
+  // setup flow
+  std::vector<int> flows;
+  const unsigned int nFlow = persPart.m_flow.size();
+  for ( unsigned int iFlow= 0; iFlow != nFlow; ++iFlow ) {
+  flows.push_back(persPart.m_flow[iFlow].second );
+  }
+  //We construct it here as vector w/o gaps.
+  p->add_attribute("flows", std::make_shared<HepMC3::VectorIntAttribute>(flows));
+#else
   DataPool<HepMC::GenParticle>& poolOfParticles = datapools->part;
   HepMC::GenParticlePtr p(0);
   if (m_isPileup) {
@@ -444,6 +712,7 @@ McEventCollectionCnv_p5::createGenParticle( const GenParticle_p5& persPart,
     p->m_flow.set_icode( persPart.m_flow[iFlow].first,
                          persPart.m_flow[iFlow].second );
   }
+#endif
 
   if ( persPart.m_endVtx != 0 ) {
     partToEndVtx[p] = persPart.m_endVtx;
@@ -452,6 +721,41 @@ McEventCollectionCnv_p5::createGenParticle( const GenParticle_p5& persPart,
   return p;
 }
 
+#ifdef HEPMC3
+void McEventCollectionCnv_p5::writeGenVertex( HepMC::ConstGenVertexPtr vtx,
+                                              McEventCollection_p5& persEvt ) const
+{
+  const HepMC::FourVector& position = vtx->position();
+  auto A_weights=vtx->attribute<HepMC3::VectorDoubleAttribute>("weights"); 
+  auto A_barcode=vtx->attribute<HepMC3::IntAttribute>("barcode"); 
+  std::vector<double> weights=A_weights?(A_weights->value()):std::vector<double>();
+  persEvt.m_genVertices.push_back(
+                                  GenVertex_p5( position.x(),
+                                                position.y(),
+                                                position.z(),
+                                                position.t(),
+                                                vtx->id(),
+                                                weights.begin(),
+                                                weights.end(),
+                                                A_barcode?(A_barcode->value()):vtx->id()) );
+  GenVertex_p5& persVtx = persEvt.m_genVertices.back();
+
+  // we write only the orphans in-coming particles
+  persVtx.m_particlesIn.reserve(vtx->particles_in().size());
+  for (auto p: vtx->particles_in()) {
+    if ( !p->production_vertex() ) {
+      persVtx.m_particlesIn.push_back( writeGenParticle( p, persEvt ) );
+    }
+  }
+
+  persVtx.m_particlesOut.reserve(vtx->particles_out().size());
+  for (auto p: vtx->particles_out()) {
+    persVtx.m_particlesOut.push_back( writeGenParticle( p, persEvt ) );
+  }
+
+  return;
+}
+#else
 void McEventCollectionCnv_p5::writeGenVertex( const HepMC::GenVertex& vtx,
                                               McEventCollection_p5& persEvt ) const
 {
@@ -488,7 +792,51 @@ void McEventCollectionCnv_p5::writeGenVertex( const HepMC::GenVertex& vtx,
 
   return;
 }
+#endif
 
+#ifdef HEPMC3
+int McEventCollectionCnv_p5::writeGenParticle( HepMC::ConstGenParticlePtr p,
+                                               McEventCollection_p5& persEvt ) const
+{
+  const HepMC::FourVector mom = p->momentum();
+  const double ene = mom.e();
+  const double m2  = mom.m2();
+
+  // Definitions of Bool isTimeLilike, isSpacelike and isLightlike according to HepLorentzVector definition
+  const bool useP2M2 = !(m2 > 0) &&   // !isTimelike
+    (m2 < 0) &&   //  isSpacelike
+    !(std::abs(m2) < 2.0*DBL_EPSILON*ene*ene); // !isLightlike
+    auto A_flows=p->attribute<HepMC3::VectorIntAttribute>("flows"); 
+    auto A_phi=p->attribute<HepMC3::DoubleAttribute>("phi"); 
+    auto A_theta=p->attribute<HepMC3::DoubleAttribute>("theta"); 
+    
+  const short recoMethod = ( !useP2M2 ? 0: ( ene >= 0.? 1: 2 ) );
+  persEvt.m_genParticles.
+    push_back( GenParticle_p5( mom.px(),
+                               mom.py(),
+                               mom.pz(),
+                               mom.m(),
+                               p->pdg_id(),
+                               p->status(),
+                               A_flows?(A_flows->value().size()):0,
+                               A_theta?(A_theta->value()):0.0,
+                               A_phi?(A_phi->value()):0.0,
+                               p->production_vertex()? HepMC::barcode(p->production_vertex()):0,
+                               p->end_vertex()? HepMC::barcode(p->end_vertex()):0,
+                               HepMC::barcode(p),
+                               p->generated_mass(),
+                               recoMethod ) );
+                               
+  std::vector< std::pair<int,int> > flow_hepmc2;
+  if(A_flows) flow_hepmc2=vector_to_vector_int_int(A_flows->value());
+  persEvt.m_genParticles.back().m_flow.assign( flow_hepmc2.begin(),flow_hepmc2.end() );
+
+  // we return the index of the particle in the big vector of particles
+  // (contained by the persistent GenEvent)
+  return (persEvt.m_genParticles.size() - 1);
+
+}
+#else
 int McEventCollectionCnv_p5::writeGenParticle( const HepMC::GenParticle& p,
                                                McEventCollection_p5& persEvt ) const
 {
@@ -534,6 +882,7 @@ int McEventCollectionCnv_p5::writeGenParticle( const HepMC::GenParticle& p,
   // (contained by the persistent GenEvent)
   return (persEvt.m_genParticles.size() - 1);
 }
+#endif
 
 void McEventCollectionCnv_p5::setPileup() {
   m_isPileup = true;
diff --git a/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_utils.h b/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_utils.h
index 982693b593a129840e17b67c1fff8b903b97b974..46b86158da55f85fb0645ab49ae96b6f67c9fa6c 100644
--- a/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_utils.h
+++ b/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_utils.h
@@ -20,4 +20,31 @@ namespace {
 
     return std::make_pair( nParts, nVerts );
   }
-}
\ No newline at end of file
+#ifdef HEPMC3
+std::vector<std::string>   name_index_map_to_names(const std::map<std::string, unsigned long int> &input)
+{
+std::vector<std::string> result;
+std::vector<std::pair<std::string, unsigned long int> > sorted; 
+for (auto el: input) sorted.push_back(el);
+std::sort(sorted.begin(), sorted.end(),[](std::pair<std::string, unsigned long int> a, std::pair<std::string, unsigned long int> b) {return a.second > b.second; }); 
+for (auto a: sorted) result.push_back(a.first);
+return result;
+}
+
+std::map<std::string, unsigned long int> names_to_name_index_map(const  std::vector<std::string>  &input )
+{
+std::map<std::string, unsigned long int> result;
+unsigned long int i=0;
+for (auto a: input) {result[a]=i; i++;}
+return result;
+}
+
+std::vector<std::pair<int,int> > vector_to_vector_int_int(const  std::vector<int>  &input )
+{
+std::vector<std::pair<int,int> > result;
+unsigned long int i=0;
+for (auto a: input) {result.push_back(std::pair<int,int>(a,i)); i++;}
+return result;
+}
+#endif
+}
diff --git a/Generators/MadGraphControl/python/MadGraphUtils.py b/Generators/MadGraphControl/python/MadGraphUtils.py
index 994d630839fdd5cf35d0aa141b55b258f0c4b8fc..238df7d9aca03ebcc6d63d306efbf68defdcd882 100755
--- a/Generators/MadGraphControl/python/MadGraphUtils.py
+++ b/Generators/MadGraphControl/python/MadGraphUtils.py
@@ -1016,12 +1016,18 @@ def arrange_output(process_dir=MADGRAPH_GRIDPACK_LOCATION,lhe_version=None,saveP
         orig_input = process_dir+'/Events/'+MADGRAPH_RUN_NAME+'/events.lhe'
         mod_output = open(os.getcwd()+'/events.lhe','w')
 
-    #Removing empty lines in LHE
+    #Removing empty lines and bad comments in LHE
     nEmpty=0
     with open(orig_input,'r') as fileobject:
         for line in fileobject:
             if line.strip():
-                mod_output.write(line)
+                if '#' not in line:
+                    mod_output.write(line)
+                elif '>' not in line[ line.find('#'): ]:
+                    mod_output.write(line)
+                else:
+                    mglog.warning('Found bad LHE line with an XML mark in a comment: "'+line.strip()+'"')
+                    mod_output.write(line[:line.find('#')]+'#'+ (line[line.find('#'):].replace('>','-')))
             else:
                 nEmpty=nEmpty+1
     mod_output.close()
diff --git a/Generators/Sherpa_i/share/Example/MC15.999999.Sherpa_Example.py b/Generators/Sherpa_i/share/Example/MC15.999999.Sherpa_Example.py
deleted file mode 100644
index e06d487ac4fe58395bf8435daa6b3b463761241f..0000000000000000000000000000000000000000
--- a/Generators/Sherpa_i/share/Example/MC15.999999.Sherpa_Example.py
+++ /dev/null
@@ -1,18 +0,0 @@
-include("MC15JobOptions/Sherpa_NNPDF30NNLO_Common.py")
-
-evgenConfig.description = "Sherpa 2.2.x example JO, Z+0,1-jet production."
-evgenConfig.keywords = [ "Example", "DrellYan" ]
-evgenConfig.contact  = [ "atlas-generators-sherpa@cern.ch", "frank.siegert@cern.ch"]
-
-sherpaRunCard="""
-(processes){
-  Process 93 93 -> 11 -11 93{1}
-  Order (*,2)
-  CKKW sqr(20/E_CMS)
-  End process;
-}(processes)
-
-(selector){
-  Mass 11 -11 40 E_CMS
-}(selector)
-"""
diff --git a/Generators/Sherpa_i/share/common/Base_Fragment.py b/Generators/Sherpa_i/share/common/Base_Fragment.py
new file mode 100644
index 0000000000000000000000000000000000000000..acb690d89d7b6f0b6cd9f298cfbf4e6979a4caa9
--- /dev/null
+++ b/Generators/Sherpa_i/share/common/Base_Fragment.py
@@ -0,0 +1,131 @@
+## Base config for Sherpa
+from Sherpa_i.Sherpa_iConf import Sherpa_i
+genSeq += Sherpa_i()
+evgenConfig.generators = ["Sherpa"]
+genSeq.Sherpa_i.PluginCode = ""
+
+## Tell Sherpa to read its run card sections from the jO
+## TODO: write out Run.dat from genSeq.Sherpa_i.RunCard and read from it
+## instead of the JO
+genSeq.Sherpa_i.Parameters += [ 'RUNDATA=%s' % runArgs.jobConfig[0] ]
+
+## Tell Sherpa to write logs into a separate file
+## (need for production, looping job detection, Wolfgang Ehrenfeld)
+genSeq.Sherpa_i.Parameters += [ 'LOG_FILE=sherpa.log' ]
+
+## General ATLAS parameters
+genSeq.Sherpa_i.Parameters += [
+    "BEAM_1=2212",
+    "BEAM_2=2212",
+    "MAX_PROPER_LIFETIME=10.0",
+    "HEPMC_TREE_LIKE=1",
+    "PRETTY_PRINT=Off",
+    ]
+
+## Cap event weights at |w|<10 in unweighted evgen; set H-event shower mode
+## in the soft region to avoid instable weights 
+genSeq.Sherpa_i.Parameters += [
+    "OVERWEIGHT_THRESHOLD=10",
+    "PP_HPSMODE=0"
+]
+
+## Enable scale variations by default
+genSeq.Sherpa_i.Parameters += [
+    "HEPMC_USE_NAMED_WEIGHTS=1",
+    "CSS_REWEIGHT=1",
+    "REWEIGHT_SPLITTING_PDF_SCALES=1",
+    "REWEIGHT_SPLITTING_ALPHAS_SCALES=1",
+    "CSS_REWEIGHT_SCALE_CUTOFF=5.0",
+    "HEPMC_INCLUDE_ME_ONLY_VARIATIONS=1",
+    "SCALE_VARIATIONS=0.25,0.25 0.25,1. 1.,0.25 1.,1. 1.,4. 4.,1. 4.,4.",
+]
+
+## Switch to EW_SCHEME=0 to be able to set PDG value of thetaW
+genSeq.Sherpa_i.Parameters += [ "EW_SCHEME=0" ]
+
+try:
+    USE_PDG_VALUES
+except NameError:
+    USE_PDG_VALUES = False
+## if USE_PDG_VALUES = True, load PDG value 
+## of sin2thetaW and particle masses/widths 
+## from parameter dictionary located in 
+## EvgenProdTools/python/offline_dict.py 
+## ToDo: Include partial widths for H/W/Z?
+recorded = []
+if USE_PDG_VALUES:
+    from EvgenProdTools.offline_dict import parameters
+    for k,v in parameters.items():
+        if k == 'particles':
+            for key,value in v.items():
+                if 5 < int(key) and int(key) < 26:
+                    ## This includes now the top quark, 
+                    ## the leptons and the bosons
+                    genSeq.Sherpa_i.Parameters += [ 
+                        'MASS['+key+']='+ value['mass'],
+                        'WIDTH['+key+']='+ value['width'],
+                    ]
+                    recorded.append(key)
+        elif k == 'EW_parameters':
+            for key,value in v.items():
+                if key[0] == 'SIN2THETAW':
+                    genSeq.Sherpa_i.Parameters += [
+                        str(key[0])+'='+str(value),
+                    ]
+                    recorded.append(str(key[0]))
+                    break
+
+# Fall-back to the MC15 default values if need be
+defaults = {
+    '6'  : [ "MASS[6]=172.5",    "WIDTH[6]=1.32"         ],
+    '15' : [ "MASS[15]=1.777",   "WIDTH[15]=2.26735e-12" ],
+    '23' : [ "MASS[23]=91.1876", "WIDTH[23]=2.4952"      ],
+    '24' : [ "MASS[24]=80.399",  "WIDTH[24]=2.085"       ],
+    'SIN2THETAW' : [ "SIN2THETAW=0.23113" ],
+}
+for key, value in defaults.items():
+  if key not in recorded:
+    genSeq.Sherpa_i.Parameters += value
+
+
+
+## set/add partial widths for H, W, Z to PDG values
+## cf. https://sherpa.hepforge.org/doc/SHERPA-MC-2.2.4.html#HDH_005fWIDTH
+genSeq.Sherpa_i.Parameters += [
+    "HDH_WIDTH[6,24,5]=1.32",    #updated to comply latest updated top results
+    "HDH_WIDTH[-6,-24,-5]=1.32",  #updated to comply latest updated top results
+    "HDH_WIDTH[25,5,-5]=2.35e-3",
+    "HDH_WIDTH[25,15,-15]=2.57e-4",
+    "HDH_WIDTH[25,13,-13]=8.91e-7",
+    "HDH_WIDTH[25,4,-4]=1.18e-4",
+    "HDH_WIDTH[25,3,-3]=1.00e-6",
+    "HDH_WIDTH[25,21,21]=3.49e-4",
+    "HDH_WIDTH[25,22,22]=9.28e-6",
+    "HDH_WIDTH[24,2,-1]=0.7041",
+    "HDH_WIDTH[24,4,-3]=0.7041",
+    "HDH_WIDTH[24,12,-11]=0.2256",
+    "HDH_WIDTH[24,14,-13]=0.2256",
+    "HDH_WIDTH[24,16,-15]=0.2256",
+    "HDH_WIDTH[-24,-2,1]=0.7041",
+    "HDH_WIDTH[-24,-4,3]=0.7041",
+    "HDH_WIDTH[-24,-12,11]=0.2256",
+    "HDH_WIDTH[-24,-14,13]=0.2256",
+    "HDH_WIDTH[-24,-16,15]=0.2256",
+    "HDH_WIDTH[23,1,-1]=0.3828",
+    "HDH_WIDTH[23,2,-2]=0.2980",
+    "HDH_WIDTH[23,3,-3]=0.3828",
+    "HDH_WIDTH[23,4,-4]=0.2980",
+    "HDH_WIDTH[23,5,-5]=0.3828",
+    "HDH_WIDTH[23,11,-11]=0.0840",
+    "HDH_WIDTH[23,12,-12]=0.1663",
+    "HDH_WIDTH[23,13,-13]=0.0840",
+    "HDH_WIDTH[23,14,-14]=0.1663",
+    "HDH_WIDTH[23,15,-15]=0.0840",
+    "HDH_WIDTH[23,16,-16]=0.1663",
+    ]
+
+## OpenLoops parameters
+genSeq.Sherpa_i.Parameters += [
+    "OL_PREFIX=/cvmfs/sft.cern.ch/lcg/releases/LCG_88/MCGenerators/openloops/2.0.0/x86_64-slc6-gcc62-opt",
+    "OL_PARAMETERS=preset=2 write_parameters=1",
+]
diff --git a/Generators/Sherpa_i/share/common/EW_scheme_sinthetaW_mZ.py b/Generators/Sherpa_i/share/common/EW_scheme_sinthetaW_mZ.py
new file mode 100644
index 0000000000000000000000000000000000000000..01379742979f04dfd1826f92f2179808e9e84932
--- /dev/null
+++ b/Generators/Sherpa_i/share/common/EW_scheme_sinthetaW_mZ.py
@@ -0,0 +1,38 @@
+# Use EW scheme which allows specifying sinThetaW and mZ simultaneously at the expense of mW.
+# Three sub-options for specifying the QED coupling are introduced:
+#
+#    EW_SCHEME=20 for alpha(0), mZ, sinThetaW
+#    EW_SCHEME=21 for Gmu, mZ, sinThetaW
+#    EW_SCHEME=22 for alpha(mZ), mZ, sinThetaW
+
+genSeq.Sherpa_i.Parameters += [ "EW_SCHEME=22" ]
+
+try:
+    USE_PDG_VALUES
+except NameError:
+    USE_PDG_VALUES = False
+## if USE_PDG_VALUES = True, load PDG value of 
+## sin2thetaW from parameter dictionary located
+## in EvgenProdTools/python/offline_dict.py 
+if USE_PDG_VALUES:
+    from EvgenProdTools.offline_dict import parameters
+    for k,v in parameters.items():
+        if k == 'EW_parameters':
+            for key,value in v.items():
+                if key[0] == 'SIN2THETAW':
+                    genSeq.Sherpa_i.Parameters += [
+                        str(key[0])+'='+str(value),
+                    ]
+                    break
+            break
+if 'SIN2THETAW' not in genSeq.Sherpa_i.Parameters[-1]:
+    genSeq.Sherpa_i.Parameters += [ "SIN2THETAW=0.23113" ]
+
+
+## Overwrite OL_PREFIX to not use it from cvmfs (which doesn't have this scheme implemented yet)
+## Also adding OL_IGNORE_MODEL (default to SM) since the scheme names aren't synchronised yet
+genSeq.Sherpa_i.Parameters += [
+    "OL_PREFIX=./Process/OpenLoops",
+    "OL_PARAMETERS=ew_renorm_scheme 22 write_parameters 1",
+    "OL_IGNORE_MODEL=1",
+]
diff --git a/Generators/Sherpa_i/share/common/Fusing_Direct.py b/Generators/Sherpa_i/share/common/Fusing_Direct.py
new file mode 100644
index 0000000000000000000000000000000000000000..d88da593d53668ea809cdda59887da8d4122fb10
--- /dev/null
+++ b/Generators/Sherpa_i/share/common/Fusing_Direct.py
@@ -0,0 +1,10 @@
+# CAUTION: when including this, you have to set the following process-dependent setting in your JO:
+# If two strong couplings are involved at Born level, `FUSING_DIRECT_FACTOR=1` (e.g. Zbb).
+# If there are four such couplings, `FUSING_DIRECT_FACTOR=2` (e.g. ttbb).
+
+# taken from Sherpa examples: Examples/V_plus_Bs/LHC_Fusing/
+
+genSeq.Sherpa_i.Parameters += [ "SHERPA_LDADD=SherpaFusing",
+                                "USERHOOK=Fusing_Direct",
+                                "CSS_SCALE_SCHEME=20",
+                                "CSS_EVOLUTION_SCHEME=30", ]
diff --git a/Generators/Sherpa_i/share/common/Fusing_Fragmentation.py b/Generators/Sherpa_i/share/common/Fusing_Fragmentation.py
new file mode 100644
index 0000000000000000000000000000000000000000..a3739a60ff02d0ef5b5ce2c70e59ba2e8d5298b1
--- /dev/null
+++ b/Generators/Sherpa_i/share/common/Fusing_Fragmentation.py
@@ -0,0 +1,8 @@
+# taken from Sherpa examples: Examples/V_plus_Bs/LHC_Fusing/
+
+genSeq.Sherpa_i.Parameters += [ "SHERPA_LDADD=SherpaFusing",
+                                "USERHOOK=Fusing_Fragmentation",
+                                "CSS_SCALE_SCHEME=20",
+                                "CSS_EVOLUTION_SCHEME=30",
+                                "FUSING_FRAGMENTATION_STORE_AS_WEIGHT=1",
+]
diff --git a/Generators/Sherpa_i/share/common/Lund_Hadronisation.py b/Generators/Sherpa_i/share/common/Lund_Hadronisation.py
new file mode 100644
index 0000000000000000000000000000000000000000..00461907d6bdb8035c20e54c30e20b28807d5fa3
--- /dev/null
+++ b/Generators/Sherpa_i/share/common/Lund_Hadronisation.py
@@ -0,0 +1,7 @@
+genSeq.Sherpa_i.Parameters += [
+  "FRAGMENTATION=Lund",
+  "DECAYMODEL=Lund",
+  "PARJ(21)=0.36",
+  "PARJ(41)=0.3",
+  "PARJ(42)=0.6"
+]
diff --git a/Generators/Sherpa_i/share/common/NNPDF30NNLO.py b/Generators/Sherpa_i/share/common/NNPDF30NNLO.py
new file mode 100644
index 0000000000000000000000000000000000000000..8ed2075b408a0b87842b2eebea0f8b681a42d955
--- /dev/null
+++ b/Generators/Sherpa_i/share/common/NNPDF30NNLO.py
@@ -0,0 +1,8 @@
+evgenConfig.tune = "NNPDF3.0 NNLO"
+
+genSeq.Sherpa_i.Parameters += [
+    "PDF_LIBRARY=LHAPDFSherpa",
+    "USE_PDF_ALPHAS=1",
+    "PDF_SET=NNPDF30_nnlo_as_0118_hessian",
+    "PDF_VARIATIONS=NNPDF30_nnlo_as_0118_hessian[all] NNPDF30_nnlo_as_0117 NNPDF30_nnlo_as_0119 MMHT2014nnlo68cl CT14nnlo PDF4LHC15_nnlo_30_pdfas[all] NNPDF31_nnlo_as_0118_hessian",
+    ]
diff --git a/Generators/Sherpa_i/share/common/NNPDF30NNLO_nf_4.py b/Generators/Sherpa_i/share/common/NNPDF30NNLO_nf_4.py
new file mode 100644
index 0000000000000000000000000000000000000000..44bdff859c515566ef5608e4352175c764e830f0
--- /dev/null
+++ b/Generators/Sherpa_i/share/common/NNPDF30NNLO_nf_4.py
@@ -0,0 +1,8 @@
+evgenConfig.tune = "NNPDF3.0 NNLO"
+
+genSeq.Sherpa_i.Parameters += [
+    "PDF_LIBRARY=LHAPDFSherpa",
+    "USE_PDF_ALPHAS=1",
+    "PDF_SET=NNPDF30_nnlo_as_0118_nf_4",
+    "PDF_VARIATIONS=NNPDF30_nnlo_as_0118_nf_4[all] NNPDF30_nnlo_as_0117_nf_4 NNPDF30_nnlo_as_0119_nf_4 MMHT2014nnlo68cl_nf4 CT14nnlo_NF4 PDF4LHC15_nlo_nf4_30[all]",
+    ]
diff --git a/Generators/Sherpa_i/share/example/999999/mc.Sh_Example.py b/Generators/Sherpa_i/share/example/999999/mc.Sh_Example.py
new file mode 100644
index 0000000000000000000000000000000000000000..9d26dec441f4338afcad7e3b7a197ba197d32054
--- /dev/null
+++ b/Generators/Sherpa_i/share/example/999999/mc.Sh_Example.py
@@ -0,0 +1,27 @@
+include("Sherpa_i/Base_Fragment.py")
+include("Sherpa_i/NNPDF30NNLO.py")
+
+evgenConfig.description = "Sherpa 2.2.x example JO, Z+0,1-jet production."
+evgenConfig.keywords = [ "2lepton" ]
+evgenConfig.contact  = [ "atlas-generators-sherpa@cern.ch", "frank.siegert@cern.ch"]
+evgenConfig.nEventsPerJob = 10000
+
+genSeq.Sherpa_i.RunCard="""
+(processes){
+  Process 93 93 -> 11 -11 93{1}
+  Order (*,2)
+  CKKW sqr(20/E_CMS)
+  End process;
+}(processes)
+
+(selector){
+  Mass 11 -11 40 E_CMS
+}(selector)
+"""
+
+genSeq.Sherpa_i.Parameters += []
+genSeq.Sherpa_i.OpenLoopsLibs = []
+genSeq.Sherpa_i.ExtraFiles = []
+genSeq.Sherpa_i.NCores = 1
+
+genSeq.Sherpa_i.CleanupGeneratedFiles = 1
diff --git a/Generators/Sherpa_i/share/Example/README b/Generators/Sherpa_i/share/example/README
similarity index 52%
rename from Generators/Sherpa_i/share/Example/README
rename to Generators/Sherpa_i/share/example/README
index b4e3651fcb0dc7e43df16732c2c9d81a1ac212e8..260f3493a5350536ccfe3e684f0ad9e6fa1024c9 100644
--- a/Generators/Sherpa_i/share/Example/README
+++ b/Generators/Sherpa_i/share/example/README
@@ -1,5 +1,5 @@
 Please refer to
 
-  https://twiki.cern.ch/twiki/bin/viewauth/AtlasProtected/SherpaForAtlas#MC12
+  https://twiki.cern.ch/twiki/bin/viewauth/AtlasProtected/SherpaForAtlas
 
-for information and instructions on how to use Sherpa JOs.
+for more information about Sherpa JOs.
diff --git a/Generators/Sherpa_i/share/validation/SherpaTest.cc b/Generators/Sherpa_i/share/validation/SherpaTest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..908c808e24ce6313a4a94a4df5b603366b693525
--- /dev/null
+++ b/Generators/Sherpa_i/share/validation/SherpaTest.cc
@@ -0,0 +1,73 @@
+// -*- C++ -*-
+#include "Rivet/Analysis.hh"
+#include "HepMC/GenEvent.h"
+
+namespace Rivet {
+
+  /// @brief Analysis for testing trivial reweighting
+  class SherpaTest : public Analysis {
+  public:
+
+    /// @name Constructors etc.
+    //@{
+
+    /// Constructor
+    SherpaTest()
+      : Analysis("SherpaTest")
+    {    }
+
+    //@}
+
+
+  public:
+
+    /// @name Analysis methods
+    //@{
+
+    /// Book histograms before the run
+    void init() {
+      _h_enW  = bookHisto1D("NomEqualsTrivWeightVariationMUR1_MUF1_PDF261000", 2, -0.5, 1.5);
+      _h_enW2  = bookHisto1D("LessThan1e-14RelativeDiffNomTrivWeightVariationMUR1_MUF1_PDF261000", 2, -0.5, 1.5);
+      _h_enW3  = bookHisto1D("LessThan1e-12RelativeDiffNomTrivWeightVariationMUR1_MUF1_PDF261000", 2, -0.5, 1.5);
+    }
+
+
+    /// Perform the per-event analysis
+    void analyze(const Event& event) {
+      double trivWeight = event.genEvent()->weights()["MUR1_MUF1_PDF261000"];
+      double Weight     = event.weight();//= event.genEvent()->weights()["Weight"];
+      _h_enW ->fill((trivWeight==Weight ? 1. : 0.), 1.);
+      double presicion  = 1e-14;
+      double presicion3 = 1e-12;      
+      _h_enW2 ->fill((abs(trivWeight/Weight-1) < presicion ? 1. : 0.), 1.);      
+      _h_enW3 ->fill((abs(trivWeight/Weight-1) < presicion3 ? 1. : 0.), 1.);      
+      /*if (abs(trivWeight/Weight-1) > 1e-16) {
+        std::cout << "Weight:              " << Weight <<std::endl;
+        std::cout << "trivWeight:          " << trivWeight <<std::endl;
+        std::cout << "trivWeight-Weight:   " << trivWeight-Weight <<std::endl;
+        std::cout << "trivWeight/Weight-1: " << trivWeight/Weight-1 <<std::endl;
+        std::cout << "abs(trivWeight/Weight-1): " << abs(trivWeight/Weight-1) <<std::endl;
+        }*/
+    }
+
+
+    /// Normalise histograms etc., after the run
+    void finalize() {
+    }
+
+    //@}
+
+
+  private:
+
+    /// @name Histograms
+    Histo1DPtr _h_enW;
+    Histo1DPtr _h_enW2;
+    Histo1DPtr _h_enW3;
+  };
+
+
+  // The hook for the plugin system
+  DECLARE_RIVET_PLUGIN(SherpaTest);
+
+}
diff --git a/HLT/Trigger/TrigControl/TrigServices/python/TriggerUnixStandardSetup.py b/HLT/Trigger/TrigControl/TrigServices/python/TriggerUnixStandardSetup.py
index ee0c6cad6bd22a610d1ed46f88433110afd645f5..8904eec9b96bbff0a3a90f796577e51d334b2e40 100644
--- a/HLT/Trigger/TrigControl/TrigServices/python/TriggerUnixStandardSetup.py
+++ b/HLT/Trigger/TrigControl/TrigServices/python/TriggerUnixStandardSetup.py
@@ -68,7 +68,7 @@ def setupCommonServices():
 
     # setup ROOT6
     from PyUtils.Helpers import ROOT6Setup
-    ROOT6Setup()
+    ROOT6Setup(batch=True)
 
     # Setup online THistSvc unless specifically configured otherwise
     #    setup the THistSvc early and force the creation of the THistSvc 
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/PlotChargeSharingConstants.cxx b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/PlotChargeSharingConstants.cxx
index 902b4225c19789a609da97c7042974471f6408b3..b3fabc9054e5a3016248462af3c03236de86440f 100644
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/PlotChargeSharingConstants.cxx
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/PlotChargeSharingConstants.cxx
@@ -14,7 +14,7 @@
 
 using namespace PixelCalib;
 
-int main ATLAS_NOT_THREAD_SAFE (int argc, char *argv[]){ // Thread unsafe PixelChargeInterpolationPlot class is used.
+int main (int argc, char *argv[]){
 
 	TApplication myapp("application", 0 , 0);
 
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/PlotPixelClusterOnTrackErrors.cxx b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/PlotPixelClusterOnTrackErrors.cxx
index a19e1af68d27eab2c311f6370695be054b75b090..062a9ef5a43e6030a205327d91277e194ce66f62 100644
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/PlotPixelClusterOnTrackErrors.cxx
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/PlotPixelClusterOnTrackErrors.cxx
@@ -14,7 +14,7 @@
 
 using namespace PixelCalib;
 
-int main ATLAS_NOT_THREAD_SAFE (int argc, char *argv[]){ // Thread usnafe PixelClusterOnTrackErrorPlot class is used.
+int main (int argc, char *argv[]){
 
 	TApplication myapp("application", 0 , 0);
 
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/createDeadModuleList.C b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/createDeadModuleList.C
index 12cda424d7082d1e7ee47345168fa82704483935..60cbc45bd3249377d90ed5c30aa3a7bd6aec39da 100644
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/createDeadModuleList.C
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/createDeadModuleList.C
@@ -21,11 +21,11 @@
 #include "PixelCalibAlgs/PixelConvert.h"
 #include "PixelConditionsData/SpecialPixelMap.h"
 
-std::vector< std::pair< std::string, std::vector<int> > > pixelMapping;
-std::vector< std::pair< int, std::vector<int> > > hashMapping;
-std::string getDCSIDFromPosition (int barrel_ec, int layer, int module_phi, int module_eta);
-int getHashFromPosition (int barrel_ec, int layer, int module_phi, int module_eta);
-std::vector<int> getPositionFromDCSID (const std::string& module_name);
+using PixelMap_t = std::vector< std::pair< std::string, std::vector<int> > >;
+using HashMap_t = std::vector< std::pair< int, std::vector<int> > >;
+std::string getDCSIDFromPosition (PixelMap_t& pixelMapping, int barrel_ec, int layer, int module_phi, int module_eta);
+int getHashFromPosition (HashMap_t& hashMapping, int barrel_ec, int layer, int module_phi, int module_eta);
+std::vector<int> getPositionFromDCSID (PixelMap_t& pixelMapping, const std::string& module_name);
 
 std::vector<std::string> &splitter(const std::string &s, char delim, std::vector<std::string> &elems) {
   std::stringstream ss(s);
@@ -51,7 +51,7 @@ bool is_file_exist(const char *fileName)
 
 using namespace std;
 
-int main ATLAS_NOT_THREAD_SAFE (int argc, char* argv[]){ // Global variable is used.
+int main (int argc, char* argv[]){
   const bool isIBL = true;
 
   //-----------------------------------
@@ -220,8 +220,10 @@ int main ATLAS_NOT_THREAD_SAFE (int argc, char* argv[]){ // Global variable is u
   const unsigned int maxPathStringLength{3000};
   if((not tmppath) or (strlen(tmppath) > maxPathStringLength) ){
       std::cout << "FATAL: Unable to retrieve environmental DATAPATH" << std::endl;
-      exit(EXIT_FAILURE);
+      return(EXIT_FAILURE);
   }
+  PixelMap_t pixelMapping;
+  HashMap_t hashMapping;
   std::stringstream tmpSstr{};
   tmpSstr<<tmppath;
   std::string cmtpath(tmpSstr.str());
@@ -338,12 +340,12 @@ int main ATLAS_NOT_THREAD_SAFE (int argc, char* argv[]){ // Global variable is u
     std::vector<std::string>::const_iterator module_iter;
     for(module_iter = (iter->second).begin(); module_iter != (iter->second).end(); ++module_iter){
       std::string moduleID = *module_iter;
-      std::vector<int> position = getPositionFromDCSID(moduleID);
+      std::vector<int> position = getPositionFromDCSID(pixelMapping, moduleID);
       int barrel = position[0];
       int layer = position[1];
       int module_phi = position[2];
       int module_eta = position[3];
-      pyFile << getHashFromPosition(barrel, layer, module_phi, module_eta) << ", ";
+      pyFile << getHashFromPosition(hashMapping, barrel, layer, module_phi, module_eta) << ", ";
     }
     pyFile << "])" << std::endl;;
   }
@@ -505,7 +507,7 @@ int main ATLAS_NOT_THREAD_SAFE (int argc, char* argv[]){ // Global variable is u
     int layer = position[1];
     int module_phi = position[2];
     int module_eta = position[3];
-    pyFile[LB] << "job.PixMapOverlayWriter.Modules += [ " << getHashFromPosition(barrel, layer, module_phi, module_eta) << " ] # " << moduleID << std::endl;
+    pyFile[LB] << "job.PixMapOverlayWriter.Modules += [ " << getHashFromPosition(hashMapping, barrel, layer, module_phi, module_eta) << " ] # " << moduleID << std::endl;
   }
   pyFile[LB].close();
 } 
@@ -518,7 +520,7 @@ delete hitMapFile;
 return 0;
 }
 
-std::string getDCSIDFromPosition ATLAS_NOT_THREAD_SAFE (int barrel_ec, int layer, int module_phi, int module_eta){ // Global variable is used.
+std::string getDCSIDFromPosition (PixelMap_t& pixelMapping, int barrel_ec, int layer, int module_phi, int module_eta){
   for(unsigned int ii = 0; ii < pixelMapping.size(); ii++) {
     if (pixelMapping[ii].second.size() != 4) {
       std::cout << "getDCSIDFromPosition: Vector size is not 4!" << std::endl;
@@ -534,7 +536,7 @@ std::string getDCSIDFromPosition ATLAS_NOT_THREAD_SAFE (int barrel_ec, int layer
   return std::string("Error!");
 }
 
-int getHashFromPosition ATLAS_NOT_THREAD_SAFE (int barrel_ec, int layer, int module_phi, int module_eta){ // Global variable is used.
+int getHashFromPosition (HashMap_t& hashMapping, int barrel_ec, int layer, int module_phi, int module_eta){
   for(unsigned int ii = 0; ii < hashMapping.size(); ii++) {
     if (hashMapping[ii].second.size() != 4) {
       std::cout << "getDCSIDFromPosition: Vector size is not 4!" << std::endl;
@@ -550,7 +552,7 @@ int getHashFromPosition ATLAS_NOT_THREAD_SAFE (int barrel_ec, int layer, int mod
   return 0;
 }
 
-std::vector<int> getPositionFromDCSID ATLAS_NOT_THREAD_SAFE (const std::string& module_name){ // Global variable is used.
+std::vector<int> getPositionFromDCSID (PixelMap_t& pixelMapping, const std::string& module_name){
   for(unsigned int ii = 0; ii < pixelMapping.size(); ii++) {
     if (pixelMapping[ii].first == module_name)
       return pixelMapping[ii].second;
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/doPixelOfflineCalib.cxx b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/doPixelOfflineCalib.cxx
index 7e053795a162138f665e6ede9a2cc86a5cd570e1..674623f61209fe53881e6a228d98a9c8eb1fafdf 100644
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/doPixelOfflineCalib.cxx
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/doPixelOfflineCalib.cxx
@@ -11,11 +11,11 @@
 using namespace PixelCalib;
 
 /// the function that does the job!
-int doAll ATLAS_NOT_THREAD_SAFE (std::string input_file, std::string input_tag, // Thread unsafe OfflineCalibrationLoop class is used.
-	  std::string output_tag,
-		std::string collection,
-	  std::string reference_file, std::string reference_tag,
-	  int maxentries){
+int doAll (std::string input_file, std::string input_tag,
+           std::string output_tag,
+           std::string collection,
+           std::string reference_file, std::string reference_tag,
+           int maxentries){
 
 	OfflineCalibrationLoop *s = 0;
 
@@ -38,7 +38,7 @@ int doAll ATLAS_NOT_THREAD_SAFE (std::string input_file, std::string input_tag,
 }
 
 /// main does include the input interpretation
-int main ATLAS_NOT_THREAD_SAFE (int argc, char *argv[]){ // Thread unsafe doAll function is used.
+int main (int argc, char *argv[]){
 
 std::cout << "ciao" << std::endl;
 
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/doPixelOfflineCalibG4.cxx b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/doPixelOfflineCalibG4.cxx
index 046b142859a064c270057f4ea832d359de7bafe7..eae67aa709a9e6caac8ccc4de241fcd2a05ca21f 100644
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/doPixelOfflineCalibG4.cxx
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/doPixelOfflineCalibG4.cxx
@@ -12,10 +12,10 @@
 using namespace PixelCalib;
 
 /// the function that does the job!
-int doAll ATLAS_NOT_THREAD_SAFE (std::string input_file, std::string input_tag, // Thread unsafe PixelRIOs class is used.
-	  std::string output_tag,
-	  std::string reference_file, std::string reference_tag,
-	  int maxentries){
+int doAll (std::string input_file, std::string input_tag,
+           std::string output_tag,
+           std::string reference_file, std::string reference_tag,
+           int maxentries){
 
 	PixelRIOs *s = 0;
 
@@ -38,7 +38,7 @@ int doAll ATLAS_NOT_THREAD_SAFE (std::string input_file, std::string input_tag,
 }
 
 /// main does include the input interpretation
-int main ATLAS_NOT_THREAD_SAFE (int argc, char *argv[]){ // Thread unsafe doAll function is used.
+int main (int argc, char *argv[]){
 
 	if(argc < 4 || argc > 5){
 		std::cout << std::endl;
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/hackNoiseMapsForStudyCP.C b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/hackNoiseMapsForStudyCP.C
index 51a217b1f0bb865abc05e54d474d0d262111e7ed..2662594b31da91e1d2f4873c652564438c1e57c0 100644
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/hackNoiseMapsForStudyCP.C
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/hackNoiseMapsForStudyCP.C
@@ -25,9 +25,9 @@
 #include "PixelCalibAlgs/PixelConvert.h"
 #include "PixelConditionsData/SpecialPixelMap.h"
 
-std::vector< std::pair< std::string, std::vector<int> > > pixelMapping;
-std::string getDCSIDFromPosition (int barrel_ec, int layer, int module_phi, int module_eta);
-std::vector<int> getPositionFromDCSID (const std::string& module_name);
+using PixelMap_t = std::vector< std::pair< std::string, std::vector<int> > >;
+std::string getDCSIDFromPosition (PixelMap_t& map, int barrel_ec, int layer, int module_phi, int module_eta);
+std::vector<int> getPositionFromDCSID (PixelMap_t& map, const std::string& module_name);
 
 double ComputeMuChip(TH2D* modhisto, int chip)
 {
@@ -122,7 +122,7 @@ int ComputePoisson(double probcut, double mu) {
   return nhits;
 }
 
-int main ATLAS_NOT_THREAD_SAFE (int argc, char* argv[]){ // Global variable is used.
+int main (int argc, char* argv[]){
 
   //std::string option;
 
@@ -567,6 +567,7 @@ int main ATLAS_NOT_THREAD_SAFE (int argc, char* argv[]){ // Global variable is u
   int tmp_barrel_ec; int tmp_layer; int tmp_module_phi; int tmp_module_eta; std::string tmp_module_name;
   std::vector<int> tmp_position;
   tmp_position.resize(4);
+  PixelMap_t pixelMapping;
   //int counter = 0; // debug
   while(ifs >> tmp_barrel_ec >> tmp_layer >> tmp_module_phi >> tmp_module_eta >> tmp_module_name) {
     tmp_position[0] = tmp_barrel_ec;
@@ -594,7 +595,7 @@ int main ATLAS_NOT_THREAD_SAFE (int argc, char* argv[]){ // Global variable is u
       noiseMap = noiseMaps[moduleID];
     }
 
-    std::vector<int> position = getPositionFromDCSID(moduleID);
+    std::vector<int> position = getPositionFromDCSID(pixelMapping, moduleID);
     int barrel = position[0];
     int layer = position[1];
     int module_phi = position[2];
@@ -984,7 +985,7 @@ int main ATLAS_NOT_THREAD_SAFE (int argc, char* argv[]){ // Global variable is u
   return 0;
 }
 
-std::string getDCSIDFromPosition ATLAS_NOT_THREAD_SAFE (int barrel_ec, int layer, int module_phi, int module_eta){ // Global variable is used.
+std::string getDCSIDFromPosition (PixelMap_t& pixelMapping, int barrel_ec, int layer, int module_phi, int module_eta){
   for(unsigned int ii = 0; ii < pixelMapping.size(); ii++) {
     if (pixelMapping[ii].second.size() != 4) {
       std::cout << "getDCSIDFromPosition: Vector size is not 4!" << std::endl;
@@ -1000,7 +1001,7 @@ std::string getDCSIDFromPosition ATLAS_NOT_THREAD_SAFE (int barrel_ec, int layer
   return std::string("Error!");
 }
 
-std::vector<int> getPositionFromDCSID ATLAS_NOT_THREAD_SAFE (const std::string& module_name){ // Global variable is used.
+std::vector<int> getPositionFromDCSID (PixelMap_t& pixelMapping, const std::string& module_name){
   for(unsigned int ii = 0; ii < pixelMapping.size(); ii++) {
     if (pixelMapping[ii].first == module_name)
     return pixelMapping[ii].second;
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/updateDeadMaps.C b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/updateDeadMaps.C
index 026c1bfca7967f35791f319b6de8c55b87a705b3..ce89507d616ae565b15b5738e8d8d0266f5efc30 100644
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/updateDeadMaps.C
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/updateDeadMaps.C
@@ -21,9 +21,9 @@
 #include "PixelCalibAlgs/PixelConvert.h"
 #include "PixelConditionsData/SpecialPixelMap.h"
 
-std::vector< std::pair< std::string, std::vector<int> > > pixelMapping;
-std::string getDCSIDFromPosition (int barrel_ec, int layer, int module_phi, int module_eta);
-std::vector<int> getPositionFromDCSID (const std::string& module_name);
+using PixelMap_t =  std::vector< std::pair< std::string, std::vector<int> > >;
+std::string getDCSIDFromPosition (PixelMap_t& pixelMapping, int barrel_ec, int layer, int module_phi, int module_eta);
+std::vector<int> getPositionFromDCSID (PixelMap_t& pixelMapping, const std::string& module_name);
 
 std::vector<std::string> &splitter(const std::string &s, char delim, std::vector<std::string> &elems) {
   std::stringstream ss(s);
@@ -49,7 +49,7 @@ bool is_file_exist(const char *fileName)
 
 using namespace std;
 
-int main ATLAS_NOT_THREAD_SAFE (int argc, char* argv[]){ // Global variable is used.
+int main (int argc, char* argv[]){
   bool isIBL = true;
 
   int minEventNumber = 2000000;
@@ -411,12 +411,13 @@ int main ATLAS_NOT_THREAD_SAFE (int argc, char* argv[]){ // Global variable is u
   const unsigned int maxPathStringLength{3000};
   if((not tmppath) or (strlen(tmppath) > maxPathStringLength) ){
       std::cout << "FATAL: Unable to retrieve environmental DATAPATH" << std::endl;
-      exit(EXIT_FAILURE);
+      return (EXIT_FAILURE);
   }
   std::stringstream tmpSstr{};
   tmpSstr<<tmppath;
   std::string cmtpath(tmpSstr.str());
   std::vector<std::string> paths = splitter(cmtpath, ':');
+  PixelMap_t pixelMapping;
   std::ifstream ifs;
   for (const auto& x : paths){
     if(is_file_exist((x + "/PixelMapping_Run2.dat").c_str())){
@@ -463,7 +464,7 @@ int main ATLAS_NOT_THREAD_SAFE (int argc, char* argv[]){ // Global variable is u
       deadmap = deadMaps[moduleID];
     }
 
-    std::vector<int> position = getPositionFromDCSID(moduleID);
+    std::vector<int> position = getPositionFromDCSID(pixelMapping, moduleID);
     int barrel = position[0];
     int layer = position[1];
     int module_phi = position[2];
@@ -793,7 +794,7 @@ int main ATLAS_NOT_THREAD_SAFE (int argc, char* argv[]){ // Global variable is u
   return 0;
 }
 
-std::string getDCSIDFromPosition ATLAS_NOT_THREAD_SAFE (int barrel_ec, int layer, int module_phi, int module_eta){ // Global variable is used.
+std::string getDCSIDFromPosition (PixelMap_t& pixelMapping, int barrel_ec, int layer, int module_phi, int module_eta){
   for(unsigned int ii = 0; ii < pixelMapping.size(); ii++) {
     if (pixelMapping[ii].second.size() != 4) {
       std::cout << "getDCSIDFromPosition: Vector size is not 4!" << std::endl;
@@ -809,7 +810,7 @@ std::string getDCSIDFromPosition ATLAS_NOT_THREAD_SAFE (int barrel_ec, int layer
   return std::string("Error!");
 }
 
-std::vector<int> getPositionFromDCSID ATLAS_NOT_THREAD_SAFE (const std::string& module_name){ // Global variable is used.
+std::vector<int> getPositionFromDCSID (PixelMap_t& pixelMapping, const std::string& module_name){
   for(unsigned int ii = 0; ii < pixelMapping.size(); ii++) {
     if (pixelMapping[ii].first == module_name)
     return pixelMapping[ii].second;
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/updateNoiseMaps.C b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/updateNoiseMaps.C
index dfd11aa47515208d0241e61c0559a4242834263f..7d4bfaacc09c3cb842b934cb516237096f3dedad 100644
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/updateNoiseMaps.C
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/updateNoiseMaps.C
@@ -23,9 +23,9 @@
 #include "PixelCalibAlgs/PixelConvert.h"
 #include "PixelConditionsData/SpecialPixelMap.h"
 
-std::vector< std::pair< std::string, std::vector<int> > > pixelMapping;
-std::string getDCSIDFromPosition (int barrel_ec, int layer, int module_phi, int module_eta);
-std::vector<int> getPositionFromDCSID (const std::string& module_name);
+using PixelMap_t = std::vector< std::pair< std::string, std::vector<int> > >;
+std::string getDCSIDFromPosition (PixelMap_t& pixelMapping, int barrel_ec, int layer, int module_phi, int module_eta);
+std::vector<int> getPositionFromDCSID (PixelMap_t& pixelMapping, const std::string& module_name);
 
 std::vector<std::string> &splitter(const std::string &s, char delim, std::vector<std::string> &elems) {
   std::stringstream ss(s);
@@ -136,7 +136,7 @@ int ComputePoisson(double probcut, double mu) {
 }
 
 
-int main ATLAS_NOT_THREAD_SAFE (int argc, char* argv[]){ // Global variable is used.
+int main (int argc, char* argv[]){
 
   std::string option;
 
@@ -519,13 +519,14 @@ int main ATLAS_NOT_THREAD_SAFE (int argc, char* argv[]){ // Global variable is u
   const unsigned int maxPathStringLength{3000};
   if((not tmppath) or (strlen(tmppath) > maxPathStringLength) ){
       std::cout << "FATAL: Unable to retrieve environmental DATAPATH" << std::endl;
-      exit(EXIT_FAILURE);
+      return (EXIT_FAILURE);
   }
   std::stringstream tmpSstr{};
   tmpSstr<<tmppath;
   std::string cmtpath(tmpSstr.str());
   std::vector<std::string> paths = splitter(cmtpath, ':');
   std::ifstream ifs;
+  PixelMap_t pixelMapping;
   for (const auto& x : paths){
     if(is_file_exist((x + "/PixelMapping_Run2.dat").c_str())){
       if(isIBL){
@@ -568,7 +569,7 @@ int main ATLAS_NOT_THREAD_SAFE (int argc, char* argv[]){ // Global variable is u
       noiseMap = noiseMaps[moduleID];
     }
 
-    std::vector<int> position = getPositionFromDCSID(moduleID);
+    std::vector<int> position = getPositionFromDCSID(pixelMapping, moduleID);
     int barrel = position[0];
     int layer = position[1];
     int module_phi = position[2];
@@ -877,7 +878,7 @@ int main ATLAS_NOT_THREAD_SAFE (int argc, char* argv[]){ // Global variable is u
   return 0;
 }
 
-std::string getDCSIDFromPosition ATLAS_NOT_THREAD_SAFE (int barrel_ec, int layer, int module_phi, int module_eta){ // Global variable is used.
+std::string getDCSIDFromPosition (PixelMap_t& pixelMapping, int barrel_ec, int layer, int module_phi, int module_eta){
   for(unsigned int ii = 0; ii < pixelMapping.size(); ii++) {
     if (pixelMapping[ii].second.size() != 4) {
       std::cout << "getDCSIDFromPosition: Vector size is not 4!" << std::endl;
@@ -893,7 +894,7 @@ std::string getDCSIDFromPosition ATLAS_NOT_THREAD_SAFE (int barrel_ec, int layer
   return std::string("Error!");
 }
 
-std::vector<int> getPositionFromDCSID ATLAS_NOT_THREAD_SAFE (const std::string& module_name){ // Global variable is used.
+std::vector<int> getPositionFromDCSID (PixelMap_t& pixelMapping, const std::string& module_name){
   for(unsigned int ii = 0; ii < pixelMapping.size(); ii++) {
     if (pixelMapping[ii].first == module_name)
     return pixelMapping[ii].second;
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/OfflineCalibrationLoop.h b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/OfflineCalibrationLoop.h
index 8ff1054824b5ef75865964ef19f55f41886b4bae..ed0776c8f76403ce136b4aba5c0c77568b520361 100644
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/OfflineCalibrationLoop.h
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/OfflineCalibrationLoop.h
@@ -19,7 +19,7 @@ class PixelChargeInterpolationValidation;
 
 class OfflineCalibrationLoop;
 
-class ATLAS_NOT_THREAD_SAFE OfflineCalibrationLoop: public PixelNtupleTracks { // Thread unsafe PixelChargeInterpolationCalibration class is used.
+class OfflineCalibrationLoop: public PixelNtupleTracks {
 
 public :
 	// Modified stuff
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelBarrelSurvey.h b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelBarrelSurvey.h
index 4cdb4c9222fdbe39bcd0b528f7df87992fd11dae..de803378bd832bf90e307c5536bb6c8000fe000c 100755
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelBarrelSurvey.h
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelBarrelSurvey.h
@@ -1,11 +1,12 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "AthenaBaseComps/AthAlgorithm.h"
 #include "GaudiKernel/ServiceHandle.h"
 #include "InDetReadoutGeometry/SiDetectorElementCollection.h"
 #include "PixelCalibAlgs/PixelBarrelSurveyUtils.h"
+#include "PixelCalibAlgs/PixelConvert.h"
 #include "StoreGate/ReadCondHandleKey.h"
 #include <vector>
 #include <string>
@@ -39,5 +40,6 @@ class PixelBarrelSurvey:public AthAlgorithm {
   SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_pixelDetEleCollKey{this, "PixelDetEleCollKey", "PixelDetectorElementCollection", "Key of SiDetectorElementCollection for Pixel"};
   AlignableTransform *m_transforms;
   DetCondCFloat *m_distorsions;
+  PixelConvert::Map m_map;
 };
  
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelChargeInterpolationCalibration.h b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelChargeInterpolationCalibration.h
index 20c37bb7403ceb84aee0ecc88670290655fe5813..f601c2d988b2269eb336273c26b94a3670778295 100644
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelChargeInterpolationCalibration.h
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelChargeInterpolationCalibration.h
@@ -17,9 +17,7 @@ class PixelChargeInterpolationHistograms;
 class PixelChargeInterpolationPlot;
 class PixelChargeInterpolationParameters;
 
-class PixelChargeInterpolationCalibration;
-
-class ATLAS_NOT_THREAD_SAFE PixelChargeInterpolationCalibration{ // Thread unsafe PixelChargeInterpolationPlot class is used.
+class PixelChargeInterpolationCalibration{
 
 public :
 	// Modified stuff
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelChargeInterpolationPlot.h b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelChargeInterpolationPlot.h
index 10dcd3620bb1f13f8eddef651caa00aab3ad7463..437ab3ba8858fcaa0d1c9749cfdad7fa5891dd5e 100644
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelChargeInterpolationPlot.h
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelChargeInterpolationPlot.h
@@ -17,9 +17,7 @@ namespace PixelCalib{
 
 class PixelChargeInterpolationParameters;
 
-class PixelChargeInterpolationPlot;
-
-class ATLAS_NOT_THREAD_SAFE PixelChargeInterpolationPlot{ // static variable is used.
+class PixelChargeInterpolationPlot{
 
 public :
   PixelChargeInterpolationPlot(const PixelChargeInterpolationParameters &parameters, bool oneconst = false);
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelChargeToTConversion.h b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelChargeToTConversion.h
index 4652dc939a6dae5678aad46182671859715c5a11..fb7a9f47013193f2c5d89de072b5dda147eb9d9f 100755
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelChargeToTConversion.h
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelChargeToTConversion.h
@@ -22,7 +22,8 @@
 
 class IBLParameterSvc;
 
-class PixelChargeToTConversion: public AthAlgorithm{
+// FIXME: Modifies data in SG!
+class ATLAS_NOT_THREAD_SAFE PixelChargeToTConversion : public AthAlgorithm{
   
  public:
   PixelChargeToTConversion(const std::string& name, ISvcLocator* pSvcLocator);
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelClusterOnTrackErrorPlot.h b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelClusterOnTrackErrorPlot.h
index d292a867ff95d890d463e63e561b419b90761a35..8306ee55da2f1b9285bec5e100f5c4be79628ace 100644
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelClusterOnTrackErrorPlot.h
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelClusterOnTrackErrorPlot.h
@@ -17,9 +17,7 @@ namespace PixelCalib{
 
 class PixelClusterOnTrackErrorData;
 
-class PixelClusterOnTrackErrorPlot;
-
-class ATLAS_NOT_THREAD_SAFE PixelClusterOnTrackErrorPlot{ // static variable is used.
+class PixelClusterOnTrackErrorPlot{
 
 public :
 	PixelClusterOnTrackErrorPlot(PixelClusterOnTrackErrorData &parameters,
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelConvert.h b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelConvert.h
index a13764e001ea2e73ee4f7168fca7058c3e9cc20e..49a58dbbee9af9b6dc3bc90e1834f1f4520ff7c3 100755
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelConvert.h
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelConvert.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 PIXELCALIBALGS_PIXELCONVERT_H
@@ -10,6 +10,7 @@
 #include <iostream>
 #include <fstream>
 #include <map>
+#include <memory>
 
 
 /*
@@ -184,8 +185,15 @@ namespace PixelConvert {
   */
   std::string DCSID(const std::string& OnlineID);
 
-  int ReadMap(const std::string& filename);
-  unsigned int GetID(const unsigned int moduleID);
+
+  struct Map
+  {
+    typedef std::map<unsigned int,unsigned int> modulemap;
+    std::unique_ptr<modulemap> m_hashIndex;
+    std::unique_ptr<modulemap> m_SNIndex;
+  };
+  int ReadMap(const std::string& filename, Map& map);
+  unsigned int GetID(const Map& map, const unsigned int moduleID);
 
 }
 
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelRIOs.h b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelRIOs.h
index fe8da3838d08b497a05f700de53580bdc11f4c9f..d6bb79dacadecd0d6f74c108985941993604466c 100644
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelRIOs.h
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelRIOs.h
@@ -20,7 +20,7 @@ class PixelChargeInterpolationCalibration;
 class PixelChargeInterpolationValidation;
 
 
-class ATLAS_NOT_THREAD_SAFE PixelRIOs { // Thread unsafe PixelChargeInterpolationCalibration class is used.
+class PixelRIOs {
 public :
    TTree          *fChain;   //!pointer to the analyzed TTree or TChain
    Int_t           fCurrent; //!current Tree number in a TChain
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/NoiseMapBuilder.cxx b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/NoiseMapBuilder.cxx
index dc7386c78135d3f940884a1b68736e419d1876f1..66343d7e9f0f3e36d0d4ac727443c11f62178e5c 100755
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/NoiseMapBuilder.cxx
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/NoiseMapBuilder.cxx
@@ -314,7 +314,7 @@ StatusCode NoiseMapBuilder::registerHistograms(){
 // execute
 //
 //=========================================================
-StatusCode NoiseMapBuilder::execute ATLAS_NOT_THREAD_SAFE (){ // Thread unsafe DataHandle template is used.
+StatusCode NoiseMapBuilder::execute(){
   ATH_MSG_DEBUG( "Executing NoiseMapBuilder" );
 
   // retrieve EventInfo
@@ -334,7 +334,7 @@ StatusCode NoiseMapBuilder::execute ATLAS_NOT_THREAD_SAFE (){ // Thread unsafe D
   }
 
   // retrieve PixelRDO container
-  const DataHandle< PixelRDO_Container > pixelRDOs;
+  const PixelRDO_Container* pixelRDOs = nullptr;
   sc = sgSvc()->retrieve(pixelRDOs, m_pixelRDOKey);
   if( !sc.isSuccess() ){
     ATH_MSG_FATAL( "Unable to retrieve pixel RDO container at " << m_pixelRDOKey );
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixMapDBWriter.cxx b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixMapDBWriter.cxx
index d05f7c08efebddab3ff2b22fcc8b284a7a4b2549..8723295eb89896f5039102a3c6cbced15111ad44 100755
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixMapDBWriter.cxx
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixMapDBWriter.cxx
@@ -90,7 +90,7 @@ StatusCode PixMapDBWriter::execute(){
 }
 
 
-StatusCode PixMapDBWriter::finalize ATLAS_NOT_THREAD_SAFE (){ // Thread unsafe DetectorSpecialPixelMap and ModuleSpecialPixelMap classes are used.
+StatusCode PixMapDBWriter::finalize (){
   ATH_MSG_INFO( "Finalizing PixMapDBWriter" );
 
   ATH_MSG_DEBUG( "Reading map of special pixels from file" );
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixMapOverlayWriter.cxx b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixMapOverlayWriter.cxx
index 52d1c1f07de7892f01039d6c2e3510a26ac41cd7..f313a1bff54c25f90990ed85cbb207ca951951f8 100644
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixMapOverlayWriter.cxx
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixMapOverlayWriter.cxx
@@ -71,7 +71,7 @@ StatusCode PixMapOverlayWriter::initialize(){
   return StatusCode::SUCCESS;
 }
 
-StatusCode PixMapOverlayWriter::execute ATLAS_NOT_THREAD_SAFE (){ // Thread unsafe ModuleSpecialPixelMap class is used.
+StatusCode PixMapOverlayWriter::execute (){
 
   auto spm = std::make_unique<DetectorSpecialPixelMap>();
   for(unsigned int i = 0; i < m_pixelID->wafer_hash_max(); i++){
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelBarrelSurvey.cxx b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelBarrelSurvey.cxx
index c4888073914929efe276a6d35dd2cd209c83a0f1..b1c50dbf5c431135c98e7c4e89538b81ac490d20 100755
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelBarrelSurvey.cxx
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelBarrelSurvey.cxx
@@ -78,7 +78,7 @@ StatusCode PixelBarrelSurvey::initialize(){
     return StatusCode::FAILURE;
   } 
 
-  int sc = PixelConvert::ReadMap(file_name);
+  int sc = PixelConvert::ReadMap(file_name, m_map);
   if ( sc ) {
     msg(MSG::FATAL) << "Error in accessing file " << file_name << endmsg;
     return StatusCode::FAILURE;
@@ -143,7 +143,7 @@ StatusCode PixelBarrelSurvey::execute() {
       HepGeom::Point3D<double> v0=trans*x0;
       HepGeom::Point3D<double> v1=trans*x1;
       unsigned int prodID=(theStave->module[i].serialNumber)%1000000;
-      Identifier hashID(PixelConvert::GetID(prodID));
+      Identifier hashID(PixelConvert::GetID(m_map, prodID));
       std::cout << m_pixelID->show_to_string(hashID) 
 	  << " " << v0.x() << " " << v0.y() << " " << v0.z()
 	  << " " << v1.x() << " " << v1.y() << " " << v1.z()
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelChargeInterpolationPlot.cxx b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelChargeInterpolationPlot.cxx
index 6f35c00e79bf6130f5d6e7e5be5e99f208922731..758a2280615a484a33e446c1a8348e4df487bbf2 100644
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelChargeInterpolationPlot.cxx
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelChargeInterpolationPlot.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef PixelChargeInterpolationPlot_cxx
@@ -8,6 +8,7 @@
 #include <vector>
 #include <string>
 #include <sstream>
+#include <atomic>
 
 #include <TH1.h>
 #include <TCanvas.h>
@@ -161,11 +162,11 @@ std::vector < TH1F* > *PixelChargeInterpolationPlot::HistogramsFromConstants(
 //	std::cout << "n bins: " << nbinhisto << std::endl;
 //	std::cout << "===============================================" << std::endl;
 
-	static int pass = 0;
-	pass++; 
+	static std::atomic<int> pass = 0;
+        int p = pass++;
 	for(int i = 0; i < nhisto; i++){
 		std::ostringstream NameString, TitleString;
-		NameString << csbins[i] << "_" << direction << pass
+		NameString << csbins[i] << "_" << direction << p
 			<< "clustersize_ " << csbins[i+1];
 		if(title != "") TitleString << title;
 		else TitleString << "Local " + xory + " - "
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelChargeToTConversion.cxx b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelChargeToTConversion.cxx
index 767740d200bafec463e5204e3054ffb574f4cff0..dbbbfb92c55f854c6029d9ef71782aa20cb18dac 100644
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelChargeToTConversion.cxx
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelChargeToTConversion.cxx
@@ -42,7 +42,7 @@ StatusCode PixelChargeToTConversion::initialize(){
   return StatusCode::SUCCESS;
 }
 
-StatusCode PixelChargeToTConversion::execute ATLAS_NOT_THREAD_SAFE (){ // const_cast is used.
+StatusCode PixelChargeToTConversion::execute(){
   const EventContext &ctx = Gaudi::Hive::currentContext();
   SG::ReadHandle<InDet::PixelClusterContainer> pixel_container( m_pixelsClustersKey, ctx);
   if (!pixel_container.isValid())
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelClusterOnTrackErrorPlot.cxx b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelClusterOnTrackErrorPlot.cxx
index aa587653862b8142f1b17f1d25c9aabec44cca96..bdd748e1acb6197f1e692c98d6d1a3708c575da4 100644
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelClusterOnTrackErrorPlot.cxx
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelClusterOnTrackErrorPlot.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef PixelClusterOnTrackErrorPlot_cxx
@@ -158,11 +158,11 @@ std::vector < TH1F* > *PixelClusterOnTrackErrorPlot::HistogramsFromConstants(
 //	std::cout << "n bins: " << nbinhisto << std::endl;
 //	std::cout << "===============================================" << std::endl;
 
-	static int pass = 0;
-	pass++; 
+	static std::atomic<int> pass = 0;
+        int p = pass++;
 	for(int i = 0; i < nhisto; i++){
 		std::ostringstream NameString, TitleString;
-		NameString << csbins[i] << "_" << direction << pass
+		NameString << csbins[i] << "_" << direction << p
 			<< "clustersize_ " << csbins[i]+1;
 		if(title != "") TitleString << title;
 		else TitleString << "Local " + xory + " - "
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelConvert.cxx b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelConvert.cxx
index a27ea5f63d73f6fc9e54e08faf24c713b47edcf9..c1d996a19928466ea771826a0ffcbe3807c18442 100755
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelConvert.cxx
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelConvert.cxx
@@ -382,10 +382,6 @@ namespace PixelConvert {
     return ID;
   }
 
-  typedef std::map<unsigned int,unsigned int> modulemap;
-
-  modulemap* hashIndex=0;
-  modulemap* SNIndex=0;
   const std::string datafile("NamingConversions.txt");
 
   /*
@@ -400,15 +396,17 @@ namespace PixelConvert {
    * file named as in the string datafile initialized above.
    */
 
-  int ReadMap ATLAS_NOT_THREAD_SAFE (const std::string& filename ) {
 // Global variables are used.
+  int ReadMap (const std::string& filename,
+               Map& map)
+  {
     std::cerr << "INFO: Opening data file " << filename << std::endl; 
     std::ifstream f(filename.c_str());
     if ( !f.good() ) {
       std::cerr << "ERROR: Cannot open data file " << filename << std::endl; 
       return -1;
     }
-    hashIndex= new modulemap;
-    SNIndex= new modulemap;
+    map.m_hashIndex = std::make_unique<PixelConvert::Map::modulemap>();
+    map.m_SNIndex = std::make_unique<PixelConvert::Map::modulemap>();
     unsigned int hashID, SN;
     std::string dummy;
     getline(f,dummy); // read header line
@@ -418,28 +416,28 @@ namespace PixelConvert {
       // std::cerr << "Read from " << filename << "\t" << hashID << "\t" << SN << std::endl; 
       if ( f.bad() ) {
 	std::cerr << "ERROR: error reading " << filename 
-		  << " after " << hashIndex->size() << " entries" 
+		  << " after " << map.m_hashIndex->size() << " entries" 
 		  << std::endl;
 	f.close();
 	return -2;
       } else if ( f.eof() ) break;
-      hashIndex->insert(std::make_pair(hashID,SN));
-      SNIndex->insert(std::make_pair(SN,hashID));
+      map.m_hashIndex->insert(std::make_pair(hashID,SN));
+      map.m_SNIndex->insert(std::make_pair(SN,hashID));
     }
     std::cerr << "INFO: end of file " << filename 
-	      << " after " << hashIndex->size() << " entries" 
+	      << " after " << map.m_hashIndex->size() << " entries" 
 	      << std::endl;
     f.close();
     return 0;
   }
 
-  unsigned int GetID ATLAS_NOT_THREAD_SAFE (const unsigned int moduleID) {
 // Global variables are used.
-    // if maps are not previously loaded, read in the file 
-    if ( !hashIndex || !SNIndex ) ReadMap(datafile);
+  unsigned int GetID (const Map& map,
+                      const unsigned int moduleID)
+  {
     if ( moduleID>=510000 && moduleID<=519999 ) 
-      return (*SNIndex)[moduleID];
+      return (*map.m_SNIndex)[moduleID];
     else 
-      return (*hashIndex)[moduleID];
+      return (*map.m_hashIndex)[moduleID];
   }
 
 }
diff --git a/InnerDetector/InDetCalibAlgs/TRT_CalibAlgs/TRT_CalibAlgs/TRTCalibrationMgr.h b/InnerDetector/InDetCalibAlgs/TRT_CalibAlgs/TRT_CalibAlgs/TRTCalibrationMgr.h
index e885ff7cdd1ec4dd1c799f0dd858a06046fe3487..db416918d329cd5ef5abe7a747c301aab5b64e93 100755
--- a/InnerDetector/InDetCalibAlgs/TRT_CalibAlgs/TRT_CalibAlgs/TRTCalibrationMgr.h
+++ b/InnerDetector/InDetCalibAlgs/TRT_CalibAlgs/TRT_CalibAlgs/TRTCalibrationMgr.h
@@ -21,6 +21,7 @@
 #include "CommissionEvent/ComTime.h"
 #include "TRT_ConditionsData/RtRelationMultChanContainer.h"
 #include "TRT_ConditionsData/StrawT0MultChanContainer.h"
+#include "CxxUtils/checker_macros.h"
 
 
 namespace TRT{
@@ -58,7 +59,8 @@ made and Dt0 is set to the mean of that. The new t0 is then the old t0
 
 */
 
-class TRTCalibrationMgr: public AthAlgorithm
+// TRTCalibrator is not thread-safe.
+class ATLAS_NOT_THREAD_SAFE TRTCalibrationMgr: public AthAlgorithm
 {
 
 public:
diff --git a/InnerDetector/InDetCalibAlgs/TRT_CalibAlgs/src/TRTOccupancyInclude.cxx b/InnerDetector/InDetCalibAlgs/TRT_CalibAlgs/src/TRTOccupancyInclude.cxx
index c35f014f13be8e50383804b0ec42639b3bf8c1b5..9d761c14355acb1fcdfec7b031b339f1ca0a3fb3 100755
--- a/InnerDetector/InDetCalibAlgs/TRT_CalibAlgs/src/TRTOccupancyInclude.cxx
+++ b/InnerDetector/InDetCalibAlgs/TRT_CalibAlgs/src/TRTOccupancyInclude.cxx
@@ -45,7 +45,7 @@ StatusCode TRTOccupancyInclude::initialize()
 
 //---------------------------------------------------------------------
 
-StatusCode TRTOccupancyInclude::execute ATLAS_NOT_THREAD_SAFE () // static variables are used.
+StatusCode TRTOccupancyInclude::execute()
 {
   msg(MSG::DEBUG) << "execute()" << endmsg;
 
@@ -60,25 +60,25 @@ StatusCode TRTOccupancyInclude::execute ATLAS_NOT_THREAD_SAFE () // static varia
   std::vector<float> TRTOccu = m_LocalOccTool->GlobalOccupancy( );
   if (TRTOccu.size() > 6) {
 
-  static SG::AuxElement::Decorator< float >  decEventInfo_occupancy0("TRTOccGlobal"); 
+  static const SG::AuxElement::Decorator< float >  decEventInfo_occupancy0("TRTOccGlobal"); 
   decEventInfo_occupancy0( *eventInfo ) = TRTOccu.at(0); 
 
-  static SG::AuxElement::Decorator< float >  decEventInfo_occupancy1("TRTOccBarrelC"); 
+  static const SG::AuxElement::Decorator< float >  decEventInfo_occupancy1("TRTOccBarrelC"); 
   decEventInfo_occupancy1( *eventInfo ) = TRTOccu.at(1); 
 
-  static SG::AuxElement::Decorator< float >  decEventInfo_occupancy2("TRTOccEndcapAC"); 
+  static const SG::AuxElement::Decorator< float >  decEventInfo_occupancy2("TRTOccEndcapAC"); 
   decEventInfo_occupancy2( *eventInfo ) = TRTOccu.at(2); 
 
-  static SG::AuxElement::Decorator< float >  decEventInfo_occupancy3("TRTOccEndcapBC"); 
+  static const SG::AuxElement::Decorator< float >  decEventInfo_occupancy3("TRTOccEndcapBC"); 
   decEventInfo_occupancy3( *eventInfo ) = TRTOccu.at(3); 
 
-  static SG::AuxElement::Decorator< float >  decEventInfo_occupancy4("TRTOccBarrelA"); 
+  static const SG::AuxElement::Decorator< float >  decEventInfo_occupancy4("TRTOccBarrelA"); 
   decEventInfo_occupancy4( *eventInfo ) = TRTOccu.at(4); 
 
-  static SG::AuxElement::Decorator< float >  decEventInfo_occupancy5("TRTOccEndcapAA"); 
+  static const SG::AuxElement::Decorator< float >  decEventInfo_occupancy5("TRTOccEndcapAA"); 
   decEventInfo_occupancy5( *eventInfo ) = TRTOccu.at(5); 
 
-  static SG::AuxElement::Decorator< float >  decEventInfo_occupancy6("TRTOccEndcapBA"); 
+  static const SG::AuxElement::Decorator< float >  decEventInfo_occupancy6("TRTOccEndcapBA"); 
   decEventInfo_occupancy6( *eventInfo ) = TRTOccu.at(6); 
   }
 
diff --git a/InnerDetector/InDetCalibTools/TRT_CalibTools/TRT_CalibTools/ITRTCalibrator.h b/InnerDetector/InDetCalibTools/TRT_CalibTools/TRT_CalibTools/ITRTCalibrator.h
index 04a418767b1628f6c8d475ada4c44bf8ace06354..ea662e52cd66912c211de39d02c39e9e0734d386 100755
--- a/InnerDetector/InDetCalibTools/TRT_CalibTools/TRT_CalibTools/ITRTCalibrator.h
+++ b/InnerDetector/InDetCalibTools/TRT_CalibTools/TRT_CalibTools/ITRTCalibrator.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 TRT_CALIBTOOLS__ITRTCALIBRATOR_H
@@ -16,6 +16,7 @@ PURPOSE:
 
 ********************************************************************/
 
+#include "CxxUtils/checker_macros.h"
 #include "GaudiKernel/IAlgTool.h"
 
 namespace Trk{
@@ -25,21 +26,13 @@ namespace TRT{
 class TrackInfo;
 }
 
-static const InterfaceID IID_ITRTCalibrator("ITRTCalibrator", 1, 0);
-
-class ITRTCalibrator : virtual public IAlgTool {
+class ATLAS_NOT_THREAD_SAFE ITRTCalibrator : virtual public IAlgTool {
 public:
-
+  DeclareInterfaceID( ITRTCalibrator, 1, 0 );
   virtual bool fill(const Trk::Track* aTrack, TRT::TrackInfo* output) = 0;
-  virtual bool calibrate() = 0;
-
-  static const InterfaceID& interfaceID();
+  // uses thread-unsafe methods from Calibrator.
+  virtual bool calibrate ATLAS_NOT_THREAD_SAFE () = 0;
 };
 
-inline const InterfaceID& ITRTCalibrator::interfaceID()
-{ 
-        return IID_ITRTCalibrator; 
-}
-
 #endif // TRT_CALIBTOOLS__ITRTCALIBRATOR_H
 
diff --git a/InnerDetector/InDetCalibTools/TRT_CalibTools/src/Calibrator.cxx b/InnerDetector/InDetCalibTools/TRT_CalibTools/src/Calibrator.cxx
index 2a17e6fced88e5eeb866bfc0287a5afff4b02fe6..0bf227d58431f7a95b5cb483fd0addfe0d29d80b 100644
--- a/InnerDetector/InDetCalibTools/TRT_CalibTools/src/Calibrator.cxx
+++ b/InnerDetector/InDetCalibTools/TRT_CalibTools/src/Calibrator.cxx
@@ -52,9 +52,6 @@ caldata::caldata(){
   calflag  = -999;
   rtflag  = -999;
   t0flag  = -999;
-  m_treshist  = nullptr;
-  reshist  = nullptr;
-  rthist  = nullptr;
   det = -999;
   lay = -999;
   mod = -999;
@@ -71,10 +68,6 @@ caldata::caldata(){
 }
 
 caldata::~caldata(){
-  delete[] m_treshist;
-  delete[] reshist;
-  delete[] rthist;
-
 }
 
 caldata::caldata(bool makehist, int nbinst, int nbinsr){
@@ -100,9 +93,6 @@ caldata::caldata(bool makehist, int nbinst, int nbinsr){
   calflag  = -999;
   rtflag  = -999;
   t0flag  = -999;
-  m_treshist  = nullptr;
-  reshist  = nullptr;
-  rthist  = nullptr;
   det = -999;
   lay = -999;
   mod = -999;
@@ -118,16 +108,9 @@ caldata::caldata(bool makehist, int nbinst, int nbinsr){
   rtgraph = nullptr;
 
   if (makehist) {
-    if (m_treshist) delete m_treshist;
-    m_treshist = new float[100];
-  }
-  if (makehist) {
-    if (reshist) delete reshist;
-    reshist = new float[100];
-  }
-  if (makehist) {
-    if (rthist) delete rthist;
-    rthist = new float[nbinsr*nbinst+200];
+    m_treshist.resize (100);
+    reshist.resize (100);
+    rthist.resize (nbinsr*nbinst+200);
   }
 }
 
@@ -299,18 +282,18 @@ RtGraph::RtGraph(TH2F* rtHist, int binvar, const char* binlabel, bool pflag, TDi
 
 RtGraph::~RtGraph(){  
 
- delete hslizes   ;
- delete m_btype     ;
- delete m_tv        ;
- delete m_dv        ;
- delete m_etv       ;
- delete m_edv       ;
- delete m_rightsig  ;
- delete m_leftsig   ;
- delete m_leftval   ;
- delete m_rightval  ;
- delete m_maxbin    ;
- delete m_maxval    ;
+ delete [] hslizes   ;
+ delete [] m_btype     ;
+ delete [] m_tv        ;
+ delete [] m_dv        ;
+ delete [] m_etv       ;
+ delete [] m_edv       ;
+ delete [] m_rightsig  ;
+ delete [] m_leftsig   ;
+ delete [] m_leftval   ;
+ delete [] m_rightval  ;
+ delete [] m_maxbin    ;
+ delete [] m_maxval    ;
 }
 
 
@@ -350,98 +333,94 @@ double rtrel_dines(double *x, double*par){
 
 
 
-Calibrator::Calibrator(){
-  level =-10;
-  m_name ="None"; 
-  m_rtbinning ="None";
-  m_minrtstat =-10;
-  m_mint0stat =-10;
-  m_t0shift =-100.;
-  m_mint=-5;
-  m_maxt=50;
-  m_nbinst=55;
-
-  m_minr=0;
-  m_maxr=2;
-  m_nbinsr=100;
-
-  m_mintres=-10;
-  m_maxtres=10;
-  m_nbinstres=100;
-
-  m_minres=-0.6;
-  m_maxres=0.6;
-  m_nbinsres=100;
-
-  m_isdines = false;
-  dort=false;
-  dot0=false;
-  dores=false;
-  nort=false;
-  not0=false;
-  usebref=false;
-  bequiet=false;
-  printlog=false;
-  printt0=false;
-  printrt=false;
-  usep0=false;
-  floatp3=false;
+Calibrator::Calibrator()
+  : dort(false),
+    dot0(false),
+    dores(false),
+    nort(false),
+    not0(false),
+    usebref(false),
+    bequiet(false),
+    printlog(false),
+    printt0(false),
+    printrt(false),
+    usep0(false),
+    floatp3(false),
+    useshortstraws(true),
+
+    m_name ("None"),
+    m_rtbinning ("None"),
+    m_minrtstat (-10),
+    m_mint0stat (-10),
+    m_t0shift (-100.),
+
+    m_nbinsr(100),
+    m_nbinst(55),
+    m_nbinstres(100),
+    m_nbinsres(100),
+    m_minr(0),
+    m_maxr(2),
+    m_mint(-5),
+    m_maxt(50),
+    m_mintres(-10),
+    m_maxtres(10),
+    m_minres(-0.6),
+    m_maxres(0.6),
+
+    m_ntreshits(0),
+    m_nreshits(0),
+    m_nrthits(0),
+    m_nhits(0),
+
+    m_isdines ( false)
+{
   selection.insert(-3);
-  useshortstraws=true;
-  m_ntreshits=0;
-  m_nreshits=0;
-  m_nrthits=0;
-  m_nhits=0;
-
-
-
-
-
+  level =-10;
 }
 
-Calibrator::Calibrator(int lev, std::string nme, int mint0, int minrt, std::string rtr, std::string rtb, float t0sft){
+Calibrator::Calibrator(int lev, const std::string& nme, int mint0, int minrt, const std::string& rtr, const std::string& rtb, float t0sft)
+  :  dort(false),
+     dot0(false),
+     dores(false),
+     nort(false),
+     not0(false),
+     usebref(false),
+     bequiet(false),
+     printlog(false),
+     printt0(false),
+     printrt(false),
+     usep0(false),
+     floatp3(false),
+     useshortstraws(true),
+
+     m_name(nme), 
+     m_rtbinning(rtb),
+     m_minrtstat(minrt),
+     m_mint0stat(mint0),
+     m_t0shift(t0sft),
+
+     m_nbinsr(100),
+     m_nbinst(55),
+     m_nbinstres(100),
+     m_nbinsres(100),
+     m_minr(0),
+     m_maxr(2),
+     m_mint(-5),
+     m_maxt(50),
+     m_mintres(-10),
+     m_maxtres(10),
+     m_minres(-0.6),
+     m_maxres(0.6),
+
+     m_ntreshits(0),
+     m_nreshits(0),
+     m_nrthits(0),
+     m_nhits(0),
+
+     m_isdines ( rtr.find("dines")!=std::string::npos)
+{
   level=lev;
-  m_name=nme; 
-  m_rtbinning=rtb;
-  m_minrtstat=minrt;
-  m_mint0stat=mint0;
-  m_t0shift=t0sft;
-
-  m_mint=-5;
-  m_maxt=50;
-  m_nbinst=55;
-
-  m_minr=0;
-  m_maxr=2;
-  m_nbinsr=100;
-
-  m_mintres=-10;
-  m_maxtres=10;
-  m_nbinstres=100;
-
-  m_minres=-0.6;
-  m_maxres=0.6;
-  m_nbinsres=100;
-
-  m_isdines = rtr.find("dines")!=std::string::npos;
-  dort=false;
-  dot0=false;
-  dores=false;
-  nort=false;
-  not0=false;
-  usebref=false;
-  bequiet=false;
-  printlog=false;
-  printt0=false;
-  printrt=false;
-  usep0=false;
-  floatp3=false;
   selection.insert(-3);
-  useshortstraws=true;
-  m_ntreshits=0;
-  m_nreshits=0;
-  m_nrthits=0;
-  m_nhits=0;
 }
 
 Calibrator::~Calibrator(){
@@ -482,10 +461,10 @@ bool Calibrator::Skip(){
 std::string Calibrator::PrintInfo(){
   std::string yn[2]={"NO","YES"};
   std::string info = std::string(Form("CONFIGURATION %-16s: dort=%-3s, dot0=%-3s, dores=%-3s, selection=",m_name.data(),yn[dort].data(),yn[dot0].data(),yn[dores].data()));
-  for (std::set<int>::iterator isel = selection.begin(); isel != selection.end(); isel++) {
-    if (*isel==-3) info += std::string("all"); 
-    else if (*isel==-4) info += std::string("none"); 
-    else info += std::string(Form("%2i,",*isel)); 
+  for (int isel : selection) {
+    if (isel==-3) info += std::string("all"); 
+    else if (isel==-4) info += std::string("none"); 
+    else info += std::string(Form("%2i,",isel)); 
   } 
   return info;
 }
@@ -520,7 +499,7 @@ std::string Calibrator::GetSelString(){
   std::string selstr="";
   if (selection.find(-3)!=selection.end()) selstr="*";
   else if (selection.find(-4)!=selection.end()) selstr="-";
-  else for (std::set<int>::iterator isel=selection.begin(); isel!=selection.end(); isel++) selstr += std::string(Form("%i",*isel));
+  else for (int isel : selection)  selstr += std::string(Form("%i",isel));
   return selstr;
 }
 
@@ -1212,9 +1191,8 @@ void Calibrator::DumpConstants(){
 
   std::ofstream dumpfile( "calib_constants_out.txt", std::ios::out | std::ios::app);
 
-  for(std::map<std::string,caldata>::iterator ihist=data.begin(); ihist!=data.end(); ihist++){
-    
-    dumpfile << ihist->first << " " << (ihist->second).t0 << " " << std::endl;
+  for (const std::pair<const std::string, caldata>& p : data) {
+    dumpfile << p.first << " " << p.second.t0 << " " << std::endl;
     
   }
   
diff --git a/InnerDetector/InDetCalibTools/TRT_CalibTools/src/Calibrator.h b/InnerDetector/InDetCalibTools/TRT_CalibTools/src/Calibrator.h
index 5c85ee62a83f29afd4de3f4785ff9ebfcc861a28..afbc6650f18da7c807a8e3c4f8f85b75f830ddec 100755
--- a/InnerDetector/InDetCalibTools/TRT_CalibTools/src/Calibrator.h
+++ b/InnerDetector/InDetCalibTools/TRT_CalibTools/src/Calibrator.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
 */
 
 /********************************************************************
@@ -14,6 +14,7 @@ PURPOSE: Class for calibrating a TRT sub-level
           
 ********************************************************************/
 
+#include "CxxUtils/checker_macros.h"
 #include <vector>
 #include <map>
 #include <set>
@@ -140,9 +141,9 @@ class caldata{
   /**flag indicating if any calibration has been made*/ bool calflag;
   /**flag indicating if an R-t calibration has been made*/ bool rtflag;
   /**flag indicating if a t0 calibration has been made*/ bool t0flag;
-  /**the 1D time residual histogram (100 bins)*/ float* m_treshist;
-  /**the 1D residual histogram (100 bins)*/ float* reshist;
-  /**the 2D rt histogram (20x32 bins)*/ float* rthist;
+  /**the 1D time residual histogram (100 bins)*/ std::vector<float> m_treshist;
+  /**the 1D residual histogram (100 bins)*/ std::vector<float> reshist;
+  /**the 2D rt histogram (20x32 bins)*/ std::vector<float> rthist;
   /**the rt graph*/ RtGraph* rtgraph;
 };
 
@@ -186,7 +187,10 @@ public:
      @param[in] rtr which rt-relation to use
      @param[in] rtb which rt binning to use
   */
-  Calibrator(int,std::string,int,int,std::string,std::string,float);
+  Calibrator(int,const std::string&,int,int,const std::string&,const std::string&,float);
+
+  Calibrator (const Calibrator&) = delete;
+  Calibrator& operator= (const Calibrator&) = delete;
 
   /**
      Destructor
@@ -241,7 +245,7 @@ public:
      @param[in] caldata_above the caldata object from the sub-module above the one to be calibrated
      @return the root directory where the histgrams were written
   */
-  TDirectory* Calibrate(TDirectory*, std::string, std::string, caldata*);
+  TDirectory* Calibrate ATLAS_NOT_THREAD_SAFE (TDirectory*, std::string, std::string, caldata*);
 
   /**
      Makes the R-t fit
@@ -249,7 +253,7 @@ public:
      @param[in] rtHist the 2D root histogram with the R-t data
      @return the t0 from the R-t fit
   */
-  float FitRt(std::string,std::string,TH2F*,TDirectory*);
+  float FitRt ATLAS_NOT_THREAD_SAFE (std::string,std::string,TH2F*,TDirectory*);
 
   /**
      Makes the time residual fit
@@ -257,7 +261,7 @@ public:
      @param[in] tresHist the 1D root histogram with the time residuals
      @return the mean value of the time residual fit
   */
-  float FitTimeResidual(std::string,TH1F*);
+  float FitTimeResidual ATLAS_NOT_THREAD_SAFE (std::string,TH1F*);
 
   /**
      Makes the residual fit
@@ -265,7 +269,7 @@ public:
      @param[in] resHist the 1D root histogram with the residuals
      @return the mean value of the residual fit
   */
-  float FitResidual(std::string,TH1F*);
+  float FitResidual ATLAS_NOT_THREAD_SAFE (std::string,TH1F*);
 
   /**
      Creates an ntuple with entries containing data associated with the sub-modules in a sub level
diff --git a/InnerDetector/InDetCalibTools/TRT_CalibTools/src/TRTCalibrator.cxx b/InnerDetector/InDetCalibTools/TRT_CalibTools/src/TRTCalibrator.cxx
index 4f0b6c2a49b659c5e4a3444765cb301c44e2be23..699e2321889329da30106ad22c990afc2c81614a 100755
--- a/InnerDetector/InDetCalibTools/TRT_CalibTools/src/TRTCalibrator.cxx
+++ b/InnerDetector/InDetCalibTools/TRT_CalibTools/src/TRTCalibrator.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 /********************************************************************
@@ -290,7 +290,7 @@ void TRTCalibrator::DumpStrawData(int isid){
 }
 
 
-bool TRTCalibrator::IsSubLev(std::string key, int lev, std::string sublev){  
+bool TRTCalibrator::IsSubLev(const std::string& key, int lev, const std::string& sublev){  
   
   std::string sl=sublev;
 
@@ -305,7 +305,7 @@ bool TRTCalibrator::IsSubLev(std::string key, int lev, std::string sublev){
 
 }
 
-int TRTCalibrator::GetSubLevels(std::string key, int lev, std::set<int>* levels){ 
+int TRTCalibrator::GetSubLevels(const std::string& key, int lev, std::set<int>* levels){ 
 
   std::string sl=SubLev(key,lev);
 
@@ -367,7 +367,7 @@ void TRTCalibrator::MakeBDKeys(int bec, int low, int mod, int brd, int chp, int
 
 }
 
-bool TRTCalibrator::calibrate() {
+bool TRTCalibrator::calibrate ATLAS_NOT_THREAD_SAFE () {
 
   float run,evt,trk,r,dr,t,rtrack,ttrack,t0,ephase,sid;
   Identifier ident;
@@ -418,26 +418,27 @@ bool TRTCalibrator::calibrate() {
   }
 
   //configure the calibrators
-  for (std::vector<std::string>::iterator it = m_doRt.begin();        it != m_doRt.end();        it++) calibrators[*it]->dort=true;
-  for (std::vector<std::string>::iterator it = m_doT0.begin();        it != m_doT0.end();        it++) calibrators[*it]->dot0=true;
-  for (std::vector<std::string>::iterator it = m_doRes.begin();       it != m_doRes.end();       it++) calibrators[*it]->dores=true;
-  for (std::vector<std::string>::iterator it = m_beQuiet.begin();     it != m_beQuiet.end();     it++) calibrators[*it]->bequiet=true;
-  for (std::vector<std::string>::iterator it = m_doOutPrint.begin();  it != m_doOutPrint.end();  it++) calibrators[*it]->printt0=true;
-  for (std::vector<std::string>::iterator it = m_doRtPrint.begin();   it != m_doRtPrint.end();   it++)  calibrators[*it]->printrt=true;
-  for (std::vector<std::string>::iterator it = m_doLogPrint.begin();  it != m_doLogPrint.end();  it++) calibrators[*it]->printlog=true;
-  for (std::vector<std::string>::iterator it = m_useBoardRef.begin(); it != m_useBoardRef.end(); it++) calibrators[*it]->usebref=true;
-  for (std::map<std::string,Calibrator*>::iterator it = calibrators.begin(); it != calibrators.end(); it++){
-    (it->second)->usep0=m_useP0;
-    (it->second)->floatp3=m_floatP3;
-    (it->second)->useshortstraws=m_DoShortStrawCorrection;
-
-    if (m_doRt.size()==0) (it->second)->nort=true;
-    if (m_doT0.size()==0) (it->second)->not0=true;
+  for (const std::string& s : m_doRt)        calibrators[s]->dort=true;
+  for (const std::string& s : m_doT0)        calibrators[s]->dot0=true;
+  for (const std::string& s : m_doRes)       calibrators[s]->dores=true;
+  for (const std::string& s : m_beQuiet)     calibrators[s]->bequiet=true;
+  for (const std::string& s : m_doOutPrint)  calibrators[s]->printt0=true;
+  for (const std::string& s : m_doRtPrint)   calibrators[s]->printrt=true;
+  for (const std::string& s : m_doLogPrint)  calibrators[s]->printlog=true;
+  for (const std::string& s : m_useBoardRef) calibrators[s]->usebref=true;
+  for (std::pair<const std::string, Calibrator*>& p : calibrators) {
+    Calibrator* calib = p.second;
+    calib->usep0=m_useP0;
+    calib->floatp3=m_floatP3;
+    calib->useshortstraws=m_DoShortStrawCorrection;
+
+    if (m_doRt.size()==0) calib->nort=true;
+    if (m_doT0.size()==0) calib->not0=true;
     
     std::set<int> selset;
-    GetSubLevels(m_selstring,(it->second)->level+1,&selset); //get the set of selections for level "level+1" from the m_selstring ... 
-    for (std::set<int>::iterator imod=selset.begin(); imod!=selset.end(); imod++){
-      (it->second)->selection = selset;//... and configure the calibrator with them
+    GetSubLevels(m_selstring,calib->level+1,&selset); //get the set of selections for level "level+1" from the m_selstring ...
+    for (std::set<int>::iterator imod=selset.begin(); imod!=selset.end(); ++imod){
+      calib->selection = selset;//... and configure the calibrator with them
     }
   }     
 
@@ -461,26 +462,27 @@ bool TRTCalibrator::calibrate() {
   calibratorsAr["Straw"]                =&Straw_Ar;
 
   //configure the calibrators
-  for (std::vector<std::string>::iterator it = m_doRt.begin();        it != m_doRt.end();        it++) calibratorsAr[*it]->dort=true;
-  for (std::vector<std::string>::iterator it = m_doT0.begin();        it != m_doT0.end();        it++) calibratorsAr[*it]->dot0=true;
-  for (std::vector<std::string>::iterator it = m_doRes.begin();       it != m_doRes.end();       it++) calibratorsAr[*it]->dores=true;
-  for (std::vector<std::string>::iterator it = m_beQuiet.begin();     it != m_beQuiet.end();     it++) calibratorsAr[*it]->bequiet=true;
-  for (std::vector<std::string>::iterator it = m_doOutPrint.begin();  it != m_doOutPrint.end();  it++) calibratorsAr[*it]->printt0=true;
-  for (std::vector<std::string>::iterator it = m_doRtPrint.begin();   it != m_doRtPrint.end();   it++)  calibratorsAr[*it]->printrt=true;
-  for (std::vector<std::string>::iterator it = m_doLogPrint.begin();  it != m_doLogPrint.end();  it++) calibratorsAr[*it]->printlog=true;
-  for (std::vector<std::string>::iterator it = m_useBoardRef.begin(); it != m_useBoardRef.end(); it++) calibratorsAr[*it]->usebref=true;
-  for (std::map<std::string,Calibrator*>::iterator it = calibratorsAr.begin(); it != calibratorsAr.end(); it++){
-    (it->second)->usep0=m_useP0;
-    (it->second)->floatp3=m_floatP3;
-    (it->second)->useshortstraws=m_DoShortStrawCorrection;
-
-    if (m_doRt.size()==0) (it->second)->nort=true;
-    if (m_doT0.size()==0) (it->second)->not0=true;
+  for (const std::string& s : m_doRt)        calibratorsAr[s]->dort=true;
+  for (const std::string& s : m_doT0)        calibratorsAr[s]->dot0=true;
+  for (const std::string& s : m_doRes)       calibratorsAr[s]->dores=true;
+  for (const std::string& s : m_beQuiet)     calibratorsAr[s]->bequiet=true;
+  for (const std::string& s : m_doOutPrint)  calibratorsAr[s]->printt0=true;
+  for (const std::string& s : m_doRtPrint)   calibratorsAr[s]->printrt=true;
+  for (const std::string& s : m_doLogPrint)  calibratorsAr[s]->printlog=true;
+  for (const std::string& s : m_useBoardRef) calibratorsAr[s]->usebref=true;
+  for (std::pair<const std::string, Calibrator*>& p : calibratorsAr) {
+    Calibrator* calib = p.second;
+    calib->usep0=m_useP0;
+    calib->floatp3=m_floatP3;
+    calib->useshortstraws=m_DoShortStrawCorrection;
+
+    if (m_doRt.size()==0) calib->nort=true;
+    if (m_doT0.size()==0) calib->not0=true;
 
     std::set<int> selset;
-    GetSubLevels(m_selstring,(it->second)->level+1,&selset); //get the set of selections for level "level+1" from the m_selstring ... 
-    for (std::set<int>::iterator imod=selset.begin(); imod!=selset.end(); imod++){
-      (it->second)->selection = selset;//... and configure the calibrator with them
+    GetSubLevels(m_selstring,calib->level+1,&selset); //get the set of selections for level "level+1" from the m_selstring ... 
+    for (std::set<int>::iterator imod=selset.begin(); imod!=selset.end(); ++imod){
+      calib->selection = selset;//... and configure the calibrator with them
     }
   }
 
@@ -959,59 +961,59 @@ bool TRTCalibrator::calibrate() {
 
   //if (m_SplitBarrel){
   
-  for (std::map<std::string,BDdetector>::iterator it = m_trt.t.begin(); it != m_trt.t.end(); it++){
+  for (std::pair<const std::string, BDdetector>& pt : m_trt.t) {
     
     if (TRT.Skip()) break;
-    if (TRT.HasKey(it->first)) {
-      trtdir = TRT.Calibrate(m_histfile,it->first,SubLev(m_options,1),&startdata);
-      if (TRT.printt0) t0calfile << Form("-3 -1 -1 -1 -1 : %e %e",TRT.data[it->first].t0,TRT.data[it->first].t0err) << std::endl;
-      if (TRT.printrt) rtcalfile << Form("-3 -1 -1 -1 -1 : %i %e %e %e %e",rtint,TRT.data[it->first].rtpar[0],TRT.data[it->first].rtpar[1],TRT.data[it->first].rtpar[2],TRT.data[it->first].rtpar[3]) << std::endl;
+    if (TRT.HasKey(pt.first)) {
+      trtdir = TRT.Calibrate(m_histfile,pt.first,SubLev(m_options,1),&startdata);
+      if (TRT.printt0) t0calfile << Form("-3 -1 -1 -1 -1 : %e %e",TRT.data[pt.first].t0,TRT.data[pt.first].t0err) << std::endl;
+      if (TRT.printrt) rtcalfile << Form("-3 -1 -1 -1 -1 : %i %e %e %e %e",rtint,TRT.data[pt.first].rtpar[0],TRT.data[pt.first].rtpar[1],TRT.data[pt.first].rtpar[2],TRT.data[pt.first].rtpar[3]) << std::endl;
     }
-    for (std::map<std::string,BDlayer>::iterator id = (it->second.d).begin() ; id != (it->second.d).end(); id++){
+    for (std::pair<const std::string, BDlayer>& pd : pt.second.d) {
       
       if(Detector.Skip()) break; 
-      if(Detector.HasKey(id->first)){
-        detdir = Detector.Calibrate(trtdir,id->first,SubLev(m_options,2),&TRT.data[it->first]);
+      if(Detector.HasKey(pd.first)){
+        detdir = Detector.Calibrate(trtdir,pd.first,SubLev(m_options,2),&TRT.data[pt.first]);
       }
-      for (std::map<std::string,BDmodule>::iterator il = (id->second.l).begin(); il != (id->second.l).end(); il++){
+      for (std::pair<const std::string, BDmodule>& pl : pd.second.l) {
 
         if(Layer.Skip()) break;
-        if(Layer.HasKey(il->first)){
-          laydir = Layer.Calibrate(detdir,il->first,SubLev(m_options,3),&Detector.data[id->first]);
-          if (Layer.printt0) t0calfile << Form("%i %i -1 -1 -1 : %e %e",Layer.data[il->first].det,Layer.data[il->first].lay,Layer.data[il->first].t0,Layer.data[il->first].t0err) << std::endl;
-          if (Layer.printrt) rtcalfile    << Form("%i %i -1 -1 -1 : %i %e %e %e %e",Layer.data[il->first].det,Layer.data[il->first].lay,rtint,Layer.data[il->first].rtpar[0],Layer.data[il->first].rtpar[1],Layer.data[il->first].rtpar[2],Layer.data[il->first].rtpar[3]) << std::endl;
+        if(Layer.HasKey(pl.first)){
+          laydir = Layer.Calibrate(detdir,pl.first,SubLev(m_options,3),&Detector.data[pd.first]);
+          if (Layer.printt0) t0calfile << Form("%i %i -1 -1 -1 : %e %e",Layer.data[pl.first].det,Layer.data[pl.first].lay,Layer.data[pl.first].t0,Layer.data[pl.first].t0err) << std::endl;
+          if (Layer.printrt) rtcalfile    << Form("%i %i -1 -1 -1 : %i %e %e %e %e",Layer.data[pl.first].det,Layer.data[pl.first].lay,rtint,Layer.data[pl.first].rtpar[0],Layer.data[pl.first].rtpar[1],Layer.data[pl.first].rtpar[2],Layer.data[pl.first].rtpar[3]) << std::endl;
           if (!m_SplitBarrel) {
-            if (Layer.printt0) t0calfile    << Form("%i %i -1 -1 -1 : %e %e",-Layer.data[il->first].det,Layer.data[il->first].lay,Layer.data[il->first].t0,Layer.data[il->first].t0err) << std::endl;
-            if (Layer.printrt) rtcalfile    << Form("%i %i -1 -1 -1 : %i %e %e %e %e",-Layer.data[il->first].det,Layer.data[il->first].lay,rtint,Layer.data[il->first].rtpar[0],Layer.data[il->first].rtpar[1],Layer.data[il->first].rtpar[2],Layer.data[il->first].rtpar[3]) << std::endl;
+            if (Layer.printt0) t0calfile    << Form("%i %i -1 -1 -1 : %e %e",-Layer.data[pl.first].det,Layer.data[pl.first].lay,Layer.data[pl.first].t0,Layer.data[pl.first].t0err) << std::endl;
+            if (Layer.printrt) rtcalfile    << Form("%i %i -1 -1 -1 : %i %e %e %e %e",-Layer.data[pl.first].det,Layer.data[pl.first].lay,rtint,Layer.data[pl.first].rtpar[0],Layer.data[pl.first].rtpar[1],Layer.data[pl.first].rtpar[2],Layer.data[pl.first].rtpar[3]) << std::endl;
           }
         }
-        for (std::map<std::string,BDboard>::iterator im = (il->second.m).begin(); im != (il->second.m).end(); im++){
+        for (std::pair<const std::string, BDboard>& pm : pl.second.m) {
 
           if(Module.Skip()) break; 
-          if(Module.HasKey(im->first)){ 
-            moddir = Module.Calibrate(laydir,im->first,SubLev(m_options,4),&Layer.data[il->first]);
-            if (Module.printt0) t0calfile << Form("%i %i %i -1 -1 : %e %e",Module.data[im->first].det,Module.data[im->first].lay,Module.data[im->first].mod,Module.data[im->first].t0,Module.data[im->first].t0err) << std::endl;
-            if (Module.printrt) rtcalfile    << Form("%i %i %i -1 -1 : %i %e %e %e %e",Module.data[im->first].det,Module.data[im->first].lay,Module.data[im->first].mod,rtint,Module.data[im->first].rtpar[0],Module.data[im->first].rtpar[1],Module.data[im->first].rtpar[2],Module.data[im->first].rtpar[3]) << std::endl;
+          if(Module.HasKey(pm.first)){ 
+            moddir = Module.Calibrate(laydir,pm.first,SubLev(m_options,4),&Layer.data[pl.first]);
+            if (Module.printt0) t0calfile << Form("%i %i %i -1 -1 : %e %e",Module.data[pm.first].det,Module.data[pm.first].lay,Module.data[pm.first].mod,Module.data[pm.first].t0,Module.data[pm.first].t0err) << std::endl;
+            if (Module.printrt) rtcalfile    << Form("%i %i %i -1 -1 : %i %e %e %e %e",Module.data[pm.first].det,Module.data[pm.first].lay,Module.data[pm.first].mod,rtint,Module.data[pm.first].rtpar[0],Module.data[pm.first].rtpar[1],Module.data[pm.first].rtpar[2],Module.data[pm.first].rtpar[3]) << std::endl;
           } 
-          for (std::map<std::string,BDchip>::iterator ib = (im->second.b).begin(); ib != (im->second.b).end(); ib++){
+          for (std::pair<const std::string, BDchip>& pb : pm.second.b) {
 
             if(Board.Skip()) break; 
-            if(Board.HasKey(ib->first)){ 
-              brddir = Board.Calibrate(moddir,ib->first,SubLev(m_options,5),&Module.data[im->first]);
+            if(Board.HasKey(pb.first)){ 
+              brddir = Board.Calibrate(moddir,pb.first,SubLev(m_options,5),&Module.data[pm.first]);
             } 
-            for (std::map<std::string,BDstraw>::iterator ic = (ib->second.c).begin(); ic != (ib->second.c).end(); ic++){
+            for (std::pair<const std::string, BDstraw>& pc : pb.second.c) {
 
               if(Chip.Skip()) break; 
-              if(Chip.HasKey(ic->first)){ 
-                chpdir = Chip.Calibrate(brddir,ic->first,SubLev(m_options,6),&Board.data[ib->first]);
+              if(Chip.HasKey(pc.first)){ 
+                chpdir = Chip.Calibrate(brddir,pc.first,SubLev(m_options,6),&Board.data[pb.first]);
               }
-              for (std::map<std::string,BDzero>::iterator is = (ic->second.s).begin(); is != (ic->second.s).end(); is++){
+              for (std::pair<const std::string, BDzero>& ps : pc.second.s) {
 
                 if(Straw.Skip()) break;
-                if(Straw.HasKey(is->first)){ 
-                  Straw.Calibrate(chpdir,is->first,SubLev(m_options,7),&Chip.data[ic->first]);
-                  if (Straw.printt0) t0calfile << Form("%i %i %i %i %i : %e %e",Straw.data[is->first].det,Straw.data[is->first].lay,Straw.data[is->first].mod,Straw.data[is->first].stl,Straw.data[is->first].stw,Straw.data[is->first].t0,Straw.data[is->first].t0err) << std::endl;
-                  if (Straw.printrt) rtcalfile << Form("%i %i %i %i %i : %i %e %e %e %e",Straw.data[is->first].det,Straw.data[is->first].lay,Straw.data[is->first].mod,Straw.data[is->first].stl,Straw.data[is->first].stw,rtint,Straw.data[is->first].rtpar[0],Straw.data[is->first].rtpar[1],Straw.data[is->first].rtpar[2],Straw.data[is->first].rtpar[3]) << std::endl;
+                if(Straw.HasKey(ps.first)){ 
+                  Straw.Calibrate(chpdir,ps.first,SubLev(m_options,7),&Chip.data[pc.first]);
+                  if (Straw.printt0) t0calfile << Form("%i %i %i %i %i : %e %e",Straw.data[ps.first].det,Straw.data[ps.first].lay,Straw.data[ps.first].mod,Straw.data[ps.first].stl,Straw.data[ps.first].stw,Straw.data[ps.first].t0,Straw.data[ps.first].t0err) << std::endl;
+                  if (Straw.printrt) rtcalfile << Form("%i %i %i %i %i : %i %e %e %e %e",Straw.data[ps.first].det,Straw.data[ps.first].lay,Straw.data[ps.first].mod,Straw.data[ps.first].stl,Straw.data[ps.first].stw,rtint,Straw.data[ps.first].rtpar[0],Straw.data[ps.first].rtpar[1],Straw.data[ps.first].rtpar[2],Straw.data[ps.first].rtpar[3]) << std::endl;
                 
 
                 }
@@ -1033,52 +1035,51 @@ bool TRTCalibrator::calibrate() {
 
   if (m_DoArXenonSep){
 
-  for (std::map<std::string,BDdetector>::iterator it = m_trt.t.begin(); it != m_trt.t.end(); it++){
+  for (std::pair<const std::string, BDdetector>& pt : m_trt.t) {
 
     if (TRT_Ar.Skip()) break;
-    if (TRT_Ar.HasKey(it->first)) {
-      trtdirAr = TRT_Ar.Calibrate(m_histfile,it->first,SubLev(m_options,1),&startdata);
+    if (TRT_Ar.HasKey(pt.first)) {
+      trtdirAr = TRT_Ar.Calibrate(m_histfile,pt.first,SubLev(m_options,1),&startdata);
     }
-    for (std::map<std::string,BDlayer>::iterator id = (it->second.d).begin() ; id != (it->second.d).end(); id++){
+    for (std::pair<const std::string, BDlayer>& pd : pt.second.d) {
 
       if(Detector_Ar.Skip()) break;
-      if(Detector_Ar.HasKey(id->first)){
-        detdirAr = Detector_Ar.Calibrate(trtdirAr,id->first,SubLev(m_options,2),&TRT_Ar.data[it->first]);
+      if(Detector_Ar.HasKey(pd.first)){
+        detdirAr = Detector_Ar.Calibrate(trtdirAr,pd.first,SubLev(m_options,2),&TRT_Ar.data[pt.first]);
       }
-      for (std::map<std::string,BDmodule>::iterator il = (id->second.l).begin(); il != (id->second.l).end(); il++){
+      for (std::pair<const std::string, BDmodule>& pl : pd.second.l) {
 
         if(Layer_Ar.Skip()) break;
-        if(Layer_Ar.HasKey(il->first)){
-          laydirAr = Layer_Ar.Calibrate(detdirAr,il->first,SubLev(m_options,3),&Detector_Ar.data[id->first]);
+        if(Layer_Ar.HasKey(pl.first)){
+          laydirAr = Layer_Ar.Calibrate(detdirAr,pl.first,SubLev(m_options,3),&Detector_Ar.data[pd.first]);
        
         }
-        for (std::map<std::string,BDboard>::iterator im = (il->second.m).begin(); im != (il->second.m).end(); im++){
+        for (std::pair<const std::string, BDboard>& pm : pl.second.m) {
 
           if(Module_Ar.Skip()) break;
-          if(Module_Ar.HasKey(im->first)){
-            moddirAr = Module_Ar.Calibrate(laydirAr,im->first,SubLev(m_options,4),&Layer_Ar.data[il->first]);
-            if (Module_Ar.printt0) t0calfile << Form("%i %i %i -1 -1 : %e %e",Module_Ar.data[im->first].det,Module_Ar.data[im->first].lay,Module_Ar.data[im->first].mod,Module_Ar.data[im->first].t0,Module_Ar.data[im->first].t0err) << std::endl;
-            if (Layer_Ar.printrt) rtcalfile    << Form("%i %i %i -1 -1 : %i %e %e %e %e",Module_Ar.data[im->first].det,Module_Ar.data[im->first].lay,Module_Ar.data[im->first].mod,rtint,Module_Ar.data[im->first].rtpar[0],Module_Ar.data[im->first].rtpar[1],Module_Ar.data[im->first].rtpar[2],Module_Ar.data[im->first].rtpar[3]) << std::endl;
+          if(Module_Ar.HasKey(pm.first)){
+            moddirAr = Module_Ar.Calibrate(laydirAr,pm.first,SubLev(m_options,4),&Layer_Ar.data[pl.first]);
+            if (Module_Ar.printt0) t0calfile << Form("%i %i %i -1 -1 : %e %e",Module_Ar.data[pm.first].det,Module_Ar.data[pm.first].lay,Module_Ar.data[pm.first].mod,Module_Ar.data[pm.first].t0,Module_Ar.data[pm.first].t0err) << std::endl;
+            if (Layer_Ar.printrt) rtcalfile    << Form("%i %i %i -1 -1 : %i %e %e %e %e",Module_Ar.data[pm.first].det,Module_Ar.data[pm.first].lay,Module_Ar.data[pm.first].mod,rtint,Module_Ar.data[pm.first].rtpar[0],Module_Ar.data[pm.first].rtpar[1],Module_Ar.data[pm.first].rtpar[2],Module_Ar.data[pm.first].rtpar[3]) << std::endl;
           }
-          for (std::map<std::string,BDchip>::iterator ib = (im->second.b).begin(); ib != (im->second.b).end(); ib++){
-
+          for (std::pair<const std::string, BDchip>& pb : pm.second.b) {
             if(Board_Ar.Skip()) break;
-            if(Board_Ar.HasKey(ib->first)){
-              brddirAr = Board_Ar.Calibrate(moddirAr,ib->first,SubLev(m_options,5),&Module_Ar.data[im->first]);
+            if(Board_Ar.HasKey(pb.first)){
+              brddirAr = Board_Ar.Calibrate(moddirAr,pb.first,SubLev(m_options,5),&Module_Ar.data[pm.first]);
             }
-            for (std::map<std::string,BDstraw>::iterator ic = (ib->second.c).begin(); ic != (ib->second.c).end(); ic++){
+            for (std::pair<const std::string, BDstraw>& pc : pb.second.c) {
 
               if(Chip_Ar.Skip()) break;
-              if(Chip_Ar.HasKey(ic->first)){
-                chpdirAr = Chip_Ar.Calibrate(brddirAr,ic->first,SubLev(m_options,6),&Board_Ar.data[ib->first]);
+              if(Chip_Ar.HasKey(pc.first)){
+                chpdirAr = Chip_Ar.Calibrate(brddirAr,pc.first,SubLev(m_options,6),&Board_Ar.data[pb.first]);
               }
-              for (std::map<std::string,BDzero>::iterator is = (ic->second.s).begin(); is != (ic->second.s).end(); is++){
+              for (std::pair<const std::string, BDzero>& ps : pc.second.s) {
 
                 if(Straw_Ar.Skip()) break;
-                if(Straw_Ar.HasKey(is->first)){
-                  Straw_Ar.Calibrate(chpdirAr,is->first,SubLev(m_options,7),&Chip_Ar.data[ic->first]);
-                  if (Straw_Ar.printt0) t0calfile << Form("%i %i %i %i %i : %e %e",Straw_Ar.data[is->first].det,Straw_Ar.data[is->first].lay,Straw_Ar.data[is->first].mod,Straw_Ar.data[is->first].stl,Straw_Ar.data[is->first].stw,Straw_Ar.data[is->first].t0,Straw_Ar.data[is->first].t0err) << std::endl;
-                  if (Straw_Ar.printrt) rtcalfile << Form("%i %i %i %i %i : %i %e %e %e %e",Straw_Ar.data[is->first].det,Straw_Ar.data[is->first].lay,Straw_Ar.data[is->first].mod,Straw_Ar.data[is->first].stl,Straw_Ar.data[is->first].stw,rtint,Straw_Ar.data[is->first].rtpar[0],Straw_Ar.data[is->first].rtpar[1],Straw_Ar.data[is->first].rtpar[2],Straw_Ar.data[is->first].rtpar[3]) << std::endl;
+                if(Straw_Ar.HasKey(ps.first)){
+                  Straw_Ar.Calibrate(chpdirAr,ps.first,SubLev(m_options,7),&Chip_Ar.data[pc.first]);
+                  if (Straw_Ar.printt0) t0calfile << Form("%i %i %i %i %i : %e %e",Straw_Ar.data[ps.first].det,Straw_Ar.data[ps.first].lay,Straw_Ar.data[ps.first].mod,Straw_Ar.data[ps.first].stl,Straw_Ar.data[ps.first].stw,Straw_Ar.data[ps.first].t0,Straw_Ar.data[ps.first].t0err) << std::endl;
+                  if (Straw_Ar.printrt) rtcalfile << Form("%i %i %i %i %i : %i %e %e %e %e",Straw_Ar.data[ps.first].det,Straw_Ar.data[ps.first].lay,Straw_Ar.data[ps.first].mod,Straw_Ar.data[ps.first].stl,Straw_Ar.data[ps.first].stw,rtint,Straw_Ar.data[ps.first].rtpar[0],Straw_Ar.data[ps.first].rtpar[1],Straw_Ar.data[ps.first].rtpar[2],Straw_Ar.data[ps.first].rtpar[3]) << std::endl;
                 }
               }
             }
diff --git a/InnerDetector/InDetCalibTools/TRT_CalibTools/src/TRTCalibrator.h b/InnerDetector/InDetCalibTools/TRT_CalibTools/src/TRTCalibrator.h
index 4628bb2a65661d35e382f8c2ea31aed4a152f7bd..00330815d4e3fad435ddf13e8a9f16efac53a737 100755
--- a/InnerDetector/InDetCalibTools/TRT_CalibTools/src/TRTCalibrator.h
+++ b/InnerDetector/InDetCalibTools/TRT_CalibTools/src/TRTCalibrator.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 TRT_CALIBTOOLS__TRTCALIBRATOR_H
@@ -72,10 +72,10 @@ public:
       "-1" & "1": calibration of the barrel C- & A-side
       "X_Y": calibration of layer Y in barrel X-side
   */
-  virtual StatusCode initialize();
-  virtual StatusCode finalize();
+  virtual StatusCode initialize() override;
+  virtual StatusCode finalize() override;
 
-  virtual bool fill(const Trk::Track* aTrack, TRT::TrackInfo* output);
+  virtual bool fill(const Trk::Track* aTrack, TRT::TrackInfo* output) override;
 
   bool IncludedLevels(std::string, int*);
 
@@ -87,7 +87,7 @@ public:
   /**
      returns true if the ...
   */
-  bool IsSubLev(std::string, int, std::string);  
+  bool IsSubLev(const std::string&, int, const std::string&);  
 
   /**
      returns true if the ...
@@ -97,7 +97,7 @@ public:
   /**
      fills a set of integers with the indexes af the sub-modules that are conatined in a selection 
   */
-  int GetSubLevels(std::string, int, std::set<int>*);  
+  int GetSubLevels(const std::string&, int, std::set<int>*);  
 
   /**
      makes the key strings for a sub-module
@@ -107,7 +107,7 @@ public:
   /**
      Method for doing the actual calibration
   */
-  virtual bool calibrate();
+  virtual bool calibrate ATLAS_NOT_THREAD_SAFE () override;
 
 private:
   const AtlasDetectorID* m_DetID;
diff --git a/InnerDetector/InDetConditions/InDetByteStreamErrors/CMakeLists.txt b/InnerDetector/InDetConditions/InDetByteStreamErrors/CMakeLists.txt
index 5559457d833fe49f8ea9df2673197b8a76fa1c8a..4c252f00bcb9581d392dfd2f07204b61e5100c26 100644
--- a/InnerDetector/InDetConditions/InDetByteStreamErrors/CMakeLists.txt
+++ b/InnerDetector/InDetConditions/InDetByteStreamErrors/CMakeLists.txt
@@ -5,16 +5,6 @@
 # Declare the package name:
 atlas_subdir( InDetByteStreamErrors )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Control/AthenaKernel
-                          Control/AthContainers
-                          Event/EventContainers
-                          DetectorDescription/Identifier )
-
-# this line failed automatic conversion in cmt2cmake :
-# use AtlasReflex          AtlasReflex-*              External - no_auto_imports
-
 # Component(s) in the package:
 atlas_add_dictionary( InDetByteStreamErrorsDict
                       InDetByteStreamErrors/InDetByteStreamErrorsDict.h
@@ -24,5 +14,5 @@ atlas_add_dictionary( InDetByteStreamErrorsDict
 atlas_add_library( InDetByteStreamErrors
                    src/*.cxx
                    PUBLIC_HEADERS InDetByteStreamErrors
-                   LINK_LIBRARIES AthenaKernel )
+                   LINK_LIBRARIES AthenaKernel EventContainers )
 
diff --git a/InnerDetector/InDetConditions/InDetByteStreamErrorsAthenaPool/CMakeLists.txt b/InnerDetector/InDetConditions/InDetByteStreamErrorsAthenaPool/CMakeLists.txt
index f117789cb97c64dbdbdeff6155c09d5999288f82..7a30a784da66fb86985f5efa2fd48bffcf810d16 100644
--- a/InnerDetector/InDetConditions/InDetByteStreamErrorsAthenaPool/CMakeLists.txt
+++ b/InnerDetector/InDetConditions/InDetByteStreamErrorsAthenaPool/CMakeLists.txt
@@ -5,18 +5,6 @@
 # Declare the package name:
 atlas_subdir( InDetByteStreamErrorsAthenaPool )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs(
-   PUBLIC
-   Database/AthenaPOOL/AthenaPoolUtilities
-   DetectorDescription/Identifier
-   PRIVATE
-   GaudiKernel
-   AtlasTest/TestTools
-   Control/AthAllocators
-   Database/AthenaPOOL/AthenaPoolCnvSvc
-   InnerDetector/InDetConditions/InDetByteStreamErrors )
-
 # Component(s) in the package:
 atlas_add_poolcnv_library( InDetByteStreamErrorsAthenaPoolPoolCnv src/*.cxx
    FILES InDetByteStreamErrors/InDetBSErrContainer.h
@@ -36,22 +24,22 @@ atlas_add_dictionary( InDetByteStreamErrorsAthenaPoolCnvDict
 atlas_add_test( InDetBSErrContainerCnv_p1_test
    SOURCES test/InDetBSErrContainerCnv_p1_test.cxx
    src/InDetBSErrContainerCnv_p1.cxx
-   LINK_LIBRARIES GaudiKernel AthenaPoolCnvSvcLib Identifier AthAllocators )
+   LINK_LIBRARIES GaudiKernel AthenaPoolCnvSvcLib Identifier AthAllocators InDetByteStreamErrors )
 
 atlas_add_test( IDCInDetBSErrContainerCnv_p1_test
    SOURCES test/IDCInDetBSErrContainerCnv_p1_test.cxx
    src/IDCInDetBSErrContainerCnv_p1.cxx
-   LINK_LIBRARIES GaudiKernel AthenaPoolCnvSvcLib Identifier AthAllocators )
+   LINK_LIBRARIES GaudiKernel AthenaPoolCnvSvcLib Identifier AthAllocators InDetByteStreamErrors )
 
 #atlas_add_test( TRT_BSErrContainerCnv_p1_test
 #   SOURCES test/TRT_BSErrContainerCnv_p1_test.cxx
 #   src/TRT_BSErrContainerCnv_p1.cxx
-#   LINK_LIBRARIES GaudiKernel AthenaPoolCnvSvcLib Identifier AthAllocators )
+#   LINK_LIBRARIES GaudiKernel AthenaPoolCnvSvcLib Identifier AthAllocators InDetByteStreamErrors )
 
 atlas_add_test( TRT_BSIdErrContainerCnv_p1_test
    SOURCES test/TRT_BSIdErrContainerCnv_p1_test.cxx
    src/TRT_BSIdErrContainerCnv_p1.cxx
-   LINK_LIBRARIES GaudiKernel AthenaPoolCnvSvcLib Identifier AthAllocators )
+   LINK_LIBRARIES GaudiKernel AthenaPoolCnvSvcLib Identifier AthAllocators InDetByteStreamErrors )
 
 # Install files from the package:
 atlas_install_headers( InDetByteStreamErrorsAthenaPool )
diff --git a/InnerDetector/InDetConditions/InDetByteStreamErrorsAthenaPool/share/IDCInDetBSErrContainerCnv_p1_test.ref b/InnerDetector/InDetConditions/InDetByteStreamErrorsAthenaPool/share/IDCInDetBSErrContainerCnv_p1_test.ref
new file mode 100644
index 0000000000000000000000000000000000000000..a5bce3fd2565d8f458555a0c6f42d0504a848bd5
--- /dev/null
+++ b/InnerDetector/InDetConditions/InDetByteStreamErrorsAthenaPool/share/IDCInDetBSErrContainerCnv_p1_test.ref
@@ -0,0 +1 @@
+test1
diff --git a/InnerDetector/InDetConditions/InDetByteStreamErrorsAthenaPool/src/InDetBSErrContainerCnv_p1.cxx b/InnerDetector/InDetConditions/InDetByteStreamErrorsAthenaPool/src/InDetBSErrContainerCnv_p1.cxx
index e428085596a7e4fba28e55027dfa68af98a4fdb1..a27a6c7839ee5ff3adb44cc58737d893943c05fd 100644
--- a/InnerDetector/InDetConditions/InDetByteStreamErrorsAthenaPool/src/InDetBSErrContainerCnv_p1.cxx
+++ b/InnerDetector/InDetConditions/InDetByteStreamErrorsAthenaPool/src/InDetBSErrContainerCnv_p1.cxx
@@ -4,7 +4,7 @@
 
 #include "InDetBSErrContainerCnv_p1.h"
 
-void InDetBSErrContainerCnv_p1::transToPers ATLAS_NOT_THREAD_SAFE // const_cast is used.
+void InDetBSErrContainerCnv_p1::transToPers
 (const InDetBSErrContainer* transCont, InDetBSErrContainer_p1* persCont, MsgStream& /*log*/)
 {
   InDetBSErrContainer::const_iterator it = transCont->begin();
@@ -14,7 +14,7 @@ void InDetBSErrContainerCnv_p1::transToPers ATLAS_NOT_THREAD_SAFE // const_cast
   for (; it != itEnd; ++it) {
     // FIXME: Should change type of m_bsErrs, but don't want to cause possible
     // back-compatibility problems.
-    std::pair<IdentifierHash, int>* ptr = const_cast<std::pair<IdentifierHash, int>*> (*it);
+    std::pair<IdentifierHash, int>* ptr ATLAS_THREAD_SAFE = const_cast<std::pair<IdentifierHash, int>*> (*it);
     (persCont->m_bsErrs).push_back(ptr);
   }
   return;
diff --git a/InnerDetector/InDetConditions/InDetByteStreamErrorsAthenaPool/src/TRT_BSIdErrContainerCnv_p1.cxx b/InnerDetector/InDetConditions/InDetByteStreamErrorsAthenaPool/src/TRT_BSIdErrContainerCnv_p1.cxx
index d27504bc31d26ea306df492385a11435d97caacc..0161e97b8a756e7dc99a44e744ec62f97baa5098 100644
--- a/InnerDetector/InDetConditions/InDetByteStreamErrorsAthenaPool/src/TRT_BSIdErrContainerCnv_p1.cxx
+++ b/InnerDetector/InDetConditions/InDetByteStreamErrorsAthenaPool/src/TRT_BSIdErrContainerCnv_p1.cxx
@@ -11,7 +11,7 @@
 
 #include <iostream>
 
-void TRT_BSIdErrContainerCnv_p1::transToPers ATLAS_NOT_THREAD_SAFE // const_cast is used.
+void TRT_BSIdErrContainerCnv_p1::transToPers
 (const TRT_BSIdErrContainer* transCont, TRT_BSIdErrContainer_p1* persCont, MsgStream & /* log */) 
 {
   TRT_BSIdErrContainer::const_iterator it = transCont->begin();
@@ -21,7 +21,7 @@ void TRT_BSIdErrContainerCnv_p1::transToPers ATLAS_NOT_THREAD_SAFE // const_cast
   for (; it != itEnd; ++it) {
     // FIXME: Should change type of m_bsErrs, but don't want to cause possible
     // back-compatibility problems.
-    std::pair<uint8_t, std::pair<uint32_t, uint8_t> >* ptr = const_cast<std::pair<uint8_t, std::pair<uint32_t, uint8_t> >*> (*it);
+    std::pair<uint8_t, std::pair<uint32_t, uint8_t> >* ptr ATLAS_THREAD_SAFE = const_cast<std::pair<uint8_t, std::pair<uint32_t, uint8_t> >*> (*it);
     (persCont->m_bsErrs).push_back(ptr);
   }
   return;
diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/python/PixelConditionsConfig.py b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/python/PixelConditionsConfig.py
index 6d2cddef950c71f2164d46a35345669d813430ac..45a1de73d1b8c7f978cb6000c1f372fcb07f4e36 100644
--- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/python/PixelConditionsConfig.py
+++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/python/PixelConditionsConfig.py
@@ -20,8 +20,8 @@ def PixelConfigCondAlgCfg(flags, name="PixelConfigCondAlg", **kwargs):
     CondArgs.update(
         UseCalibConditions=True,
         UseDeadmapConditions=True,
-        UseDCSStateConditions=False,
-        UseDCSStatusConditions=False,
+        UseDCSStateConditions=(not flags.Input.isMC and flags.InDet.usePixelDCS),
+        UseDCSStatusConditions=(not flags.Input.isMC and flags.InDet.usePixelDCS),
         UseDCSHVConditions=True,
         UseDCSTemperatureConditions=True,
         UseTDAQConditions=False,
@@ -52,137 +52,138 @@ def PixelConfigCondAlgCfg(flags, name="PixelConfigCondAlg", **kwargs):
             EndcapTimeOffset=[5.0,5.0,5.0],
             DBMTimeOffset=[5.0,5.0,5.0]
         )
-    # Digitization parameters
-    CondArgs.update(
-        BunchSpace=25.0,
-        FEI4BarrelHitDiscConfig=[2]
-    )
 
-    #====================================================================================
-    # Run-dependent SIMULATION(digitization) parameters:
-    #====================================================================================
-    # RUN2 2015/2016
-    CondArgs.update(
-        BarrelToTThreshold2016       = [   -1,    5,    5,    5],
-        FEI3BarrelLatency2016        = [    0,  151,  256,  256],
-        FEI3BarrelHitDuplication2016 = [False,False,False,False],
-        FEI3BarrelSmallHitToT2016    = [   -1,   -1,   -1,   -1],
-        FEI3BarrelTimingSimTune2016  = [   -1, 2015, 2015, 2015],
-        BarrelCrossTalk2016          = [ 0.30, 0.06, 0.06, 0.06],
-        BarrelNoiseOccupancy2016     = [ 5e-8, 5e-8, 5e-8, 5e-8],
-        BarrelDisableProbability2016 = [ 9e-3, 9e-3, 9e-3, 9e-3],
-        EndcapToTThreshold2016       = [    5,    5,    5],
-        FEI3EndcapLatency2016        = [  256,  256,  256],
-        FEI3EndcapHitDuplication2016 = [False,False,False],
-        FEI3EndcapSmallHitToT2016    = [   -1,   -1,   -1],
-        FEI3EndcapTimingSimTune2016  = [ 2015, 2015, 2015],
-        EndcapCrossTalk2016          = [ 0.06, 0.06, 0.06],
-        EndcapNoiseOccupancy2016     = [ 5e-8, 5e-8, 5e-8],
-        EndcapDisableProbability2016 = [ 9e-3, 9e-3, 9e-3],
-        DBMToTThreshold2016       = [   -1,   -1,   -1],
-        DBMCrossTalk2016          = [ 0.06, 0.06, 0.06],
-        DBMNoiseOccupancy2016     = [ 5e-8, 5e-8, 5e-8],
-        DBMDisableProbability2016 = [ 9e-3, 9e-3, 9e-3],
-        IBLNoiseShape2016    = [0.0, 0.0330, 0.0, 0.3026, 0.5019, 0.6760, 0.8412, 0.9918, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0],
-        BLayerNoiseShape2016 = [0.0, 0.0, 0.0, 0.0, 0.2204, 0.5311, 0.7493, 0.8954, 0.9980, 1.0],
-        PixelNoiseShape2016  = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.2418, 0.4397, 0.5858, 0.6949, 0.7737, 0.8414, 0.8959, 0.9414, 0.9828, 1.0],
-        # Layer-2 noise shape                     [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.2129, 0.4016, 0.5477, 0.6599, 0.7435, 0.8160, 0.8779, 0.9340, 0.9798, 1.0]
-        # So far, Gaudi::Property does not support 2D vector.
-        #EndcapNoiseShape=[[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1748, 0.3409, 0.4760, 0.5850, 0.6754, 0.7538, 0.8264, 0.8962, 0.9655, 1.0],
-        #                  [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1852, 0.3528, 0.4881, 0.5961, 0.6855, 0.7640, 0.8374, 0.9068, 0.9749, 1.0],
-        #                  [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1735, 0.3380, 0.4733, 0.5829, 0.6730, 0.7516, 0.8234, 0.8916, 0.9595, 1.0]]
-    )
-    #====================================================================================
-    # RUN2 2017
-    CondArgs.update(
-        BarrelToTThreshold2017       = [   -1,    5,    5,    5],
-        FEI3BarrelLatency2017        = [    0,  151,  256,  256],
-        FEI3BarrelHitDuplication2017 = [False,False,False,False],
-        FEI3BarrelSmallHitToT2017    = [   -1,   -1,   -1,   -1],
-        FEI3BarrelTimingSimTune2017  = [   -1, 2018, 2018, 2018],
-        BarrelCrossTalk2017          = [ 0.30, 0.06, 0.06, 0.06],
-        BarrelNoiseOccupancy2017     = [ 5e-8, 5e-8, 5e-8, 5e-8],
-        BarrelDisableProbability2017 = [ 9e-3, 9e-3, 9e-3, 9e-3],
-        EndcapToTThreshold2017       = [    5,    5,    5],
-        FEI3EndcapLatency2017        = [  256,  256,  256],
-        FEI3EndcapHitDuplication2017 = [False,False,False],
-        FEI3EndcapSmallHitToT2017    = [   -1,   -1,   -1],
-        FEI3EndcapTimingSimTune2017  = [ 2018, 2018, 2018],
-        EndcapCrossTalk2017          = [ 0.06, 0.06, 0.06],
-        EndcapNoiseOccupancy2017     = [ 5e-8, 5e-8, 5e-8],
-        EndcapDisableProbability2017 = [ 9e-3, 9e-3, 9e-3],
-        DBMToTThreshold2017       = [   -1,   -1,   -1],
-        DBMCrossTalk2017          = [ 0.06, 0.06, 0.06],
-        DBMNoiseOccupancy2017     = [ 5e-8, 5e-8, 5e-8],
-        DBMDisableProbability2017 = [ 9e-3, 9e-3, 9e-3],
-        IBLNoiseShape2017    = [0.0, 0.0330, 0.0, 0.3026, 0.5019, 0.6760, 0.8412, 0.9918, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0],
-        BLayerNoiseShape2017 = [0.0, 0.0, 0.0, 0.0, 0.2204, 0.5311, 0.7493, 0.8954, 0.9980, 1.0],
-        PixelNoiseShape2017  = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.2418, 0.4397, 0.5858, 0.6949, 0.7737, 0.8414, 0.8959, 0.9414, 0.9828, 1.0],
-    )
-    #====================================================================================
-    # RUN2 2018
-    CondArgs.update(
-        BarrelToTThreshold2018       = [   -1,    3,    5,    5],
-        FEI3BarrelLatency2018        = [    0,  151,  256,  256],
-        FEI3BarrelHitDuplication2018 = [False,False,False,False],
-        FEI3BarrelSmallHitToT2018    = [   -1,   -1,   -1,   -1],
-        FEI3BarrelTimingSimTune2018  = [   -1, 2018, 2018, 2018],
-        BarrelCrossTalk2018          = [ 0.30, 0.06, 0.06, 0.06],
-        BarrelNoiseOccupancy2018     = [ 5e-8, 5e-8, 5e-8, 5e-8],
-        BarrelDisableProbability2018 = [ 9e-3, 9e-3, 9e-3, 9e-3],
-        EndcapToTThreshold2018       = [    5,    5,    5],
-        FEI3EndcapLatency2018        = [  256,  256,  256],
-        FEI3EndcapHitDuplication2018 = [False,False,False],
-        FEI3EndcapSmallHitToT2018    = [   -1,   -1,   -1],
-        FEI3EndcapTimingSimTune2018  = [ 2018, 2018, 2018],
-        EndcapCrossTalk2018          = [ 0.06, 0.06, 0.06],
-        EndcapNoiseOccupancy2018     = [ 5e-8, 5e-8, 5e-8],
-        EndcapDisableProbability2018 = [ 9e-3, 9e-3, 9e-3],
-        DBMToTThreshold2018       = [   -1,   -1,   -1],
-        DBMCrossTalk2018          = [ 0.06, 0.06, 0.06],
-        DBMNoiseOccupancy2018     = [ 5e-8, 5e-8, 5e-8],
-        DBMDisableProbability2018 = [ 9e-3, 9e-3, 9e-3],
-        IBLNoiseShape2018    = [0.0, 0.0330, 0.0, 0.3026, 0.5019, 0.6760, 0.8412, 0.9918, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0],
-        BLayerNoiseShape2018 = [0.0, 0.0, 0.0, 0.0, 0.2204, 0.5311, 0.7493, 0.8954, 0.9980, 1.0],
-        PixelNoiseShape2018  = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.2418, 0.4397, 0.5858, 0.6949, 0.7737, 0.8414, 0.8959, 0.9414, 0.9828, 1.0],
-    )
-    #====================================================================================
-    # RUN1
-    CondArgs.update(
-        BarrelToTThresholdRUN1       = [    3,    3,    3],
-        FEI3BarrelLatencyRUN1        = [  256,  256,  256],
-        FEI3BarrelHitDuplicationRUN1 = [ True, True, True],
-        FEI3BarrelSmallHitToTRUN1    = [    7,    7,    7],
-        FEI3BarrelTimingSimTuneRUN1  = [ 2009, 2009, 2009],
-        BarrelCrossTalkRUN1          = [ 0.06, 0.06, 0.06],
-        BarrelNoiseOccupancyRUN1     = [ 5e-8, 5e-8, 5e-8],
-        BarrelDisableProbabilityRUN1 = [ 9e-3, 9e-3, 9e-3],
-        EndcapToTThresholdRUN1       = [    3,    3,    3],
-        FEI3EndcapLatencyRUN1        = [  256,  256,  256],
-        FEI3EndcapHitDuplicationRUN1 = [ True, True, True],
-        FEI3EndcapSmallHitToTRUN1    = [    7,    7,    7],
-        FEI3EndcapTimingSimTuneRUN1  = [ 2009, 2009, 2009],
-        EndcapCrossTalkRUN1          = [ 0.06, 0.06, 0.06],
-        EndcapNoiseOccupancyRUN1     = [ 5e-8, 5e-8, 5e-8],
-        EndcapDisableProbabilityRUN1 = [ 9e-3, 9e-3, 9e-3],
-        BLayerNoiseShapeRUN1 = [0.0, 0.0, 0.0, 0.0, 0.2204, 0.5311, 0.7493, 0.8954, 0.9980, 1.0],
-        PixelNoiseShapeRUN1  = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.2418, 0.4397, 0.5858, 0.6949, 0.7737, 0.8414, 0.8959, 0.9414, 0.9828, 1.0],
-    )
-    #====================================================================================
-    # ITK
-    CondArgs.update(
-        BarrelToTThresholdITK       = [    3,    3,    3,    3,    3],
-        BarrelCrossTalkITK          = [ 0.06, 0.06, 0.06, 0.06, 0.06],
-        BarrelNoiseOccupancyITK     = [ 5e-8, 5e-8, 5e-8, 5e-8, 5e-8],
-        BarrelDisableProbabilityITK = [ 9e-3, 9e-3, 9e-3, 9e-3, 9e-3],
-        EndcapToTThresholdITK       = [    3,    3,    3,    3,    3,    3,    3,    3,    3,    3,    3,    3,    3,    3],
-        EndcapCrossTalkITK          = [ 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06],
-        EndcapNoiseOccupancyITK     = [ 5e-8, 5e-8, 5e-8, 5e-8, 5e-8, 5e-8, 5e-8, 5e-8, 5e-8, 5e-8, 5e-8, 5e-8, 5e-8, 5e-8],
-        EndcapDisableProbabilityITK = [ 9e-3, 9e-3, 9e-3, 9e-3, 9e-3, 9e-3, 9e-3, 9e-3, 9e-3, 9e-3, 9e-3, 9e-3, 9e-3, 9e-3],
-        InnermostNoiseShapeITK     = [0.0, 1.0],
-        NextInnermostNoiseShapeITK = [0.0, 1.0],
-        PixelNoiseShapeITK         = [0.0, 1.0]
-    )
+    if flags.Input.isMC:
+        # Digitization parameters
+        CondArgs.update(
+            BunchSpace=25.0,
+            FEI4BarrelHitDiscConfig=[2]
+        )
+        #====================================================================================
+        # Run-dependent SIMULATION(digitization) parameters:
+        #====================================================================================
+        # RUN2 2015/2016
+        CondArgs.update(
+            BarrelToTThreshold2016       = [   -1,    5,    5,    5],
+            FEI3BarrelLatency2016        = [    0,  151,  256,  256],
+            FEI3BarrelHitDuplication2016 = [False,False,False,False],
+            FEI3BarrelSmallHitToT2016    = [   -1,   -1,   -1,   -1],
+            FEI3BarrelTimingSimTune2016  = [   -1, 2015, 2015, 2015],
+            BarrelCrossTalk2016          = [ 0.30, 0.06, 0.06, 0.06],
+            BarrelNoiseOccupancy2016     = [ 5e-8, 5e-8, 5e-8, 5e-8],
+            BarrelDisableProbability2016 = [ 9e-3, 9e-3, 9e-3, 9e-3],
+            EndcapToTThreshold2016       = [    5,    5,    5],
+            FEI3EndcapLatency2016        = [  256,  256,  256],
+            FEI3EndcapHitDuplication2016 = [False,False,False],
+            FEI3EndcapSmallHitToT2016    = [   -1,   -1,   -1],
+            FEI3EndcapTimingSimTune2016  = [ 2015, 2015, 2015],
+            EndcapCrossTalk2016          = [ 0.06, 0.06, 0.06],
+            EndcapNoiseOccupancy2016     = [ 5e-8, 5e-8, 5e-8],
+            EndcapDisableProbability2016 = [ 9e-3, 9e-3, 9e-3],
+            DBMToTThreshold2016       = [   -1,   -1,   -1],
+            DBMCrossTalk2016          = [ 0.06, 0.06, 0.06],
+            DBMNoiseOccupancy2016     = [ 5e-8, 5e-8, 5e-8],
+            DBMDisableProbability2016 = [ 9e-3, 9e-3, 9e-3],
+            IBLNoiseShape2016    = [0.0, 0.0330, 0.0, 0.3026, 0.5019, 0.6760, 0.8412, 0.9918, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0],
+            BLayerNoiseShape2016 = [0.0, 0.0, 0.0, 0.0, 0.2204, 0.5311, 0.7493, 0.8954, 0.9980, 1.0],
+            PixelNoiseShape2016  = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.2418, 0.4397, 0.5858, 0.6949, 0.7737, 0.8414, 0.8959, 0.9414, 0.9828, 1.0],
+            # Layer-2 noise shape                     [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.2129, 0.4016, 0.5477, 0.6599, 0.7435, 0.8160, 0.8779, 0.9340, 0.9798, 1.0]
+            # So far, Gaudi::Property does not support 2D vector.
+            #EndcapNoiseShape=[[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1748, 0.3409, 0.4760, 0.5850, 0.6754, 0.7538, 0.8264, 0.8962, 0.9655, 1.0],
+            #                  [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1852, 0.3528, 0.4881, 0.5961, 0.6855, 0.7640, 0.8374, 0.9068, 0.9749, 1.0],
+            #                  [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1735, 0.3380, 0.4733, 0.5829, 0.6730, 0.7516, 0.8234, 0.8916, 0.9595, 1.0]]
+        )
+        #====================================================================================
+        # RUN2 2017
+        CondArgs.update(
+            BarrelToTThreshold2017       = [   -1,    5,    5,    5],
+            FEI3BarrelLatency2017        = [    0,  151,  256,  256],
+            FEI3BarrelHitDuplication2017 = [False,False,False,False],
+            FEI3BarrelSmallHitToT2017    = [   -1,   -1,   -1,   -1],
+            FEI3BarrelTimingSimTune2017  = [   -1, 2018, 2018, 2018],
+            BarrelCrossTalk2017          = [ 0.30, 0.06, 0.06, 0.06],
+            BarrelNoiseOccupancy2017     = [ 5e-8, 5e-8, 5e-8, 5e-8],
+            BarrelDisableProbability2017 = [ 9e-3, 9e-3, 9e-3, 9e-3],
+            EndcapToTThreshold2017       = [    5,    5,    5],
+            FEI3EndcapLatency2017        = [  256,  256,  256],
+            FEI3EndcapHitDuplication2017 = [False,False,False],
+            FEI3EndcapSmallHitToT2017    = [   -1,   -1,   -1],
+            FEI3EndcapTimingSimTune2017  = [ 2018, 2018, 2018],
+            EndcapCrossTalk2017          = [ 0.06, 0.06, 0.06],
+            EndcapNoiseOccupancy2017     = [ 5e-8, 5e-8, 5e-8],
+            EndcapDisableProbability2017 = [ 9e-3, 9e-3, 9e-3],
+            DBMToTThreshold2017       = [   -1,   -1,   -1],
+            DBMCrossTalk2017          = [ 0.06, 0.06, 0.06],
+            DBMNoiseOccupancy2017     = [ 5e-8, 5e-8, 5e-8],
+            DBMDisableProbability2017 = [ 9e-3, 9e-3, 9e-3],
+            IBLNoiseShape2017    = [0.0, 0.0330, 0.0, 0.3026, 0.5019, 0.6760, 0.8412, 0.9918, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0],
+            BLayerNoiseShape2017 = [0.0, 0.0, 0.0, 0.0, 0.2204, 0.5311, 0.7493, 0.8954, 0.9980, 1.0],
+            PixelNoiseShape2017  = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.2418, 0.4397, 0.5858, 0.6949, 0.7737, 0.8414, 0.8959, 0.9414, 0.9828, 1.0],
+        )
+        #====================================================================================
+        # RUN2 2018
+        CondArgs.update(
+            BarrelToTThreshold2018       = [   -1,    3,    5,    5],
+            FEI3BarrelLatency2018        = [    0,  151,  256,  256],
+            FEI3BarrelHitDuplication2018 = [False,False,False,False],
+            FEI3BarrelSmallHitToT2018    = [   -1,   -1,   -1,   -1],
+            FEI3BarrelTimingSimTune2018  = [   -1, 2018, 2018, 2018],
+            BarrelCrossTalk2018          = [ 0.30, 0.06, 0.06, 0.06],
+            BarrelNoiseOccupancy2018     = [ 5e-8, 5e-8, 5e-8, 5e-8],
+            BarrelDisableProbability2018 = [ 9e-3, 9e-3, 9e-3, 9e-3],
+            EndcapToTThreshold2018       = [    5,    5,    5],
+            FEI3EndcapLatency2018        = [  256,  256,  256],
+            FEI3EndcapHitDuplication2018 = [False,False,False],
+            FEI3EndcapSmallHitToT2018    = [   -1,   -1,   -1],
+            FEI3EndcapTimingSimTune2018  = [ 2018, 2018, 2018],
+            EndcapCrossTalk2018          = [ 0.06, 0.06, 0.06],
+            EndcapNoiseOccupancy2018     = [ 5e-8, 5e-8, 5e-8],
+            EndcapDisableProbability2018 = [ 9e-3, 9e-3, 9e-3],
+            DBMToTThreshold2018       = [   -1,   -1,   -1],
+            DBMCrossTalk2018          = [ 0.06, 0.06, 0.06],
+            DBMNoiseOccupancy2018     = [ 5e-8, 5e-8, 5e-8],
+            DBMDisableProbability2018 = [ 9e-3, 9e-3, 9e-3],
+            IBLNoiseShape2018    = [0.0, 0.0330, 0.0, 0.3026, 0.5019, 0.6760, 0.8412, 0.9918, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0],
+            BLayerNoiseShape2018 = [0.0, 0.0, 0.0, 0.0, 0.2204, 0.5311, 0.7493, 0.8954, 0.9980, 1.0],
+            PixelNoiseShape2018  = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.2418, 0.4397, 0.5858, 0.6949, 0.7737, 0.8414, 0.8959, 0.9414, 0.9828, 1.0],
+        )
+        #====================================================================================
+        # RUN1
+        CondArgs.update(
+            BarrelToTThresholdRUN1       = [    3,    3,    3],
+            FEI3BarrelLatencyRUN1        = [  256,  256,  256],
+            FEI3BarrelHitDuplicationRUN1 = [ True, True, True],
+            FEI3BarrelSmallHitToTRUN1    = [    7,    7,    7],
+            FEI3BarrelTimingSimTuneRUN1  = [ 2009, 2009, 2009],
+            BarrelCrossTalkRUN1          = [ 0.06, 0.06, 0.06],
+            BarrelNoiseOccupancyRUN1     = [ 5e-8, 5e-8, 5e-8],
+            BarrelDisableProbabilityRUN1 = [ 9e-3, 9e-3, 9e-3],
+            EndcapToTThresholdRUN1       = [    3,    3,    3],
+            FEI3EndcapLatencyRUN1        = [  256,  256,  256],
+            FEI3EndcapHitDuplicationRUN1 = [ True, True, True],
+            FEI3EndcapSmallHitToTRUN1    = [    7,    7,    7],
+            FEI3EndcapTimingSimTuneRUN1  = [ 2009, 2009, 2009],
+            EndcapCrossTalkRUN1          = [ 0.06, 0.06, 0.06],
+            EndcapNoiseOccupancyRUN1     = [ 5e-8, 5e-8, 5e-8],
+            EndcapDisableProbabilityRUN1 = [ 9e-3, 9e-3, 9e-3],
+            BLayerNoiseShapeRUN1 = [0.0, 0.0, 0.0, 0.0, 0.2204, 0.5311, 0.7493, 0.8954, 0.9980, 1.0],
+            PixelNoiseShapeRUN1  = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.2418, 0.4397, 0.5858, 0.6949, 0.7737, 0.8414, 0.8959, 0.9414, 0.9828, 1.0],
+        )
+        #====================================================================================
+        # ITK
+        CondArgs.update(
+            BarrelToTThresholdITK       = [    3,    3,    3,    3,    3],
+            BarrelCrossTalkITK          = [ 0.06, 0.06, 0.06, 0.06, 0.06],
+            BarrelNoiseOccupancyITK     = [ 5e-8, 5e-8, 5e-8, 5e-8, 5e-8],
+            BarrelDisableProbabilityITK = [ 9e-3, 9e-3, 9e-3, 9e-3, 9e-3],
+            EndcapToTThresholdITK       = [    3,    3,    3,    3,    3,    3,    3,    3,    3,    3,    3,    3,    3,    3],
+            EndcapCrossTalkITK          = [ 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06],
+            EndcapNoiseOccupancyITK     = [ 5e-8, 5e-8, 5e-8, 5e-8, 5e-8, 5e-8, 5e-8, 5e-8, 5e-8, 5e-8, 5e-8, 5e-8, 5e-8, 5e-8],
+            EndcapDisableProbabilityITK = [ 9e-3, 9e-3, 9e-3, 9e-3, 9e-3, 9e-3, 9e-3, 9e-3, 9e-3, 9e-3, 9e-3, 9e-3, 9e-3, 9e-3],
+            InnermostNoiseShapeITK     = [0.0, 1.0],
+            NextInnermostNoiseShapeITK = [0.0, 1.0],
+            PixelNoiseShapeITK         = [0.0, 1.0]
+        )
 
     # Charge calibration parameters
     CondArgs.update(
diff --git a/InnerDetector/InDetConfig/python/InDetConfigFlags.py b/InnerDetector/InDetConfig/python/InDetConfigFlags.py
index b04a31baeb1c4bfa5d83c6d05ac5b4608c1fb42c..f5a76d284f667ea8a767be84787c9bb4b62cabf1 100644
--- a/InnerDetector/InDetConfig/python/InDetConfigFlags.py
+++ b/InnerDetector/InDetConfig/python/InDetConfigFlags.py
@@ -173,6 +173,7 @@ def createInDetConfigFlags():
   icf.addFlag("InDet.doSLHCVeryForward", False ) # Turn running of SLHC reconstruction for Very Forward extension on and off 
   icf.addFlag("InDet.doTRTGlobalOccupancy", False) # Turn running of Event Info TRT Occupancy Filling Alg on and off (also whether it is used in TRT PID calculation) 
   icf.addFlag("InDet.doNNToTCalibration", False ) # USe ToT calibration for NN clustering rather than Charge 
+  icf.addFlag("InDet.useNNTTrainedNetworks", True ) # Use older NNs stored as TTrainedNetworks in place of default MDNs/other more recent networks. This is necessary for older configuration tags where the trainings were not available.
   icf.addFlag("InDet.keepAdditionalHitsOnTrackParticle", False) # Do not drop first/last hits on track (only for special cases - will blow up TrackParticle szie!!!) 
   icf.addFlag("InDet.doSCTModuleVeto", False) # Turn on SCT_ModuleVetoSvc, allowing it to be configured later 
   icf.addFlag("InDet.doParticleConversion", False) # In case anyone still wants to do Rec->xAOD TrackParticle Conversion 
diff --git a/InnerDetector/InDetConfig/python/TrackingCutsFlags.py b/InnerDetector/InDetConfig/python/TrackingCutsFlags.py
index a59976e2e1157abc5bbc6a27afd31ff8b9332819..cfa8fe0dc8074ac7fdc6465fdb54fb8afff52039 100644
--- a/InnerDetector/InDetConfig/python/TrackingCutsFlags.py
+++ b/InnerDetector/InDetConfig/python/TrackingCutsFlags.py
@@ -520,7 +520,7 @@ def createLowPtLargeD0TrackingFlags():
 def createLowPtTrackingFlags():
     icf = createTrackingFlags()
     icf.extension        = "LowPt"
-    icf.maxPT = lambda pcf: (1e6  if pcf.InDet.doMinBias else pcf.InDet.Tracking.minPt + 0.3) * Units.GeV
+    icf.maxPT = lambda pcf: (1e6  if pcf.InDet.doMinBias else pcf.InDet.Tracking.minPT + 0.3) * Units.GeV
     icf.minPT            = 0.050 * Units.GeV
     icf.minClusters      = 5
     icf.minSiNotShared   = 4
diff --git a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetDDAthenaComps.h b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetDDAthenaComps.h
index 7dd8641b422f2298421f313b93ecf03401912bb1..cfeb09814f61f60b70c837c4371b3de5e20c63c8 100644
--- a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetDDAthenaComps.h
+++ b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetDDAthenaComps.h
@@ -24,19 +24,18 @@ public:
   AthenaComps(const std::string & msgStreamName);
 
   //Declaring the Message method for further use
-  MsgStream& msg (MSG::Level lvl) const { return m_msg << lvl; }
+  MsgStream& msg (MSG::Level lvl) { return m_msg << lvl; }
 
   //Declaring the Method providing Verbosity Level
-  bool msgLvl (MSG::Level lvl) const { return m_msg.get().level() <= lvl; }
+  bool msgLvl (MSG::Level lvl) { return m_msg.get().level() <= lvl; }
 
   void setDetStore(StoreGateSvc *);
   void setGeoDbTagSvc(IGeoDbTagSvc *);
   void setRDBAccessSvc(IRDBAccessSvc *);
   void setGeometryDBSvc(IGeometryDBSvc *);
 
-  StoreGateSvc * detStore() const;
+  const StoreGateSvc * detStore() const;
   const IGeoDbTagSvc * geoDbTagSvc() const;
-  IRDBAccessSvc * rdbAccessSvc() const;
   const IGeometryDBSvc * geomDB() const;
   
   StoreGateSvc * detStore();
@@ -46,7 +45,7 @@ public:
   
 private:
   //Declaring private message stream member.
-  mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE;
+  Athena::MsgStreamMember m_msg;
   
   StoreGateSvc * m_detStore;
   IGeoDbTagSvc * m_geoDbTagSvc;
@@ -55,19 +54,19 @@ private:
 
 };
 
-inline StoreGateSvc * AthenaComps::detStore ATLAS_NOT_THREAD_SAFE () const
+inline StoreGateSvc * AthenaComps::detStore()
 {
   return m_detStore;
 }
 
-inline const IGeoDbTagSvc * AthenaComps::geoDbTagSvc() const
+inline const StoreGateSvc * AthenaComps::detStore() const
 {
-  return m_geoDbTagSvc;
+  return m_detStore;
 }
 
-inline IRDBAccessSvc * AthenaComps::rdbAccessSvc ATLAS_NOT_THREAD_SAFE () const
+inline const IGeoDbTagSvc * AthenaComps::geoDbTagSvc() const
 {
-  return m_rdbAccessSvc;
+  return m_geoDbTagSvc;
 }
 
 inline const IGeometryDBSvc * AthenaComps::geomDB() const
@@ -75,16 +74,12 @@ inline const IGeometryDBSvc * AthenaComps::geomDB() const
   return m_geometryDBSvc;
 }
 
-inline StoreGateSvc * AthenaComps::detStore()
-{
-  return m_detStore;
-}
-
 inline IGeoDbTagSvc * AthenaComps::geoDbTagSvc()
 {
   return m_geoDbTagSvc;
 }
 
+
 inline IRDBAccessSvc * AthenaComps::rdbAccessSvc()
 {
   return m_rdbAccessSvc;
diff --git a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetDetectorFactoryBase.h b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetDetectorFactoryBase.h
index dfd46b3e9d473c17a7d8de7c455aa2dd4b680939..c6202402d9c9db86ad8807489f5f92dd950f6d38 100644
--- a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetDetectorFactoryBase.h
+++ b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetDetectorFactoryBase.h
@@ -20,15 +20,16 @@ class DetectorFactoryBase : public GeoVDetectorFactory
 { 
 
 public:
-  DetectorFactoryBase(const InDetDD::AthenaComps * athenaComps)
+  DetectorFactoryBase(InDetDD::AthenaComps * athenaComps)
     : m_athenaComps(athenaComps)
   {}
 
-  StoreGateSvc * detStore ATLAS_NOT_THREAD_SAFE () const {return m_athenaComps->detStore();}
+  StoreGateSvc * detStore () {return m_athenaComps->detStore();}
+  const StoreGateSvc * detStore () const {return m_athenaComps->detStore();}
 
   const IGeoDbTagSvc * geoDbTagSvc() const {return m_athenaComps->geoDbTagSvc();}
 
-  IRDBAccessSvc * rdbAccessSvc ATLAS_NOT_THREAD_SAFE () const {return m_athenaComps->rdbAccessSvc();}
+  IRDBAccessSvc * rdbAccessSvc() {return m_athenaComps->rdbAccessSvc();}
   
   const IGeometryDBSvc * geomDB() const {return m_athenaComps->geomDB();}
 
@@ -38,11 +39,11 @@ public:
   //Declaring the Method providing Verbosity Level
   bool msgLvl (MSG::Level lvl) const { return m_athenaComps->msgLvl(lvl); }
 
-  const InDetDD::AthenaComps *  getAthenaComps() {return m_athenaComps;}
+  InDetDD::AthenaComps *  getAthenaComps() {return m_athenaComps;}
 
 private:
   
-  const InDetDD::AthenaComps *  m_athenaComps;
+  InDetDD::AthenaComps *  m_athenaComps;
 
 };
 
diff --git a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetMaterialManager.h b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetMaterialManager.h
index 33bd2ada2b50bf52763c0975a929c8c9cc6b5393..5f17b84770f8d0c3135d84656872af33b95143a0 100755
--- a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetMaterialManager.h
+++ b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetMaterialManager.h
@@ -47,7 +47,7 @@ public:
 		       IRDBRecordset_ptr compositionTable,
 		       const std::string & space = "");
   InDetMaterialManager(const std::string & managerName, 
-		       const InDetDD::AthenaComps *) ATLAS_CTORDTOR_NOT_THREAD_SAFE; // Thread unsafe AthenaComps::detStore() const is used.
+		       InDetDD::AthenaComps *);
   ~InDetMaterialManager();
 
   void addWeightTable(IRDBRecordset_ptr weightTable, const std::string & space = "");
@@ -102,7 +102,7 @@ public:
   // in the arguments as a vector of materials and multiplictive factors.
   const GeoMaterial * getMaterialForVolumeLength(const std::string & name,
 						 const std::vector<std::string> & materialComponents, 
-						 const std::vector<double> factors, 
+						 const std::vector<double>& factors, 
 						 double volume, 
 						 double length);
   
@@ -132,7 +132,7 @@ public:
   void addMaterial(GeoMaterial *material);
 
   //Declaring the Message method for further use
-  MsgStream& msg (MSG::Level lvl) const { return m_msg << lvl; }
+  MsgStream& msg (MSG::Level lvl) { return m_msg << lvl; }
 
   //Declaring the Method providing Verbosity Level
   bool msgLvl (MSG::Level lvl){ return m_msg.get().level() <= lvl; }
@@ -233,7 +233,7 @@ private:
   ExtraScaleFactorMap m_scalingMap;
 
   //Declaring private message stream member.
-  mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE;
+  Athena::MsgStreamMember m_msg;
 
   // Has linear weight flag. 
   bool m_extraFunctionality;
diff --git a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetSubDetectorFactoryBase.h b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetSubDetectorFactoryBase.h
index d09860ce6f81ae54e15f50fe77eb558bd2b0246d..166eb76e1e837417ad4970f8c4d0c2d47c2df6d8 100644
--- a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetSubDetectorFactoryBase.h
+++ b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetSubDetectorFactoryBase.h
@@ -26,26 +26,26 @@ class SubDetectorFactoryBase
 { 
 
 public:
-  SubDetectorFactoryBase(const InDetDD::AthenaComps * athenaComps)
+  SubDetectorFactoryBase(InDetDD::AthenaComps * athenaComps)
     : m_athenaComps(athenaComps),
       m_materialManager(0)
   {}
 
-  SubDetectorFactoryBase(const InDetDD::AthenaComps * athenaComps,
+  SubDetectorFactoryBase(InDetDD::AthenaComps * athenaComps,
 			 InDetMaterialManager * matManager)
     : m_athenaComps(athenaComps),
       m_materialManager(matManager)
   {}
 
-  StoreGateSvc * detStore ATLAS_NOT_THREAD_SAFE () const {return m_athenaComps->detStore();} // const method returns non-const pointer
+  StoreGateSvc * detStore() {return m_athenaComps->detStore();}
 
   const IGeoDbTagSvc * geoDbTagSvc() const {return m_athenaComps->geoDbTagSvc();}
 
-  IRDBAccessSvc * rdbAccessSvc ATLAS_NOT_THREAD_SAFE () const {return m_athenaComps->rdbAccessSvc();} // const method returns non-const pointer
+  IRDBAccessSvc * rdbAccessSvc() const {return m_athenaComps->rdbAccessSvc();}
   
   const IGeometryDBSvc * geomDB() const {return m_athenaComps->geomDB();}
 
-  InDetMaterialManager * materialManager ATLAS_NOT_THREAD_SAFE () const {return m_materialManager;} // const method returns non-const pointer
+  InDetMaterialManager * materialManager() {return m_materialManager;}
 
  //Declaring the Message method for further use
   MsgStream& msg (MSG::Level lvl) const { return m_athenaComps->msg(lvl); }
@@ -53,10 +53,10 @@ public:
   //Declaring the Method providing Verbosity Level
   bool msgLvl (MSG::Level lvl) const { return m_athenaComps->msgLvl(lvl); }
 
-  const InDetDD::AthenaComps *  getAthenaComps() {return m_athenaComps;}
+  InDetDD::AthenaComps *  getAthenaComps() {return m_athenaComps;}
   
 private:
-  const InDetDD::AthenaComps *  m_athenaComps;
+  InDetDD::AthenaComps *  m_athenaComps;
   
 protected:
   InDetMaterialManager * m_materialManager;
diff --git a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/ServiceVolumeMaker.h b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/ServiceVolumeMaker.h
index 39d2dae48557286122cc9e26ad1e6273e28546e6..44c095c5e0cd788aa846f7cc357732c9d7cf6bf5 100644
--- a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/ServiceVolumeMaker.h
+++ b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/ServiceVolumeMaker.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 ServiceVolumeMaker_H 
@@ -99,7 +99,7 @@ namespace InDetDD {
   class ServiceVolumeMakerMgr {
   public:
     ServiceVolumeMakerMgr(IRDBRecordset_ptr table, const ServiceVolumeSchema & schema, 
-			  const InDetDD::AthenaComps * athenaComps);
+			  InDetDD::AthenaComps * athenaComps);
     
     double rmin(int index) const;
     double rmax(int index) const;
@@ -130,7 +130,7 @@ namespace InDetDD {
     IRDBRecordset_ptr m_table;
     IRDBRecordset_ptr m_layer;
     ServiceVolumeSchema m_schema;
-    const InDetDD::AthenaComps * m_athenaComps;
+    InDetDD::AthenaComps * m_athenaComps;
   };
 
   class ServiceVolumeMaker {
@@ -138,7 +138,7 @@ namespace InDetDD {
     ServiceVolumeMaker(const std::string & label,
 		       IRDBRecordset_ptr table, 
 		       const ServiceVolumeSchema & schema,
-		       const InDetDD::AthenaComps *) ATLAS_CTORDTOR_NOT_THREAD_SAFE; // Thread unsafe ServiceVolumeMakerMgr::readLayerShift method is used.
+		       InDetDD::AthenaComps *);
 		ServiceVolumeMaker(const ServiceVolumeMaker &) = delete;
 		ServiceVolumeMaker & operator =(const ServiceVolumeMaker &) = delete;
     ~ServiceVolumeMaker();
diff --git a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/VolumeBuilder.h b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/VolumeBuilder.h
index 39e1be7b0d97e7b1b448ed75490a04af4acbf1cd..46c3b99e2c64fb7aba90b1eb7bd4c00bd5cb7ef4 100644
--- a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/VolumeBuilder.h
+++ b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/VolumeBuilder.h
@@ -47,8 +47,8 @@ namespace InDetDD {
     GeoTransform * getPlacement(int iElement, int iCopy);
     GeoTransform * getPlacementEnvelope(int iElement, int iCopy,  int iMothElement);
 
-    MsgStream& msg (MSG::Level lvl) const { return m_msg.get() << lvl; }
-    bool msgLvl (MSG::Level lvl) const { return m_msg.get().level() <= lvl; }
+    MsgStream& msg (MSG::Level lvl) { return m_msg.get() << lvl; }
+    bool msgLvl (MSG::Level lvl) { return m_msg.get().level() <= lvl; }
 
     bool isEnvelopeOrChild(int iElement);
     int  getEnvelopeNum(int iElement);
@@ -59,7 +59,7 @@ namespace InDetDD {
   private:
     //const GeoShape * getShape(const ServiceVolume & param, double & volume);
     
-    mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE;
+    Athena::MsgStreamMember m_msg;
     std::string m_region;
     double m_zcenter;
     const std::vector<const ServiceVolume *>* m_services;
diff --git a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/VolumeSplitter.h b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/VolumeSplitter.h
index 6591156b0f3dbf8944d8eaee0b41d874e5fa23e3..a3c58310e77a2fc4257379a85c325d3dd4d9ed3a 100644
--- a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/VolumeSplitter.h
+++ b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/VolumeSplitter.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 InDetGeoModelUtils_VolumeSplitter_H
@@ -18,7 +18,7 @@ namespace InDetDD {
   public:
     VolumeSplitter();
     ~VolumeSplitter();
-    const std::vector<const ServiceVolume *> & splitAll(const Zone & zone,  const std::vector<const ServiceVolume *>);
+    const std::vector<const ServiceVolume *> & splitAll(const Zone & zone,  const std::vector<const ServiceVolume *>&);
     void split(const Zone & zone, const ServiceVolume & origVolume);
     const std::vector<const ServiceVolume *> & getVolumes() const {return m_volumes;}
     // Take ownership of volumes. If called user must delete the volumes. 
diff --git a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/InDetMaterialManager.cxx b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/InDetMaterialManager.cxx
index 286b443389e0ad18ae365fe30f2c71db58124a19..bcaf9930f2e4a03f284fd23c370774e33189f790 100755
--- a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/InDetMaterialManager.cxx
+++ b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/InDetMaterialManager.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 "InDetGeoModelUtils/InDetMaterialManager.h"
@@ -65,7 +65,7 @@ InDetMaterialManager::InDetMaterialManager(const std::string& managerName, Store
 }
 
 InDetMaterialManager::InDetMaterialManager(const std::string& managerName,
-                                           const InDetDD::AthenaComps* athenaComps)
+                                           InDetDD::AthenaComps* athenaComps)
   : m_managerName(managerName),
   m_msg(managerName),
   m_extraFunctionality(true),
@@ -557,7 +557,7 @@ InDetMaterialManager::getMaterialForVolumeLength(const std::string& materialName
 
     std::vector<double> factors;
     std::vector<std::string> components;
-    for (MaterialCompositionMap::const_iterator iter = iterRange.first; iter != iterRange.second; iter++) {
+    for (MaterialCompositionMap::const_iterator iter = iterRange.first; iter != iterRange.second; ++iter) {
       double factorTmp = iter->second.factor;
       if (iter->second.actualLength > 0) factorTmp *= iter->second.actualLength / length;
       factors.push_back(factorTmp);
@@ -606,7 +606,7 @@ InDetMaterialManager::getMaterialForVolumeLength(const std::string& name,
 const GeoMaterial*
 InDetMaterialManager::getMaterialForVolumeLength(const std::string& name,
                                                  const std::vector<std::string>& materialComponents,
-                                                 const std::vector<double> factors,
+                                                 const std::vector<double>& factors,
                                                  double volume,
                                                  double length) {
   // Make sure we have a valid volume size.
diff --git a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/ServiceVolumeMaker.cxx b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/ServiceVolumeMaker.cxx
index 00ee4b9fc97ec9f2a82fe138f003ca6966b766b9..051655368a5a21d76dc99a196a975bc4b87e315d 100755
--- a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/ServiceVolumeMaker.cxx
+++ b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/ServiceVolumeMaker.cxx
@@ -84,7 +84,7 @@ namespace InDetDD {
   }
 
   ServiceVolumeMakerMgr::ServiceVolumeMakerMgr(IRDBRecordset_ptr table, const ServiceVolumeSchema& schema,
-                                               const InDetDD::AthenaComps* athenaComps)
+                                               InDetDD::AthenaComps* athenaComps)
     : m_table(table),
     m_schema(schema),
     m_athenaComps(athenaComps)
@@ -218,7 +218,7 @@ namespace InDetDD {
   }
 
   std::vector<double>
-  ServiceVolumeMakerMgr::readLayerShift ATLAS_NOT_THREAD_SAFE () const { // Thread unsafe IRDBAccessSvc* InDetDD::AthenaComps::rdbAccessSvc() const is used.
+  ServiceVolumeMakerMgr::readLayerShift() const {
     std::vector<double> layerShift;
 
     IRDBAccessSvc* rdbSvc = m_athenaComps->rdbAccessSvc();
@@ -243,7 +243,7 @@ namespace InDetDD {
 
   ServiceVolumeMaker::ServiceVolumeMaker(const std::string& label,
                                          IRDBRecordset_ptr table, const ServiceVolumeSchema& schema,
-                                         const InDetDD::AthenaComps* athenaComps)
+                                         InDetDD::AthenaComps* athenaComps)
     : m_label(label) {
     m_mgr = new ServiceVolumeMakerMgr(table, schema, athenaComps);
     m_layerShift = m_mgr->readLayerShift();
diff --git a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/VolumeSplitter.cxx b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/VolumeSplitter.cxx
index 26586912aa588f568360818d8a2c0f02980f7877..c42abfce85fa4188c68cb8950b305a8306c24949 100755
--- a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/VolumeSplitter.cxx
+++ b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/VolumeSplitter.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 "InDetGeoModelUtils/VolumeSplitter.h"
@@ -25,7 +25,7 @@ namespace InDetDD {
   }
 
   const std::vector<const ServiceVolume*>&
-  VolumeSplitter::splitAll(const Zone& zone, const std::vector<const ServiceVolume*> origVolumeList) {
+  VolumeSplitter::splitAll(const Zone& zone, const std::vector<const ServiceVolume*>& origVolumeList) {
     for (unsigned int i = 0; i < origVolumeList.size(); ++i) {
       split(zone, *(origVolumeList[i]));
     }
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/EndPlateFactory.h b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/EndPlateFactory.h
index 1917d6a747c02ebe73c86454a20baa8d0cfc9f0c..79d6e792265979165d1ad2cb97a6b47f5dfa00e5 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/EndPlateFactory.h
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/EndPlateFactory.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 INDETSERVMATGEOMODEL_ENDPLATEFACTORY_H
@@ -14,7 +14,7 @@ class EndPlateFactory : public InDetDD::SubDetectorFactoryBase  {
  public:
   
   // Constructor:
-  EndPlateFactory(const InDetDD::AthenaComps * athenaComps, 
+  EndPlateFactory(InDetDD::AthenaComps * athenaComps, 
 		  InDetMaterialManager * matManager);
   
   // Destructor:
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatFactory.h b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatFactory.h
index 7ba70123cfb71c235c215b2be5c85fcc4160777a..2b5d19214b4c6392ce5a9e3e082866652d001435 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatFactory.h
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatFactory.h
@@ -18,7 +18,7 @@ class InDetServMatFactory : public InDetDD::DetectorFactoryBase  {
  public:
   
   // Constructor:
-  InDetServMatFactory(const InDetDD::AthenaComps * athenaComps);
+  InDetServMatFactory(InDetDD::AthenaComps * athenaComps);
 
   // Destructor:
   ~InDetServMatFactory();
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatFactoryDC3.h b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatFactoryDC3.h
index 7bac6f690f0f221d46dce820841f0d76b90fade2..18ea92b01bc9928a81a951d9cf4aaa57a36b84bf 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatFactoryDC3.h
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatFactoryDC3.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 INDETSERVMATGEOMODEL_INDETSERVMATFACTORYDC3_H
@@ -17,7 +17,7 @@ class InDetServMatFactoryDC3: public InDetDD::DetectorFactoryBase  {
  public:
   
   // Constructor:
-  InDetServMatFactoryDC3(const InDetDD::AthenaComps * athenaComps);
+  InDetServMatFactoryDC3(InDetDD::AthenaComps * athenaComps);
   
   // Destructor:
   ~InDetServMatFactoryDC3();
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatFactorySLHC.h b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatFactorySLHC.h
index 5599b6e4376c7094365e6a1078731778cbde0ab3..bf452be441cf395be75a8bf40784ece59bab56fe 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatFactorySLHC.h
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatFactorySLHC.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 INDETSERVMATGEOMODEL_INDETSERVMATFACTORYSLHC_H
@@ -17,7 +17,7 @@ class InDetServMatFactorySLHC : public InDetDD::DetectorFactoryBase {
  public:
   
   // Constructor:
-  InDetServMatFactorySLHC(const InDetServMatAthenaComps * athenaComps);
+  InDetServMatFactorySLHC(InDetServMatAthenaComps * athenaComps);
 
   // Destructor:
   ~InDetServMatFactorySLHC();
@@ -46,7 +46,7 @@ class InDetServMatFactorySLHC : public InDetDD::DetectorFactoryBase {
   IRDBRecordset_ptr m_InDetServGenEnvelope;
 
   // Need acceess to derived version
-  const InDetServMatAthenaComps * m_athenaComps;
+  InDetServMatAthenaComps * m_athenaComps;
 
   // private data
   InDetDD::InDetServMatManager *m_manager;
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatGeometryManager.h b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatGeometryManager.h
index 0155f5478548dd20932957deb6e612fe3f4db3a7..2f033050610d597935028f282bed4e90d75d9ed7 100644
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatGeometryManager.h
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatGeometryManager.h
@@ -15,7 +15,7 @@ class InDetMaterialManager;
 class InDetServMatGeometryManager
 {
 public:
-  InDetServMatGeometryManager(const InDetDD::AthenaComps * athenaComps) ATLAS_CTORDTOR_NOT_THREAD_SAFE; // Thread unsafe InDetDD::AthenaComps::rdbAccessSvc method is used.
+  InDetServMatGeometryManager(InDetDD::AthenaComps * athenaComps) ATLAS_CTORDTOR_NOT_THREAD_SAFE; // Thread unsafe InDetDD::AthenaComps::rdbAccessSvc method is used.
  
   ~InDetServMatGeometryManager();
   
@@ -182,7 +182,7 @@ private:
   IRDBRecordset_ptr m_scalingTable;
 
   // Access to athena components
-  const InDetDD::AthenaComps * m_athenaComps;
+  InDetDD::AthenaComps * m_athenaComps;
 
   // Material Manager
   InDetMaterialManager * m_matMgr;
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/PixelServMatFactory.h b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/PixelServMatFactory.h
index 5fb67d75e559631dbb2b049ca93374d1f35b9184..2b90d5006f72869330d227ead6e635903e898aab 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/PixelServMatFactory.h
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/PixelServMatFactory.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 INDETSERVMATGEOMODEL_PIXELSERVMATFACTORY_H
@@ -15,7 +15,7 @@ class PixelServMatFactory  : public InDetDD::SubDetectorFactoryBase  {
  public:
   
   // Constructor:
-  PixelServMatFactory(const InDetDD::AthenaComps * athenaComps);
+  PixelServMatFactory(InDetDD::AthenaComps * athenaComps);
   
   // Destructor:
   ~PixelServMatFactory();
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/PixelServMatFactoryDC3.h b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/PixelServMatFactoryDC3.h
index 5bf2b510a7619f1a8f9e42cf346d1605a77e6a76..2c550cb2755385c3faa0e24701b1a63277b93501 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/PixelServMatFactoryDC3.h
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/PixelServMatFactoryDC3.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 INDETSERVMATGEOMODEL_PIXELSERVMATFACTORYDC3_H
@@ -13,7 +13,7 @@ class PixelServMatFactoryDC3 : public InDetDD::SubDetectorFactoryBase  {
  public:
   
   // Constructor:
-  PixelServMatFactoryDC3(const InDetDD::AthenaComps * athenaComps, 
+  PixelServMatFactoryDC3(InDetDD::AthenaComps * athenaComps, 
 			 InDetMaterialManager * matManager);
 
   
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/SCT_ServMatFactory.h b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/SCT_ServMatFactory.h
index 45d4ff1ce811f29cc5e2718a031710f339c3b0c0..9df267ccda173918428a85d0d7378d4f6ad8f069 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/SCT_ServMatFactory.h
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/SCT_ServMatFactory.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 INDETSERVMATGEOMODEL_SCT_SERVMATFACTORY_H
@@ -17,7 +17,7 @@ class SCT_ServMatFactory : public InDetDD::SubDetectorFactoryBase  {
  public:
   
   // Constructor:
-  SCT_ServMatFactory(const InDetDD::AthenaComps * athenaComps);
+  SCT_ServMatFactory(InDetDD::AthenaComps * athenaComps);
 
   // Destructor:
   ~SCT_ServMatFactory();
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/SCT_ServMatFactoryDC3.h b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/SCT_ServMatFactoryDC3.h
index fcaab9256eba8796d627f771d5486ea4b938333f..7c68863a9d85ef797967660f3e56ecc082e20a63 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/SCT_ServMatFactoryDC3.h
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/SCT_ServMatFactoryDC3.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 INDETSERVMATGEOMODEL_SCT_SERVMATFACTORYDC3_H
@@ -20,7 +20,7 @@ class SCT_ServMatFactoryDC3 : public InDetDD::SubDetectorFactoryBase  {
  public:
   
   // Constructor:
-  SCT_ServMatFactoryDC3(const InDetDD::AthenaComps * athenaComps, 
+  SCT_ServMatFactoryDC3(InDetDD::AthenaComps * athenaComps, 
 			InDetMaterialManager * matManager);
   
   // Destructor:
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/SquirrelCageFactory.h b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/SquirrelCageFactory.h
index b205da8ee6a44db4005d407f9dbe7887bf5c396b..b1340ab3dbfc1cc74bc3810c96b9fdc97f174b3c 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/SquirrelCageFactory.h
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/SquirrelCageFactory.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 INDETSERVMATGEOMODEL_SQUIRRELCAGEFACTORY_H
@@ -14,7 +14,7 @@ class SquirrelCageFactory : public InDetDD::SubDetectorFactoryBase  {
  public:
   
   // Constructor:
-  SquirrelCageFactory(const InDetDD::AthenaComps * athenaComps, 
+  SquirrelCageFactory(InDetDD::AthenaComps * athenaComps, 
 		      InDetMaterialManager * matManager);
   
   // Destructor:
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/SupportRailFactory.h b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/SupportRailFactory.h
index 63f2b30e4ff72e46925967c1c6184c88984376df..185d0e9d54f996295e21c7c89a71d10deba6e34a 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/SupportRailFactory.h
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/SupportRailFactory.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 INDETSERVMATGEOMODEL_SUPPORTRAILFACTORY_H
@@ -14,7 +14,7 @@ class SupportRailFactory : public InDetDD::SubDetectorFactoryBase {
  public:
   
   // Constructor:
-  SupportRailFactory(const InDetDD::AthenaComps * athenaComps, 
+  SupportRailFactory(InDetDD::AthenaComps * athenaComps, 
 		     InDetMaterialManager * matManager);
     
   // Destructor:
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/TRT_ServMatFactory.h b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/TRT_ServMatFactory.h
index 32e6d4f4d4b62aac06cfc67261afb48cd4cb2669..9b107941590fc48e2edd81b097f60d5cab89ee5f 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/TRT_ServMatFactory.h
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/TRT_ServMatFactory.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 INDETSERVMATGEOMODEL_TRT_SERVMATFACTORY_H
@@ -17,7 +17,7 @@ class TRT_ServMatFactory : public InDetDD::SubDetectorFactoryBase  {
  public:
   
   // Constructor:
-  TRT_ServMatFactory(const InDetDD::AthenaComps * athenaComps);
+  TRT_ServMatFactory(InDetDD::AthenaComps * athenaComps);
 
   // Destructor:
   ~TRT_ServMatFactory();
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/TRT_ServMatFactoryDC3.h b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/TRT_ServMatFactoryDC3.h
index 19ac5f7fde09d3e144ec6f198cc68cfd30da94f0..b6129dc92b96a7ea629d47d02ed407f5ae449268 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/TRT_ServMatFactoryDC3.h
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/TRT_ServMatFactoryDC3.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 INDETSERVMATGEOMODEL_TRT_SERVMATFACTORYDC3_H
@@ -19,7 +19,7 @@ class TRT_ServMatFactoryDC3 : public InDetDD::SubDetectorFactoryBase {
  public:
   
   // Constructor:
-  TRT_ServMatFactoryDC3(const InDetDD::AthenaComps * athenaComps, 
+  TRT_ServMatFactoryDC3(InDetDD::AthenaComps * athenaComps, 
 			InDetMaterialManager * matManager);
   
   // Destructor:
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/EndPlateFactory.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/EndPlateFactory.cxx
index e8213943495ada6bac8b105bcce79124c5c71070..a546533a46ccbe302b92972c7db07e534ca9a81f 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/EndPlateFactory.cxx
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/EndPlateFactory.cxx
@@ -30,7 +30,7 @@
 #include <iostream>
 
 
-EndPlateFactory::EndPlateFactory(const InDetDD::AthenaComps * athenaComps, InDetMaterialManager * matManager)
+EndPlateFactory::EndPlateFactory(InDetDD::AthenaComps * athenaComps, InDetMaterialManager * matManager)
   : InDetDD::SubDetectorFactoryBase(athenaComps, matManager)
 {  
 }
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatFactory.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatFactory.cxx
index d6131c8fd554c3ca5d2580547345733923305100..f5168e20530f4eba581799f38369b0d4b572dfd0 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatFactory.cxx
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatFactory.cxx
@@ -41,7 +41,7 @@
 
 #include <iostream>
 
-InDetServMatFactory::InDetServMatFactory(const InDetDD::AthenaComps * athenaComps)
+InDetServMatFactory::InDetServMatFactory(InDetDD::AthenaComps * athenaComps)
   : InDetDD::DetectorFactoryBase(athenaComps),
     m_manager(0)
 {  
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatFactoryDC3.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatFactoryDC3.cxx
index 7940808e20f6f599ce38ec4cddb0929944e379ea..da80a1fb0eac267d9066fadb688259472549eaca 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatFactoryDC3.cxx
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatFactoryDC3.cxx
@@ -40,7 +40,7 @@
 #include "GaudiKernel/PhysicalConstants.h"
 #include <iostream>
 
-InDetServMatFactoryDC3::InDetServMatFactoryDC3(const InDetDD::AthenaComps * athenaComps)
+InDetServMatFactoryDC3::InDetServMatFactoryDC3(InDetDD::AthenaComps * athenaComps)
   : InDetDD::DetectorFactoryBase(athenaComps),
     m_manager(0)
 {}
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatFactorySLHC.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatFactorySLHC.cxx
index a6fb9a02b8bbeac5d67282a25f3c6c43952db74a..5ddc937358ace1917cb9c1f085aa7171997e0b69 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatFactorySLHC.cxx
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatFactorySLHC.cxx
@@ -40,7 +40,7 @@
 #include "GaudiKernel/PhysicalConstants.h"
 #include <iostream>
 
-InDetServMatFactorySLHC::InDetServMatFactorySLHC(const InDetServMatAthenaComps * athenaComps)
+InDetServMatFactorySLHC::InDetServMatFactorySLHC(InDetServMatAthenaComps * athenaComps)
   :  InDetDD::DetectorFactoryBase(athenaComps),
      m_athenaComps(athenaComps),
      m_manager(0)
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatGeometryManager.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatGeometryManager.cxx
index f5e9a48132ad90c6db4255076bad519703a1318c..33ba286ac6fe13c1ca4e0364c8d4d002ca790a59 100644
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatGeometryManager.cxx
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatGeometryManager.cxx
@@ -12,7 +12,7 @@
 
 #include "GaudiKernel/SystemOfUnits.h"
 
-InDetServMatGeometryManager::InDetServMatGeometryManager(const InDetDD::AthenaComps * athenaComps)   
+InDetServMatGeometryManager::InDetServMatGeometryManager(InDetDD::AthenaComps * athenaComps)   
   : m_athenaComps(athenaComps),
     m_matMgr(0)
 {
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/PixelServMatFactory.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/PixelServMatFactory.cxx
index 1cd41e4df1a7ebaa25273361e9a8f022f3e5e474..a200789c0e626f715ef5a65fd9083a85d098065f 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/PixelServMatFactory.cxx
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/PixelServMatFactory.cxx
@@ -30,7 +30,7 @@
 #include <iostream>
 
 
-PixelServMatFactory::PixelServMatFactory(const InDetDD::AthenaComps * athenaComps)
+PixelServMatFactory::PixelServMatFactory(InDetDD::AthenaComps * athenaComps)
   : InDetDD::SubDetectorFactoryBase(athenaComps)
 {}
 
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/PixelServMatFactoryDC3.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/PixelServMatFactoryDC3.cxx
index 90351e689cd339636916805fdc212b0a9d5b5128..c81a5897ff250a4464c75c4e10a6d890c7510767 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/PixelServMatFactoryDC3.cxx
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/PixelServMatFactoryDC3.cxx
@@ -32,7 +32,7 @@
 #define SKIPCYLINDER 3
 //#define NUMBEROFCYLINDER 7
 
-PixelServMatFactoryDC3::PixelServMatFactoryDC3(const InDetDD::AthenaComps * athenaComps, 
+PixelServMatFactoryDC3::PixelServMatFactoryDC3(InDetDD::AthenaComps * athenaComps, 
 					       InDetMaterialManager * matManager)
   : InDetDD::SubDetectorFactoryBase(athenaComps, matManager)
 {  
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SCT_ServMatFactory.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SCT_ServMatFactory.cxx
index e6eb4ee1b487c9f054e4567af36778f60ab29f3b..7811c6d21eb0338e4673eef8e6a2050d6a287411 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SCT_ServMatFactory.cxx
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SCT_ServMatFactory.cxx
@@ -32,7 +32,7 @@
 #include <sstream>
 #include <iostream>
 
-SCT_ServMatFactory::SCT_ServMatFactory(const InDetDD::AthenaComps * athenaComps)
+SCT_ServMatFactory::SCT_ServMatFactory(InDetDD::AthenaComps * athenaComps)
   : InDetDD::SubDetectorFactoryBase(athenaComps)
 {
 }
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SCT_ServMatFactoryDC3.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SCT_ServMatFactoryDC3.cxx
index fd3a7bd810d02114b5d3dbbcba0f4c57778403a4..babf016ac03f8b0fa317623eb44345145b27bdfb 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SCT_ServMatFactoryDC3.cxx
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SCT_ServMatFactoryDC3.cxx
@@ -35,7 +35,7 @@
 
 #include <sstream>
 
-SCT_ServMatFactoryDC3::SCT_ServMatFactoryDC3(const InDetDD::AthenaComps * athenaComps, 
+SCT_ServMatFactoryDC3::SCT_ServMatFactoryDC3(InDetDD::AthenaComps * athenaComps, 
 					     InDetMaterialManager * matManager)
   : InDetDD::SubDetectorFactoryBase(athenaComps, matManager)
 {  
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SquirrelCageFactory.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SquirrelCageFactory.cxx
index 083a0be6babd2f6111a2bddc604b6419b864980c..1de085da22d8fe6667034aada88466c807079184 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SquirrelCageFactory.cxx
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SquirrelCageFactory.cxx
@@ -30,7 +30,7 @@
 #include <iostream>
 
 
-SquirrelCageFactory::SquirrelCageFactory(const InDetDD::AthenaComps * athenaComps, 
+SquirrelCageFactory::SquirrelCageFactory(InDetDD::AthenaComps * athenaComps, 
 					 InDetMaterialManager * matManager)
   : InDetDD::SubDetectorFactoryBase(athenaComps, matManager)
 {  
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SupportRailFactory.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SupportRailFactory.cxx
index d7dd2a222df1c2c8b1d3234aa385d8bbd77999b4..21fc8b9e3005c74bc3988f1df1c1dc00c004caa6 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SupportRailFactory.cxx
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SupportRailFactory.cxx
@@ -32,7 +32,7 @@
 #include <math.h>
 
 
-SupportRailFactory::SupportRailFactory(const InDetDD::AthenaComps * athenaComps, 
+SupportRailFactory::SupportRailFactory(InDetDD::AthenaComps * athenaComps, 
 				       InDetMaterialManager * matManager)
   : InDetDD::SubDetectorFactoryBase(athenaComps, matManager)
 {  
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/TRT_ServMatFactory.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/TRT_ServMatFactory.cxx
index 274ee7b48c7bea3fdae86828031bbe2eacd5a3c3..81ad9c3262f613edee13fbe174f59d8a59bbcd65 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/TRT_ServMatFactory.cxx
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/TRT_ServMatFactory.cxx
@@ -33,7 +33,7 @@
 #include <sstream>
 #include <iostream>
 
-TRT_ServMatFactory::TRT_ServMatFactory(const InDetDD::AthenaComps * athenaComps)
+TRT_ServMatFactory::TRT_ServMatFactory(InDetDD::AthenaComps * athenaComps)
   : InDetDD::SubDetectorFactoryBase(athenaComps)
 {
 }
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/TRT_ServMatFactoryDC3.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/TRT_ServMatFactoryDC3.cxx
index 493d0eb158086df544dd5f52cb2b73b619cc2173..9341703b36a201837e9a757a989f3c86bb7ee1f8 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/TRT_ServMatFactoryDC3.cxx
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/TRT_ServMatFactoryDC3.cxx
@@ -33,7 +33,7 @@
 #include <sstream>
 #include <iostream>
 
-TRT_ServMatFactoryDC3::TRT_ServMatFactoryDC3(const InDetDD::AthenaComps * athenaComps, 
+TRT_ServMatFactoryDC3::TRT_ServMatFactoryDC3(InDetDD::AthenaComps * athenaComps, 
 					     InDetMaterialManager * matManager)
   : InDetDD::SubDetectorFactoryBase(athenaComps, matManager)
 {  
diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/RobustTrackingGeometryBuilder.h b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/RobustTrackingGeometryBuilder.h
index 82446382572779dce1bcb51f42bbd734d083c1f5..39abd5e741ab5d08896ea3e085c8d71af9624c3e 100755
--- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/RobustTrackingGeometryBuilder.h
+++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/RobustTrackingGeometryBuilder.h
@@ -23,6 +23,8 @@
 #include <vector>
 #include <string>
 
+#include "CxxUtils/checker_macros.h"
+
 #ifndef TRKDETDESCR_TAKESMALLERBIGGER
 #define TRKDETDESCR_TAKESMALLERBIGGER
 #define takeSmaller(current,test) current = current < test ? current : test
@@ -76,7 +78,7 @@ namespace InDet {
       /** AlgTool finalize method */
       StatusCode finalize();
       /** TrackingGeometry Interface methode */
-      const Trk::TrackingGeometry* trackingGeometry(const Trk::TrackingVolume* tvol = 0) const; 
+      const Trk::TrackingGeometry* trackingGeometry ATLAS_NOT_THREAD_SAFE (const Trk::TrackingVolume* tvol = 0) const; 
 
       /** The unique signature */
       Trk::GeometrySignature geometrySignature() const { return Trk::ID; }
@@ -84,7 +86,8 @@ namespace InDet {
     private:
         
       /** Private method, creates and packs a triple containing of NegEndcap-Barrel-PosEndcap layers */
-      const Trk::TrackingVolume* packVolumeTriple(const std::vector<const Trk::Layer*>& negLayers,
+      const Trk::TrackingVolume* packVolumeTriple ATLAS_NOT_THREAD_SAFE
+                                                 (const std::vector<const Trk::Layer*>& negLayers,
                                                   const std::vector<const Trk::Layer*>& centralLayers,
                                                   const std::vector<const Trk::Layer*>& posLayers,
                                                   double rMin, double rMax,
diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/RobustTrackingGeometryBuilderCond.h b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/RobustTrackingGeometryBuilderCond.h
index f0f9f84acb95a97229e4b95fcf0a3a2077e33341..8f168cfc228199f31bbb96da179c649d0ae94ae3 100755
--- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/RobustTrackingGeometryBuilderCond.h
+++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/RobustTrackingGeometryBuilderCond.h
@@ -16,6 +16,7 @@
 // Athena
 #include "AthenaBaseComps/AthAlgTool.h"
 #include "CxxUtils/CachedUniquePtr.h"
+#include "CxxUtils/checker_macros.h"
 // Gaudi
 #include "GaudiKernel/ToolHandle.h"
 #include "GaudiKernel/ServiceHandle.h"
@@ -76,7 +77,7 @@ namespace InDet {
       /** AlgTool finalize method */
       StatusCode finalize();
       /** TrackingGeometry Interface methode */
-      std::pair<EventIDRange, const Trk::TrackingGeometry*> trackingGeometry(const EventContext& ctx, std::pair<EventIDRange, const Trk::TrackingVolume*> tVolPair) const; 
+      std::pair<EventIDRange, const Trk::TrackingGeometry*> trackingGeometry ATLAS_NOT_THREAD_SAFE (const EventContext& ctx, std::pair<EventIDRange, const Trk::TrackingVolume*> tVolPair) const; 
 
       /** The unique signature */
       Trk::GeometrySignature geometrySignature() const { return Trk::ID; }
@@ -84,7 +85,8 @@ namespace InDet {
     private:
         
       /** Private method, creates and packs a triple containing of NegEndcap-Barrel-PosEndcap layers */
-      const Trk::TrackingVolume* packVolumeTriple(const std::vector<const Trk::Layer*>& negLayers,
+      const Trk::TrackingVolume* packVolumeTriple ATLAS_NOT_THREAD_SAFE
+                                                 (const std::vector<const Trk::Layer*>& negLayers,
                                                   const std::vector<const Trk::Layer*>& centralLayers,
                                                   const std::vector<const Trk::Layer*>& posLayers,
                                                   double rMin, double rMax,
diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/StagedTrackingGeometryBuilder.h b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/StagedTrackingGeometryBuilder.h
index 4c6b835b50ab9eece8bc265c87f187517bca94b1..e24b76dfe7cc3b83b0df6c762f78bf45b260eed4 100755
--- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/StagedTrackingGeometryBuilder.h
+++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/StagedTrackingGeometryBuilder.h
@@ -23,6 +23,8 @@
 #include <vector>
 #include <string>
 
+#include "CxxUtils/checker_macros.h"
+
 #ifndef TRKDETDESCR_TAKESMALLERBIGGER
 #define TRKDETDESCR_TAKESMALLERBIGGER
 #define takeSmaller(current,test) current = current < test ? current : test
@@ -141,7 +143,7 @@ namespace InDet {
       /** AlgTool finalize method */
       StatusCode finalize();
       /** TrackingGeometry Interface methode */
-      const Trk::TrackingGeometry* trackingGeometry(const Trk::TrackingVolume* tvol = 0) const; 
+      const Trk::TrackingGeometry* trackingGeometry ATLAS_NOT_THREAD_SAFE (const Trk::TrackingVolume* tvol = 0) const; 
 
       /** The unique signature */
       Trk::GeometrySignature geometrySignature() const { return Trk::ID; }
@@ -163,7 +165,8 @@ namespace InDet {
                                    
                                    
       /** Private helper method to flush the cache into the id volumes - return volume is the one to be provided */
-      const Trk::TrackingVolume* createFlushVolume(std::vector<InDet::LayerSetup>& layerSetupCache,
+      const Trk::TrackingVolume* createFlushVolume ATLAS_NOT_THREAD_SAFE
+                                                  (std::vector<InDet::LayerSetup>& layerSetupCache,
                                                    double innerRadius, double& outerRadius, double extendZ) const;                                                         
         
       /** Private helper method, creates a TrackingVolume - and checks if configured - for Ring Layout 
@@ -179,7 +182,8 @@ namespace InDet {
       /** Private helper method, creates and packs a triple containing of NegEndcap-Barrel-PosEndcap layers
           - in case of a ring layout the subvolumes are created and the rMax is adapted                                             
          */
-      const Trk::TrackingVolume* packVolumeTriple(const LayerSetup& layerSetup,
+      const Trk::TrackingVolume* packVolumeTriple ATLAS_NOT_THREAD_SAFE
+                                                 (const LayerSetup& layerSetup,
                                                   double rMin, double& rMax,
                                                   double zMin, double zPosCentral) const;      
       
diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/StagedTrackingGeometryBuilderCond.h b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/StagedTrackingGeometryBuilderCond.h
index 600faa007fa95ab9a283574329342890306c8eeb..fcf44258dd049e17718b3ebcc108043bc7554320 100755
--- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/StagedTrackingGeometryBuilderCond.h
+++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/StagedTrackingGeometryBuilderCond.h
@@ -18,6 +18,7 @@
 // Athena
 #include "AthenaBaseComps/AthAlgTool.h"
 #include "CxxUtils/CachedUniquePtr.h"
+#include "CxxUtils/checker_macros.h"
 // Gaudi
 #include "GaudiKernel/ToolHandle.h"
 #include "GaudiKernel/ServiceHandle.h"
@@ -144,7 +145,7 @@ namespace InDet {
       /** AlgTool finalize method */
       StatusCode finalize();
       /** TrackingGeometry Interface methode */
-      std::pair<EventIDRange, const Trk::TrackingGeometry*> trackingGeometry(const EventContext& ctx, std::pair<EventIDRange, const Trk::TrackingVolume*> tVolPair) const; 
+      std::pair<EventIDRange, const Trk::TrackingGeometry*> trackingGeometry ATLAS_NOT_THREAD_SAFE (const EventContext& ctx, std::pair<EventIDRange, const Trk::TrackingVolume*> tVolPair) const; 
 
       /** The unique signature */
       Trk::GeometrySignature geometrySignature() const { return Trk::ID; }
@@ -166,7 +167,8 @@ namespace InDet {
                                    
                                    
       /** Private helper method to flush the cache into the id volumes - return volume is the one to be provided */
-      const Trk::TrackingVolume* createFlushVolume(std::vector<InDet::LayerSetup>& layerSetupCache,
+      const Trk::TrackingVolume* createFlushVolume ATLAS_NOT_THREAD_SAFE
+                                                  (std::vector<InDet::LayerSetup>& layerSetupCache,
                                                    double innerRadius, double& outerRadius, double extendZ) const;                                                         
         
       /** Private helper method, creates a TrackingVolume - and checks if configured - for Ring Layout 
@@ -182,7 +184,8 @@ namespace InDet {
       /** Private helper method, creates and packs a triple containing of NegEndcap-Barrel-PosEndcap layers
           - in case of a ring layout the subvolumes are created and the rMax is adapted                                             
          */
-      const Trk::TrackingVolume* packVolumeTriple(const LayerSetup& layerSetup,
+      const Trk::TrackingVolume* packVolumeTriple ATLAS_NOT_THREAD_SAFE
+                                                 (const LayerSetup& layerSetup,
                                                   double rMin, double& rMax,
                                                   double zMin, double zPosCentral) const;      
       
diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/RobustTrackingGeometryBuilder.cxx b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/RobustTrackingGeometryBuilder.cxx
index 4252dae946b9ab3497d754b8b772f0b3071392a2..26f66afbe71619d92322eeb8d0be21b1f4549daf 100755
--- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/RobustTrackingGeometryBuilder.cxx
+++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/RobustTrackingGeometryBuilder.cxx
@@ -531,7 +531,7 @@ const Trk::TrackingGeometry* InDet::RobustTrackingGeometryBuilder::trackingGeome
                                                                    "Container");
                                                                    
    // get the dimensions from the envelope service 
-   RZPairVector& envelopeDefs = m_enclosingEnvelopeSvc->getInDetRZValues();
+   const RZPairVector& envelopeDefs = m_enclosingEnvelopeSvc->getInDetRZBoundary();
    ATH_MSG_VERBOSE("       -> retrieved Inner Detector envelope definitions at size " << envelopeDefs.size());
    double enclosingVolumeRadius = envelopeDefs[1].first;
    double enclosingVolumeHalfZ  = fabs(envelopeDefs[1].second);
diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/RobustTrackingGeometryBuilderCond.cxx b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/RobustTrackingGeometryBuilderCond.cxx
index fc37f3dd31066c2f7f5fbd81cc2bf19062b9174b..b4857202b0bc363d21f27c2c27aa3289ce7f599f 100755
--- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/RobustTrackingGeometryBuilderCond.cxx
+++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/RobustTrackingGeometryBuilderCond.cxx
@@ -542,7 +542,7 @@ std::pair<EventIDRange, const Trk::TrackingGeometry*> InDet::RobustTrackingGeome
                                                                    "Container");
                                                                    
    // get the dimensions from the envelope service 
-   RZPairVector& envelopeDefs = m_enclosingEnvelopeSvc->getInDetRZValues();
+   const RZPairVector& envelopeDefs = m_enclosingEnvelopeSvc->getInDetRZBoundary();
    ATH_MSG_VERBOSE("       -> retrieved Inner Detector envelope definitions at size " << envelopeDefs.size());
    double enclosingVolumeRadius = envelopeDefs[1].first;
    double enclosingVolumeHalfZ  = fabs(envelopeDefs[1].second);
diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/StagedTrackingGeometryBuilder.cxx b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/StagedTrackingGeometryBuilder.cxx
index ff798f6dfb71e2479fec331238b0d1fde498b03f..4a975bc65e5061e639cc9b9cfb594abfa9d1e9c2 100755
--- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/StagedTrackingGeometryBuilder.cxx
+++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/StagedTrackingGeometryBuilder.cxx
@@ -134,7 +134,7 @@ const Trk::TrackingGeometry* InDet::StagedTrackingGeometryBuilder::trackingGeome
    Trk::TrackingGeometry* trackingGeometry = 0;   
 
    // get the dimensions from the envelope service 
-   RZPairVector& envelopeDefs = m_enclosingEnvelopeSvc->getInDetRZValues();
+   const RZPairVector& envelopeDefs = m_enclosingEnvelopeSvc->getInDetRZBoundary();
    ATH_MSG_VERBOSE("       -> retrieved Inner Detector envelope definitions at size " << envelopeDefs.size());
    double envelopeVolumeRadius = envelopeDefs[1].first;
    double envelopeVolumeHalfZ  = fabs(envelopeDefs[1].second);
diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/StagedTrackingGeometryBuilderCond.cxx b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/StagedTrackingGeometryBuilderCond.cxx
index c297b686c96416fd9d519f146d104f4cd12ef5f8..f88833a8d419ee12c01a2e1598279f1659da37e6 100755
--- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/StagedTrackingGeometryBuilderCond.cxx
+++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/StagedTrackingGeometryBuilderCond.cxx
@@ -135,7 +135,7 @@ std::pair<EventIDRange, const Trk::TrackingGeometry*> InDet::StagedTrackingGeome
    Trk::TrackingGeometry* trackingGeometry = 0;   
 
    // get the dimensions from the envelope service 
-   RZPairVector& envelopeDefs = m_enclosingEnvelopeSvc->getInDetRZValues();
+   const RZPairVector& envelopeDefs = m_enclosingEnvelopeSvc->getInDetRZBoundary();
    ATH_MSG_VERBOSE("       -> retrieved Inner Detector envelope definitions at size " << envelopeDefs.size());
    double envelopeVolumeRadius = envelopeDefs[1].first;
    double envelopeVolumeHalfZ  = fabs(envelopeDefs[1].second);
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/OraclePixGeoManager.cxx b/InnerDetector/InDetDetDescr/PixelGeoModel/src/OraclePixGeoManager.cxx
index 5ddd97ad67416743f2a5e1a10ec914b8e2fefa9b..113d7f1cde55a577ca34b877f026f599bef63ab5 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/OraclePixGeoManager.cxx
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/OraclePixGeoManager.cxx
@@ -41,7 +41,7 @@ using InDetDD::PixelDetectorManager;
 
 using namespace std;
 
-OraclePixGeoManager::OraclePixGeoManager(const PixelGeoModelAthenaComps * athenaComps)
+OraclePixGeoManager::OraclePixGeoManager(PixelGeoModelAthenaComps * athenaComps)
   : PixelGeometryManager(athenaComps), 
     m_eta(0),
     m_phi(0),
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/OraclePixGeoManager.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/OraclePixGeoManager.h
index 1ad1b7df82d5e9c8840159802ba880fdb9a873dd..15c423c69ac8c2f1480507639b49d254b9f37213 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/OraclePixGeoManager.h
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/OraclePixGeoManager.h
@@ -174,7 +174,7 @@ class OraclePixGeoManager : public PixelGeometryManager {
 
  public:
 
-  OraclePixGeoManager(const PixelGeoModelAthenaComps * athenaComps) ATLAS_CTORDTOR_NOT_THREAD_SAFE; // Thread unsafe init method is used.
+  OraclePixGeoManager(PixelGeoModelAthenaComps * athenaComps) ATLAS_CTORDTOR_NOT_THREAD_SAFE; // Thread unsafe init method is used.
   ~OraclePixGeoManager();
   
   void init();
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactory.cxx b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactory.cxx
index 4dd77253ff858d4e6044bc468e013ba29e12d2b8..aca2adef16ec09409bc6f6d170ba9d81ed626811 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactory.cxx
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactory.cxx
@@ -32,7 +32,7 @@
 using InDetDD::PixelDetectorManager; 
 using InDetDD::SiCommonItems; 
 
-PixelDetectorFactory::PixelDetectorFactory(const PixelGeoModelAthenaComps * athenaComps,
+PixelDetectorFactory::PixelDetectorFactory(PixelGeoModelAthenaComps * athenaComps,
 					   const PixelSwitches & switches)
   : InDetDD::DetectorFactoryBase(athenaComps),
     m_detectorManager(0),
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactory.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactory.h
index f24855015125a63897b368f4809912db61c1c0ed..5dfd2b11d15b1923324fd23cbd65a9919e40a68e 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactory.h
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactory.h
@@ -21,7 +21,7 @@ class PixelDetectorFactory : public InDetDD::DetectorFactoryBase {
  public:
   
   // Constructor:
-  PixelDetectorFactory(const PixelGeoModelAthenaComps * athenaComps,
+  PixelDetectorFactory(PixelGeoModelAthenaComps * athenaComps,
 		       const PixelSwitches & switches) ATLAS_CTORDTOR_NOT_THREAD_SAFE; // Thread unsafe GeoVPixelFactory class is used.
   
   // Destructor:
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactoryDC2.cxx b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactoryDC2.cxx
index 709bb24f4a1f028b46517468a5d60ec39e50ea41..ad7183b444da7b1236e703e5a39857b2f6b3344a 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactoryDC2.cxx
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactoryDC2.cxx
@@ -30,7 +30,7 @@ using InDetDD::SiCommonItems;
 using namespace PixelGeoDC2;
 
 
-PixelDetectorFactoryDC2::PixelDetectorFactoryDC2(const PixelGeoModelAthenaComps * athenaComps,
+PixelDetectorFactoryDC2::PixelDetectorFactoryDC2(PixelGeoModelAthenaComps * athenaComps,
 						 const PixelSwitches & switches)						 
   : InDetDD::DetectorFactoryBase(athenaComps),
     m_detectorManager(0)
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactoryDC2.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactoryDC2.h
index 3f30fb601be5872ffaf5f71b40f33fab2ca5e619..b0b0f119fa6094b990f4df88d5b555dcb354ffa0 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactoryDC2.h
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactoryDC2.h
@@ -19,7 +19,7 @@ class PixelDetectorFactoryDC2 : public InDetDD::DetectorFactoryBase {
  public:
   
   // Constructor:
-  PixelDetectorFactoryDC2(const PixelGeoModelAthenaComps * athenaComps,
+  PixelDetectorFactoryDC2(PixelGeoModelAthenaComps * athenaComps,
 			  const PixelSwitches & switches) ATLAS_CTORDTOR_NOT_THREAD_SAFE; // Thread unsafe InDetDD::DetectorFactoryBase::detStore method is used.
   
   // Destructor:
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactorySR1.cxx b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactorySR1.cxx
index be566a3cdcd8fbfea28f0bbade2507dfdbaef124..a0a5593c539e227c43e923e7021c23be74a6a250 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactorySR1.cxx
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactorySR1.cxx
@@ -31,7 +31,7 @@
 using InDetDD::PixelDetectorManager; 
 using InDetDD::SiCommonItems; 
 
-PixelDetectorFactorySR1::PixelDetectorFactorySR1(const PixelGeoModelAthenaComps * athenaComps,
+PixelDetectorFactorySR1::PixelDetectorFactorySR1(PixelGeoModelAthenaComps * athenaComps,
 						 const PixelSwitches & switches)
   : InDetDD::DetectorFactoryBase(athenaComps),
     m_detectorManager(0)
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactorySR1.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactorySR1.h
index 56e72a015ed09471dc103637d59081383923c7dd..bdd8df13e7d1ece7298f399667efe4509072adfe 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactorySR1.h
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactorySR1.h
@@ -20,7 +20,7 @@ class PixelDetectorFactorySR1 : public InDetDD::DetectorFactoryBase {
  public:
   
   // Constructor:
-  PixelDetectorFactorySR1(const PixelGeoModelAthenaComps * athenaComps,
+  PixelDetectorFactorySR1(PixelGeoModelAthenaComps * athenaComps,
 			  const PixelSwitches & switches) ATLAS_CTORDTOR_NOT_THREAD_SAFE; // Thread unsafe GeoVPixelFactory class is used.
     
   // Destructor:
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorTool.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorTool.h
index 4f1c4b43bb44f07300b724a8b921abf76c08d7c4..e33824a5d569628a44218ea75a698efdff62137c 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorTool.h
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorTool.h
@@ -16,6 +16,8 @@
 #include "PixelGeoModel/IBLParameterSvc.h"
 #include "InDetGeoModelUtils/IInDetServMatBuilderTool.h"
 
+#include "CxxUtils/checker_macros.h"
+
 class PixelGeoModelAthenaComps;
 
 namespace InDetDD {
@@ -35,8 +37,8 @@ class PixelDetectorTool final : public GeoModelTool {
   virtual StatusCode create() override final;
   virtual StatusCode clear() override final;
 
-  // Register callback function on ConDB object
-  virtual StatusCode registerCallback() override final;
+  // Register callback function on CondDB object
+  virtual StatusCode registerCallback ATLAS_NOT_THREAD_SAFE () override final;
 
   // Callback function itself
   virtual StatusCode align(IOVSVC_CALLBACK_ARGS) override;
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelGeometryManager.cxx b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelGeometryManager.cxx
index b8f2f517b62355d71bf5e27957a5345eb5ae0f26..db6c95719e64b9159e56bc0da89aecc0e8ea186d 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelGeometryManager.cxx
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelGeometryManager.cxx
@@ -1,12 +1,12 @@
 /*
-  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 "PixelGeometryManager.h"
 
 using namespace std;
 
-PixelGeometryManager::PixelGeometryManager(const PixelGeoModelAthenaComps * athenaComps) :
+PixelGeometryManager::PixelGeometryManager(PixelGeoModelAthenaComps * athenaComps) :
   m_athenaComps(athenaComps)
 {}
 
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelGeometryManager.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelGeometryManager.h
index 7a4785c3da8e9ccb281f90e3ccbd0209462a6ec6..14bb7670cbccbbe86c6a44c9d20331a9a1ca7756 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelGeometryManager.h
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelGeometryManager.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 PixelGeometryManager_H
@@ -29,7 +29,7 @@ class PixelGeometryManager {
 
 public:
   
-  PixelGeometryManager(const PixelGeoModelAthenaComps * athenaComps);
+  PixelGeometryManager(PixelGeoModelAthenaComps * athenaComps);
   virtual ~PixelGeometryManager();
 
   //
@@ -621,6 +621,7 @@ public:
   //Declaring the Method providing Verbosity Level
   bool msgLvl (MSG::Level lvl) const { return m_athenaComps->msgLvl(lvl); }
 
+  PixelGeoModelAthenaComps * athenaComps() {return m_athenaComps;}
   const PixelGeoModelAthenaComps * athenaComps() const {return m_athenaComps;}
 
   /////
@@ -661,7 +662,7 @@ public:
 private:
   
   // Access to athena components
-  const PixelGeoModelAthenaComps * m_athenaComps;
+  PixelGeoModelAthenaComps * m_athenaComps;
 
 
 };
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DataBase.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DataBase.h
index f59eee96d252fe17879df5de598a6073fec2a150..4fa0a746e0f93ba0f39d757dc589ec577b8170db 100644
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DataBase.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DataBase.h
@@ -19,9 +19,9 @@ class SCT_DataBase
   
 public:
 
-  SCT_DataBase(const SCT_GeoModelAthenaComps* athenaComps) ATLAS_CTORDTOR_NOT_THREAD_SAFE; // Thread unsafe AthenaComps::rdbAccessSvc const method is used.
+  SCT_DataBase(SCT_GeoModelAthenaComps* athenaComps);
 
-  const SCT_GeoModelAthenaComps* athenaComps() const;
+  SCT_GeoModelAthenaComps* athenaComps();
 
   IRDBRecordset_ptr weightTable() const;
   IRDBRecordset_ptr scalingTable() const;
@@ -100,7 +100,7 @@ private:
 
 private:
 
-  const SCT_GeoModelAthenaComps* m_athenaComps;
+  SCT_GeoModelAthenaComps* m_athenaComps;
 
   std::string m_sctVersionTag;
 
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorFactory.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorFactory.h
index be3d76c245d8f7f43f5769c5c8497b86aab09aba..a509917a12ad8674006e75f93895d676f1009f32 100644
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorFactory.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorFactory.h
@@ -24,8 +24,8 @@ class SCT_DetectorFactory : public InDetDD::DetectorFactoryBase
   
  public: 
   // Constructor
-  SCT_DetectorFactory(const SCT_GeoModelAthenaComps * athenaComps, 
-		      const SCT_Options & options) ATLAS_CTORDTOR_NOT_THREAD_SAFE; // Thread unsafe InDetDD::DetectorFactoryBase::rdbAccessSvc() method is used.
+  SCT_DetectorFactory(SCT_GeoModelAthenaComps * athenaComps, 
+		      const SCT_Options & options);
 
   // Destructor
   virtual ~SCT_DetectorFactory(); 
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorTool.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorTool.h
index 391ae9d64077dc812e3bedc5fcff5eda2b273133..c16e113fb7bee443fe9e9e862d87030df83bac50 100644
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorTool.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorTool.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 SCT_GEOMODEL_SCT_DETECTORTOOL_H
@@ -12,6 +12,8 @@
 #include "GeoModelInterfaces/IGeoDbTagSvc.h"
 #include "RDBAccessSvc/IRDBAccessSvc.h"
 
+#include "CxxUtils/checker_macros.h"
+
 #include "GaudiKernel/ServiceHandle.h"
 
 #include <string>
@@ -29,8 +31,8 @@ public:
   virtual StatusCode create() override final;
   virtual StatusCode clear() override final;
 
-  // Register callback function on ConDB object
-  virtual StatusCode registerCallback() override final;
+  // Register callback function on CondDB object
+  virtual StatusCode registerCallback ATLAS_NOT_THREAD_SAFE () override final;
 
   // Callback function itself
   virtual StatusCode align(IOVSVC_CALLBACK_ARGS) override;
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DataBase.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DataBase.cxx
index 8b211df7544ea8643496f712d4b66862e855b244..be090e023fb7b8c2eb068c498a43364ac1f6fffd 100644
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DataBase.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DataBase.cxx
@@ -15,7 +15,7 @@
 
 #include <iostream>
 
-SCT_DataBase::SCT_DataBase(const SCT_GeoModelAthenaComps * athenaComps)
+SCT_DataBase::SCT_DataBase(SCT_GeoModelAthenaComps * athenaComps)
 {
   m_athenaComps = athenaComps;
 
@@ -188,7 +188,7 @@ SCT_DataBase::SCT_DataBase(const SCT_GeoModelAthenaComps * athenaComps)
 
 }
 
-const SCT_GeoModelAthenaComps* SCT_DataBase::athenaComps() const { return m_athenaComps; }
+SCT_GeoModelAthenaComps* SCT_DataBase::athenaComps() { return m_athenaComps; }
 
 IRDBRecordset_ptr SCT_DataBase::weightTable() const {return m_weightTable;}
 
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DetectorFactory.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DetectorFactory.cxx
index bf0223e215cc090f974e27ed73a77f9f827b9650..610527dc10bde8633ab4b47b81a7e344545cdede 100644
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DetectorFactory.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DetectorFactory.cxx
@@ -63,7 +63,7 @@
 using InDetDD::SCT_DetectorManager; 
 using InDetDD::SiCommonItems; 
 
-SCT_DetectorFactory::SCT_DetectorFactory(const SCT_GeoModelAthenaComps * athenaComps,
+SCT_DetectorFactory::SCT_DetectorFactory(SCT_GeoModelAthenaComps * athenaComps,
 					 const SCT_Options & options)
   : InDetDD::DetectorFactoryBase(athenaComps),
     m_useDynamicAlignFolders(false)
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DetectorTool.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DetectorTool.cxx
index 2fc7636e39f29227446711297e30e50ca90df956..e1a1394147e47956ed8327491b63888fd8c1d111 100644
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DetectorTool.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DetectorTool.cxx
@@ -48,7 +48,7 @@ SCT_DetectorTool::SCT_DetectorTool(const std::string& type,
 //
 
 StatusCode
-SCT_DetectorTool::create ATLAS_NOT_THREAD_SAFE () // Thread unsafe SCT_DetectorFactory constructor is used.
+SCT_DetectorTool::create()
 {
   // Get the detector configuration.
   ATH_CHECK(m_geoDbTagSvc.retrieve());
diff --git a/InnerDetector/InDetDetDescr/TRT_Cabling/src/TRT_FillCablingData_SR1.cxx b/InnerDetector/InDetDetDescr/TRT_Cabling/src/TRT_FillCablingData_SR1.cxx
index 276139525a6ff9a1b598e8d419746c50c87233e8..e0802e2245413f4bc4c374dfe88538c35e4296ed 100644
--- a/InnerDetector/InDetDetDescr/TRT_Cabling/src/TRT_FillCablingData_SR1.cxx
+++ b/InnerDetector/InDetDetDescr/TRT_Cabling/src/TRT_FillCablingData_SR1.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
 */
 
 //
@@ -516,7 +516,7 @@ void TRT_FillCablingData_SR1::defineTables()
 
      std::vector<uint32_t>::iterator it = (m_phi_to_source[my_phi]).begin();
      while ( (it != (m_phi_to_source[my_phi]).end()) && (srcId != *it) )
-	it++;
+	++it;
 
      if ( it == m_phi_to_source[my_phi].end() )
      {
@@ -540,7 +540,7 @@ void TRT_FillCablingData_SR1::defineTables()
 #endif // NOTDEF
 
   GlobalCableMap::iterator pos;
-  for ( pos=m_CableMap.begin(); pos != m_CableMap.end(); pos++ )
+  for ( pos=m_CableMap.begin(); pos != m_CableMap.end(); ++pos )
   {
      std::vector< GlobalCableMap_t *> GCM;
 
@@ -550,7 +550,7 @@ void TRT_FillCablingData_SR1::defineTables()
 
      int ConnectorCount=-1;
      std::vector< GlobalCableMap_t *>::iterator it;
-     for ( it=GCM.begin(); it != GCM.end(); it++ )
+     for ( it=GCM.begin(); it != GCM.end(); ++it )
      {
 	ConnectorCount++;
 
@@ -766,7 +766,7 @@ void TRT_FillCablingData_SR1::defineCollID()
    ATH_MSG_INFO( "In defineCollID()" );
 
    GlobalCableMap::iterator pos;
-   for ( pos=m_CableMap.begin(); pos != m_CableMap.end(); pos++ )
+   for ( pos=m_CableMap.begin(); pos != m_CableMap.end(); ++pos )
    {   
       std::vector<IdentifierHash> * vectID = new std::vector<IdentifierHash>();
       fillCollID( pos->first, *vectID);
@@ -838,7 +838,7 @@ std::vector<IdentifierHash> & ids)
 		   (my_map->FEid == "3FL2") || (my_map->FEid == "3FS") )
 	   rings |= 4;
 
-	 it++;
+	 ++it;
 	
 	 if ( it != GCM.end() )
 	 {
@@ -949,7 +949,7 @@ std::vector<IdentifierHash> & ids)
 	   return;
 	 }
 
-	 it++;
+	 ++it;
 	
 	 if ( it != GCM.end() )
 	 {
@@ -1019,7 +1019,7 @@ std::vector<uint32_t> TRT_FillCablingData_SR1::getRobID(Identifier id)
      eformat::helper::SourceIdentifier sid( *it1 );
      v.push_back(sid.code());
 
-     it1++;
+     ++it1;
   }
 
   return v;
diff --git a/InnerDetector/InDetDetDescr/TRT_Cabling/src/TRT_FillCablingData_SR1_ECC.cxx b/InnerDetector/InDetDetDescr/TRT_Cabling/src/TRT_FillCablingData_SR1_ECC.cxx
index d1bcb65d2920a0de488ac4437ca1f813cd9b1b6a..e7f73973ba008b31579b97800d985f709640cb18 100644
--- a/InnerDetector/InDetDetDescr/TRT_Cabling/src/TRT_FillCablingData_SR1_ECC.cxx
+++ b/InnerDetector/InDetDetDescr/TRT_Cabling/src/TRT_FillCablingData_SR1_ECC.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
 */
 
 //
@@ -622,7 +622,7 @@ void TRT_FillCablingData_SR1_ECC::defineTables()
 
      std::vector<uint32_t>::iterator it = (m_phi_to_source[my_phi]).begin();
      while ( (it != (m_phi_to_source[my_phi]).end()) && (srcId != *it) )
-	it++;
+	++it;
 
      if ( it == m_phi_to_source[my_phi].end() )
      {
@@ -646,7 +646,7 @@ void TRT_FillCablingData_SR1_ECC::defineTables()
 #endif // NOTDEF
 
   GlobalCableMap::iterator pos;
-  for ( pos=m_CableMap.begin(); pos != m_CableMap.end(); pos++ )
+  for ( pos=m_CableMap.begin(); pos != m_CableMap.end(); ++pos )
   {
      std::vector< GlobalCableMap_t *> GCM;
 
@@ -656,7 +656,7 @@ void TRT_FillCablingData_SR1_ECC::defineTables()
 
      int ConnectorCount=-1;
      std::vector< GlobalCableMap_t *>::iterator it;
-     for ( it=GCM.begin(); it != GCM.end(); it++ )
+     for ( it=GCM.begin(); it != GCM.end(); ++it )
      {
 	ConnectorCount++;
 
@@ -882,7 +882,7 @@ void TRT_FillCablingData_SR1_ECC::defineCollID()
    ATH_MSG_INFO( "In defineCollID()" );
 
    GlobalCableMap::iterator pos;
-   for ( pos=m_CableMap.begin(); pos != m_CableMap.end(); pos++ )
+   for ( pos=m_CableMap.begin(); pos != m_CableMap.end(); ++pos )
    {   
       std::vector<IdentifierHash> * vectID = new std::vector<IdentifierHash>();
       fillCollID( pos->first, *vectID);
@@ -954,7 +954,7 @@ std::vector<IdentifierHash> & ids)
 		   (my_map->FEid == "3FL2") || (my_map->FEid == "3FS") )
 	   rings |= 4;
 
-	 it++;
+	 ++it;
 	
 	 if ( it != GCM.end() )
 	 {
@@ -1065,7 +1065,7 @@ std::vector<IdentifierHash> & ids)
 	   return;
 	 }
 
-	 it++;
+	 ++it;
 	
 	 if ( it != GCM.end() )
 	 {
@@ -1135,7 +1135,7 @@ std::vector<uint32_t> TRT_FillCablingData_SR1_ECC::getRobID(Identifier id)
      eformat::helper::SourceIdentifier sid( *it1 );
      v.push_back(sid.code());
 
-     it1++;
+     ++it1;
   }
 
   return v;
diff --git a/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRTDetectorFactory_Full.cxx b/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRTDetectorFactory_Full.cxx
index 63ae8c42e0d8ae214182f37065f9a4256232a264..d48ccba8a08df32bbc13294b822a8138998741de 100755
--- a/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRTDetectorFactory_Full.cxx
+++ b/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRTDetectorFactory_Full.cxx
@@ -82,7 +82,7 @@ double magn(GeoTrf::Vector2D& vector)
 }
 /////////////////////////////////// Constructor //////////////////////////////////
 //
-TRTDetectorFactory_Full::TRTDetectorFactory_Full(const InDetDD::AthenaComps * athenaComps,
+TRTDetectorFactory_Full::TRTDetectorFactory_Full(InDetDD::AthenaComps * athenaComps,
 						 const ITRT_StrawStatusSummaryTool* sumTool, // added for Argon
 						 bool useOldActiveGasMixture,
 						 bool DC2CompatibleBarrelCoordinates,
@@ -2287,7 +2287,7 @@ GeoPhysVol * TRTDetectorFactory_Full::makeStraw( double& activeGasZPosition, boo
 ///////////////////////////////// makeStrawPlane /////////////////////////////////
 //
 //GeoFullPhysVol * TRTDetectorFactory_Full::makeStrawPlane(size_t w) const {
-GeoFullPhysVol * TRTDetectorFactory_Full::makeStrawPlane(size_t w, ActiveGasMixture gasMixture) const {
+GeoFullPhysVol * TRTDetectorFactory_Full::makeStrawPlane(size_t w, ActiveGasMixture gasMixture) {
   // -----------------------------------------------------------------------------------//
   //                                                                                    //
   // There are twelve straw planes; however there are only two kinds, one for sector    //
@@ -2295,29 +2295,29 @@ GeoFullPhysVol * TRTDetectorFactory_Full::makeStrawPlane(size_t w, ActiveGasMixt
   // In order to economize, we shall only create two planes.                            //
   // -----------------------------------------------------------------------------------//
 
-  static GeoFullPhysVol *type1Plane=nullptr, *type2Plane=nullptr, *type1PlaneAr=nullptr, *type2PlaneAr=nullptr, *type1PlaneKr=nullptr, *type2PlaneKr=nullptr;
   size_t nstraws=0;
 
   //A and B wheels have similar straw planes, but the C wheels are different.
   //  const size_t firstIndexOfC = 15; //hardcoded
   const size_t firstIndexOfC = 14; //hardcoded
 
-  GeoFullPhysVol *&cur_type1Plane = (gasMixture == GM_KRYPTON) ? type1PlaneKr :
-                                    (gasMixture == GM_ARGON  ) ? type1PlaneAr :
-                                                                 type1Plane;
-  GeoFullPhysVol *&cur_type2Plane = (gasMixture == GM_KRYPTON) ? type2PlaneKr :
-                                    (gasMixture == GM_ARGON  ) ? type2PlaneAr :
-                                                                 type2Plane;
+  unsigned iplane = 0;
+  if (gasMixture == GM_ARGON) {
+    iplane = 1;
+  }
+  else if (gasMixture == GM_KRYPTON) {
+    iplane = 2;
+  }
 
   if (w>=firstIndexOfC) {
-    if (cur_type2Plane!=nullptr) {
-      return cur_type2Plane;
+    if (m_type2Planes[iplane] != nullptr) {
+      return m_type2Planes[iplane];
     }
     nstraws=m_data->endcapNumberOfStrawsInStrawLayer_CWheels;
   } 
   else {
-    if (cur_type1Plane!=nullptr) {
-      return cur_type1Plane;
+    if (m_type1Planes[iplane] != nullptr) {
+      return m_type1Planes[iplane];
     }
     nstraws=m_data->endcapNumberOfStrawsInStrawLayer_AWheels;
     //Check here that (m_data->endcapNumberOfStrawsInStrawLayer_AWheels == m_data->endcapNumberOfStrawsInStrawLayer_BWheels) !!
@@ -2415,15 +2415,13 @@ GeoFullPhysVol * TRTDetectorFactory_Full::makeStrawPlane(size_t w, ActiveGasMixt
   GeoPhysVol *pWire = new GeoPhysVol(lWire);
   pStraw->add(pWire);
 
-  // Look above *type2Plane=nullptr
-  if (w>=firstIndexOfC && type2Plane!=nullptr) {
-    cur_type2Plane=pStrawPlane;
-    return cur_type2Plane;
+  if (w>=firstIndexOfC) {
+    m_type2Planes[iplane] = pStrawPlane;
   }
   else {
-    cur_type1Plane=pStrawPlane;
-    return cur_type1Plane;
+    m_type1Planes[iplane] = pStrawPlane;
   }
+  return pStrawPlane;
 
 }
 
diff --git a/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRTDetectorFactory_Full.h b/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRTDetectorFactory_Full.h
index 561fa50e21b71e27f5c2e104053fc341c79e4b3d..aabed98257aee7f0281a05423bae73cd5856ef1b 100755
--- a/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRTDetectorFactory_Full.h
+++ b/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRTDetectorFactory_Full.h
@@ -29,14 +29,14 @@ class GeoFullPhysVol;
 class TRTParameterInterface;
 class InDetMaterialManager;
 
-class ATLAS_NOT_THREAD_SAFE TRTDetectorFactory_Full : public InDetDD::DetectorFactoryBase  { // Static variables are used.
+class TRTDetectorFactory_Full : public InDetDD::DetectorFactoryBase  {
 
  public:
   
   //--------------------------Public Interface:--------------------------------//
   //                                                                           //
   // Constructor:                                                              //
-  TRTDetectorFactory_Full(const InDetDD::AthenaComps * athenaComps,            //
+  TRTDetectorFactory_Full(InDetDD::AthenaComps * athenaComps,                  //
 			  const ITRT_StrawStatusSummaryTool * sumTool,         //
 			  bool useOldActiveGasMixture,                         //
 			  bool DC2CompatibleBarrelCoordinates,                 //
@@ -88,7 +88,7 @@ class ATLAS_NOT_THREAD_SAFE TRTDetectorFactory_Full : public InDetDD::DetectorFa
   //GeoPhysVol * makeStraw( double& activeGasZPosition, bool hasLargeDeadRegion=false ) const;
   GeoPhysVol * makeStraw( double& activeGasZPosition, bool hasLargeDeadRegion=false, ActiveGasMixture gasMixture = GM_XENON) const;
   //GeoFullPhysVol  *makeStrawPlane( size_t w ) const;
-  GeoFullPhysVol  *makeStrawPlane( size_t w , ActiveGasMixture gasMixture = GM_XENON) const;
+  GeoFullPhysVol  *makeStrawPlane( size_t w , ActiveGasMixture gasMixture = GM_XENON);
 
   // private member data:
   InDetDD::TRT_DetectorManager * m_detectorManager;
@@ -105,6 +105,8 @@ class ATLAS_NOT_THREAD_SAFE TRTDetectorFactory_Full : public InDetDD::DetectorFa
   bool m_doKrypton;
   bool m_useDynamicAlignFolders;
 
+  GeoFullPhysVol* m_type1Planes[3] = {nullptr, nullptr, nullptr};
+  GeoFullPhysVol* m_type2Planes[3] = {nullptr, nullptr, nullptr};
 };
 
 #endif // TRTDetectorFactory_Full_h
diff --git a/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRT_DetDescrDB_ParameterInterface.cxx b/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRT_DetDescrDB_ParameterInterface.cxx
index 09c2173e1872f8efb2be28a8c1c94a4e5efd253a..65baba4b4caa5f5b87ceafe23a2c15308b774180 100755
--- a/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRT_DetDescrDB_ParameterInterface.cxx
+++ b/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRT_DetDescrDB_ParameterInterface.cxx
@@ -14,7 +14,7 @@
 #include "InDetGeoModelUtils/InDetDDAthenaComps.h"
 
 //_________________________________________________________________________________________
-TRT_DetDescrDB_ParameterInterface::TRT_DetDescrDB_ParameterInterface(const InDetDD::AthenaComps * athenaComps) :
+TRT_DetDescrDB_ParameterInterface::TRT_DetDescrDB_ParameterInterface(InDetDD::AthenaComps * athenaComps) :
   TRTParameterInterface(),  m_athenaComps(athenaComps), m_distortedMatManager(0), m_placements(0)
 { SetValues(); }
 
@@ -53,7 +53,7 @@ TRT_DetDescrDB_ParameterInterface::~TRT_DetDescrDB_ParameterInterface() {
 }
 
 //_________________________________________________________________________________________
-void TRT_DetDescrDB_ParameterInterface::SetValues ATLAS_NOT_THREAD_SAFE () { // Thread unsafe AthenaComps::rdbAccessSvc const method is used.
+void TRT_DetDescrDB_ParameterInterface::SetValues() {
 
   /////////////////////////////////////////////////////////////////////////////////////////
   //                                 Initialize Services                                 //
diff --git a/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRT_DetDescrDB_ParameterInterface.h b/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRT_DetDescrDB_ParameterInterface.h
index 704469026c0590703c2c06cc4e5d5322d29b6c04..f28529a3f1ddd31b66b2fd9a22ebae56eef097dd 100755
--- a/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRT_DetDescrDB_ParameterInterface.h
+++ b/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRT_DetDescrDB_ParameterInterface.h
@@ -23,7 +23,7 @@ public:
 
    
   // Only allowed constructor
-  TRT_DetDescrDB_ParameterInterface(const InDetDD::AthenaComps * athenaComps) ATLAS_CTORDTOR_NOT_THREAD_SAFE; // Thread unsafe SetValues method is used.
+  TRT_DetDescrDB_ParameterInterface(InDetDD::AthenaComps * athenaComps);
 
   ~TRT_DetDescrDB_ParameterInterface();
   // delete copy c'tor
@@ -49,7 +49,7 @@ public:
   
 private:
 
-  const InDetDD::AthenaComps * m_athenaComps;
+  InDetDD::AthenaComps * m_athenaComps;
 
   const InDetDD::DistortedMaterialManager * m_distortedMatManager;
   TopLevelPlacements * m_placements;
diff --git a/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRT_DetectorTool.cxx b/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRT_DetectorTool.cxx
index b14adda18339446810d53b1713c54b84780e2adb..ffe15af57e624747300bb8bea9a567b199a25752 100755
--- a/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRT_DetectorTool.cxx
+++ b/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRT_DetectorTool.cxx
@@ -68,7 +68,7 @@ TRT_DetectorTool::~TRT_DetectorTool()
 
 //////////////  Create the Detector Node corresponding to this tool //////////////
 //
-StatusCode TRT_DetectorTool::create ATLAS_NOT_THREAD_SAFE () // Thread unsafe TRTDetectorFactory_Full class is used.
+StatusCode TRT_DetectorTool::create()
 { 
 
   // Get the detector configuration.
diff --git a/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRT_DetectorTool.h b/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRT_DetectorTool.h
index df96a5f6705b8529b9b75f5f75ab1c7e82947f69..7d6a696c3f1594d2b11f6eb1689e40f198394bea 100755
--- a/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRT_DetectorTool.h
+++ b/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRT_DetectorTool.h
@@ -9,6 +9,7 @@
 #include "GaudiKernel/ToolHandle.h"
 #include "GaudiKernel/ServiceHandle.h"
 #include "TRT_ConditionsServices/ITRT_StrawStatusSummaryTool.h" //for Argon
+#include "CxxUtils/checker_macros.h"
 #include <string>
 
 ////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -37,8 +38,8 @@ public:
     virtual StatusCode create() override final;
     virtual StatusCode clear() override final;
 
-    // Register callback function on ConDB object
-    virtual StatusCode registerCallback() override final;
+    // Register callback function on CondDB object
+    virtual StatusCode registerCallback ATLAS_NOT_THREAD_SAFE () override final;
 
     // Callback function itself
     virtual StatusCode align(IOVSVC_CALLBACK_ARGS) override final;
diff --git a/InnerDetector/InDetDetDescr/TRT_ReadoutGeometry/TRT_ReadoutGeometry/TRT_DetectorManager.h b/InnerDetector/InDetDetDescr/TRT_ReadoutGeometry/TRT_ReadoutGeometry/TRT_DetectorManager.h
index 28eaa8410bc537872814776e90515581e5871df8..79b19bc58359f481cc842b4d041b0da32010f124 100755
--- a/InnerDetector/InDetDetDescr/TRT_ReadoutGeometry/TRT_ReadoutGeometry/TRT_DetectorManager.h
+++ b/InnerDetector/InDetDetDescr/TRT_ReadoutGeometry/TRT_ReadoutGeometry/TRT_DetectorManager.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
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -28,6 +28,8 @@
 
 #include "InDetReadoutGeometry/InDetDD_Defs.h"
 
+#include "CxxUtils/checker_macros.h"
+
 #include <map>
 #include <memory>
 #include <set>
@@ -170,7 +172,7 @@ namespace InDetDD {
 
     // Alignment stuff
     // DEPRECATED - kept for compatibilty with Lisbon CondDB
-    void addKey(const std::string & key, int level);
+    void addKey ATLAS_NOT_THREAD_SAFE (const std::string & key, int level);
     // DEPRECATED use addChannel
     void addKey(const std::string & key, int level, FrameType frame);
 
diff --git a/InnerDetector/InDetDigitization/BCM_Digitization/python/BCM_DigitizationConfigNew.py b/InnerDetector/InDetDigitization/BCM_Digitization/python/BCM_DigitizationConfigNew.py
index 67941c9cade900429cf636551b46087f973575d0..3882f4e4191668ff0cd7209003542b60add772ef 100644
--- a/InnerDetector/InDetDigitization/BCM_Digitization/python/BCM_DigitizationConfigNew.py
+++ b/InnerDetector/InDetDigitization/BCM_Digitization/python/BCM_DigitizationConfigNew.py
@@ -9,6 +9,7 @@ from PixelGeoModel.PixelGeoModelConfig import PixelGeometryCfg
 from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
 from Digitization.TruthDigitizationOutputConfig import TruthDigitizationOutputCfg
 from Digitization.PileUpToolsConfig import PileUpToolsCfg
+from Digitization.PileUpMergeSvcConfigNew import PileUpMergeSvcCfg, PileUpXingFolderCfg
 
 
 # The earliest and last bunch crossing times for which interactions will be sent
@@ -28,11 +29,10 @@ def BCM_RangeCfg(flags, name="BCM_Range", **kwargs):
     # Default 0 no dataproxy reset
     kwargs.setdefault("CacheRefreshFrequency", 1.0)
     kwargs.setdefault("ItemList", ["SiHitCollection#BCMHits"])
-    PileUpXingFolder = CompFactory.PileUpXingFolder
-    return PileUpXingFolder(name, **kwargs)
+    return PileUpXingFolderCfg(flags, name, **kwargs)
 
 
-def BCM_DigitizationToolCfg(flags, name="BCM_DigitizationTool", **kwargs):
+def BCM_DigitizationToolCommonCfg(flags, name="BCM_DigitizationTool", **kwargs):
     """Return a ComponentAccumulator with configured BCM_DigitizationTool"""
     # take initial ComponentAccumulator from RNG
     acc = RNG(flags.Random.Engine)
@@ -64,12 +64,30 @@ def BCM_DigitizationToolCfg(flags, name="BCM_DigitizationTool", **kwargs):
     if flags.Digitization.DoXingByXingPileUp:
         kwargs.setdefault("FirstXing", BCM_FirstXing())
         kwargs.setdefault("LastXing",  BCM_LastXing())
-    
+
     BCM_DigitizationTool = CompFactory.BCM_DigitizationTool
     acc.setPrivateTools(BCM_DigitizationTool(name, **kwargs))
     return acc
 
 
+def BCM_DigitizationToolCfg(flags, name="BCM_DigitizationTool", **kwargs):
+    """Return ComponentAccumulator with BCM_DigitizationTool for non-overlay"""
+    acc = ComponentAccumulator()
+    rangetool = acc.popToolsAndMerge(BCM_RangeCfg(flags))
+    acc.merge(PileUpMergeSvcCfg(flags, Intervals=rangetool))
+    tool = acc.popToolsAndMerge(BCM_DigitizationToolCommonCfg(flags, name))
+    acc.setPrivateTools(tool)
+    return acc
+
+
+def BCM_OverlayDigitizationToolCfg(flags, name="BCM_OverlayDigitizationTool", **kwargs):
+    """Return ComponentAccumulator with BCM_DigitizationTool for Overlay"""
+    acc = ComponentAccumulator()
+    tool = acc.popToolsAndMerge(BCM_DigitizationToolCommonCfg(flags, name))
+    acc.setPrivateTools(tool)
+    return acc
+
+
 def BCM_OutputCfg(flags):
     """Return ComponentAccumulator with Output for BCM. Not standalone."""
     acc = ComponentAccumulator()
@@ -85,6 +103,8 @@ def BCM_OutputCfg(flags):
 def BCM_DigitizationBasicCfg(flags, **kwargs):
     """Return ComponentAccumulator for BCM digitization"""
     acc = PixelGeometryCfg(flags)
+    rangetool = acc.popToolsAndMerge(BCM_RangeCfg(flags))
+    acc.merge(PileUpMergeSvcCfg(flags, Intervals=rangetool))
     if "PileUpTools" not in kwargs:
         PileUpTools = acc.popToolsAndMerge(BCM_DigitizationToolCfg(flags))
         kwargs["PileUpTools"] = PileUpTools
@@ -97,7 +117,7 @@ def BCM_OverlayDigitizationBasicCfg(flags, name="BCM_OverlayDigitization", **kwa
     acc = PixelGeometryCfg(flags)
 
     if "DigitizationTool" not in kwargs:
-        tool = acc.popToolsAndMerge(BCM_DigitizationToolCfg(flags, name="BCM_OverlayDigitizationTool"))
+        tool = acc.popToolsAndMerge(BCM_OverlayDigitizationToolCfg(flags))
         kwargs["DigitizationTool"] = tool
 
     if flags.Concurrency.NumThreads > 0:
diff --git a/InnerDetector/InDetDigitization/FastTRT_Digitization/src/TRTFastDigitizationTool.cxx b/InnerDetector/InDetDigitization/FastTRT_Digitization/src/TRTFastDigitizationTool.cxx
index 58cd1b8c9eb89fbfa44adddffb427d34de7652c1..38913f15bc9ce534587bec497789da59283e92fa 100644
--- a/InnerDetector/InDetDigitization/FastTRT_Digitization/src/TRTFastDigitizationTool.cxx
+++ b/InnerDetector/InDetDigitization/FastTRT_Digitization/src/TRTFastDigitizationTool.cxx
@@ -760,7 +760,7 @@ bool TRTFastDigitizationTool::isArgonStraw( const Identifier &straw_id ) const
 int TRTFastDigitizationTool::gasType( const Identifier &straw_id ) const
 {
   // getStatusHT returns enum EStatus { Undefined, Dead, Good, Xenon, Argon, Krypton } // from 20.7.1
-  //see InnerDetector/InDetConditions/TRT_ConditionsData/TRT_ConditionsData/StrawStatus.h
+  // see InnerDetector/InDetConditions/TRT_ConditionsData/TRT_ConditionsData/StrawStatus.h
   // TRT representation of gasType = Xenon: 0, Argon: 1, Krypton: 2
 
   int status = m_trtStrawStatusSummaryTool->getStatusHT( straw_id );
diff --git a/InnerDetector/InDetDigitization/PixelDigitization/python/PixelDigitizationConfigNew.py b/InnerDetector/InDetDigitization/PixelDigitization/python/PixelDigitizationConfigNew.py
index 64e5ff85bc7c5403162e5f5256d0197378033c2b..b133d30a5f7da084f47f6119bac95b42904f8b56 100644
--- a/InnerDetector/InDetDigitization/PixelDigitization/python/PixelDigitizationConfigNew.py
+++ b/InnerDetector/InDetDigitization/PixelDigitization/python/PixelDigitizationConfigNew.py
@@ -21,6 +21,7 @@ from PixelConditionsTools.PixelConditionsSummaryConfig import PixelConditionsSum
 from PixelGeoModel.PixelGeoModelConfig import PixelGeometryCfg
 from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
 from Digitization.TruthDigitizationOutputConfig import TruthDigitizationOutputCfg
+from Digitization.PileUpMergeSvcConfigNew import PileUpMergeSvcCfg, PileUpXingFolderCfg
 
 
 # The earliest and last bunch crossing times for which interactions will be sent
@@ -207,38 +208,62 @@ def PixelDigitizationBasicToolCfg(flags, name="PixelDigitizationBasicTool", **kw
 
 def PixelDigitizationToolCfg(flags, name="PixelDigitizationTool", **kwargs):
     """Return ComponentAccumulator with configured BasicPixelDigitizationTool"""
+    acc = ComponentAccumulator()
+    rangetool = acc.popToolsAndMerge(PixelRangeCfg(flags))
+    acc.merge(PileUpMergeSvcCfg(flags, Intervals=rangetool))
     kwargs.setdefault("HardScatterSplittingMode", 0)
-    return PixelDigitizationBasicToolCfg(flags, name, **kwargs)
+    tool = acc.popToolsAndMerge(PixelDigitizationBasicToolCfg(flags, name, **kwargs))
+    acc.setPrivateTools(tool)
+    return acc
 
 
 def PixelGeantinoTruthDigitizationToolCfg(flags, name="PixelGeantinoTruthDigitizationTool", **kwargs):
     """Return configured PixelDigitizationTool"""
+    acc = ComponentAccumulator()
+    rangetool = acc.popToolsAndMerge(PixelRangeCfg(flags))
+    acc.merge(PileUpMergeSvcCfg(flags, Intervals=rangetool))
     kwargs.setdefault("ParticleBarcodeVeto", 0)
     PixelDigitizationTool = CompFactory.PixelDigitizationTool
-    return PixelDigitizationTool(name, **kwargs)
+    acc.setPrivateTools(PixelDigitizationTool(name, **kwargs))
+    return acc
 
 
 def PixelDigitizationHSToolCfg(flags, name="PixelDigitizationHSTool", **kwargs):
     """Return ComponentAccumulator with PixelDigitizationTool configured for Hard Scatter"""
+    acc = ComponentAccumulator()
+    rangetool = acc.popToolsAndMerge(PixelRangeCfg(flags))
+    acc.merge(PileUpMergeSvcCfg(flags, Intervals=rangetool))
     kwargs.setdefault("HardScatterSplittingMode", 1)
-    return PixelDigitizationBasicToolCfg(flags, name, **kwargs)
+    tool = acc.popToolsAndMerge(PixelDigitizationBasicToolCfg(flags, name, **kwargs))
+    acc.setPrivateTools(tool)
+    return acc
 
 
 def PixelDigitizationPUToolCfg(flags, name="PixelDigitizationPUTool", **kwargs):
     """Return ComponentAccumulator with PixelDigitizationTool configured for PileUp"""
+    acc = ComponentAccumulator()
+    rangetool = acc.popToolsAndMerge(PixelRangeCfg(flags))
+    acc.merge(PileUpMergeSvcCfg(flags, Intervals=rangetool))
     kwargs.setdefault("HardScatterSplittingMode", 2)
     kwargs.setdefault("RDOCollName", "Pixel_PU_RDOs")
     kwargs.setdefault("SDOCollName", "Pixel_PU_SDO_Map")
-    return PixelDigitizationBasicToolCfg(flags, name, **kwargs)
+    tool = acc.popToolsAndMerge(PixelDigitizationBasicToolCfg(flags, name, **kwargs))
+    acc.setPrivateTools(tool)
+    return acc
 
 
 def PixelDigitizationSplitNoMergePUToolCfg(flags, name="PixelDigitizationSplitNoMergePUTool", **kwargs):
     """Return ComponentAccumulator with PixelDigitizationTool configured for PileUpPixelHits"""
+    acc = ComponentAccumulator()
+    rangetool = acc.popToolsAndMerge(PixelRangeCfg(flags))
+    acc.merge(PileUpMergeSvcCfg(flags, Intervals=rangetool))
     kwargs.setdefault("HardScatterSplittingMode", 0)
     kwargs.setdefault("InputObjectName", "PileupPixelHits")
     kwargs.setdefault("RDOCollName", "Pixel_PU_RDOs")
     kwargs.setdefault("SDOCollName", "Pixel_PU_SDO_Map")
-    return PixelDigitizationBasicToolCfg(flags, name, **kwargs)
+    tool = acc.popToolsAndMerge(PixelDigitizationBasicToolCfg(flags, name, **kwargs))
+    acc.setPrivateTools(tool)
+    return acc
 
 
 def PixelOverlayDigitizationToolCfg(flags, name="PixelOverlayDigitizationTool", **kwargs):
@@ -256,8 +281,7 @@ def PixelRangeCfg(flags, name="PixelRange", **kwargs):
     kwargs.setdefault("LastXing", Pixel_LastXing(flags))
     kwargs.setdefault("CacheRefreshFrequency", 1.0) # default 0 no dataproxy reset
     kwargs.setdefault("ItemList", ["SiHitCollection#PixelHits"])
-    PileUpXingFolder = CompFactory.PileUpXingFolder
-    return PileUpXingFolder(name, **kwargs)
+    return PileUpXingFolderCfg(flags, name, **kwargs)
 
 
 def PixelOutputCfg(flags):
diff --git a/InnerDetector/InDetDigitization/PixelDigitization/src/SensorSim3DTool.cxx b/InnerDetector/InDetDigitization/PixelDigitization/src/SensorSim3DTool.cxx
index 2f3474393ed4d5c6cb4438477c904032d92d63b7..7d783d4d5054e52dbe002662cd3e8570d88309ca 100644
--- a/InnerDetector/InDetDigitization/PixelDigitization/src/SensorSim3DTool.cxx
+++ b/InnerDetector/InDetDigitization/PixelDigitization/src/SensorSim3DTool.cxx
@@ -598,7 +598,7 @@ double SensorSim3DTool::getMobility(double electricField, bool isHoleBit) {
   double ecrit = 0;
   double beta = 0;
 
-  //These parameterizations come from C. Jacoboni et al., Solid‐State Electronics 20 (1977) 77‐89. (see also https://cds.cern.ch/record/684187/files/indet-2001-004.pdf).
+  //These parameterizations come from C. Jacoboni et al., Solid-State Electronics 20 (1977) 77-89. (see also https://cds.cern.ch/record/684187/files/indet-2001-004.pdf).
 
   if (!isHoleBit) {
     vsat = 15.3 * pow(m_temperature, -0.87); // mm/ns
diff --git a/InnerDetector/InDetDigitization/PixelDigitization/test/PixelDigitizationConfigNew_test.py b/InnerDetector/InDetDigitization/PixelDigitization/test/PixelDigitizationConfigNew_test.py
index c24d8f88cf320c6ec61d3bf006e0e16fc7e9400c..1ecfd86a20357384f49c47c00644438a32ef01d7 100755
--- a/InnerDetector/InDetDigitization/PixelDigitization/test/PixelDigitizationConfigNew_test.py
+++ b/InnerDetector/InDetDigitization/PixelDigitization/test/PixelDigitizationConfigNew_test.py
@@ -7,21 +7,11 @@ import sys
 from AthenaCommon.Logging import log
 from AthenaCommon.Constants import DEBUG
 from AthenaCommon.Configurable import Configurable
-from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
 from AthenaConfiguration.AllConfigFlags import ConfigFlags
 from AthenaConfiguration.MainServicesConfig import MainServicesCfg
 from AthenaConfiguration.TestDefaults import defaultTestFiles
 from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
-from PixelGeoModel.PixelGeoModelConfig import PixelGeometryCfg
-from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
-from PixelDigitization.PixelDigitizationConfigNew import (
-    ChargeCollProbSvcCfg, EnergyDepositionToolCfg, SensorSimPlanarToolCfg, SensorSim3DToolCfg,
-    BarrelRD53SimToolCfg, EndcapRD53SimToolCfg, BarrelFEI4SimToolCfg, DBMFEI4SimToolCfg,
-    BarrelFEI3SimToolCfg, EndcapFEI3SimToolCfg, PixelDigitizationBasicToolCfg, PixelDigitizationToolCfg,
-    PixelGeantinoTruthDigitizationToolCfg, PixelDigitizationHSToolCfg, PixelDigitizationPUToolCfg,
-    PixelDigitizationSplitNoMergePUToolCfg, PixelDigitizationOverlayToolCfg, PixelRangeCfg,
-    PixelDigitizationHSCfg, PixelDigitizationPUCfg, PixelDigitizationOverlayCfg,
-)
+from PixelDigitization.PixelDigitizationConfigNew import PixelDigitizationHSCfg
 
 # Set up logging and new style config
 log.setLevel(DEBUG)
diff --git a/InnerDetector/InDetDigitization/SCT_Digitization/python/SCT_DigitizationConfigNew.py b/InnerDetector/InDetDigitization/SCT_Digitization/python/SCT_DigitizationConfigNew.py
index c3615af60448b45c3725e05979c35b96bf8521f8..6f64115c6b9a2ed3c52311b62ffc06f705d743be 100644
--- a/InnerDetector/InDetDigitization/SCT_Digitization/python/SCT_DigitizationConfigNew.py
+++ b/InnerDetector/InDetDigitization/SCT_Digitization/python/SCT_DigitizationConfigNew.py
@@ -14,6 +14,7 @@ from SiPropertiesTool.SCT_SiPropertiesConfig import SCT_SiPropertiesCfg
 from SiLorentzAngleTool.SCT_LorentzAngleConfig import SCT_LorentzAngleCfg
 from Digitization.TruthDigitizationOutputConfig import TruthDigitizationOutputCfg
 from Digitization.PileUpToolsConfig import PileUpToolsCfg
+from Digitization.PileUpMergeSvcConfigNew import PileUpMergeSvcCfg, PileUpXingFolderCfg
 
 import AthenaCommon.SystemOfUnits as Units
 
@@ -55,6 +56,9 @@ def SCT_DigitizationCommonCfg(flags, name="SCT_DigitizationToolCommon", **kwargs
 
 def SCT_DigitizationToolCfg(flags, name="SCT_DigitizationTool", **kwargs):
     """Return ComponentAccumulator with configured SCT digitization tool"""
+    acc = ComponentAccumulator()
+    rangetool = acc.popToolsAndMerge(SCT_RangeCfg(flags))
+    acc.merge(PileUpMergeSvcCfg(flags, Intervals=rangetool))
     if flags.Digitization.PileUpPremixing:
         kwargs.setdefault("OutputObjectName", flags.Overlay.BkgPrefix + "SCT_RDOs")
         kwargs.setdefault("OutputSDOName", flags.Overlay.BkgPrefix + "SCT_SDO_Map")
@@ -62,23 +66,35 @@ def SCT_DigitizationToolCfg(flags, name="SCT_DigitizationTool", **kwargs):
         kwargs.setdefault("OutputObjectName", "SCT_RDOs")
         kwargs.setdefault("OutputSDOName", "SCT_SDO_Map")
     kwargs.setdefault("HardScatterSplittingMode", 0)
-    return SCT_DigitizationCommonCfg(flags, name, **kwargs)
+    tool = acc.popToolsAndMerge(SCT_DigitizationCommonCfg(flags, name, **kwargs))
+    acc.setPrivateTools(tool)
+    return acc
 
 
 def SCT_DigitizationHSToolCfg(flags, name="SCT_DigitizationHSTool", **kwargs):
     """Return ComponentAccumulator with hard scatter configured SCT digitization tool"""
+    acc = ComponentAccumulator()
+    rangetool = acc.popToolsAndMerge(SCT_RangeCfg(flags))
+    acc.merge(PileUpMergeSvcCfg(flags, Intervals=rangetool))
     kwargs.setdefault("OutputObjectName", "SCT_RDOs")
     kwargs.setdefault("OutputSDOName", "SCT_SDO_Map")
     kwargs.setdefault("HardScatterSplittingMode", 1)
-    return SCT_DigitizationCommonCfg(flags, name, **kwargs)
+    tool = acc.popToolsAndMerge(SCT_DigitizationCommonCfg(flags, name, **kwargs))
+    acc.setPrivateTools(tool)
+    return acc
 
 
 def SCT_DigitizationPUToolCfg(flags, name="SCT_DigitizationPUTool",**kwargs):
     """Return ComponentAccumulator with pileup configured SCT digitization tool"""
+    acc = ComponentAccumulator()
+    rangetool = acc.popToolsAndMerge(SCT_RangeCfg(flags))
+    acc.merge(PileUpMergeSvcCfg(flags, Intervals=rangetool))
     kwargs.setdefault("OutputObjectName", "SCT_PU_RDOs")
     kwargs.setdefault("OutputSDOName", "SCT_PU_SDO_Map")
     kwargs.setdefault("HardScatterSplittingMode", 2)
-    return SCT_DigitizationCommonCfg(flags, name, **kwargs)
+    tool = acc.popToolsAndMerge(SCT_DigitizationCommonCfg(flags, name, **kwargs))
+    acc.setPrivateTools(tool)
+    return acc
 
 
 def SCT_OverlayDigitizationToolCfg(flags, name="SCT_OverlayDigitizationTool",**kwargs):
@@ -95,13 +111,18 @@ def SCT_OverlayDigitizationToolCfg(flags, name="SCT_OverlayDigitizationTool",**k
 
 def SCT_DigitizationToolSplitNoMergePUCfg(flags, name="SCT_DigitizationToolSplitNoMergePU",**kwargs):
     """Return ComponentAccumulator with merged pileup configured SCT digitization tool"""
+    acc = ComponentAccumulator()
+    rangetool = acc.popToolsAndMerge(SCT_RangeCfg(flags))
+    acc.merge(PileUpMergeSvcCfg(flags, Intervals=rangetool))
     kwargs.setdefault("InputObjectName", "PileupSCT_Hits")
     kwargs.setdefault("HardScatterSplittingMode", 0)
     kwargs.setdefault("OutputObjectName", "SCT_PU_RDOs")
     kwargs.setdefault("OutputSDOName", "SCT_PU_SDO_Map")
     kwargs.setdefault("OnlyHitElements", True)
     kwargs.setdefault("FrontEnd", "PileupSCT_FrontEnd")
-    return SCT_DigitizationCommonCfg(flags, name, **kwargs)
+    tool = acc.popToolsAndMerge(SCT_DigitizationCommonCfg(flags, name, **kwargs))
+    acc.setPrivateTools(tool)
+    return acc
 
 
 def SCT_DigitizationToolGeantinoTruthCfg(flags, name="SCT_GeantinoTruthDigitizationTool", **kwargs):
@@ -227,14 +248,14 @@ def SCT_FrontEndPileupCfg(flags, name="PileupSCT_FrontEnd", **kwargs):
     kwargs.setdefault("NoiseOn", False)
     return SCT_FrontEndCfg(flags, name, **kwargs)
 
+
 def SCT_RangeCfg(flags, name="SiliconRange", **kwargs):
     """Return an SCT configured PileUpXingFolder tool"""
     kwargs.setdefault("FirstXing", SCT_FirstXing())
     kwargs.setdefault("LastXing", SCT_LastXing())
     kwargs.setdefault("CacheRefreshFrequency", 1.0) # default 0 no dataproxy reset
     kwargs.setdefault("ItemList", ["SiHitCollection#SCT_Hits"] )
-    PileUpXingFolder = CompFactory.PileUpXingFolder
-    return PileUpXingFolder(name, **kwargs)
+    return PileUpXingFolderCfg(flags, name, **kwargs)
 
 
 def SCT_OutputCfg(flags):
diff --git a/InnerDetector/InDetDigitization/TRT_Digitization/python/TRT_DigitizationConfigNew.py b/InnerDetector/InDetDigitization/TRT_Digitization/python/TRT_DigitizationConfigNew.py
index 05ea43ed8e2a627194f0cbe57d06b34c11c561de..1aeb4207ed65e6a379d46ee689b674cc429cd102 100644
--- a/InnerDetector/InDetDigitization/TRT_Digitization/python/TRT_DigitizationConfigNew.py
+++ b/InnerDetector/InDetDigitization/TRT_Digitization/python/TRT_DigitizationConfigNew.py
@@ -12,6 +12,7 @@ from TRT_PAI_Process.TRT_PAI_ProcessConfigNew import TRT_PAI_Process_KrToolCfg
 from IOVDbSvc.IOVDbSvcConfig import addFolders
 from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
 from Digitization.PileUpToolsConfig import PileUpToolsCfg
+from Digitization.PileUpMergeSvcConfigNew import PileUpMergeSvcCfg, PileUpXingFolderCfg
 from Digitization.TruthDigitizationOutputConfig import TruthDigitizationOutputCfg
 
 
@@ -31,8 +32,7 @@ def TRT_RangeCfg(flags, name="TRTRange", **kwargs):
     kwargs.setdefault("LastXing", TRT_LastXing())
     kwargs.setdefault("CacheRefreshFrequency", 1.0) #default 0 no dataproxy reset
     kwargs.setdefault("ItemList", ["TRTUncompressedHitCollection#TRTUncompressedHits"])
-    PileUpXingFolder = CompFactory.PileUpXingFolder
-    return PileUpXingFolder(name, **kwargs)
+    return PileUpXingFolderCfg(flags, name, **kwargs)
 
 
 def TRT_DigitizationBasicToolCfg(flags, name="TRT_DigitizationBasicTool", **kwargs):
@@ -69,8 +69,12 @@ def TRT_DigitizationBasicToolCfg(flags, name="TRT_DigitizationBasicTool", **kwar
     acc.setPrivateTools(tool)
     return acc
 
+
 def TRT_DigitizationToolCfg(flags, name="TRTDigitizationTool", **kwargs):
     """Return ComponentAccumulator with configured TRT digitization tool"""
+    acc = ComponentAccumulator()
+    rangetool = acc.popToolsAndMerge(TRT_RangeCfg(flags))
+    acc.merge(PileUpMergeSvcCfg(flags, Intervals=rangetool))
     if flags.Digitization.PileUpPremixing:
         kwargs.setdefault("OutputObjectName", flags.Overlay.BkgPrefix + "TRT_RDOs")
         kwargs.setdefault("OutputSDOName", flags.Overlay.BkgPrefix + "TRT_SDO_Map")
@@ -78,40 +82,61 @@ def TRT_DigitizationToolCfg(flags, name="TRTDigitizationTool", **kwargs):
         kwargs.setdefault("OutputObjectName", "TRT_RDOs")
         kwargs.setdefault("OutputSDOName", "TRT_SDO_Map")
     kwargs.setdefault("HardScatterSplittingMode", 0)
-    return TRT_DigitizationBasicToolCfg(flags, name, **kwargs)
+    tool = acc.popToolsAndMerge(TRT_DigitizationBasicToolCfg(flags, name, **kwargs))
+    acc.setPrivateTools(tool)
+    return acc
 
 
 def TRT_DigitizationGeantinoTruthToolCfg(flags, name="TRT_GeantinoTruthDigitizationTool", **kwargs):
     """Return ComponentAccumulator with Geantino configured TRT digitization tool"""
+    acc = ComponentAccumulator()
+    rangetool = acc.popToolsAndMerge(TRT_RangeCfg(flags))
+    acc.merge(PileUpMergeSvcCfg(flags, Intervals=rangetool))
     kwargs.setdefault("ParticleBarcodeVeto", 0)
-    return TRT_DigitizationToolCfg(flags, name, **kwargs)
+    tool = acc.popToolsAndMerge(TRT_DigitizationToolCfg(flags, name, **kwargs))
+    acc.setPrivateTools(tool)
+    return acc
 
 
 def TRT_DigitizationHSToolCfg(flags, name="TRT_DigitizationToolHS", **kwargs):
     """Return ComponentAccumulator with Hard Scatter configured TRT digitization tool"""
+    acc = ComponentAccumulator()
+    rangetool = acc.popToolsAndMerge(TRT_RangeCfg(flags))
+    acc.merge(PileUpMergeSvcCfg(flags, Intervals=rangetool))
     kwargs.setdefault("OutputObjectName", "TRT_RDOs")
     kwargs.setdefault("OutputSDOName", "TRT_SDO_Map")
     kwargs.setdefault("HardScatterSplittingMode", 1)
-    return TRT_DigitizationBasicToolCfg(flags, name, **kwargs)
+    tool = acc.popToolsAndMerge(TRT_DigitizationBasicToolCfg(flags, name, **kwargs))
+    acc.setPrivateTools(tool)
+    return acc
 
 
 def TRT_DigitizationPUToolCfg(flags, name="TRT_DigitizationToolPU", **kwargs):
     """Return ComponentAccumulator with Pile Up configured TRT digitization tool"""
+    acc = ComponentAccumulator()
+    rangetool = acc.popToolsAndMerge(TRT_RangeCfg(flags))
+    acc.merge(PileUpMergeSvcCfg(flags, Intervals=rangetool))
     kwargs.setdefault("OutputObjectName", "TRT_PU_RDOs")
     kwargs.setdefault("OutputSDOName", "TRT_PU_SDO_Map")
     kwargs.setdefault("HardScatterSplittingMode", 2)
-    return TRT_DigitizationBasicToolCfg(flags, name, **kwargs)
+    acc.merge(TRT_DigitizationBasicToolCfg(flags, name, **kwargs))
+    return acc
 
 
 def TRT_DigitizationSplitNoMergePUToolCfg(flags, name="TRT_DigitizationToolSplitNoMergePU", **kwargs):
     """Return ComponentAccumulator with PileUpTRT_Hits configured TRT digitization tool"""
+    acc = ComponentAccumulator()
+    rangetool = acc.popToolsAndMerge(TRT_RangeCfg(flags))
+    acc.merge(PileUpMergeSvcCfg(flags, Intervals=rangetool))
     kwargs.setdefault("HardScatterSplittingMode", 0)
     kwargs.setdefault("DataObjectName", "PileupTRTUncompressedHits")
     kwargs.setdefault("OutputObjectName", "TRT_PU_RDOs")
     kwargs.setdefault("OutputSDOName", "TRT_PU_SDO_Map")
     kwargs.setdefault("Override_noiseInSimhits", 0)
     kwargs.setdefault("Override_noiseInUnhitStraws", 0)
-    return TRT_DigitizationBasicToolCfg(flags, name, **kwargs)
+    tool = acc.popToolsAndMerge(TRT_DigitizationBasicToolCfg(flags, name, **kwargs))
+    acc.setPrivateTools(tool)
+    return acc
 
 
 def TRT_OverlayDigitizationToolCfg(flags, name="TRT_OverlayDigitizationTool", **kwargs):
diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/InDetEventAthenaPool/InDetEventAthenaPoolCnvDict.h b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/InDetEventAthenaPool/InDetEventAthenaPoolCnvDict.h
index abf7ea017fef90ef6eebcb581d7870878e986f8f..c906216533e98f09ebafc1ac21bbe39402724441 100644
--- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/InDetEventAthenaPool/InDetEventAthenaPoolCnvDict.h
+++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/InDetEventAthenaPool/InDetEventAthenaPoolCnvDict.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 INDETEVENTATHENAPOOLDICT_H
@@ -18,6 +18,7 @@
 #include "InDetEventAthenaPool/InDetRawDataCollection_p1.h"
 #include "InDetEventAthenaPool/InDetRawDataContainer_p1.h"
 #include "InDetEventAthenaPool/InDetRawDataContainer_p2.h"
+#include "InDetEventAthenaPool/InDetRawDataContainer_p3.h"
 #include "InDetEventAthenaPool/SCT_RawDataContainer_p1.h"
 #include "InDetEventAthenaPool/SCT_RawDataContainer_p2.h"
 #include "InDetEventAthenaPool/SCT_RawDataContainer_p3.h"
diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/InDetEventAthenaPool/InDetRawDataContainer_p3.h b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/InDetEventAthenaPool/InDetRawDataContainer_p3.h
new file mode 100644
index 0000000000000000000000000000000000000000..bd9bb5002cd6d947dfab7e431a5bf2da5a8295e0
--- /dev/null
+++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/InDetEventAthenaPool/InDetRawDataContainer_p3.h
@@ -0,0 +1,33 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef INDETRAWDATACONTAINER_P3_H
+#define INDETRAWDATACONTAINER_P3_H
+
+/*
+   For the TRT, the channel Ids are dropped from the persistent container and so
+   the p2 version "std::vector<InDetRawData_p2> m_rawdata;" is replaced with
+   the p3 version "std::vector<unsigned int>    m_rawdata;".
+*/
+
+#include <vector>
+#include <string>
+#include "InDetEventAthenaPool/InDetRawDataCollection_p1.h"
+
+class InDetRawDataContainer_p3
+{
+ public:
+/// Default constructor
+  InDetRawDataContainer_p3 ();
+  friend class TRT_LoLumRawDataContainerCnv_p3;
+ private:
+  std::vector<InDetRawDataCollection_p1>  m_collections;
+  std::vector<unsigned int>               m_rawdata;
+};
+
+// inlines
+inline
+InDetRawDataContainer_p3::InDetRawDataContainer_p3 () {}
+
+#endif
diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/InDetEventAthenaPool/selection.xml b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/InDetEventAthenaPool/selection.xml
index 04f9a62a2feb8391d38c878c5614c8e71e2b774a..6ec53a8d40f7e8878ac8493e3df70673a999c14b 100644
--- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/InDetEventAthenaPool/selection.xml
+++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/InDetEventAthenaPool/selection.xml
@@ -29,6 +29,7 @@
   <class name="std::vector<SCT3_RawData_p4>" />
   <class name="InDetRawDataContainer_p1" id="DA76970C-E019-43D2-B2F9-25660DCECD9D" />
   <class name="InDetRawDataContainer_p2" id="7138342E-0A80-4A32-A387-2842A01C2539" />
+  <class name="InDetRawDataContainer_p3" id="D0313948-9BC8-415F-BE58-7BA8178F93CD" />
   <class name="SCT_RawDataContainer_p1" id="8E13963E-13E5-4D10-AA8B-73F00AFF8FA8" />
   <class name="SCT_RawDataContainer_p2" id="D1258125-2CBA-476E-8578-E09D54F477E1" />
   <class name="SCT_RawDataContainer_p3" id="5FBC8D4D-7B4D-433A-8487-0EA0C870CBDB" />
diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/TRT_LoLumRawDataContainerCnv_p3.cxx b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/TRT_LoLumRawDataContainerCnv_p3.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..2315df926a59ed418f71b9ba745dd5f6c32b4006
--- /dev/null
+++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/TRT_LoLumRawDataContainerCnv_p3.cxx
@@ -0,0 +1,240 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+#include "InDetEventAthenaPool/InDetRawDataCollection_p1.h"
+#include "InDetRawData/TRT_RDO_Container.h"
+#include "InDetIdentifier/TRT_ID.h"
+#include "TRT_LoLumRawDataContainerCnv_p3.h"
+#include "TRT_RDO_Elements.h"
+#include "MsgUtil.h"
+
+void TRT_LoLumRawDataContainerCnv_p3::transToPers(const TRT_RDO_Container* transCont, InDetRawDataContainer_p3* persCont, MsgStream &log)
+{
+
+  // The transient model has a container holding collections (up to 14912 TRT detector elements/modules)
+  // and the collections hold channels (e.g. up to 24 straws in the TRT endcaps). There are a total of 350848 TRT straws.
+  // The persistent model flattens this so that the persistent container has two vectors: 1) all collections, 2) all RDO
+  // The persistent collections then only maintain indexes into the container's vector of all channels.
+  // So here we loop over all collection and add their channels to the container's vector, saving the indexes in the collection.
+
+  // Hard-code the number of collections their ids and their sizes to generate collections and channels for the whole detector
+  const unsigned int dummy_digit=0;
+  const unsigned int trt_number_of_collections=14912;
+  const unsigned int trt_number_of_channels=350848;
+  const unsigned int trt_channel_id_increment=0x20u;
+
+  std::vector<unsigned int> trt_collection_id;   // There are 14912 elements/modules in the TRT
+  std::vector<unsigned int> trt_collection_size; // Each element has a specific number of straws
+
+  set_vectors_of_collection_ids_and_size(trt_collection_id,
+                                         trt_collection_size,
+                                         trt_number_of_collections);
+
+  unsigned int trt_collection_index=0; // module index (0,14911), initialized first collection
+  unsigned int trt_channel_index=0;    // straw index (0,350847)
+  unsigned int trt_channel_id;         // straw id (32-bit), initialized to the first channel in the first collection
+  unsigned int tcoll_id;               // transient collection id from transCont
+  unsigned int tchan_id;               // transient channel id from transCont
+  unsigned int tchan_word;             // transient channel word from transCont
+
+  typedef TRT_RDO_Container TRANS;
+  TRANS::const_iterator it_transColl     = transCont->begin(); // The transient container has an incomplete list of collections
+  TRANS::const_iterator it_transCollEnd  = transCont->end();   // and channels, we can access them with this iterator
+
+  persCont->m_collections.resize(trt_number_of_collections);
+  persCont->m_rawdata.resize(trt_number_of_channels);
+
+  // Loop over all existing transient collections, add missing collections and missing channels
+  for (; it_transColl != it_transCollEnd; it_transColl++) {
+
+    const TRT_RDO_Collection& collection = (**it_transColl);
+    tcoll_id = collection.identify().get_identifier32().get_compact();
+
+    // create collections and channels until we find a match to a transient container
+    while ( trt_collection_id[trt_collection_index] != tcoll_id ) {
+      // The transient collection is missing; create the persistent collection with empty digits
+      trt_channel_id = trt_collection_id[trt_collection_index];
+      InDetRawDataCollection_p1& pcollection = persCont->m_collections[trt_collection_index];
+      pcollection.m_id     = 0;
+      pcollection.m_hashId = 0; // no hashId for this empty collection
+      pcollection.m_begin  = 0;
+      pcollection.m_end    = 0;
+      // Fill all the channels with with empty digits.
+      for (unsigned int i=0; i<trt_collection_size[trt_collection_index]; ++i) {
+        persCont->m_rawdata[trt_channel_index] = dummy_digit;
+        trt_channel_id += trt_channel_id_increment;
+        trt_channel_index++;
+      }
+      trt_collection_index++;
+    }
+
+    // Here we have a match to a transient collection
+    // create the persistent collection just as we did above
+    trt_channel_id = trt_collection_id[trt_collection_index];
+    InDetRawDataCollection_p1& pcollection = persCont->m_collections[trt_collection_index];
+    pcollection.m_id     = 0;
+    pcollection.m_hashId = (unsigned int) collection.identifyHash(); // Required by the overlay alogrithm (not the reco algorithms)
+    pcollection.m_begin  = 0;
+    pcollection.m_end    = 0;
+
+    const unsigned int collection_end = trt_channel_index+trt_collection_size[trt_collection_index];
+
+    // Fill all the channels; some with existing digits, the others with empty digits.
+    for (unsigned int i = 0; i < collection.size(); ++i) {
+
+      // Get the channel id and word from the digitization transient object
+      // We will use the id to determine when to insert missing straws to create a container that represents the complete detector.
+      // We will only store the digit word.
+      const TRT_LoLumRawData* tchan0 = dynamic_cast<const TRT_LoLumRawData*>(collection[i]);
+      tchan_id   = tchan0->identify().get_identifier32().get_compact(); // the i'th channel id in the transient collection
+      tchan_word = tchan0->getWord();                                   // the i'th channel word in the transient collection
+
+      while ( trt_channel_id != tchan_id) {
+        persCont->m_rawdata[trt_channel_index] = dummy_digit;
+        trt_channel_id += trt_channel_id_increment;
+        trt_channel_index++;
+      }
+
+      // Here we have a matching transient channel; write it.
+      persCont->m_rawdata[trt_channel_index]=tchan_word;
+      trt_channel_id += trt_channel_id_increment;
+      trt_channel_index++;
+
+    } // end transient channel loop
+
+    // write all other missing channels
+    while (trt_channel_index != collection_end) {
+      persCont->m_rawdata[trt_channel_index] = dummy_digit;
+      trt_channel_id += trt_channel_id_increment;
+      trt_channel_index++;
+    }
+
+    // increment to the next collection
+    trt_collection_index++;
+
+  } // end transient collection loop
+
+  // Finally, create any remaining missing collections
+    while ( trt_collection_index < trt_number_of_collections ) {
+      // The transient collection is missing; create the persistent collection with empty digits
+      trt_channel_id = trt_collection_id[trt_collection_index];
+      InDetRawDataCollection_p1& pcollection = persCont->m_collections[trt_collection_index];
+      pcollection.m_id     = 0;
+      pcollection.m_hashId = 0; // no hashId for this empty collection
+      pcollection.m_begin  = 0;
+      pcollection.m_end    = 0;
+
+      // Fill all the channels with with empty digits.
+      for (unsigned int i=0; i<trt_collection_size[trt_collection_index]; ++i) {
+        persCont->m_rawdata[trt_channel_index] = dummy_digit;
+        trt_channel_id += trt_channel_id_increment;
+        trt_channel_index++;
+      }
+      trt_collection_index++;
+    }
+
+  MSG_DEBUG(log," Prepared " << persCont->m_collections.size() << "Collections");
+  MSG_DEBUG(log," ***  Writing TRT_RDO_Container (TRT_LoLumRawData concrete type)");
+
+  trt_collection_id.clear();
+  trt_collection_size.clear();
+
+} // end of transToPers
+
+
+void  TRT_LoLumRawDataContainerCnv_p3::persToTrans(const InDetRawDataContainer_p3* persCont, TRT_RDO_Container* transCont, MsgStream &log)
+{
+
+  // The transient model has a container holding collections (up to 14912 TRT detector elements/modules)
+  // and the collections hold channels (e.g. up to 24 straws in the TRT endcaps). There are a total of 350848 TRT straws.
+  // The persistent model flattens this so that the persistent container has two vectors: 1) all collections, 2) all RDO
+  // The persistent collections then only maintain indexes into the container's vector of all channels.
+  // So here we loop over all collection and extract their channels from the vector.
+
+  // Hard-code the number of collections, their ids and their sizes to generate collections and channels for the whole detector
+  const unsigned int dummy_digit=0;
+  const unsigned int trt_number_of_collections=14912;
+  const unsigned int trt_channel_id_increment=0x20u;
+  std::vector<unsigned int> trt_collection_id;   // There are 14912 elements/modules in the TRT
+  std::vector<unsigned int> trt_collection_size; // Each element has a specific number of straws
+
+  set_vectors_of_collection_ids_and_size(trt_collection_id,
+                                         trt_collection_size,
+                                         trt_number_of_collections);
+
+  unsigned int trt_channel_id;
+  unsigned int trt_channel_index=0;
+  unsigned int trt_channel_index_old;
+  unsigned int total_number_of_channels=0;
+
+  TRT_RDO_Collection* tcoll=0;         // transient collection to be constructed
+
+  MSG_DEBUG(log," Reading " << persCont->m_collections.size() << "Collections");
+  if (persCont->m_collections.size() != trt_number_of_collections)
+    log << MSG::ERROR << "TRT_LoLumRawDataContainerCnv_p3::persToTrans expected 14912 collections but got " << persCont->m_collections.size() << ". We should be reading the whole detector!" << endmsg;
+
+  for (unsigned int trt_collection_index=0; trt_collection_index<trt_number_of_collections; ++trt_collection_index) {
+
+    // Create trans collection - in NOT owner of TRT_RDO_RawData (SG::VIEW_ELEMENTS); IDet collection don't have the Ownership policy c'tor
+
+    // count the number of non-dummy digits and skip to the next persistent collection if there are none.
+    unsigned int nchans = trt_collection_size[trt_collection_index];
+    trt_channel_index_old = trt_channel_index; // the beginning of this collection
+    unsigned int mchans = 0;
+    for (unsigned int ichan = 0; ichan < nchans; ++ichan) {
+      const unsigned int pword = persCont->m_rawdata[trt_channel_index];
+      if ( pword != dummy_digit ) mchans++;
+      trt_channel_index++;
+    }
+    if (!mchans) continue;
+
+    // This collection has "mchans" digits
+    total_number_of_channels += mchans;
+
+    // Create the transeint collection and fill with channels
+    tcoll = new TRT_RDO_Collection(IdentifierHash(trt_collection_index));
+    tcoll->setIdentifier(Identifier(trt_collection_id[trt_collection_index]));
+    tcoll->resize(mchans);
+
+    trt_channel_id = trt_collection_id[trt_collection_index]; // the id of the first channel in this collection
+    trt_channel_index = trt_channel_index_old; // go back to the beginning of this collection and process it again
+
+    unsigned int jchan=0; // counter for the non-dummy digits
+    for (unsigned int ichan = 0; ichan < nchans; ++ichan) {
+      const unsigned int pword = persCont->m_rawdata[trt_channel_index];
+      if ( pword == dummy_digit ) {
+        // advance to the next straw
+        trt_channel_id += trt_channel_id_increment;
+        trt_channel_index++;
+        continue; // don't write a dummy digit
+      }
+
+      TRT_LoLumRawData* tchan = new TRT_LoLumRawData(Identifier(trt_channel_id),pword);
+
+      (*tcoll)[jchan] = tchan;
+      jchan++;
+
+      // advance to the next straw
+      trt_channel_id += trt_channel_id_increment;
+      trt_channel_index++;
+    }
+
+    // register the rdo collection in IDC with hash - faster addCollection
+    StatusCode sc = transCont->addCollection(tcoll, IdentifierHash(trt_collection_index));
+    if (sc.isFailure()) throw std::runtime_error("Failed to add collection to ID Container");
+    MSG_VERBOSE(log,"AthenaPoolTPCnvIDCont::persToTrans, collection, hash_id / coll_id = " << trt_collection_index << " / " << trt_collection_id[trt_collection_index] << ", added to Identifiable container.");
+  }
+
+  trt_collection_id.clear();
+  trt_collection_size.clear();
+
+  MSG_DEBUG(log," ***  Reading TRT_RDO_Container (TRT_LoLumRawData concrete type)");
+
+} // end of persToTrans
+
+//================================================================
+TRT_RDO_Container* TRT_LoLumRawDataContainerCnv_p3::createTransient(const InDetRawDataContainer_p3* persObj, MsgStream& log) {
+  std::unique_ptr<TRT_RDO_Container> trans(std::make_unique<TRT_RDO_Container>(m_trtId->straw_layer_hash_max()));
+  persToTrans(persObj, trans.get(), log);
+  return(trans.release());
+}
diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/TRT_LoLumRawDataContainerCnv_p3.h b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/TRT_LoLumRawDataContainerCnv_p3.h
new file mode 100644
index 0000000000000000000000000000000000000000..4c2cd31ab08a6dc1d7f2339b8f3d982c36774fe1
--- /dev/null
+++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/TRT_LoLumRawDataContainerCnv_p3.h
@@ -0,0 +1,46 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef TRT_LOLUMRAWDATACONTAINERCNV_P3_H
+#define TRT_LOLUMRAWDATACONTAINERCNV_P3_H
+
+// TRT_LoLumRawDataContainerCnv_p3, T/P separation of TRT Raw data
+// author D.Costanzo <davide.costanzo@cern.ch>
+
+#include "InDetRawData/TRT_RDO_Container.h"
+#include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h"
+#include "InDetEventAthenaPool/InDetRawDataContainer_p3.h"
+class TRT_ID;
+
+
+// We do NOT use T_AthenaPoolTPCnvIDCont because we do all of the
+// conversion in the .cxx. Same as for the LAr Raw Channels
+// Note that this is used for a container of TRT Raw Data
+// that containes only TRT_LoLumRawData concrete types
+// TRT_RDO_ContainerCnv.cxx delegates the conversion to this
+// converter if the objects are of the correct type
+
+
+class TRT_LoLumRawDataContainerCnv_p3 : public T_AthenaPoolTPCnvBase<TRT_RDO_Container, InDetRawDataContainer_p3>
+{
+private:
+  const TRT_ID *m_trtId;
+public:
+  TRT_LoLumRawDataContainerCnv_p3() : m_trtId(0) {};
+
+  virtual void persToTrans(const InDetRawDataContainer_p3* persCont,
+                           TRT_RDO_Container* transCont,
+                           MsgStream &log) ;
+  virtual void transToPers(const TRT_RDO_Container* transCont,
+                           InDetRawDataContainer_p3* persCont,
+                           MsgStream &log) ;
+  virtual TRT_RDO_Container* createTransient(const InDetRawDataContainer_p3* persObj, MsgStream& log) ;
+
+
+  // ID helper can't be used in the constructor, need initialize()
+  void initialize(const TRT_ID *idhelper) { m_trtId = idhelper; }
+
+};
+
+#endif
diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/TRT_RDO_ContainerCnv.cxx b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/TRT_RDO_ContainerCnv.cxx
index 3b2c9d76bfc8ed4a2c95c8785eb1e28197d46082..22540ccb26ed13d5e9aee265249ad54d55731034 100644
--- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/TRT_RDO_ContainerCnv.cxx
+++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/TRT_RDO_ContainerCnv.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "TRT_RDO_ContainerCnv.h"
@@ -73,6 +73,7 @@ StatusCode TRT_RDO_ContainerCnv::initialize() {
    m_converter_p1.initialize(idhelper, m_storeGate);
    m_converter_TP1.initialize(idhelper);
    m_converter_TP2.initialize(idhelper);
+   m_converter_TP3.initialize(idhelper);
 
    ATH_MSG_DEBUG("Converter initialized");
 
@@ -126,9 +127,17 @@ TRT_RDO_Container* TRT_RDO_ContainerCnv::createTransient() {
   static const pool::Guid   p1_guid("CFBDB7A8-C788-4EE7-A260-3C8B680234FE"); // with TRT_RDORawData
   static const pool::Guid   TP1_guid("DA76970C-E019-43D2-B2F9-25660DCECD9D"); // for t/p separated version with InDetRawDataContainer_p1
   static const pool::Guid   TP2_guid("7138342E-0A80-4A32-A387-2842A01C2539"); // for t/p separated version with InDetRawDataContainer_p2
+  static const pool::Guid   TP3_guid("D0313948-9BC8-415F-BE58-7BA8178F93CD"); // for t/p separated version with InDetRawDataContainer_p3
   ATH_MSG_DEBUG("createTransient(): main converter");
 
-  if( compareClassGuid(TP2_guid) ) {
+  if( compareClassGuid(TP3_guid) ) {
+    ATH_MSG_DEBUG("createTransient(): New TP version - TP3 branch");
+    std::unique_ptr< InDetRawDataContainer_p3 >   col_vect( poolReadObject< InDetRawDataContainer_p3 >() );
+    TRT_RDO_Container *res = m_converter_TP3.createTransient( col_vect.get(), msg() );
+    ATH_MSG_DEBUG("createTransient(), TP3 branch: returns TRANS = "<<shortPrint(res));
+    return res;
+  }
+  else if( compareClassGuid(TP2_guid) ) {
     ATH_MSG_DEBUG("createTransient(): New TP version - TP2 branch");
     std::unique_ptr< InDetRawDataContainer_p2 >   col_vect( poolReadObject< InDetRawDataContainer_p2 >() );
     TRT_RDO_Container *res = m_converter_TP2.createTransient( col_vect.get(), msg() );
diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/TRT_RDO_ContainerCnv.h b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/TRT_RDO_ContainerCnv.h
index ef4b23321d693c979faf588e8eff16032714da3f..66f994bb243745777f4a2ded3138a48a5887faf4 100644
--- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/TRT_RDO_ContainerCnv.h
+++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/TRT_RDO_ContainerCnv.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 TRT_RDO_CONTAINERCNV_H
@@ -17,11 +17,15 @@
 #include "TRT_RDO_ContainerCnv_p1.h"
 #include "TRT_LoLumRawDataContainerCnv_p1.h"
 #include "TRT_LoLumRawDataContainerCnv_p2.h"
+#include "TRT_LoLumRawDataContainerCnv_p3.h"
 
 
 // the latest persistent representation type of DataCollection:
 typedef  InDetRawDataContainer_p2         TRT_RDO_Container_PERS;
 typedef  TRT_LoLumRawDataContainerCnv_p2  TRT_RDO_ContainerCnv_PERS;
+// To switch to the p3 version (20% RDO size reduction), comment the two lines above and uncomment the two below.
+// typedef  InDetRawDataContainer_p3         TRT_RDO_Container_PERS;
+// typedef  TRT_LoLumRawDataContainerCnv_p3  TRT_RDO_ContainerCnv_PERS;
 
 typedef  T_AthenaPoolCustomCnv<TRT_RDO_Container, TRT_RDO_Container_PERS >   TRT_RDO_ContainerCnvBase;
 
@@ -30,10 +34,11 @@ class TRT_RDO_ContainerCnv : public TRT_RDO_ContainerCnvBase {
 
   // Converters need to be initialized (use ID helpers)
   // Thus they can't be local
-  TRT_RDO_ContainerCnv_p1   m_converter_p1;
+  TRT_RDO_ContainerCnv_p1           m_converter_p1;
   TRT_RDO_ContainerCnv_p0           m_converter_p0;
   TRT_LoLumRawDataContainerCnv_p1   m_converter_TP1;
   TRT_LoLumRawDataContainerCnv_p2   m_converter_TP2;
+  TRT_LoLumRawDataContainerCnv_p3   m_converter_TP3;
   TRT_RDO_ContainerCnv_PERS         m_converter_PERS;
 
   // Should not be needed at some point.
diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/TRT_RDO_Elements.h b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/TRT_RDO_Elements.h
new file mode 100644
index 0000000000000000000000000000000000000000..3fe1b15fd51aa4b5141b5fa91f8baedbce6718a8
--- /dev/null
+++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/TRT_RDO_Elements.h
@@ -0,0 +1,90 @@
+void set_vectors_of_collection_ids_and_size(std::vector<unsigned int> &element, std::vector<unsigned int> &nstraws, const unsigned int number_of_elements) {
+
+  // The transient model has a container holding collections (TRT detector elements/modules)
+  // and the collections hold channels (e.g. up to 24 straws in the TRT endcaps).
+  // Here we construct, for the whole detector, the ids of the collections (14912 TRT detector elements/modules)
+  // and the number of channels (straws) in each collection according to the numbering scheme in the TRT RDO container.
+  // A total 350848 straw ids can be defined using these two vectors since the id of each straw simply follows from the
+  // previous id starting from the id of the collection that contains it.
+
+  /*
+    5120 endcap elements : 32(6*(15*1,17),7*(7*1,25),7*1,601)
+    4672 barrel elements : 64(18*1,14,23*1,9,29*1,931)
+    5120 endcap elements : 32(6*(15*1,17),7*(7*1,25),7*1,601)
+    ----
+   14912  << number_of_elements
+    ----
+  */
+
+  element.resize(number_of_elements);
+  nstraws.resize(number_of_elements,24); // all endcap modules have 24 straws. The barrels will need a more detailed assignment.
+
+  const unsigned int first_straw = 0x10000000u;
+  unsigned int i,j,k,n;
+  unsigned int c=0;
+
+  n=0;
+  element[n++]=0;
+  for (i=0; i<32; i++) {
+    for (j=0; j<6; j++) { for (k=0; k<15; k++) { c++; element[n++]=c; }; c=c+17; element[n++]=c; }
+    for (j=0; j<7; j++) { for (k=0; k< 7; k++) { c++; element[n++]=c; }; c=c+25; element[n++]=c; }
+    for (j=0; j<7; j++) { c++; element[n++]=c; }; c=c+601; element[n++]=c;
+  }
+  for (i=0; i<64; i++) {
+    for (k=0; k<18; k++) { c++; element[n++]=c; }; c=c+14;  element[n++]=c;
+    for (k=0; k<23; k++) { c++; element[n++]=c; }; c=c+9;   element[n++]=c;
+    for (k=0; k<29; k++) { c++; element[n++]=c; }; c=c+931; element[n++]=c;
+  }
+  for (i=0; i<32; i++) {
+    for (j=0; j<6; j++) { for (k=0; k<15; k++) { c++; element[n++]=c; }; c=c+17; element[n++]=c; }
+    for (j=0; j<7; j++) { for (k=0; k< 7; k++) { c++; element[n++]=c; }; c=c+25; element[n++]=c; }
+    for (j=0; j<7; j++) { c++; element[n++]=c; }; c=c+601; if (n<number_of_elements) element[n++]=c;
+  } // the very last item in the pattern is dropped.
+
+  // Finally convert from 22 bit to 32 bit form.
+  for (i=0; i<number_of_elements; i++) element[i] = (element[i]<<10)+first_straw;
+
+  /*
+    5120 endcap elements : 24
+    4672 barrel elements : 64(15,4*16,5*17,5*18,3*19,18,19,5*20,5*21,5*22,5*23,2*24,2*23,4*24,5*25,5*26,5*27,5*28,4*29,28)
+    5120 endcap elements : 24
+  */
+  n=5120;
+  for (i=0; i<64; i++) {
+    nstraws[n++]=15;
+    for (j=0; j<4; j++) nstraws[n++]=16;
+    for (j=0; j<5; j++) nstraws[n++]=17;
+    for (j=0; j<5; j++) nstraws[n++]=18;
+    for (j=0; j<3; j++) nstraws[n++]=19;
+    nstraws[n++]=18; nstraws[n++]=19;
+    for (j=0; j<5; j++) nstraws[n++]=20;
+    for (j=0; j<5; j++) nstraws[n++]=21;
+    for (j=0; j<5; j++) nstraws[n++]=22;
+    for (j=0; j<5; j++) nstraws[n++]=23;
+    for (j=0; j<2; j++) nstraws[n++]=24;
+    for (j=0; j<2; j++) nstraws[n++]=23;
+    for (j=0; j<4; j++) nstraws[n++]=24;
+    for (j=0; j<5; j++) nstraws[n++]=25;
+    for (j=0; j<5; j++) nstraws[n++]=26;
+    for (j=0; j<5; j++) nstraws[n++]=27;
+    for (j=0; j<5; j++) nstraws[n++]=28;
+    for (j=0; j<4; j++) nstraws[n++]=29;
+    nstraws[n++]=28;
+  }
+
+/*
+  // DEBUG dump out all straw ids (32-bit representation; no information is lost)
+  unsigned int trt_strawid[350848];
+  unsigned int istraw=0;
+  for (unsigned int i=0; i<trt_number_of_collections; i++) {
+    trt_strawid[istraw++] = trt_collection_id[i];
+    for (unsigned int j=1; j<trt_collection_size[i]; j++) {
+      trt_strawid[istraw]=trt_strawid[istraw-1]+0x20u;
+      istraw++;
+    }
+  }
+  std::cout << "AJB DUMP number of straws is " << istraw << std::endl;
+  for (unsigned int k=0; k<350848; k++) std::cout << "AJB DUMP " << std::hex << trt_strawid[k] << std::endl;
+*/
+
+}
diff --git a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetCompetingRIOsOnTrack/CompetingPixelClustersOnTrackCnv_p1.cxx b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetCompetingRIOsOnTrack/CompetingPixelClustersOnTrackCnv_p1.cxx
index 07a86d81008ba6c02f5f4aea0607c51836f6bc3b..955d745ecad47b4c13c959bf8395db442ab79038 100644
--- a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetCompetingRIOsOnTrack/CompetingPixelClustersOnTrackCnv_p1.cxx
+++ b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetCompetingRIOsOnTrack/CompetingPixelClustersOnTrackCnv_p1.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
 */
 
 //-----------------------------------------------------------------------------
@@ -19,15 +19,11 @@ CompetingPixelClustersOnTrackCnv_p1::persToTrans( const InDet::CompetingPixelClu
                                                        InDet::CompetingPixelClustersOnTrack *transObj, 
                                                        MsgStream &log )
 {
-  
-   std::vector< TPObjRef >::const_iterator  it = persObj->m_containedChildRots.begin(), 
-                                            itE = persObj->m_containedChildRots.end();
-                                            
    auto containedChildRots = new std::vector< const InDet::PixelClusterOnTrack * >;
    
-   for (; it!=itE;it++) {
+   for (const TPObjRef& ref : persObj->m_containedChildRots) {
        ITPConverterFor<Trk::MeasurementBase>  *rotCnv = 0;
-       const InDet::PixelClusterOnTrack* mcot = dynamic_cast<const InDet::PixelClusterOnTrack*>(createTransFromPStore(&rotCnv, *it, log));
+       const InDet::PixelClusterOnTrack* mcot = dynamic_cast<const InDet::PixelClusterOnTrack*>(createTransFromPStore(&rotCnv, ref, log));
        containedChildRots->push_back( mcot );
    }
 
diff --git a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetCompetingRIOsOnTrack/CompetingSCT_ClustersOnTrackCnv_p1.cxx b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetCompetingRIOsOnTrack/CompetingSCT_ClustersOnTrackCnv_p1.cxx
index eef3a18654177b49d30be7044403513f009b7288..3e650c1de0bc18304178365626c8861d7d8c5c79 100644
--- a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetCompetingRIOsOnTrack/CompetingSCT_ClustersOnTrackCnv_p1.cxx
+++ b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetCompetingRIOsOnTrack/CompetingSCT_ClustersOnTrackCnv_p1.cxx
@@ -13,15 +13,11 @@ CompetingSCT_ClustersOnTrackCnv_p1::persToTrans( const InDet::CompetingSCT_Clust
                                                        InDet::CompetingSCT_ClustersOnTrack *transObj, 
                                                        MsgStream &log )
 {
-  
-   std::vector< TPObjRef >::const_iterator  it = persObj->m_containedChildRots.begin(), 
-                                            itE = persObj->m_containedChildRots.end();
-                                            
    std::vector< const InDet::SCT_ClusterOnTrack * > containedChildRots;
-   
-   for (; it!=itE;it++) {
+
+   for (const TPObjRef& ref : persObj->m_containedChildRots) {
        ITPConverterFor<Trk::MeasurementBase>  *rotCnv = 0;
-       const InDet::SCT_ClusterOnTrack* mcot = dynamic_cast<const InDet::SCT_ClusterOnTrack*>(createTransFromPStore(&rotCnv, *it, log));
+       const InDet::SCT_ClusterOnTrack* mcot = dynamic_cast<const InDet::SCT_ClusterOnTrack*>(createTransFromPStore(&rotCnv, ref, log));
        containedChildRots.push_back( mcot );
    }
 
diff --git a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetCompetingRIOsOnTrack/CompetingTRT_DriftCirclesOnTrackCnv_p1.cxx b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetCompetingRIOsOnTrack/CompetingTRT_DriftCirclesOnTrackCnv_p1.cxx
index 622446b219e8ba66e941d98632c82f6397785416..e914ad54f9bc0de248d9665f9dcfc00190a269e3 100644
--- a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetCompetingRIOsOnTrack/CompetingTRT_DriftCirclesOnTrackCnv_p1.cxx
+++ b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetCompetingRIOsOnTrack/CompetingTRT_DriftCirclesOnTrackCnv_p1.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
 */
 
 //-----------------------------------------------------------------------------
@@ -21,15 +21,11 @@ CompetingTRT_DriftCirclesOnTrackCnv_p1::persToTrans( const InDet::CompetingTRT_D
                                                      InDet::CompetingTRT_DriftCirclesOnTrack *transObj, 
                                                        MsgStream &log )
 {
-  
-   std::vector< TPObjRef >::const_iterator  it = persObj->m_containedChildRots.begin(), 
-                                            itE = persObj->m_containedChildRots.end();
-                                            
    auto containedChildRots = new std::vector< const InDet::TRT_DriftCircleOnTrack * >;
    
-   for (; it!=itE;it++) {
+   for (const TPObjRef& ref : persObj->m_containedChildRots) {
        ITPConverterFor<Trk::MeasurementBase>  *rotCnv = 0;
-       const InDet::TRT_DriftCircleOnTrack* mcot = dynamic_cast<const InDet::TRT_DriftCircleOnTrack*>(createTransFromPStore(&rotCnv, *it, log));
+       const InDet::TRT_DriftCircleOnTrack* mcot = dynamic_cast<const InDet::TRT_DriftCircleOnTrack*>(createTransFromPStore(&rotCnv, ref, log));
        containedChildRots->push_back( mcot );
    }
    
diff --git a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/PixelClusterCnv_p2.cxx b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/PixelClusterCnv_p2.cxx
index 066a9784b024c0890f902338b87883d1bba656ac..a0185a1883b1be9262761b6ab4f55accb8be5f5c 100644
--- a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/PixelClusterCnv_p2.cxx
+++ b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/PixelClusterCnv_p2.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 //-----------------------------------------------------------------------------
@@ -29,11 +29,10 @@ PixelClusterCnv_p2::createPixelCluster (const InDet::PixelCluster_p2* persObj,
   Identifier id (persObj->m_clusId);
   Identifier::value_type id32 = id.get_compact();
   std::vector<Identifier>::iterator tit = rdoList.begin();
-  for(std::vector<InDet::PixelCluster_p2::rdo_diff_type>::const_iterator it = persObj->m_rdoList.begin(); 
-                                                            it != persObj->m_rdoList.end();it++)
+  for (const InDet::PixelCluster_p2::rdo_diff_type& rdo : persObj->m_rdoList)
   {
-    *tit = Identifier((Identifier::value_type) *it + id32);
-    tit++;
+    *tit = Identifier((Identifier::value_type) rdo + id32);
+    ++tit;
   }
 
   InDet::SiWidth width;
@@ -99,10 +98,9 @@ void PixelClusterCnv_p2::transToPers( const InDet::PixelCluster *transObj, InDet
   
   
   std::vector<InDet::PixelCluster_p2::rdo_diff_type>::iterator pit = persObj->m_rdoList.begin();
-  for (std::vector<Identifier>::const_iterator it=transObj->rdoList().begin(); it != transObj->rdoList().end(); it++) {
-  
-   *pit = (InDet::PixelCluster_p2::rdo_diff_type)  (it->get_compact()) - persObj->m_clusId  ;
-    pit++;
+  for (const Identifier& id : transObj->rdoList()) {
+   *pit = (InDet::PixelCluster_p2::rdo_diff_type)  (id.get_compact()) - persObj->m_clusId  ;
+   ++pit;
   }
   
 }
diff --git a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/PixelClusterCnv_p3.cxx b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/PixelClusterCnv_p3.cxx
index 96fdafb1a49edb0a443adc86c61ae6371072ffe3..50aac2cac0f89b418f7622b37cb29c8b35ad3990 100644
--- a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/PixelClusterCnv_p3.cxx
+++ b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/PixelClusterCnv_p3.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 //-----------------------------------------------------------------------------
@@ -158,11 +158,11 @@ void PixelClusterCnv_p3::transToPers( const InDet::PixelCluster *transObj, InDet
   // Save offset to wafer id for the cluster id
   Identifier waferId =  m_pixId2->wafer_id(clusId); // remove the eta/phi of channel id
   *pit = static_cast<InDet::PixelCluster_p3::rdo_diff_type>( m_pixId2->calc_offset(waferId, clusId) );
-  pit++;
+  ++pit;
   
   for (const Identifier& id : transObj->rdoList()) {
     *pit = static_cast<InDet::PixelCluster_p3::rdo_diff_type>( m_pixId2->calc_offset(clusId, id) );
-    pit++;
+    ++pit;
   }
 
   // Setting of cluster properties:
diff --git a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/PixelClusterContainerCnv_p1.cxx b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/PixelClusterContainerCnv_p1.cxx
index e73443f6eddda9d2a9bf2e17fad0dc8948abaf38..21ba9aaa626871b338f4ec574ccda2b79cf5af8e 100644
--- a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/PixelClusterContainerCnv_p1.cxx
+++ b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/PixelClusterContainerCnv_p1.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 // Athena
@@ -50,7 +50,7 @@ void InDet::PixelClusterContainerCnv_p1::transToPers(const InDet::PixelClusterCo
     unsigned int chanEnd = 0;
     persCont->m_collections.resize(transCont->numberOfCollections());
   
-    for (collIndex = 0; it_Coll != it_CollEnd; ++collIndex, it_Coll++)  {
+    for (collIndex = 0; it_Coll != it_CollEnd; ++collIndex, ++it_Coll)  {
         // Add in new collection
         const InDet::PixelClusterCollection& collection = (**it_Coll);
         chanBegin  = chanEnd;
diff --git a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/PixelGangedClusterAmbiguitiesCnv_p1.cxx b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/PixelGangedClusterAmbiguitiesCnv_p1.cxx
index ca87616fd94bd9d7629dc016023c652335dfc74a..a31249f799dde6f78509de10acf2641cb2ae9f0d 100644
--- a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/PixelGangedClusterAmbiguitiesCnv_p1.cxx
+++ b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/PixelGangedClusterAmbiguitiesCnv_p1.cxx
@@ -56,7 +56,7 @@ void PixelGangedClusterAmbiguitiesCnv_p1::transToPers
     IdentifierHash          idHash  = pixelCluster->getHashAndIndex().collHash(); // idHash of collection
     
     // loop over dhs
-    for ( ; dh!=dhEnd; dh++ ) 		  {
+    for ( ; dh!=dhEnd; ++dh ) 		  {
       auto coll = dh->indexFindPtr(idHash); //matching collection
       // does coll exist?
       // check prd exists in collection
@@ -77,7 +77,7 @@ void PixelGangedClusterAmbiguitiesCnv_p1::transToPers
     const InDet::SiCluster* keyPixelCluster(0);
     const InDet::SiCluster* gangedPixelCluster(0);
     unsigned int count(1);
-    for( ; itr != itrE ; itr++ ) {
+    for( ; itr != itrE ; ++itr ) {
     
       // for clarity assign the elements
       keyPixelCluster            = itr->first;
@@ -124,20 +124,15 @@ void  PixelGangedClusterAmbiguitiesCnv_p1::persToTrans(const InDet::PixelGangedC
         << persObj->m_pixelClusterContainerName << endmsg;
   }
     
-  std::vector< std::pair<uint32_t, std::vector<uint32_t> > >::const_iterator persItr  = persObj->m_ambiguityMap.begin();
-  std::vector< std::pair<uint32_t, std::vector<uint32_t> > >::const_iterator persItrE = persObj->m_ambiguityMap.end();
-  
   const InDet::PixelCluster* keyPixelCluster(0);
   const InDet::PixelCluster* gangedPixelCluster(0);
-  
-  for( ; persItr != persItrE ; persItr++ )
+
+  for (const std::pair<uint32_t, std::vector<uint32_t> >& mapElement : persObj->m_ambiguityMap)
   {
-    const std::pair<uint32_t, std::vector<uint32_t> >& mapElement = (*persItr);
-    for (std::vector<uint32_t>::const_iterator newItr = (mapElement.second).begin();
-                                              newItr != (mapElement.second).end(); ++newItr)
+    for (uint32_t elt : mapElement.second)
     {
       IdentContIndex keyIdentContIndex(mapElement.first);
-      IdentContIndex gangedIdentContIndex(*newItr);
+      IdentContIndex gangedIdentContIndex(elt);
       for (InDet::PixelClusterContainer::const_iterator contItr  = pCC->begin();
                                                         contItr != pCC->end(); ++contItr)
       {
diff --git a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/SCT_ClusterCnv_p2.cxx b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/SCT_ClusterCnv_p2.cxx
index 22adf0022e4ab5c03a8e0258b090bde444b8e242..9d48c95fb3698225cd2f87ca212ebbdbe6fc4e28 100644
--- a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/SCT_ClusterCnv_p2.cxx
+++ b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/SCT_ClusterCnv_p2.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 //-----------------------------------------------------------------------------
@@ -38,10 +38,9 @@ SCT_ClusterCnv_p2::createSCT_Cluster (const InDet::SCT_Cluster_p2* persObj,
   //Identifier::value_type id32 = transObj->identify().get_compact(); 
   //Identifier id32 = transObj->identify(); 
   std::vector<Identifier>::iterator tit = rdoList.begin();
-  for (std::vector<InDet::SCT_Cluster_p2::rdo_diff_type>::const_iterator it=persObj->m_rdoList.begin(); it != persObj->m_rdoList.end(); it++) {
- 
-    *tit = Identifier(m_sctId2->strip_id_offset(clusId,*it) );
-    tit++;
+  for (const InDet::SCT_Cluster_p2::rdo_diff_type& rdo : persObj->m_rdoList) {
+    *tit = Identifier(m_sctId2->strip_id_offset(clusId,rdo) );
+    ++tit;
   }
   
   InDet::SiWidth sw;
@@ -100,10 +99,9 @@ void SCT_ClusterCnv_p2::transToPers( const InDet::SCT_Cluster *transObj, InDet::
   std::vector<InDet::SCT_Cluster_p2::rdo_diff_type>::iterator pit = persObj->m_rdoList.begin(); 
   
   
-  for (std::vector<Identifier>::const_iterator it=transObj->rdoList().begin(); it != transObj->rdoList().end(); it++) {
-    //*pit = static_cast<InDet::SCT_Cluster_p2::rdo_diff_type>(it->get_compact() - id32);
-    *pit = static_cast<InDet::SCT_Cluster_p2::rdo_diff_type>( m_sctId2->calc_offset(id32, *it) );
-    pit++;
+  for (const Identifier& id : transObj->rdoList()) {
+    *pit = static_cast<InDet::SCT_Cluster_p2::rdo_diff_type>( m_sctId2->calc_offset(id32, id) );
+    ++pit;
   }
   
 }
diff --git a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/SCT_ClusterCnv_p3.cxx b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/SCT_ClusterCnv_p3.cxx
index 134ed0490d4a76d60f863bc916b24df3aa9c967f..6d5f1628030cbaf8f19fce9ab8f15f4ec20aaabc 100644
--- a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/SCT_ClusterCnv_p3.cxx
+++ b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/SCT_ClusterCnv_p3.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 //-----------------------------------------------------------------------------
@@ -39,10 +39,9 @@ SCT_ClusterCnv_p3::createSCT_Cluster (const InDet::SCT_Cluster_p3* persObj,
   //Identifier::value_type id32 = transObj->identify().get_compact(); 
   //Identifier id32 = transObj->identify(); 
   std::vector<Identifier>::iterator tit = rdoList.begin();
-  for (std::vector<InDet::SCT_Cluster_p3::rdo_diff_type>::const_iterator it=persObj->m_rdoList.begin(); it != persObj->m_rdoList.end(); it++) {
- 
-    *tit = Identifier(m_sctId2->strip_id_offset(clusId,*it) );
-    tit++;
+  for (const InDet::SCT_Cluster_p3::rdo_diff_type& rdo : persObj->m_rdoList) {
+    *tit = Identifier(m_sctId2->strip_id_offset(clusId,rdo) );
+    ++tit;
   }
   
   InDet::SiWidth sw;
@@ -106,10 +105,9 @@ void SCT_ClusterCnv_p3::transToPers( const InDet::SCT_Cluster *transObj, InDet::
   std::vector<InDet::SCT_Cluster_p3::rdo_diff_type>::iterator pit = persObj->m_rdoList.begin(); 
   
   
-  for (std::vector<Identifier>::const_iterator it=transObj->rdoList().begin(); it != transObj->rdoList().end(); it++) {
-
-    *pit = static_cast<InDet::SCT_Cluster_p3::rdo_diff_type>( m_sctId2->calc_offset(id32, *it) );
-    pit++;
+  for (const Identifier& id : transObj->rdoList()) {
+    *pit = static_cast<InDet::SCT_Cluster_p3::rdo_diff_type>( m_sctId2->calc_offset(id32, id) );
+    ++pit;
   }
   
 }
diff --git a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/SCT_ClusterContainerCnv_p1.cxx b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/SCT_ClusterContainerCnv_p1.cxx
index dc28443ef350a92c8d198b42c2144709e7e27b88..30c40f0b23f344526e2e120fd63b7ca130abd212 100644
--- a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/SCT_ClusterContainerCnv_p1.cxx
+++ b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/SCT_ClusterContainerCnv_p1.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "InDetEventTPCnv/InDetPrepRawData/SCT_ClusterContainerCnv_p1.h"
@@ -52,7 +52,7 @@ void InDet::SCT_ClusterContainerCnv_p1::transToPers(const InDet::SCT_ClusterCont
     persCont->m_collections.resize(transCont->numberOfCollections());
 //     if (log.level() <= MSG::DEBUG) log << MSG::DEBUG  << " Preparing " << persCont->m_collections.size() << "Collections" << endmsg;
   
-    for (collIndex = 0; it_Coll != it_CollEnd; ++collIndex, it_Coll++)  {
+    for (collIndex = 0; it_Coll != it_CollEnd; ++collIndex, ++it_Coll)  {
         // Add in new collection
 //         if (log.level() <= MSG::DEBUG) log << MSG::DEBUG  << " New collection" << endmsg;
         const InDet::SCT_ClusterCollection& collection = (**it_Coll);
diff --git a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/TRT_DriftCircleContainerCnv_p1.cxx b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/TRT_DriftCircleContainerCnv_p1.cxx
index 2cec40c90c3a3cbecc2c44bae91f56b62df34185..8c095de94e188a641895419494f0f55b8627eb99 100644
--- a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/TRT_DriftCircleContainerCnv_p1.cxx
+++ b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/InDetPrepRawData/TRT_DriftCircleContainerCnv_p1.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "InDetPrepRawData/TRT_DriftCircle.h"
@@ -56,7 +56,7 @@ void InDet::TRT_DriftCircleContainerCnv_p1::transToPers(const InDet::TRT_DriftCi
     persCont->m_collections.resize(transCont->numberOfCollections());
 //     if (log.level() <= MSG::DEBUG) log << MSG::DEBUG  << " Preparing " << persCont->m_collections.size() << "Collections" << endmsg;
   
-    for (collIndex = 0; it_Coll != it_CollEnd; ++collIndex, it_Coll++)  {
+    for (collIndex = 0; it_Coll != it_CollEnd; ++collIndex, ++it_Coll)  {
         // Add in new collection
         const InDet::TRT_DriftCircleCollection& collection = (**it_Coll);
         chanBegin  = chanEnd;
diff --git a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/PixelClusterContainerCnv_p2.cxx b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/PixelClusterContainerCnv_p2.cxx
index 65de22842c21c04b303cff8e9624e2cf8ce9e93b..9ff99ce36a9757b83c750ca114c731498bcae1bb 100644
--- a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/PixelClusterContainerCnv_p2.cxx
+++ b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/PixelClusterContainerCnv_p2.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 // Athena
@@ -55,7 +55,7 @@ void PixelClusterContainerCnv_p2::transToPers(const InDet::PixelClusterContainer
     unsigned int chanEnd = 0;
     persCont->m_collections.resize(transCont->numberOfCollections());
     //    if (log.level() <= MSG::DEBUG) log << MSG::DEBUG  << " Preparing " << persCont->m_collections.size() << "Collections" << endmsg;
-    for (collIndex = 0; it_Coll != it_CollEnd; ++collIndex, it_Coll++)  {
+    for (collIndex = 0; it_Coll != it_CollEnd; ++collIndex, ++it_Coll)  {
         // Add in new collection
         const InDet::PixelClusterCollection& collection = (**it_Coll);
         chanBegin  = chanEnd;
diff --git a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/PixelClusterContainerCnv_p3.cxx b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/PixelClusterContainerCnv_p3.cxx
index 08e4fb20dbdd5dad8726e385ffc3060640cb9a2a..19e411e31040d7fbbe3d09bbc8589305bf2d9d77 100644
--- a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/PixelClusterContainerCnv_p3.cxx
+++ b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/PixelClusterContainerCnv_p3.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "InDetEventTPCnv/PixelClusterContainerCnv_p3.h"
@@ -63,7 +63,7 @@ void PixelClusterContainerCnv_p3::transToPers(const InDet::PixelClusterContainer
     unsigned int chanEnd = 0;
     persCont->m_collections.resize(transCont->numberOfCollections());
     //    if (log.level() <= MSG::DEBUG) log << MSG::DEBUG  << " Preparing " << persCont->m_collections.size() << "Collections" << endmsg;
-    for (collIndex = 0; it_Coll != it_CollEnd; ++collIndex, it_Coll++)  {
+    for (collIndex = 0; it_Coll != it_CollEnd; ++collIndex, ++it_Coll)  {
         // Add in new collection
         const InDet::PixelClusterCollection& collection = (**it_Coll);
         chanBegin  = chanEnd;
diff --git a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/SCT_ClusterContainerCnv_p2.cxx b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/SCT_ClusterContainerCnv_p2.cxx
index d71a253787aa2f3eda2a3fa1fe1731acce7c9b12..a6476bd530330b1a8d703635acb22190c74f0ad7 100644
--- a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/SCT_ClusterContainerCnv_p2.cxx
+++ b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/SCT_ClusterContainerCnv_p2.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "InDetEventTPCnv/SCT_ClusterContainerCnv_p2.h"
@@ -67,7 +67,7 @@ void SCT_ClusterContainerCnv_p2::transToPers(const InDet::SCT_ClusterContainer*
     // to avoid the inside-loop resize
     int totSize = 0; 
     //for ( ; it_Coll != it_CollEnd;  it_Coll++)  {
-    for ( it_Coll=transCont->begin(); it_Coll != it_CollEnd;  it_Coll++)  {
+    for ( it_Coll=transCont->begin(); it_Coll != it_CollEnd;  ++it_Coll)  {
       const InDet::SCT_ClusterCollection& collection = (**it_Coll);
       totSize+=collection.size();
     }
@@ -76,7 +76,7 @@ void SCT_ClusterContainerCnv_p2::transToPers(const InDet::SCT_ClusterContainer*
 
     //    if (log.level() <= MSG::DEBUG) log << MSG::DEBUG  << " Preparing " << persCont->m_collections.size() << "Collections" << endmsg;
     //for (collIndex = 0; it_Coll != it_CollEnd; ++collIndex, it_Coll++)  {
-    for (collIndex = 0, it_Coll=transCont->begin(); it_Coll != it_CollEnd; ++collIndex, it_Coll++)  {
+    for (collIndex = 0, it_Coll=transCont->begin(); it_Coll != it_CollEnd; ++collIndex, ++it_Coll)  {
         // Add in new collection
         const InDet::SCT_ClusterCollection& collection = (**it_Coll);
         chanBegin  = chanEnd;
diff --git a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/SCT_ClusterContainerCnv_p3.cxx b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/SCT_ClusterContainerCnv_p3.cxx
index 0a7dff6f89c89a4bb5ce7aaa01ab72972a729957..cf7868ddab1914f5d6544edbb58989d182485f25 100644
--- a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/SCT_ClusterContainerCnv_p3.cxx
+++ b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/SCT_ClusterContainerCnv_p3.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "InDetEventTPCnv/SCT_ClusterContainerCnv_p3.h"
@@ -67,7 +67,7 @@ void SCT_ClusterContainerCnv_p3::transToPers(const InDet::SCT_ClusterContainer*
     // to avoid the inside-loop resize
     int totSize = 0; 
     //for ( ; it_Coll != it_CollEnd;  it_Coll++)  {
-    for ( it_Coll=transCont->begin(); it_Coll != it_CollEnd;  it_Coll++)  {
+    for ( it_Coll=transCont->begin(); it_Coll != it_CollEnd;  ++it_Coll)  {
       const InDet::SCT_ClusterCollection& collection = (**it_Coll);
       totSize+=collection.size();
     }
@@ -76,7 +76,7 @@ void SCT_ClusterContainerCnv_p3::transToPers(const InDet::SCT_ClusterContainer*
 
     //    if (log.level() <= MSG::DEBUG) log << MSG::DEBUG  << " Preparing " << persCont->m_collections.size() << "Collections" << endmsg;
     //for (collIndex = 0; it_Coll != it_CollEnd; ++collIndex, it_Coll++)  {
-    for (collIndex = 0, it_Coll=transCont->begin(); it_Coll != it_CollEnd; ++collIndex, it_Coll++)  {
+    for (collIndex = 0, it_Coll=transCont->begin(); it_Coll != it_CollEnd; ++collIndex, ++it_Coll)  {
         // Add in new collection
         const InDet::SCT_ClusterCollection& collection = (**it_Coll);
         chanBegin  = chanEnd;
diff --git a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/TRT_DriftCircleContainerCnv_p2.cxx b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/TRT_DriftCircleContainerCnv_p2.cxx
index d728296dc4108f86226bd31d54c9c11c43981f26..b686037dadb52379e7974305543ce89b837101f0 100644
--- a/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/TRT_DriftCircleContainerCnv_p2.cxx
+++ b/InnerDetector/InDetEventCnv/InDetEventTPCnv/src/TRT_DriftCircleContainerCnv_p2.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "InDetPrepRawData/TRT_DriftCircle.h"
@@ -67,7 +67,7 @@ void TRT_DriftCircleContainerCnv_p2::transToPers(const InDet::TRT_DriftCircleCon
     // to avoid the inside-loop resize
     int totSize = 0; 
     //for ( ; it_Coll != it_CollEnd;  it_Coll++)  {
-    for ( it_Coll=transCont->begin(); it_Coll != it_CollEnd;  it_Coll++)  {
+    for ( it_Coll=transCont->begin(); it_Coll != it_CollEnd;  ++it_Coll)  {
       const InDet::TRT_DriftCircleCollection& collection = (**it_Coll);
       totSize+=collection.size();
     }
@@ -76,7 +76,7 @@ void TRT_DriftCircleContainerCnv_p2::transToPers(const InDet::TRT_DriftCircleCon
 
     //    if (log.level() <= MSG::DEBUG) log << MSG::DEBUG << " Preparing " << persCont->m_collections.size() << "Collections" << endmsg;
     //    for (collIndex = 0; it_Coll != it_CollEnd; ++collIndex, it_Coll++)  {
-    for (collIndex = 0, it_Coll=transCont->begin(); it_Coll != it_CollEnd; ++collIndex, it_Coll++)  {
+    for (collIndex = 0, it_Coll=transCont->begin(); it_Coll != it_CollEnd; ++collIndex, ++it_Coll)  {
         // Add in new collection
         const InDet::TRT_DriftCircleCollection& collection = (**it_Coll);
         chanBegin  = chanEnd;
diff --git a/InnerDetector/InDetEventCnv/TRT_RawDataByteStreamCnv/src/TRT_RodDecoder.cxx b/InnerDetector/InDetEventCnv/TRT_RawDataByteStreamCnv/src/TRT_RodDecoder.cxx
index 09bf2cd292cd50a505b621ba71b241ec92f928c4..a89fb9bac5140a06e752844bfcfb2f97cb72d4b1 100644
--- a/InnerDetector/InDetEventCnv/TRT_RawDataByteStreamCnv/src/TRT_RodDecoder.cxx
+++ b/InnerDetector/InDetEventCnv/TRT_RawDataByteStreamCnv/src/TRT_RodDecoder.cxx
@@ -186,7 +186,7 @@ StatusCode TRT_RodDecoder::initialize()
     std::vector<int>::iterator it;
 
     for ( it=m_LoadCompressTableVersions.begin() ; 
-	  it < m_LoadCompressTableVersions.end(); it++ )
+	  it < m_LoadCompressTableVersions.end(); ++it )
      {
        if ( (*it < 4) || (*it > m_maxCompressionVersion) )
        {
@@ -1743,7 +1743,7 @@ TRT_RodDecoder::update() {
 			  Ctable->m_TableVersion );
 
 	 delete Ctable;
-	 catrIt++;
+	 ++catrIt;
 
 	 continue;
        }
@@ -1754,7 +1754,7 @@ TRT_RodDecoder::update() {
 	 ATH_MSG_DEBUG( "Table " << Ctable->m_TableVersion 
 			  << " already loaded!  Not overwriting" );
 	 delete Ctable;
-	 catrIt++;
+         ++catrIt;
 
 	 continue;
        }
@@ -1843,7 +1843,7 @@ TRT_RodDecoder::update() {
        }
 #endif /* NOTDEF */
 
-       catrIt++;
+       ++catrIt;
 
     }
 
diff --git a/InnerDetector/InDetEventCnv/TRT_RawDataByteStreamCnv/src/TRT_RodEncoder.cxx b/InnerDetector/InDetEventCnv/TRT_RawDataByteStreamCnv/src/TRT_RodEncoder.cxx
index 87461ac2fff5e9909f86e8c874650eda5f77572f..d67370a7c0de2026b30e7f4a1943f08bcd36c658 100644
--- a/InnerDetector/InDetEventCnv/TRT_RawDataByteStreamCnv/src/TRT_RodEncoder.cxx
+++ b/InnerDetector/InDetEventCnv/TRT_RawDataByteStreamCnv/src/TRT_RodEncoder.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
 */
 
 // Implementation of TRT_RodEncoder class 
@@ -65,7 +65,7 @@ TRT_RodEncoder::fillROD( std::vector<uint32_t>&  v32rod )
 
       v32rod[BufferOffset] = StrawWord;
 
-      rdo_it++;
+      ++rdo_it;
    }
 
    return StatusCode::SUCCESS;  
@@ -107,7 +107,7 @@ TRT_RodEncoder::fillROD3( std::vector<uint32_t>&  v32rod )
 
       tmp_data[BufferOffset] = StrawWord;
 
-      rdo_it++;
+      ++rdo_it;
    }
 
    for ( int i=0; i<TRT_MaxBufferSize; i++ )
diff --git a/InnerDetector/InDetExample/InDetRecExample/python/InDetJobProperties.py b/InnerDetector/InDetExample/InDetRecExample/python/InDetJobProperties.py
index 160c7f3fcfe4db9c2e2c823a0e5f2045fad627c4..e988de6ed2e570080195786c63265c9894beed50 100644
--- a/InnerDetector/InDetExample/InDetRecExample/python/InDetJobProperties.py
+++ b/InnerDetector/InDetExample/InDetRecExample/python/InDetJobProperties.py
@@ -1145,6 +1145,12 @@ class doNNToTCalibration(InDetFlagsJobProperty):
   allowedTypes = ['bool']
   StoredValue  = False
 
+class useNNTTrainedNetworks(InDetFlagsJobProperty):
+  """Use older NNs stored as TTrainedNetworks in place of default MDNs/other more recent networks. This is necessary for older configuration tags where the trainings were not available."""
+  statusOn     = True
+  allowedTypes = ['bool']
+  StoredValue  = True
+
 class keepAdditionalHitsOnTrackParticle(InDetFlagsJobProperty): 
   """Do not drop first/last hits on track (only for special cases - will blow up TrackParticle szie!!!)""" 
   statusOn     = True 
@@ -2757,6 +2763,7 @@ _list_InDetJobProperties = [Enabled,
                             doSLHCVeryForward,
                             doTRTGlobalOccupancy,
                             doNNToTCalibration,
+                            useNNTTrainedNetworks,
                             keepAdditionalHitsOnTrackParticle,
                             doSCTModuleVeto,
                             doDBMstandalone,
diff --git a/InnerDetector/InDetExample/InDetRecExample/python/TrackingCommon.py b/InnerDetector/InDetExample/InDetRecExample/python/TrackingCommon.py
index 088720d63265487ba71698f4e9b2d8cedcf3530f..f51709b523e30e1f6e0e1edb9efb9023a896a6cf 100644
--- a/InnerDetector/InDetExample/InDetRecExample/python/TrackingCommon.py
+++ b/InnerDetector/InDetExample/InDetRecExample/python/TrackingCommon.py
@@ -95,7 +95,7 @@ def makePublicTool(tool_creator) :
             if the_name != tool.name() :
                 raise Exception('Tool has not the exepected name %s but %s' % (the_name, tool.name()))
             if private is False :
-                print ('DEBUG add to ToolSvc %s' % (tool.name()))
+                log.debug ('DEBUG add to ToolSvc %s' % (tool.name()))
                 ToolSvc += tool
             return tool
         else :
@@ -274,6 +274,23 @@ def getPixelClusterNnCondAlg(**kwargs) :
     from SiClusterizationTool.SiClusterizationToolConf import InDet__TTrainedNetworkCondAlg
     return InDet__TTrainedNetworkCondAlg(kwargs.pop("name", 'PixelClusterNnCondAlg'), **kwargs)
 
+def getLWTNNCondAlg(**kwargs) :
+
+    # Check for the folder
+    from IOVDbSvc.CondDB import conddb
+    if not conddb.folderRequested('/PIXEL/PixelClustering/PixelClusNNCalibJSON'):
+        # COOL binding
+        conddb.addFolderSplitOnline("PIXEL","/PIXEL/Onl/PixelClustering/PixelNNCalibJSON",
+                                    "/PIXEL/PixelClustering/PixelNNCalibJSON",className='CondAttrListCollection')
+
+    # What we'll store it as
+    kwargs=setDefaults(kwargs,
+                       WriteKey = 'PixelClusterNNJSON')
+
+    # Set up the algorithm
+    from SiClusterizationTool.SiClusterizationToolConf import InDet__LWTNNCondAlg
+    return InDet__LWTNNCondAlg(kwargs.pop("name", "LWTNNCondAlg"),**kwargs)
+
 def getPixelClusterNnWithTrackCondAlg(**kwargs) :
 
     kwargs = setDefaults( kwargs,
@@ -306,10 +323,33 @@ def getNnClusterizationFactory(name='NnClusterizationFactory', **kwargs) :
     if 'PixelLorentzAngleTool' not in kwargs :
         kwargs = setDefaults( kwargs, PixelLorentzAngleTool = getPixelLorentzAngleTool())
 
+    from InDetRecExample.InDetJobProperties import InDetFlags
+    useTTrainedNetworks = InDetFlags.useNNTTrainedNetworks()
     from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags as geoFlags
     do_runI = geoFlags.Run() not in ["RUN2", "RUN3"]
-    createAndAddCondAlg( getPixelClusterNnCondAlg,         'PixelClusterNnCondAlg',          GetInputsInfo = do_runI)
-    createAndAddCondAlg( getPixelClusterNnWithTrackCondAlg,'PixelClusterNnWithTrackCondAlg', GetInputsInfo = do_runI)
+    
+    if useTTrainedNetworks :
+      log.debug("Setting up TTrainedNetworks")
+      createAndAddCondAlg( getPixelClusterNnCondAlg,         'PixelClusterNnCondAlg',          GetInputsInfo = do_runI)
+      createAndAddCondAlg( getPixelClusterNnWithTrackCondAlg,'PixelClusterNnWithTrackCondAlg', GetInputsInfo = do_runI)
+    else :
+
+      ######################################
+      # Temporary - pixel clustering setup #
+      ######################################
+      # Allow use of folder that exists but is not yet in global tag.
+      # Different names in different DB instances....
+      if not ('conddb' in dir()):
+        from IOVDbSvc.CondDB import conddb
+
+      if (conddb.dbmc == "OFLP200" or (conddb.dbdata=="OFLP200" and globalflags.DataSource=='data')) :
+        conddb.addOverride("/PIXEL/PixelClustering/PixelNNCalibJSON","PixelNNCalibJSON-SIM-RUN2-000-00")
+      if ((conddb.dbmc == "CONDBR2" and globalflags.DataSource!='data') or conddb.dbdata == "CONDBR2") :
+        conddb.addOverride("/PIXEL/PixelClustering/PixelNNCalibJSON","PixelNNCalibJSON-DATA-RUN2-000-00")
+      ## End of temporary code
+
+      log.debug("Setting up lwtnn system")
+      createAndAddCondAlg( getLWTNNCondAlg,                  'LWTNNCondAlg')
 
     from InDetRecExample.InDetJobProperties import InDetFlags
     kwargs = setDefaults( kwargs,
@@ -319,8 +359,10 @@ def getNnClusterizationFactory(name='NnClusterizationFactory', **kwargs) :
                           useRecenteringNNWithTracks         = False if do_runI else False,  # default,
                           correctLorShiftBarrelWithoutTracks = 0,
                           correctLorShiftBarrelWithTracks    = 0.030 if do_runI else 0.000,  # default,
+                          useTTrainedNetworks                = useTTrainedNetworks,
                           NnCollectionReadKey                = 'PixelClusterNN',
-                          NnCollectionWithTrackReadKey       = 'PixelClusterNNWithTrack')
+                          NnCollectionWithTrackReadKey       = 'PixelClusterNNWithTrack',
+                          NnCollectionJSONReadKey            = '' if useTTrainedNetworks else 'PixelClusterNNJSON')
     return InDet__NnClusterizationFactory(name=the_name, **kwargs)
 
 @makePublicTool
diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecConditionsAccess.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecConditionsAccess.py
index c6282395efc33255c797523da3043f3e15f9bf29..335ae6e7d84d2b6e177b8898547cfac3fb1ea86a 100644
--- a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecConditionsAccess.py
+++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecConditionsAccess.py
@@ -228,8 +228,7 @@ if DetFlags.pixel_on():
                 PixeldEdxAlg.CalibrationFile="dtpar_signed_234.txt"
             else:
                 PixeldEdxAlg.CalibrationFile="mcpar_signed_234.txt"
-
-
+ 
 #
 # --- Load SCT Conditions Services
 #
diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecLoadTools.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecLoadTools.py
index 800bf2d703a4e5b8470f7c0e4339617069be27ce..0652c33afd8be2a3b09c971ac6e3750b3e74baae 100755
--- a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecLoadTools.py
+++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecLoadTools.py
@@ -562,30 +562,6 @@ if (InDetFlags.doVertexFinding() or InDetFlags.doVertexFindingForMonitoring()) o
     InDetVtxSeedFinder = Trk__TrackDensitySeedFinder(name="GaussianDensitySeedFinder",
                                                      DensityEstimator=GaussDensityEstimator)
 
-  elif (InDetFlags.primaryVertexSetup() == 'MedImgMultiFinding'):
-    from TrkVertexSeedFinderUtils.TrkVertexSeedFinderUtilsConf import Trk__LocalMax1DClusterFinder, Trk__VertexImageMaker
-    InDetMedImgClusterFinder = Trk__LocalMax1DClusterFinder(name="InDetMedImgClusterFinder",
-                                                            weightThreshold=1500.0,
-                                                            mergeParameter=0.95,
-                                                            clusterWindowXY=0.34,
-                                                            refineZ=True,
-                                                            gaussianWindow=True)
-    ToolSvc += InDetMedImgClusterFinder
-    InDetMedImgMaker = Trk__VertexImageMaker(name="InDetMedImgMaker",
-                                             xbins=32,
-                                             ybins=32,
-                                             zbins=2048,
-                                             xrange=2.0,
-                                             yrange=2.0,
-                                             zrange=200.0,
-                                             cutoffFreqDenominator_xy=2,
-                                             cutoffFreqDenominator_z=1,
-                                             angularCutoffParameter=0.75)
-    ToolSvc += InDetMedImgMaker
-    from TrkVertexSeedFinderTools.TrkVertexSeedFinderToolsConf import Trk__ImagingSeedFinder
-    InDetVtxSeedFinder = Trk__ImagingSeedFinder(name="InDetMedImgSeedFinder",
-                                                VertexCluster=InDetMedImgClusterFinder,
-                                                VertexImageMaker=InDetMedImgMaker)
 
   elif (InDetFlags.doPrimaryVertex3DFinding()):
     from TrkVertexSeedFinderTools.TrkVertexSeedFinderToolsConf import Trk__CrossDistancesSeedFinder
@@ -780,7 +756,6 @@ if (InDetFlags.doVertexFinding() or InDetFlags.doVertexFindingForMonitoring()) o
   if (InDetFlags.primaryVertexSetup() == 'DefaultKalmanFinding' or
       InDetFlags.primaryVertexSetup() == 'DefaultAdaptiveFinding' or
       InDetFlags.primaryVertexSetup() == 'IterativeFinding' or
-      InDetFlags.primaryVertexSetup() == 'MedImgMultiFinding' or
       InDetFlags.primaryVertexSetup() == 'GaussIterativeFinding' ):
     from TrkVertexFitters.TrkVertexFittersConf import Trk__SequentialVertexSmoother
     InDetVertexSmoother = Trk__SequentialVertexSmoother(name = "InDetSequentialVertexSmoother")
@@ -817,27 +792,6 @@ if (InDetFlags.doVertexFinding() or InDetFlags.doVertexFindingForMonitoring()) o
                                                     VertexSmoother         = InDetVertexSmoother
                                                     # VertexUpdator   = # no setting required
                                                     )
-  elif (InDetFlags.primaryVertexSetup() == 'MedImgMultiFinding') :
-
-      from TrkVertexSeedFinderTools.TrkVertexSeedFinderToolsConf import Trk__CrossDistancesSeedFinder
-      InDet3DVtxSeedFinder = Trk__CrossDistancesSeedFinder(name                = "InDet3DCrossDistancesSeedFinder",
-                                                           trackdistcutoff     = 1.,
-                                                           trackdistexppower   = 2,
-                                                           # Mode1dFinder = # default, no setting needed
-                                                           )
-      ToolSvc+=InDet3DVtxSeedFinder
-      if (InDetFlags.doPrintConfigurables()):
-        printfunc (InDet3DVtxSeedFinder)
-    #
-    # --- load configured adaptive vertex fitter (with simplified seed finder for start point)
-    #
-      from TrkVertexFitters.TrkVertexFittersConf import Trk__AdaptiveVertexFitter
-      InDetVxFitterTool = Trk__AdaptiveVertexFitter(name                         = "InDetAdaptiveVxFitterTool",
-                                                    SeedFinder                   = InDet3DVtxSeedFinder,
-                                                    LinearizedTrackFactory       = InDetLinFactory,
-                                                    ImpactPoint3dEstimator       = InDetImpactPoint3dEstimator,
-                                                    AnnealingMaker               = InDetAnnealingMaker,
-                                                    VertexSmoother               = InDetVertexSmoother)
 
   elif (InDetFlags.primaryVertexSetup() == 'DefaultAdaptiveFinding' or
         InDetFlags.primaryVertexSetup() == 'IterativeFinding' or
diff --git a/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecLoadTools.py b/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecLoadTools.py
index 8cdd29a1ce71646b0ec09ce3ee3de9851583c92a..b6b7ddd76e5d125620845efe108c626eb6eb0d0c 100755
--- a/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecLoadTools.py
+++ b/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecLoadTools.py
@@ -225,11 +225,11 @@ if InDetTrigFlags.loadRotCreator():
 #
 if InDetTrigFlags.loadUpdator():
    
-  if InDetTrigFlags.kalmanUpdator() is "fast" :
+  if InDetTrigFlags.kalmanUpdator() == "fast" :
     # fast Kalman updator tool
     from TrkMeasurementUpdator_xk.TrkMeasurementUpdator_xkConf import Trk__KalmanUpdator_xk
     InDetTrigUpdator = Trk__KalmanUpdator_xk(name = 'InDetTrigUpdator')
-  elif InDetTrigFlags.kalmanUpdator() is "weight" :
+  elif InDetTrigFlags.kalmanUpdator() == "weight" :
     from TrkMeasurementUpdator.TrkMeasurementUpdatorConf import Trk__KalmanWeightUpdator as ConfiguredWeightUpdator
     InDetTrigUpdator = ConfiguredWeightUpdator(name='InDetTrigUpdator')
   else :
@@ -241,7 +241,7 @@ if InDetTrigFlags.loadUpdator():
     print (     InDetTrigUpdator)
 
   # ---------- control loading of the gsf updator
-  if InDetTrigFlags.trackFitterType() is 'GaussianSumFilter' :
+  if InDetTrigFlags.trackFitterType() == 'GaussianSumFilter' :
     # Load the Gsf Measurement Updator
 
     from TrkGaussianSumFilter.TrkGaussianSumFilterConf import Trk__GsfMeasurementUpdator
@@ -271,7 +271,7 @@ if InDetTrigFlags.loadExtrapolator():
   InDetTrigRKPropagator = Trk__RungeKuttaPropagator(name = 'InDetTrigRKPropagator')
   ToolSvc += InDetTrigRKPropagator
   
-  if InDetTrigFlags.propagatorType() is "STEP":
+  if InDetTrigFlags.propagatorType() == "STEP":
     InDetTrigPropagator = InDetTrigStepPropagator
   else:
     InDetTrigPropagator = InDetTrigRKPropagator
@@ -341,7 +341,7 @@ if InDetTrigFlags.loadExtrapolator():
 # ----------- control loading of fitters
 #
 if InDetTrigFlags.loadFitter():
-  if InDetTrigFlags.trackFitterType() is 'KalmanFitter' or InDetTrigFlags.trackFitterType() is 'KalmanDNAFitter':
+  if InDetTrigFlags.trackFitterType() == 'KalmanFitter' or InDetTrigFlags.trackFitterType() == 'KalmanDNAFitter':
 
     from InDetCompetingRIOsOnTrackTool.InDetCompetingRIOsOnTrackToolConf \
          import InDet__CompetingPixelClustersOnTrackTool as IDCPCOTT
@@ -378,7 +378,7 @@ if InDetTrigFlags.loadFitter():
     if (InDetTrigFlags.doPrintConfigurables()):
       print (InDetTrigKalmanInternalDAF)
 
-    if InDetTrigFlags.trackFitterType() is 'KalmanDNAFitter':
+    if InDetTrigFlags.trackFitterType() == 'KalmanDNAFitter':
       from TrkDynamicNoiseAdjustor.TrkDynamicNoiseAdjustorConf import Trk__InDetDynamicNoiseAdjustment
       InDetTrigDNAdjustor = Trk__InDetDynamicNoiseAdjustment(name       = 'InDetTrigDNAdjustor')
       ToolSvc += InDetTrigDNAdjustor
@@ -447,7 +447,7 @@ if InDetTrigFlags.loadFitter():
                                                       InternalDAFHandle              = InDetTrigKalmanInternalDAF)
 
     
-  elif InDetTrigFlags.trackFitterType() is 'DistributedKalmanFilter' :
+  elif InDetTrigFlags.trackFitterType() == 'DistributedKalmanFilter' :
    
     from TrkDistributedKalmanFilter.TrkDistributedKalmanFilterConf import Trk__DistributedKalmanFilter
     InDetTrigTrackFitter = Trk__DistributedKalmanFilter(name             = 'InDetTrigTrackFitter',
@@ -456,7 +456,7 @@ if InDetTrigFlags.loadFitter():
                                                         #sortingReferencePoint = ???
                                                         )
    
-  elif InDetTrigFlags.trackFitterType() is 'GlobalChi2Fitter' :
+  elif InDetTrigFlags.trackFitterType() == 'GlobalChi2Fitter' :
 
     from TrkGlobalChi2Fitter.TrkGlobalChi2FitterConf import Trk__GlobalChi2Fitter
     InDetTrigTrackFitter = Trk__GlobalChi2Fitter(name                  = 'InDetTrigTrackFitter',
@@ -561,7 +561,7 @@ if InDetTrigFlags.loadFitter():
     if InDetTrigFlags.doRobustReco():
       InDetTrigTrackFitterTRT.MaxOutliers=99
             
-  elif InDetTrigFlags.trackFitterType() is 'GaussianSumFilter' :
+  elif InDetTrigFlags.trackFitterType() == 'GaussianSumFilter' :
     #
     # component Reduction
     #
@@ -610,7 +610,7 @@ if InDetTrigFlags.loadFitter():
   if (InDetTrigFlags.doPrintConfigurables()):
     print (     InDetTrigTrackFitter)
     
-  if InDetTrigFlags.trackFitterType() is not 'GlobalChi2Fitter' :
+  if InDetTrigFlags.trackFitterType() != 'GlobalChi2Fitter' :
     InDetTrigTrackFitterTRT=InDetTrigTrackFitter
     InDetTrigTrackFitterLowPt=InDetTrigTrackFitter
     ToolSvc += InDetTrigTrackFitterLowPt
diff --git a/InnerDetector/InDetG4/SCT_G4_SD/src/SctSensorGmxSD.cxx b/InnerDetector/InDetG4/SCT_G4_SD/src/SctSensorGmxSD.cxx
index 6a8ef0e94b1b57d485e74938e0b894d7b99988cd..b6919875be1f58c31f97f11246de77c6201cfff2 100644
--- a/InnerDetector/InDetG4/SCT_G4_SD/src/SctSensorGmxSD.cxx
+++ b/InnerDetector/InDetG4/SCT_G4_SD/src/SctSensorGmxSD.cxx
@@ -49,14 +49,13 @@ G4bool SctSensorGmxSD::ProcessHits(G4Step *aStep, G4TouchableHistory * /* not us
   G4ThreeVector localPosition2 = transformation.TransformPoint(coord2);
   HepGeom::Point3D<double> lP1, lP2;
 
-  // GeoModelXml sensors with depth along local z
-  lP1[SiHit::xEta] = localPosition1[0]*CLHEP::mm;
+  lP1[SiHit::xEta] = localPosition1[2]*CLHEP::mm;
   lP1[SiHit::xPhi] = localPosition1[1]*CLHEP::mm;
-  lP1[SiHit::xDep] = localPosition1[2]*CLHEP::mm;
+  lP1[SiHit::xDep] = localPosition1[0]*CLHEP::mm;
 
-  lP2[SiHit::xEta] = localPosition2[0]*CLHEP::mm;
+  lP2[SiHit::xEta] = localPosition2[2]*CLHEP::mm;
   lP2[SiHit::xPhi] = localPosition2[1]*CLHEP::mm;
-  lP2[SiHit::xDep] = localPosition2[2]*CLHEP::mm;
+  lP2[SiHit::xDep] = localPosition2[0]*CLHEP::mm;
 
   //
   //    Get the indexes of which detector the hit is in
diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTOutputFile.hh b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTOutputFile.hh
index 1ffa44e9a93fe872a83b00d5653b3e65f6979581..0373cc1d91855ba2662b08667dc8cc317ea7932c 100644
--- a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTOutputFile.hh
+++ b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTOutputFile.hh
@@ -11,35 +11,24 @@
 #include "AthenaKernel/MsgStreamMember.h"
 #include "CxxUtils/checker_macros.h"
 
-class ATLAS_NOT_THREAD_SAFE TRTOutputFile // This class needs give non-const reference for output streaming. static TRTOutputFile* m_pOutputFile cannot be static const. Thread unsafe exit is also used.
+class TRTOutputFile
 {
 public:
-  ~TRTOutputFile();
-  
-  static TRTOutputFile* GetPointer()
-  {
-    if (!m_pOutputFile)
-      m_pOutputFile = new TRTOutputFile;
-    return m_pOutputFile;
-    }
+ 
+  static TRTOutputFile* GetPointer();
   
   std::ofstream& GetReference()
   {return m_output;}
  
-  MsgStream& msg (MSG::Level lvl) const { return m_msg << lvl; }
+  MsgStream& msg (MSG::Level lvl) { return m_msg << lvl; }
   bool msgLevel (MSG::Level lvl)    { return m_msg.get().level() <= lvl; }
 
 private:
   TRTOutputFile();
-  
-  
+  ~TRTOutputFile();
   
   std::ofstream m_output;
-  
-  static TRTOutputFile* m_pOutputFile;
-
-  mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE;
-
+  Athena::MsgStreamMember m_msg;
 };
 
 #endif
diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParameters.hh b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParameters.hh
index 70e8f70f714e9cba4c863e9926d0744ecb337bae..025bbe958cc54d89045d38a313e6ad165478cda0 100644
--- a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParameters.hh
+++ b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParameters.hh
@@ -11,17 +11,10 @@
 #include "AthenaKernel/MsgStreamMember.h"
 #include "CxxUtils/checker_macros.h"
 
-class ATLAS_NOT_THREAD_SAFE TRTParameters // static variable and thread unsafe exit are used.
+class TRTParameters
 {
 public:
-  ~TRTParameters();
-  
-  static TRTParameters* GetPointer()
-  {
-    if (!s_pParameters)
-      s_pParameters = new TRTParameters;
-    return s_pParameters;
-  }
+  static const TRTParameters* GetPointer();
   
   int GetInteger(std::string) const;
   double GetDouble(std::string) const;
@@ -31,11 +24,12 @@ public:
   void GetPartOfDoubleArray(std::string, int, double*) const;
   int GetElementOfIntegerArray(std::string, int) const;
 
-  MsgStream& msg (MSG::Level lvl) const { return m_msg << lvl; }
-  bool msgLevel (MSG::Level lvl)  const  { return m_msg.get().level() <= lvl; }
+  MsgStream& msg (MSG::Level lvl) { return m_msg << lvl; }
+  bool msgLevel (MSG::Level lvl) { return m_msg.get().level() <= lvl; }
 
 private:
   TRTParameters();
+  ~TRTParameters();
   
   void ReadInputFile(std::string);
   void PrintListOfParameters() const;
@@ -47,10 +41,7 @@ private:
   std::multimap<std::string, double, std::less<std::string> >::const_iterator
   multimapIterator;
   
-  static TRTParameters* s_pParameters;
-
-  mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE;
-
+  Athena::MsgStreamMember m_msg;
 };
 
 #endif
diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfBarrelStraws.hh b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfBarrelStraws.hh
index 62d1cb3ec7d92315fe785859a41c20389729ffad..a292913192e67ea15355919bdaf1da8a56d6180b 100644
--- a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfBarrelStraws.hh
+++ b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfBarrelStraws.hh
@@ -13,7 +13,7 @@
 class TRTParameters;
 
 
-class ATLAS_NOT_THREAD_SAFE TRTParametersOfBarrelStraws // Thread unsafe TRTParameters class is used.
+class TRTParametersOfBarrelStraws
 {
   friend class TRTConstructionOfBarrelStraws;
 
@@ -21,14 +21,14 @@ class ATLAS_NOT_THREAD_SAFE TRTParametersOfBarrelStraws // Thread unsafe TRTPara
     TRTParametersOfBarrelStraws();
     ~TRTParametersOfBarrelStraws();
 
-    MsgStream& msg (MSG::Level lvl) const { return m_msg << lvl; }
-    bool msgLevel (MSG::Level lvl) const   { return m_msg.get().level() <= lvl; }
+    MsgStream& msg (MSG::Level lvl) { return m_msg << lvl; }
+    bool msgLevel (MSG::Level lvl)   { return m_msg.get().level() <= lvl; }
 
   private:
     TRTParametersOfBarrelStraws (const TRTParametersOfBarrelStraws&); 
     TRTParametersOfBarrelStraws& operator= (const TRTParametersOfBarrelStraws&); 
     void DefineParameters();
-    void PrintParameters() const;
+    void PrintParameters(MsgStream& msg) const;
 
     double m_outerRadiusOfStrawHole;
     double m_lengthOfStrawHole;
@@ -61,10 +61,9 @@ class ATLAS_NOT_THREAD_SAFE TRTParametersOfBarrelStraws // Thread unsafe TRTPara
     double m_outerRadiusOfWire;
     double m_lengthOfWire;
 
-    TRTParameters* m_pParameters;
-
-    mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE;
+    const TRTParameters* m_pParameters;
 
+    Athena::MsgStreamMember m_msg;
 };
 
 #endif
diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfModulesA.hh b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfModulesA.hh
index 61cc54b44570e3795a0ed2bedae090699c65579e..700dfbeac9619933f4bcedeaa63180fe1aa1c36f 100644
--- a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfModulesA.hh
+++ b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfModulesA.hh
@@ -13,7 +13,7 @@
 class TRTParameters;
 
 
-class ATLAS_NOT_THREAD_SAFE TRTParametersOfModulesA // Thread unsafe TRTParameters class is used.
+class TRTParametersOfModulesA
 {
   friend class TRTConstructionOfModulesA;
   
@@ -21,14 +21,14 @@ public:
   TRTParametersOfModulesA();
   ~TRTParametersOfModulesA();
 
-  MsgStream& msg (MSG::Level lvl) const { return m_msg << lvl; }
-  bool msgLevel (MSG::Level lvl) const  { return m_msg.get().level() <= lvl; }
+  MsgStream& msg (MSG::Level lvl) { return m_msg << lvl; }
+  bool msgLevel (MSG::Level lvl)  { return m_msg.get().level() <= lvl; }
   
 private:
   TRTParametersOfModulesA (const TRTParametersOfModulesA&); 
   TRTParametersOfModulesA& operator= (const TRTParametersOfModulesA&); 
   void DefineParameters();
-  void PrintParameters(double*, double*) const;
+  void PrintParameters(MsgStream& msg, double*, double*) const;
   
   double m_baseOfShellTrd1A;
   double m_heightOfShellTrd1A;
@@ -72,10 +72,9 @@ private:
 
   int m_numberOfShortStrawsA;
   
-  TRTParameters* m_pParameters;
+  const TRTParameters* m_pParameters;
   
-  mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE;
-
+  Athena::MsgStreamMember m_msg;
 };
 
 #endif
diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfModulesB.hh b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfModulesB.hh
index 95b7c0e93bd8f0da1d63f46567da57ffd6855bf9..a72270fd1e2416e0ac30fa3c0bac06401df6d657 100644
--- a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfModulesB.hh
+++ b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfModulesB.hh
@@ -13,7 +13,7 @@
 class TRTParameters;
 
 
-class ATLAS_NOT_THREAD_SAFE TRTParametersOfModulesB // Thread unsafe TRTParameters class is used.
+class TRTParametersOfModulesB
 {
   friend class TRTConstructionOfModulesB;
 
@@ -21,14 +21,14 @@ class ATLAS_NOT_THREAD_SAFE TRTParametersOfModulesB // Thread unsafe TRTParamete
     TRTParametersOfModulesB();
     ~TRTParametersOfModulesB();
    
-     MsgStream& msg (MSG::Level lvl) const { return m_msg << lvl; }
-     bool msgLevel (MSG::Level lvl) const    { return m_msg.get().level() <= lvl; }
+     MsgStream& msg (MSG::Level lvl) { return m_msg << lvl; }
+     bool msgLevel (MSG::Level lvl)    { return m_msg.get().level() <= lvl; }
 
   private:
     TRTParametersOfModulesB (const TRTParametersOfModulesB&); 
     TRTParametersOfModulesB& operator= (const TRTParametersOfModulesB&); 
     void DefineParameters();
-    void PrintParameters(double*, double*) const;
+    void PrintParameters(MsgStream& msg, double*, double*) const;
 
     double m_baseOfShellTrd1B;
     double m_heightOfShellTrd1B;
@@ -75,10 +75,9 @@ class ATLAS_NOT_THREAD_SAFE TRTParametersOfModulesB // Thread unsafe TRTParamete
     double* m_xOfHolesForCoolingTubesB;
     double* m_zOfHolesForCoolingTubesB;
 
-    TRTParameters* m_pParameters;
-
-    mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE;
+    const TRTParameters* m_pParameters;
 
+    Athena::MsgStreamMember m_msg;
 };
 
 #endif
diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfModulesC.hh b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfModulesC.hh
index 10a02d6d2d3f06a7af8c9b7db4bc726b652ef49b..73bb514bc89bd5dd896522f20cdfdf12c9c8ecfb 100644
--- a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfModulesC.hh
+++ b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfModulesC.hh
@@ -13,7 +13,7 @@
 class TRTParameters;
 
 
-class ATLAS_NOT_THREAD_SAFE TRTParametersOfModulesC // Thread unsafe TRTParameters class is used.
+class TRTParametersOfModulesC
 {
   friend class TRTConstructionOfModulesC;
 
@@ -21,14 +21,14 @@ public:
   TRTParametersOfModulesC();
   ~TRTParametersOfModulesC();
   
-  MsgStream& msg (MSG::Level lvl) const { return m_msg << lvl; }
-  bool msgLevel (MSG::Level lvl) const    { return m_msg.get().level() <= lvl; }
+  MsgStream& msg (MSG::Level lvl) { return m_msg << lvl; }
+  bool msgLevel (MSG::Level lvl)    { return m_msg.get().level() <= lvl; }
   
 private:
   TRTParametersOfModulesC (const TRTParametersOfModulesC&); 
   TRTParametersOfModulesC& operator= (const TRTParametersOfModulesC&); 
   void DefineParameters();
-  void PrintParameters(double*, double*) const;
+  void PrintParameters(MsgStream& msg, double*, double*) const;
   
   double m_baseOfShellTrd1C;
   double m_heightOfShellTrd1C;
@@ -75,9 +75,9 @@ private:
   double* m_xOfHolesForCoolingTubesC;
   double* m_zOfHolesForCoolingTubesC;
   
-  TRTParameters* m_pParameters;
+  const TRTParameters* m_pParameters;
 
-  mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE;
+  Athena::MsgStreamMember m_msg;
 
 };
 
diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfStrawPlanes.hh b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfStrawPlanes.hh
index 98373f53ff22794307e4d3a4a4d6303db389733e..430012292369408442a346f74239908486277db3 100644
--- a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfStrawPlanes.hh
+++ b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfStrawPlanes.hh
@@ -13,7 +13,7 @@
 class TRTParameters;
 
 
-class ATLAS_NOT_THREAD_SAFE TRTParametersOfStrawPlanes // Thread unsafe TRTParameters class is used.
+class TRTParametersOfStrawPlanes
 {
   friend class TRTConstructionOfStrawPlanes;
 
@@ -21,14 +21,14 @@ class ATLAS_NOT_THREAD_SAFE TRTParametersOfStrawPlanes // Thread unsafe TRTParam
     TRTParametersOfStrawPlanes();
     ~TRTParametersOfStrawPlanes();
 
-    MsgStream& msg (MSG::Level lvl) const { return m_msg << lvl; }
-    bool msgLevel (MSG::Level lvl) const   { return m_msg.get().level() <= lvl; }
+    MsgStream& msg (MSG::Level lvl) { return m_msg << lvl; }
+    bool msgLevel (MSG::Level lvl)   { return m_msg.get().level() <= lvl; }
 
   private:
     TRTParametersOfStrawPlanes (const TRTParametersOfStrawPlanes&); 
     TRTParametersOfStrawPlanes& operator= (const TRTParametersOfStrawPlanes&); 
     void DefineParameters();
-    void PrintParameters() const;
+    void PrintParameters(MsgStream& msg) const;
 
     double m_innerRadiusOfStrawPlanesAB;
     double m_innerRadiusOfStrawPlaneC;
@@ -72,9 +72,9 @@ class ATLAS_NOT_THREAD_SAFE TRTParametersOfStrawPlanes // Thread unsafe TRTParam
     double m_lengthOfWiresAB;
     double m_lengthOfWireC;
 
-    TRTParameters* m_pParameters;
+    const TRTParameters* m_pParameters;
 
-    mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE;
+    Athena::MsgStreamMember m_msg;
 
 };
 
diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfWheelsA.hh b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfWheelsA.hh
index 7076b52b4e8759ed377e228a4f37555470c49631..a6a79461fe8404cdcb1e319a9f8ef6edd594e5c3 100644
--- a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfWheelsA.hh
+++ b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfWheelsA.hh
@@ -13,7 +13,7 @@
 class TRTParameters;
 
 
-class ATLAS_NOT_THREAD_SAFE TRTParametersOfWheelsA // Thread unsafe TRTParameters class is used.
+class TRTParametersOfWheelsA
 {
   friend class TRTConstructionOfWheelsA;
 
@@ -21,15 +21,15 @@ class ATLAS_NOT_THREAD_SAFE TRTParametersOfWheelsA // Thread unsafe TRTParameter
     TRTParametersOfWheelsA();
     ~TRTParametersOfWheelsA();
   
-    MsgStream& msg (MSG::Level lvl) const { return m_msg << lvl; }
-    bool msgLevel (MSG::Level lvl) const   { return m_msg.get().level() <= lvl; }
+    MsgStream& msg (MSG::Level lvl) { return m_msg << lvl; }
+    bool msgLevel (MSG::Level lvl)   { return m_msg.get().level() <= lvl; }
 
   private:
     TRTParametersOfWheelsA (const TRTParametersOfWheelsA&); 
     TRTParametersOfWheelsA& operator= (const TRTParametersOfWheelsA&); 
 
     void DefineParameters();
-    void PrintParameters() const;
+    void PrintParameters(MsgStream& msg) const;
 
     int m_numberOfWheelsA;
     double m_distanceBetweenWheelsA;
@@ -66,9 +66,9 @@ class ATLAS_NOT_THREAD_SAFE TRTParametersOfWheelsA // Thread unsafe TRTParameter
     double m_outerRadiusOfThinRadiatorA;
     double m_lengthOfThinRadiatorA;
 
-    TRTParameters* m_pParameters;
+    const TRTParameters* m_pParameters;
   
-    mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE;
+    Athena::MsgStreamMember m_msg;
 };
 
 #endif
diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfWheelsB.hh b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfWheelsB.hh
index fbd27905e4da5bc9607356db05185cb6460c4ec6..19a7d530c61d4df92b4e4cccf621a92a7bff3bc9 100644
--- a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfWheelsB.hh
+++ b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfWheelsB.hh
@@ -13,7 +13,7 @@
 class TRTParameters;
 
 
-class ATLAS_NOT_THREAD_SAFE TRTParametersOfWheelsB // Thread unsafe TRTParameters class is used.
+class TRTParametersOfWheelsB
 {
   friend class TRTConstructionOfWheelsB;
 
@@ -21,15 +21,15 @@ class ATLAS_NOT_THREAD_SAFE TRTParametersOfWheelsB // Thread unsafe TRTParameter
     TRTParametersOfWheelsB();
     ~TRTParametersOfWheelsB();
 
-    MsgStream& msg (MSG::Level lvl) const { return m_msg << lvl; }
-    bool msgLevel (MSG::Level lvl) const   { return m_msg.get().level() <= lvl; }
+    MsgStream& msg (MSG::Level lvl) { return m_msg << lvl; }
+    bool msgLevel (MSG::Level lvl) { return m_msg.get().level() <= lvl; }
  
   private:
     TRTParametersOfWheelsB (const TRTParametersOfWheelsB&); 
     TRTParametersOfWheelsB& operator= (const TRTParametersOfWheelsB&); 
 
     void DefineParameters();
-    void PrintParameters() const;
+    void PrintParameters(MsgStream& msg) const;
 
     int m_numberOfWheelsB;
     double m_distanceBetweenWheelsB;
@@ -73,9 +73,9 @@ class ATLAS_NOT_THREAD_SAFE TRTParametersOfWheelsB // Thread unsafe TRTParameter
     double m_outerRadiusOfMiddleRadiatorB;
     double m_lengthOfMiddleRadiatorB;
 
-    TRTParameters* m_pParameters;
+    const TRTParameters* m_pParameters;
   
-    mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE;
+    Athena::MsgStreamMember m_msg;
 };
 
 #endif
diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfWheelsC.hh b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfWheelsC.hh
index a3b79e86d930e1bcd6ce153e05247b082cdc2795..eeb0c82be475f568118dedb551f431d9f4c47597 100644
--- a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfWheelsC.hh
+++ b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfWheelsC.hh
@@ -13,7 +13,7 @@
 class TRTParameters;
 
 
-class ATLAS_NOT_THREAD_SAFE TRTParametersOfWheelsC // Thread unsafe TRTParameters class is used.
+class TRTParametersOfWheelsC
 {
   friend class TRTConstructionOfWheelsC;
 
@@ -21,15 +21,15 @@ class ATLAS_NOT_THREAD_SAFE TRTParametersOfWheelsC // Thread unsafe TRTParameter
     TRTParametersOfWheelsC();
     ~TRTParametersOfWheelsC();
 
-     MsgStream& msg (MSG::Level lvl) const { return m_msg << lvl; }
-     bool msgLevel (MSG::Level lvl) const   { return m_msg.get().level() <= lvl; }
+     MsgStream& msg (MSG::Level lvl) { return m_msg << lvl; }
+     bool msgLevel (MSG::Level lvl) { return m_msg.get().level() <= lvl; }
 
   private:
     TRTParametersOfWheelsC (const TRTParametersOfWheelsC&); 
     TRTParametersOfWheelsC& operator= (const TRTParametersOfWheelsC&); 
 
     void DefineParameters();
-    void PrintParameters() const;
+    void PrintParameters(MsgStream& msg) const;
 
     int m_numberOfWheelsC;
     double m_distanceBetweenWheelsC;
@@ -66,9 +66,9 @@ class ATLAS_NOT_THREAD_SAFE TRTParametersOfWheelsC // Thread unsafe TRTParameter
     double m_outerRadiusOfThinRadiatorC;
     double m_lengthOfThinRadiatorC;
 
-    TRTParameters* m_pParameters;
+    const TRTParameters* m_pParameters;
  
-    mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE;
+    Athena::MsgStreamMember m_msg;
 };
 
 #endif
diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTUtilities.hh b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTUtilities.hh
index 4f0aaf3bf3cf3384b6fbcfec7e9685efe6de9606..5808681ca5ffd881c1001ffad309217d04d13dec 100644
--- a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTUtilities.hh
+++ b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTUtilities.hh
@@ -13,38 +13,14 @@
 class TRTOutputFile;
 
 
-class ATLAS_NOT_THREAD_SAFE TRTUtilities // This class uses thread unsafe TRTOutputFile. static TRTUtilities utilities cannot be static const for output streaming.
+namespace TRTUtilities
 {
-public:
-    ~TRTUtilities();
-  
-  static TRTUtilities* GetPointer()
-  {
-    if (!s_pUtilities)
-      s_pUtilities = new TRTUtilities;
-    return s_pUtilities;
-  }
-  
   std::string NumberToString(int);
   
-  void PrintTubeParameters(double, double);
-  void PrintTubeParameters(double, double, double);
-  void PrintTubeParameters(double, double, double, double);
-
-  MsgStream& msg (MSG::Level lvl) const { return m_msg << lvl; }
-  bool msgLevel (MSG::Level lvl)    { return m_msg.get().level() <= lvl; }
-
-private:
-  TRTUtilities();
-  
-  std::ofstream& GetReference();
-
-  TRTOutputFile* m_pOutputFile;
-  
-  static TRTUtilities* s_pUtilities;
-
-  mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE;
+  void PrintTubeParameters(TRTOutputFile& f, double, double);
+  void PrintTubeParameters(TRTOutputFile& f, double, double, double);
+  void PrintTubeParameters(TRTOutputFile& f, double, double, double, double);
+}
 
-};
 
 #endif
diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTVisualization.hh b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTVisualization.hh
index 2e469b410c9ff254815b20021dc09584b8e935e8..438db2d5f803b71f236315e54e77f64084a5a5aa 100644
--- a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTVisualization.hh
+++ b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTVisualization.hh
@@ -14,26 +14,18 @@ class G4LogicalVolume;
 class G4VisAttributes;
 
 
-class ATLAS_NOT_THREAD_SAFE TRTVisualization // static variable and thread unsafe exit are used.
+class TRTVisualization
 {
   public:
+    TRTVisualization();
     ~TRTVisualization();
 
-    static TRTVisualization* GetPointer()
-    {
-      if (!s_pVisualization)
-        s_pVisualization = new TRTVisualization;
-      return s_pVisualization;
-    }
-
     void Visualize(G4LogicalVolume*, int);
  
-    MsgStream& msg (MSG::Level lvl) const { return m_msg << lvl; }
+    MsgStream& msg (MSG::Level lvl) { return m_msg << lvl; }
     bool msgLevel (MSG::Level lvl)    { return m_msg.get().level() <= lvl; }
 
   private:
-    TRTVisualization();
-
     void Initialize();
 
     G4VisAttributes* m_pVisAttributeRed;
@@ -44,10 +36,7 @@ class ATLAS_NOT_THREAD_SAFE TRTVisualization // static variable and thread unsaf
     G4VisAttributes* m_pVisAttributeCyan;
     G4VisAttributes* m_pVisAttributeBlack;
 
-    static TRTVisualization* s_pVisualization;
-
-    mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE;
-
+    Athena::MsgStreamMember m_msg;
 };
 
 #endif
diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/share/ut_TRT_G4UtilitiesTest.ref b/InnerDetector/InDetG4/TRT_G4Utilities/share/ut_TRT_G4UtilitiesTest.ref
index 852c6dd72d82f936dde0ccc7070307f9f9f5c626..3c74de17e85b6b0363e87f97df162a1a71d15aff 100644
--- a/InnerDetector/InDetG4/TRT_G4Utilities/share/ut_TRT_G4UtilitiesTest.ref
+++ b/InnerDetector/InDetG4/TRT_G4Utilities/share/ut_TRT_G4UtilitiesTest.ref
@@ -1,9 +1,6 @@
 Running 7 test cases...
 Athena::getMessageSvc: WARNING MessageSvc not found, will use std::cout
 Athena::getMessageSvc: WARNING MessageSvc not found, will use std::cout
-Athena::getMessageSvc: WARNING MessageSvc not found, will use std::cout
-Athena::getMessageSvc: WARNING MessageSvc not found, will use std::cout
-Athena::getMessageSvc: WARNING MessageSvc not found, will use std::cout
-Athena::getMessageSvc: WARNING MessageSvc not found, will use std::cout
-Athena::getMessageSvc: WARNING MessageSvc not found, will use std::cout
-*** No errors detected
+
+*** No errors detected
+
\ No newline at end of file
diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTOutputFile.cc b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTOutputFile.cc
index 7ee44c936131f490d699fcee7db15f16ae54a4ea..35fa501b3bd5a34bd871a2076e26352c002b06fb 100644
--- a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTOutputFile.cc
+++ b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTOutputFile.cc
@@ -1,15 +1,11 @@
 /*
-  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 "TRT_G4Utilities/TRTOutputFile.hh"
 #include <fstream>
 
-
-TRTOutputFile* TRTOutputFile::m_pOutputFile = NULL;
-
-
   // Called by GetPointer
 
 TRTOutputFile::TRTOutputFile() : m_output("TRTOutput", std::ios::out), m_msg("TRTOutputFile")
@@ -31,7 +27,12 @@ TRTOutputFile::~TRTOutputFile()
 
   m_output.close();
 
-  m_pOutputFile = NULL;
-
   if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "####### Destructor TRTOutputFile done" << endmsg;
 }
+
+
+TRTOutputFile* TRTOutputFile::GetPointer()
+{
+  static TRTOutputFile f ATLAS_THREAD_SAFE;
+  return &f;
+}
diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParameters.cc b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParameters.cc
index b8692eea93f56ced715c6020e07a9817a6d9d4e9..2266c13306ea4e643b36772bd8b0834079a980d8 100644
--- a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParameters.cc
+++ b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParameters.cc
@@ -8,10 +8,14 @@
 #include <fstream>
 
 
-TRTParameters* TRTParameters::s_pParameters = NULL;
+const TRTParameters* TRTParameters::GetPointer()
+{
+  static TRTParameters parameters ATLAS_THREAD_SAFE;
+  return &parameters;
+}
 
 
-  // Called by GetPointer
+// Called by GetPointer
 
 TRTParameters::TRTParameters() : m_msg("TRTParameters")
 {
@@ -34,15 +38,13 @@ TRTParameters::~TRTParameters()
 {
   if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "####### Destructor TRTParameters" << endmsg;
 
-  s_pParameters = NULL;
-
   if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "####### Destructor TRTParameters done" << endmsg;
 }
 
 
   // Called by TRTParameters
 
-void TRTParameters::ReadInputFile ATLAS_NOT_THREAD_SAFE (std::string fileName) // Thread unsafe exit function is used.
+void TRTParameters::ReadInputFile(std::string fileName)
 {
   if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "######### Method TRTParameters::ReadInputFile" << endmsg;
 
@@ -55,7 +57,7 @@ void TRTParameters::ReadInputFile ATLAS_NOT_THREAD_SAFE (std::string fileName) /
     std::cerr << "***** TRTParameters::ReadInputFile *****" << std::endl;
     std::cerr << "  Cannot open input file '" << fileName << "'." << std::endl;
     std::cerr << "  Exit!" << std::endl << std::endl;
-    exit(0);
+    std::abort();
   }
 
   int inputState = 0;
@@ -88,7 +90,7 @@ void TRTParameters::ReadInputFile ATLAS_NOT_THREAD_SAFE (std::string fileName) /
 	std::cerr << "  Last parameter '" << parameterName << "'." << std::endl;
         std::cerr << "  Cannot find symbol '='." << std::endl;
         std::cerr << "  Exit!" << std::endl << std::endl;
-        exit(0);
+        std::abort();
       }
     }
     else if (inputState == 3)
@@ -108,7 +110,7 @@ void TRTParameters::ReadInputFile ATLAS_NOT_THREAD_SAFE (std::string fileName) /
           std::cerr << "  Last parameter '" << parameterName << "'." << std::endl;
           std::cerr << "  Unexpected symbol '>'." << std::endl;
           std::cerr << "  Exit!" << std::endl << std::endl;
-          exit(0);
+          std::abort();
         }
       }
       else if (inputString == "<")
@@ -119,7 +121,7 @@ void TRTParameters::ReadInputFile ATLAS_NOT_THREAD_SAFE (std::string fileName) /
         std::cerr << "  Last parameter '" << parameterName << "'." << std::endl;
         std::cerr << "  Unexpected symbol '<'." << std::endl;
         std::cerr << "  Exit!" << std::endl << std::endl;
-        exit(0);
+        std::abort();
       }
       else
       {
@@ -138,7 +140,7 @@ void TRTParameters::ReadInputFile ATLAS_NOT_THREAD_SAFE (std::string fileName) /
     std::cerr << "  Last parameter '" << parameterName << "'." << std::endl;
     std::cerr << "  Cannot find symbol '>' at the end of file." << std::endl;
     std::cerr << "  Exit!" << std::endl << std::endl;
-    exit(0);
+    std::abort();
   }
 
   inputFile.close();
@@ -149,10 +151,8 @@ void TRTParameters::ReadInputFile ATLAS_NOT_THREAD_SAFE (std::string fileName) /
 
   // Called by TRTParameters
 
-void TRTParameters::PrintListOfParameters ATLAS_NOT_THREAD_SAFE () const // Thread unsafe TRTOutputFile class is used.
+void TRTParameters::PrintListOfParameters() const
 {
-  if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "######### Method TRTParameters::PrintListOfParameters" << endmsg;
-
   TRTOutputFile* pOutputFile = TRTOutputFile::GetPointer();
 
   std::ofstream& output = pOutputFile->GetReference();
@@ -164,14 +164,12 @@ void TRTParameters::PrintListOfParameters ATLAS_NOT_THREAD_SAFE () const // Thre
     i != m_multimapOfParameters.end(); ++i)
     output << "  " << (*i).first << "=" << (*i).second << std::endl;
   output << std::endl;
-
-  if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "######### Method TRTParameters::PrintListOfParameters done" << endmsg;
 }
 
 
   // Called on demand
 
-int TRTParameters::GetInteger ATLAS_NOT_THREAD_SAFE (std::string parameterName) const // Thread unsafe exit function is used.
+int TRTParameters::GetInteger(std::string parameterName) const
 {
   int numberOfItems = m_multimapOfParameters.count(parameterName);
 
@@ -187,7 +185,7 @@ int TRTParameters::GetInteger ATLAS_NOT_THREAD_SAFE (std::string parameterName)
     std::cerr << "***** TRTParameters::GetInteger *****" << std::endl;
     std::cerr << "  Cannot find parameter '" << parameterName << "'." << std::endl;
     std::cerr << "  Exit!" << std::endl << std::endl;
-    exit(0);
+    std::abort();
   }
   else
   {
@@ -196,14 +194,14 @@ int TRTParameters::GetInteger ATLAS_NOT_THREAD_SAFE (std::string parameterName)
     std::cerr << "  Parameter '" << parameterName << "' has " << numberOfItems
            << " copies." << std::endl;
     std::cerr << "  Exit!" << std::endl << std::endl;
-    exit(0);
+    std::abort();
   }
 }
 
 
   // Called on demand
 
-double TRTParameters::GetDouble ATLAS_NOT_THREAD_SAFE (std::string parameterName) const // Thread unsafe exit function is used.
+double TRTParameters::GetDouble(std::string parameterName) const
 {
   int numberOfItems = m_multimapOfParameters.count(parameterName);
 
@@ -219,7 +217,7 @@ double TRTParameters::GetDouble ATLAS_NOT_THREAD_SAFE (std::string parameterName
     std::cerr << "***** TRTParameters::GetDouble *****" << std::endl;
     std::cerr << "  Cannot find parameter '" << parameterName << "'." << std::endl;
     std::cerr << "  Exit!" << std::endl << std::endl;
-    exit(0);
+    std::abort();
   }
   else
   {
@@ -228,15 +226,15 @@ double TRTParameters::GetDouble ATLAS_NOT_THREAD_SAFE (std::string parameterName
     std::cerr << "  Parameter '" << parameterName << "' has " << numberOfItems
            << " copies." << std::endl;
     std::cerr << "  Exit!" << std::endl << std::endl;
-    exit(0);
+    std::abort();
   }
 }
 
 
   // Called on demand
 
-void TRTParameters::GetIntegerArray ATLAS_NOT_THREAD_SAFE (std::string arrayName, int arraySize, // Thread unsafe exit function is used.
-  int* array) const
+void TRTParameters::GetIntegerArray(std::string arrayName, int arraySize,
+                                    int* array) const
 {
   int numberOfItems = m_multimapOfParameters.count(arrayName);
 
@@ -252,7 +250,7 @@ void TRTParameters::GetIntegerArray ATLAS_NOT_THREAD_SAFE (std::string arrayName
     std::cerr << "***** TRTParameters::GetIntegerArray *****" << std::endl;
     std::cerr << "  Cannot find array '" << arrayName << "'." << std::endl;
     std::cerr << "  Exit!" << std::endl << std::endl;
-    exit(0);
+    std::abort();
   }
   else
   {
@@ -262,15 +260,15 @@ void TRTParameters::GetIntegerArray ATLAS_NOT_THREAD_SAFE (std::string arrayName
            << "." << std::endl;
     std::cerr << "  Demanded size is " << arraySize << "." << std::endl;
     std::cerr << "  Exit!" << std::endl << std::endl;
-    exit(0);
+    std::abort();
   }
 }
 
 
   // Called on demand
 
-void TRTParameters::GetDoubleArray ATLAS_NOT_THREAD_SAFE (std::string arrayName, int arraySize, // Thread unsafe exit function is used.
-  double* array) const
+void TRTParameters::GetDoubleArray(std::string arrayName, int arraySize,
+                                   double* array) const
 {
   int numberOfItems = m_multimapOfParameters.count(arrayName);
 
@@ -286,7 +284,7 @@ void TRTParameters::GetDoubleArray ATLAS_NOT_THREAD_SAFE (std::string arrayName,
     std::cerr << "***** TRTParameters::GetDoubleArray *****" << std::endl;
     std::cerr << "  Cannot find array '" << arrayName << "'." << std::endl;
     std::cerr << "  Exit!" << std::endl << std::endl;
-    exit(0);
+    std::abort();
   }
   else
   {
@@ -296,15 +294,15 @@ void TRTParameters::GetDoubleArray ATLAS_NOT_THREAD_SAFE (std::string arrayName,
            << "." << std::endl;
     std::cerr << "  Demanded size is " << arraySize << "." << std::endl;
     std::cerr << "  Exit!" << std::endl << std::endl;
-    exit(0);
+    std::abort();
   }
 }
 
 
   // Called on demand
 
-void TRTParameters::GetPartOfIntegerArray ATLAS_NOT_THREAD_SAFE (std::string arrayName, // Thread unsafe exit function is used.
-  int numberOfDemandedElements, int* array) const
+void TRTParameters::GetPartOfIntegerArray(std::string arrayName,
+                                          int numberOfDemandedElements, int* array) const
 {
   int numberOfItems = m_multimapOfParameters.count(arrayName);
 
@@ -320,7 +318,7 @@ void TRTParameters::GetPartOfIntegerArray ATLAS_NOT_THREAD_SAFE (std::string arr
     std::cerr << "***** TRTParameters::GetPartOfIntegerArray *****" << std::endl;
     std::cerr << "  Cannot find array '" << arrayName << "'." << std::endl;
     std::cerr << "  Exit!" << std::endl << std::endl;
-    exit(0);
+    std::abort();
   }
   else
   {
@@ -331,15 +329,15 @@ void TRTParameters::GetPartOfIntegerArray ATLAS_NOT_THREAD_SAFE (std::string arr
     std::cerr << "  Number of demanded elements " << numberOfDemandedElements
            << "." << std::endl;
     std::cerr << "  Exit!" << std::endl << std::endl;
-    exit(0);
+    std::abort();
   }
 }
 
 
   // Called on demand
 
-void TRTParameters::GetPartOfDoubleArray ATLAS_NOT_THREAD_SAFE (std::string arrayName, // Thread unsafe exit function is used.
-  int numberOfDemandedElements, double* array) const
+void TRTParameters::GetPartOfDoubleArray(std::string arrayName,
+                                         int numberOfDemandedElements, double* array) const
 {
   int numberOfItems = m_multimapOfParameters.count(arrayName);
 
@@ -355,7 +353,7 @@ void TRTParameters::GetPartOfDoubleArray ATLAS_NOT_THREAD_SAFE (std::string arra
     std::cerr << "***** TRTParameters::GetPartOfDoubleArray *****" << std::endl;
     std::cerr << "  Cannot find array '" << arrayName << "'." << std::endl;
     std::cerr << "  Exit!" << std::endl << std::endl;
-    exit(0);
+    std::abort();
   }
   else
   {
@@ -366,15 +364,15 @@ void TRTParameters::GetPartOfDoubleArray ATLAS_NOT_THREAD_SAFE (std::string arra
     std::cerr << "  Number of demanded elements " << numberOfDemandedElements
            << "." << std::endl;
     std::cerr << "  Exit!" << std::endl << std::endl;
-    exit(0);
+    std::abort();
   }
 }
 
 
   // Called on demand
 
-int TRTParameters::GetElementOfIntegerArray ATLAS_NOT_THREAD_SAFE (std::string arrayName, // Thread unsafe exit function is used.
-  int elementIndex) const
+int TRTParameters::GetElementOfIntegerArray(std::string arrayName,
+                                            int elementIndex) const
 {
   int numberOfItems = m_multimapOfParameters.count(arrayName);
 
@@ -390,7 +388,7 @@ int TRTParameters::GetElementOfIntegerArray ATLAS_NOT_THREAD_SAFE (std::string a
     std::cerr << "***** TRTParameters::GetElementOfIntegerArray *****" << std::endl;
     std::cerr << "  Cannot find array '" << arrayName << "'." << std::endl;
     std::cerr << "  Exit!" << std::endl << std::endl;
-    exit(0);
+    std::abort();
   }
   else
   {
@@ -400,6 +398,6 @@ int TRTParameters::GetElementOfIntegerArray ATLAS_NOT_THREAD_SAFE (std::string a
            << arrayName << "'." << std::endl;
     std::cerr << "  Array size " << numberOfItems << "." << std::endl;
     std::cerr << "  Exit!" << std::endl << std::endl;
-    exit(0);
+    std::abort();
   }
 }
diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfBarrelStraws.cc b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfBarrelStraws.cc
index 028f16c49ae490f217512633ec94bd7e3df34c89..9144ee438116c0eb5d858bc3e10f7b7ef44bc21b 100644
--- a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfBarrelStraws.cc
+++ b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfBarrelStraws.cc
@@ -21,7 +21,7 @@ TRTParametersOfBarrelStraws::TRTParametersOfBarrelStraws(): m_msg("TRTParameters
   DefineParameters();
 
   if (m_pParameters->GetInteger("PrintParametersOfBarrelStraws"))
-    PrintParameters();
+    PrintParameters(m_msg.get());
 
   if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "##### Constructor TRTParametersOfBarrelStraws done" << endmsg;
 }
@@ -91,12 +91,11 @@ void TRTParametersOfBarrelStraws::DefineParameters()
 
 // Called by TRTParametersOfBarrelStraws
 
-void TRTParametersOfBarrelStraws::PrintParameters ATLAS_NOT_THREAD_SAFE () const // Thread unsafe TRTUtilities and TRTOutputFile classes are used.
+void TRTParametersOfBarrelStraws::PrintParameters(MsgStream& msg) const
 {
-  if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "######### Method TRTParametersOfBarrelStraws::PrintParameters"
+  if (msg.level() <= MSG::VERBOSE) msg << MSG::VERBOSE << "######### Method TRTParametersOfBarrelStraws::PrintParameters"
 						<< endmsg;
 
-  TRTUtilities* pUtilities = TRTUtilities::GetPointer();
   TRTOutputFile* pOutputFile = TRTOutputFile::GetPointer();
 
   std::ofstream& output = pOutputFile->GetReference();
@@ -106,50 +105,60 @@ void TRTParametersOfBarrelStraws::PrintParameters ATLAS_NOT_THREAD_SAFE () const
          << std::endl;
 
   output << "Parameters of barrel straw hole:" << std::endl;
-  pUtilities->PrintTubeParameters(m_outerRadiusOfStrawHole,
-                                  m_lengthOfStrawHole);
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_outerRadiusOfStrawHole,
+                                    m_lengthOfStrawHole);
 
   output << std::endl << "Parameters of barrel straw:" << std::endl;
-  pUtilities->PrintTubeParameters(m_outerRadiusOfStraw, m_lengthOfStraw);
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_outerRadiusOfStraw, m_lengthOfStraw);
 
   output << std::endl << "Parameters of barrel straw wire:" << std::endl;
-  pUtilities->PrintTubeParameters(m_outerRadiusOfWire, m_lengthOfWire);
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_outerRadiusOfWire, m_lengthOfWire);
 
   output << std::endl << "Parameters of barrel straw twister:" << std::endl;
-  pUtilities->PrintTubeParameters(m_innerRadiusOfTwister,
-    m_outerRadiusOfTwister, m_lengthOfTwister);
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_innerRadiusOfTwister,
+                                    m_outerRadiusOfTwister, m_lengthOfTwister);
 
   output << std::endl << "Parameters of gas S for short straw:" << std::endl;
-  pUtilities->PrintTubeParameters(m_innerRadiusOfGas, m_outerRadiusOfGas,
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_innerRadiusOfGas, m_outerRadiusOfGas,
     m_lengthOfGasS, m_positionOfGasS);
 
   output << std::endl << "Parameters of dead region SA for short straw:"
          << std::endl;
-  pUtilities->PrintTubeParameters(m_innerRadiusOfDeadRegion,
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_innerRadiusOfDeadRegion,
     m_outerRadiusOfDeadRegion, m_lengthOfDeadRegion, m_positionOfDeadRegionSA);
 
   output << std::endl << "Parameters of long dead region SB for short straw:"
          << std::endl;
-  pUtilities->PrintTubeParameters(m_innerRadiusOfDeadRegion,
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_innerRadiusOfDeadRegion,
     m_outerRadiusOfDeadRegion, m_lengthOfLongDeadRegion,
     m_positionOfLongDeadRegionSB);
 
   output << std::endl << "Parameters of gas L for long straw:" << std::endl;
-  pUtilities->PrintTubeParameters(m_innerRadiusOfGas, m_outerRadiusOfGas,
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_innerRadiusOfGas, m_outerRadiusOfGas,
     m_lengthOfGasL, m_positionOfGasL);
 
   output << std::endl << "Parameters of dead region LA for long straw:"
          << std::endl;
-  pUtilities->PrintTubeParameters(m_innerRadiusOfDeadRegion,
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_innerRadiusOfDeadRegion,
     m_outerRadiusOfDeadRegion, m_lengthOfDeadRegion, m_positionOfDeadRegionLA);
 
   output << std::endl << "Parameters of dead region LB for long straw:"
          << std::endl;
-  pUtilities->PrintTubeParameters(m_innerRadiusOfDeadRegion,
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_innerRadiusOfDeadRegion,
     m_outerRadiusOfDeadRegion, m_lengthOfDeadRegion, m_positionOfDeadRegionLB);
 
   output << std::endl;
 
-  if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "######### Method TRTParametersOfBarrelStraws::PrintParameters"
+  if (msg.level() <= MSG::VERBOSE) msg << MSG::VERBOSE << "######### Method TRTParametersOfBarrelStraws::PrintParameters"
 						<< " done" << endmsg;
 }
diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfModulesA.cc b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfModulesA.cc
index e9d4b0599f60c6dbb4793669f9e619073ae64116..677bc601682853787e9f6950deb7d91e2220adb9 100644
--- a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfModulesA.cc
+++ b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfModulesA.cc
@@ -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
 */
 
 
@@ -245,7 +245,7 @@ void TRTParametersOfModulesA::DefineParameters()
   delete [] numberOfShortStrawsInLayersA;
 
   if (m_pParameters->GetInteger("PrintParametersOfModulesA"))
-    PrintParameters(xGlobalOfHolesA, yGlobalOfHolesA);
+    PrintParameters(m_msg.get(), xGlobalOfHolesA, yGlobalOfHolesA);
 
   delete [] xGlobalOfHolesA;
   delete [] yGlobalOfHolesA;
@@ -256,10 +256,10 @@ void TRTParametersOfModulesA::DefineParameters()
 
   // Called by DefineParameters
 
-void TRTParametersOfModulesA::PrintParameters(double* xGlobalOfHolesA,
+void TRTParametersOfModulesA::PrintParameters(MsgStream& msg, double* xGlobalOfHolesA,
   double* yGlobalOfHolesA) const
 {
-  if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "######### Method TRTParametersOfModulesA::PrintParameters" << endmsg;
+  if (msg.level() <= MSG::VERBOSE) msg << MSG::VERBOSE << "######### Method TRTParametersOfModulesA::PrintParameters" << endmsg;
 
   TRTOutputFile* pOutputFile = TRTOutputFile::GetPointer();
 
@@ -359,5 +359,5 @@ void TRTParametersOfModulesA::PrintParameters(double* xGlobalOfHolesA,
 
   output << std::endl;
 
-  if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "######### Method TRTParametersOfModulesA::PrintParameters done" << endmsg;
+  if (msg.level() <= MSG::VERBOSE) msg << MSG::VERBOSE << "######### Method TRTParametersOfModulesA::PrintParameters done" << endmsg;
 }
diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfModulesB.cc b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfModulesB.cc
index 450d5757a6d4b3e05dbd95a460ec60eab5203f32..9f6869cbe0597f7c3763972326a13e1875160221 100644
--- a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfModulesB.cc
+++ b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfModulesB.cc
@@ -257,7 +257,7 @@ void TRTParametersOfModulesB::DefineParameters()
   delete [] yOfHolesB;
 
   if (m_pParameters->GetInteger("PrintParametersOfModulesB"))
-    PrintParameters(xGlobalOfHolesB, yGlobalOfHolesB);
+    PrintParameters(m_msg.get(), xGlobalOfHolesB, yGlobalOfHolesB);
 
   delete [] xGlobalOfHolesB;
   delete [] yGlobalOfHolesB;
@@ -268,10 +268,10 @@ void TRTParametersOfModulesB::DefineParameters()
 
   // Called by DefineParameters
 
-void TRTParametersOfModulesB::PrintParameters(double* xGlobalOfHolesB,
+void TRTParametersOfModulesB::PrintParameters(MsgStream& msg, double* xGlobalOfHolesB,
   double* yGlobalOfHolesB) const
 {
-  if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "######### Method TRTParametersOfModulesB::PrintParameters" << endmsg;
+  if (msg.level() <= MSG::VERBOSE) msg << MSG::VERBOSE << "######### Method TRTParametersOfModulesB::PrintParameters" << endmsg;
 
   TRTOutputFile* pOutputFile = TRTOutputFile::GetPointer();
 
@@ -383,5 +383,5 @@ void TRTParametersOfModulesB::PrintParameters(double* xGlobalOfHolesB,
 
   output << std::endl;
 
-  if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "######### Method TRTParametersOfModulesB::PrintParameters done" << endmsg;
+  if (msg.level() <= MSG::VERBOSE) msg << MSG::VERBOSE << "######### Method TRTParametersOfModulesB::PrintParameters done" << endmsg;
 }
diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfModulesC.cc b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfModulesC.cc
index 81a036bc59d3ff66d27bb4dd8eda29fb3d08f2e6..1ddc9e2d40f379a7189fb73afdb29e2f5dc5f92c 100644
--- a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfModulesC.cc
+++ b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfModulesC.cc
@@ -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
 */
 
 
@@ -257,7 +257,7 @@ void TRTParametersOfModulesC::DefineParameters()
   delete [] yOfHolesC;
 
   if (m_pParameters->GetInteger("PrintParametersOfModulesC"))
-    PrintParameters(xGlobalOfHolesC, yGlobalOfHolesC);
+    PrintParameters(m_msg.get(), xGlobalOfHolesC, yGlobalOfHolesC);
 
   delete [] xGlobalOfHolesC;
   delete [] yGlobalOfHolesC;
@@ -268,10 +268,10 @@ void TRTParametersOfModulesC::DefineParameters()
 
   // Called by DefineParameters
 
-void TRTParametersOfModulesC::PrintParameters(double* xGlobalOfHolesC,
+void TRTParametersOfModulesC::PrintParameters(MsgStream& msg, double* xGlobalOfHolesC,
   double* yGlobalOfHolesC) const
 {
-  if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "######### Method TRTParametersOfModulesC::PrintParameters" << endmsg;
+  if (msg.level() <= MSG::VERBOSE) msg << MSG::VERBOSE << "######### Method TRTParametersOfModulesC::PrintParameters" << endmsg;
 
   TRTOutputFile* pOutputFile = TRTOutputFile::GetPointer();
 
@@ -384,5 +384,5 @@ void TRTParametersOfModulesC::PrintParameters(double* xGlobalOfHolesC,
 
   output << std::endl;
 
-  if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "######### Method TRTParametersOfModulesC::PrintParameters done" << endmsg;
+  if (msg.level() <= MSG::VERBOSE) msg << MSG::VERBOSE << "######### Method TRTParametersOfModulesC::PrintParameters done" << endmsg;
 }
diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfStrawPlanes.cc b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfStrawPlanes.cc
index 660ccce572943e7b78965d5a947f65ea4a03be66..0c669b471dbdcd554f81d269de482747e33263d7 100644
--- a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfStrawPlanes.cc
+++ b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfStrawPlanes.cc
@@ -22,7 +22,7 @@ TRTParametersOfStrawPlanes::TRTParametersOfStrawPlanes() : m_msg("TRTParametersO
   DefineParameters();
 
   if (m_pParameters->GetInteger("PrintParametersOfStrawPlanes"))
-    PrintParameters();
+    PrintParameters(m_msg.get());
 
   if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "##### Constructor TRTParametersOfStrawPlanes done" << endmsg;
 }
@@ -130,11 +130,10 @@ void TRTParametersOfStrawPlanes::DefineParameters()
 
   // Called by TRTParametersOfStrawPlanes
 
-void TRTParametersOfStrawPlanes::PrintParameters ATLAS_NOT_THREAD_SAFE () const // Thread unsafe TRTUtilities and TRTOutputFile classes are used.
+void TRTParametersOfStrawPlanes::PrintParameters(MsgStream& msg) const
 {
-  if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "######### Method TRTParametersOfStrawPlanes::PrintParameters" << endmsg;
+  if (msg.level() <= MSG::VERBOSE) msg << MSG::VERBOSE << "######### Method TRTParametersOfStrawPlanes::PrintParameters" << endmsg;
 
-  TRTUtilities* pUtilities = TRTUtilities::GetPointer();
   TRTOutputFile* pOutputFile = TRTOutputFile::GetPointer();
 
   std::ofstream& output = pOutputFile->GetReference();
@@ -144,7 +143,8 @@ void TRTParametersOfStrawPlanes::PrintParameters ATLAS_NOT_THREAD_SAFE () const
          << std::endl;
 
   output << "Parameters of straw planes AB:" << std::endl;
-  pUtilities->PrintTubeParameters(m_innerRadiusOfStrawPlanesAB,
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_innerRadiusOfStrawPlanesAB,
     m_outerRadiusOfStrawPlanesAB, m_lengthOfStrawPlane);
   output << "  numberOfStrawsInPlanesAB=" << m_numberOfStrawsInPlanesAB
          << std::endl;
@@ -152,31 +152,37 @@ void TRTParametersOfStrawPlanes::PrintParameters ATLAS_NOT_THREAD_SAFE () const
   if (m_pParameters->GetInteger("SectorsABC"))
   {
     output << std::endl << "Parameters of sectors AB:" << std::endl;
-    pUtilities->PrintTubeParameters(m_innerRadiusOfSectorsAB,
+    TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                      m_innerRadiusOfSectorsAB,
       m_outerRadiusOfSectorsAB, m_lengthOfSector);
     output << "  numberOfStrawsInSectorsAB=" << m_numberOfStrawsInSectorsAB
            << std::endl;
   }
 
   output << std::endl << "Parameters of straws AB:" << std::endl;
-  pUtilities->PrintTubeParameters(m_outerRadiusOfStraw, m_lengthOfStrawsAB);
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_outerRadiusOfStraw, m_lengthOfStrawsAB);
   output << "  position=" << m_positionOfStrawsAB << " mm" << std::endl;
 
   output << std::endl << "Parameters of gas AB:" << std::endl;
-  pUtilities->PrintTubeParameters(m_innerRadiusOfGas,
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_innerRadiusOfGas,
     m_outerRadiusOfGas, m_lengthOfGasAB);
 
   output << std::endl << "Parameters of dead regions AB:" << std::endl;
-  pUtilities->PrintTubeParameters(m_innerRadiusOfDeadRegion,
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_innerRadiusOfDeadRegion,
     m_outerRadiusOfDeadRegion, m_lengthOfDeadRegion, m_positionOfDeadRegionsAB);
 
   output << std::endl << "Parameters of wires AB:" << std::endl;
-  pUtilities->PrintTubeParameters(m_outerRadiusOfWire, m_lengthOfWiresAB);
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_outerRadiusOfWire, m_lengthOfWiresAB);
 
   if (m_pParameters->GetInteger("WheelsC"))
   {
     output << std::endl << "Parameters of straw plane C:" << std::endl;
-    pUtilities->PrintTubeParameters(m_innerRadiusOfStrawPlaneC,
+    TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                      m_innerRadiusOfStrawPlaneC,
       m_outerRadiusOfStrawPlaneC, m_lengthOfStrawPlane);
     output << "  numberOfStrawsInPlaneC=" << m_numberOfStrawsInPlaneC
            << std::endl;
@@ -184,29 +190,33 @@ void TRTParametersOfStrawPlanes::PrintParameters ATLAS_NOT_THREAD_SAFE () const
     if (m_pParameters->GetInteger("SectorsABC"))
     {
       output << std::endl << "Parameters of sector C:" << std::endl;
-      pUtilities->PrintTubeParameters(m_innerRadiusOfSectorC,
+      TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                        m_innerRadiusOfSectorC,
         m_outerRadiusOfSectorC, m_lengthOfSector);
       output << "  numberOfStrawsInSectorC=" << m_numberOfStrawsInSectorC
              << std::endl;
     }
 
     output << std::endl << "Parameters of straw C:" << std::endl;
-    pUtilities->PrintTubeParameters(m_outerRadiusOfStraw, m_lengthOfStrawC);
+    TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                      m_outerRadiusOfStraw, m_lengthOfStrawC);
     output << "  position=" << m_positionOfStrawC << " mm" << std::endl;
 
     output << std::endl << "Parameters of gas C:" << std::endl;
-    pUtilities->PrintTubeParameters(m_innerRadiusOfGas,
+    TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                      m_innerRadiusOfGas,
       m_outerRadiusOfGas, m_lengthOfGasC);
 
     output << std::endl << "Parameters of dead region C:" << std::endl;
-    pUtilities->PrintTubeParameters(m_innerRadiusOfDeadRegion,
+    TRTUtilities::PrintTubeParameters(*pOutputFile,m_innerRadiusOfDeadRegion,
       m_outerRadiusOfDeadRegion, m_lengthOfDeadRegion, m_positionOfDeadRegionC);
 
     output << std::endl << "Parameters of wire C:" << std::endl;
-    pUtilities->PrintTubeParameters(m_outerRadiusOfWire, m_lengthOfWireC);
+    TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                      m_outerRadiusOfWire, m_lengthOfWireC);
   }
 
   output << std::endl;
 
-  if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "######### Method TRTParametersOfStrawPlanes::PrintParameters done" << endmsg;
+  if (msg.level() <= MSG::VERBOSE) msg << MSG::VERBOSE << "######### Method TRTParametersOfStrawPlanes::PrintParameters done" << endmsg;
 }
diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfWheelsA.cc b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfWheelsA.cc
index 234e8fd99325e5b59e3e9f21193257679319f9f7..28f1047395e453292fc333c78732ab2d17919c40 100644
--- a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfWheelsA.cc
+++ b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfWheelsA.cc
@@ -21,7 +21,7 @@ TRTParametersOfWheelsA::TRTParametersOfWheelsA() : m_msg("TRTParametersOfWheelsA
   DefineParameters();
 
   if (m_pParameters->GetInteger("PrintParametersOfWheelsA"))
-    PrintParameters();
+    PrintParameters(m_msg.get());
 
   if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "##### Constructor TRTParametersOfWheelsA done" << endmsg;
 }
@@ -134,11 +134,10 @@ void TRTParametersOfWheelsA::DefineParameters()
 
   // Called by TRTParametersOfWheelsA
 
-void TRTParametersOfWheelsA::PrintParameters ATLAS_NOT_THREAD_SAFE () const // Thread unsafe TRTUtilities and TRTOutputFile classes are used.
+void TRTParametersOfWheelsA::PrintParameters(MsgStream& msg) const
 {
-  if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "######### Method TRTParametersOfWheelsA::PrintParameters" << endmsg;
+  if (msg.level() <= MSG::VERBOSE) msg << MSG::VERBOSE << "######### Method TRTParametersOfWheelsA::PrintParameters" << endmsg;
 
-  TRTUtilities* pUtilities = TRTUtilities::GetPointer();
   TRTOutputFile* pOutputFile = TRTOutputFile::GetPointer();
 
   std::ofstream& output = pOutputFile->GetReference();
@@ -156,15 +155,18 @@ void TRTParametersOfWheelsA::PrintParameters ATLAS_NOT_THREAD_SAFE () const // T
            << " mm" << std::endl;
 
   output << std::endl << "Parameters of wheel A:" << std::endl;
-  pUtilities->PrintTubeParameters(m_innerRadiusOfWheelA, m_outerRadiusOfWheelA,
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_innerRadiusOfWheelA, m_outerRadiusOfWheelA,
     m_lengthOfWheelA);
 
   output << std::endl << "Parameters of inner support A:" << std::endl;
-  pUtilities->PrintTubeParameters(m_innerRadiusOfInnerSupportA,
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_innerRadiusOfInnerSupportA,
     m_outerRadiusOfInnerSupportA, m_lengthOfInnerSupportA);
 
   output << std::endl << "Parameters of outer support A:" << std::endl;
-  pUtilities->PrintTubeParameters(m_innerRadiusOfOuterSupportA,
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_innerRadiusOfOuterSupportA,
     m_outerRadiusOfOuterSupportA, m_lengthOfOuterSupportA);
 
   output << std::endl << "Parameters of main radiators A:" << std::endl;
@@ -175,7 +177,8 @@ void TRTParametersOfWheelsA::PrintParameters ATLAS_NOT_THREAD_SAFE () const // T
            << m_positionsOfMainRadiatorsA[i] << " mm" << std::endl;
 
   output << std::endl << "Parameters of main radiator A:" << std::endl;
-  pUtilities->PrintTubeParameters(m_innerRadiusOfMainRadiatorA,
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_innerRadiusOfMainRadiatorA,
     m_outerRadiusOfMainRadiatorA, m_lengthOfMainRadiatorA);
 
   output << std::endl << "Parameters of thin radiators A:" << std::endl;
@@ -186,7 +189,8 @@ void TRTParametersOfWheelsA::PrintParameters ATLAS_NOT_THREAD_SAFE () const // T
            << m_positionsOfThinRadiatorsA[i] << " mm" << std::endl;
 
   output << std::endl << "Parameters of thin radiator A:" << std::endl;
-  pUtilities->PrintTubeParameters(m_innerRadiusOfThinRadiatorA,
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_innerRadiusOfThinRadiatorA,
     m_outerRadiusOfThinRadiatorA, m_lengthOfThinRadiatorA);
 
   output << std::endl << "Parameters of straw planes A:" << std::endl;
@@ -203,5 +207,5 @@ void TRTParametersOfWheelsA::PrintParameters ATLAS_NOT_THREAD_SAFE () const // T
 
   output << std::endl;
 
-  if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "######### Method TRTParametersOfWheelsA::PrintParameters done" << endmsg;
+  if (msg.level() <= MSG::VERBOSE) msg << MSG::VERBOSE << "######### Method TRTParametersOfWheelsA::PrintParameters done" << endmsg;
 }
diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfWheelsB.cc b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfWheelsB.cc
index f466a0cc18f08bae7d018f1da9e75b2fb10bf835..e6c27e250ff99920518bfb0bcea313efb2b132a6 100644
--- a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfWheelsB.cc
+++ b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfWheelsB.cc
@@ -21,7 +21,7 @@ TRTParametersOfWheelsB::TRTParametersOfWheelsB() : m_msg("TRTParametersOfWheelsB
   DefineParameters();
 
   if (m_pParameters->GetInteger("PrintParametersOfWheelsB"))
-    PrintParameters();
+    PrintParameters(m_msg.get());
 
   if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "##### Constructor TRTParametersOfWheelsB done" << endmsg;
 }
@@ -146,11 +146,10 @@ void TRTParametersOfWheelsB::DefineParameters()
 
   // Called by TRTParametersOfWheelsB
 
-void TRTParametersOfWheelsB::PrintParameters ATLAS_NOT_THREAD_SAFE () const // Thread unsafe TRTUtilities and TRTOutputFile classes are used.
+void TRTParametersOfWheelsB::PrintParameters(MsgStream& msg) const
 {
-  if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "######### Method TRTParametersOfWheelsB::PrintParameters" << endmsg;
+  if (msg.level() <= MSG::VERBOSE) msg << MSG::VERBOSE << "######### Method TRTParametersOfWheelsB::PrintParameters" << endmsg;
 
-  TRTUtilities* pUtilities = TRTUtilities::GetPointer();
   TRTOutputFile* pOutputFile = TRTOutputFile::GetPointer();
 
   std::ofstream& output = pOutputFile->GetReference();
@@ -168,15 +167,18 @@ void TRTParametersOfWheelsB::PrintParameters ATLAS_NOT_THREAD_SAFE () const // T
            << " mm" << std::endl;
 
   output << std::endl << "Parameters of wheel B:" << std::endl;
-  pUtilities->PrintTubeParameters(m_innerRadiusOfWheelB, m_outerRadiusOfWheelB,
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_innerRadiusOfWheelB, m_outerRadiusOfWheelB,
     m_lengthOfWheelB);
 
   output << std::endl << "Parameters of inner support B:" << std::endl;
-  pUtilities->PrintTubeParameters(m_innerRadiusOfInnerSupportB,
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_innerRadiusOfInnerSupportB,
     m_outerRadiusOfInnerSupportB, m_lengthOfInnerSupportB);
 
   output << std::endl << "Parameters of outer support B:" << std::endl;
-  pUtilities->PrintTubeParameters(m_innerRadiusOfOuterSupportB,
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_innerRadiusOfOuterSupportB,
     m_outerRadiusOfOuterSupportB, m_lengthOfOuterSupportB);
 
   output << std::endl << "Parameters of main radiators B:" << std::endl;
@@ -187,7 +189,8 @@ void TRTParametersOfWheelsB::PrintParameters ATLAS_NOT_THREAD_SAFE () const // T
            << m_positionsOfMainRadiatorsB[i] << " mm" << std::endl;
 
   output << std::endl << "Parameters of main radiator B:" << std::endl;
-  pUtilities->PrintTubeParameters(m_innerRadiusOfMainRadiatorB,
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_innerRadiusOfMainRadiatorB,
     m_outerRadiusOfMainRadiatorB, m_lengthOfMainRadiatorB);
 
   output << std::endl << "Parameters of thin radiators B:" << std::endl;
@@ -198,7 +201,8 @@ void TRTParametersOfWheelsB::PrintParameters ATLAS_NOT_THREAD_SAFE () const // T
            << m_positionsOfThinRadiatorsB[i] << " mm" << std::endl;
 
   output << std::endl << "Parameters of thin radiator B:" << std::endl;
-  pUtilities->PrintTubeParameters(m_innerRadiusOfThinRadiatorB,
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_innerRadiusOfThinRadiatorB,
     m_outerRadiusOfThinRadiatorB, m_lengthOfThinRadiatorB);
 
   output << std::endl << "Parameters of middle radiators B:" << std::endl;
@@ -209,7 +213,8 @@ void TRTParametersOfWheelsB::PrintParameters ATLAS_NOT_THREAD_SAFE () const // T
            << m_positionsOfMiddleRadiatorsB[i] << " mm" << std::endl;
 
   output << std::endl << "Parameters of middle radiator B:" << std::endl;
-  pUtilities->PrintTubeParameters(m_innerRadiusOfMiddleRadiatorB,
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_innerRadiusOfMiddleRadiatorB,
     m_outerRadiusOfMiddleRadiatorB, m_lengthOfMiddleRadiatorB);
 
   output << std::endl << "Parameters of straw planes B:" << std::endl;
@@ -226,5 +231,5 @@ void TRTParametersOfWheelsB::PrintParameters ATLAS_NOT_THREAD_SAFE () const // T
 
   output << std::endl;
 
-  if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "######### Method TRTParametersOfWheelsB::PrintParameters done" << endmsg;
+  if (msg.level() <= MSG::VERBOSE) msg << MSG::VERBOSE << "######### Method TRTParametersOfWheelsB::PrintParameters done" << endmsg;
 }
diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfWheelsC.cc b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfWheelsC.cc
index 7edacf4ed66e043cfccbfb05ca46ed24c470b34f..26610b0dc3545f8857540f5b6cbe95ac37fd3f7e 100644
--- a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfWheelsC.cc
+++ b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfWheelsC.cc
@@ -22,7 +22,7 @@ TRTParametersOfWheelsC::TRTParametersOfWheelsC() : m_msg("TRTParametersOfWheelsC
   DefineParameters();
 
   if (m_pParameters->GetInteger("PrintParametersOfWheelsC"))
-    PrintParameters();
+    PrintParameters(m_msg.get());
 
   if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "##### Constructor TRTParametersOfWheelsC done" << endmsg;
 }
@@ -134,11 +134,10 @@ void TRTParametersOfWheelsC::DefineParameters()
 
   // Called by TRTParametersOfWheelsC
 
-void TRTParametersOfWheelsC::PrintParameters ATLAS_NOT_THREAD_SAFE () const // Thread unsafe TRTUtilities and TRTOutputFile classes are used.
+void TRTParametersOfWheelsC::PrintParameters(MsgStream& msg) const
 {
-  if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "######### Method TRTParametersOfWheelsC::PrintParameters" << endmsg;
+  if (msg.level() <= MSG::VERBOSE) msg << MSG::VERBOSE << "######### Method TRTParametersOfWheelsC::PrintParameters" << endmsg;
 
-  TRTUtilities* pUtilities = TRTUtilities::GetPointer();
   TRTOutputFile* pOutputFile = TRTOutputFile::GetPointer();
 
   std::ofstream& output = pOutputFile->GetReference();
@@ -156,15 +155,18 @@ void TRTParametersOfWheelsC::PrintParameters ATLAS_NOT_THREAD_SAFE () const // T
            << " mm" << std::endl;
 
   output << std::endl << "Parameters of wheel C:" << std::endl;
-  pUtilities->PrintTubeParameters(m_innerRadiusOfWheelC, m_outerRadiusOfWheelC,
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_innerRadiusOfWheelC, m_outerRadiusOfWheelC,
     m_lengthOfWheelC);
 
   output << std::endl << "Parameters of inner support C:" << std::endl;
-  pUtilities->PrintTubeParameters(m_innerRadiusOfInnerSupportC,
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_innerRadiusOfInnerSupportC,
     m_outerRadiusOfInnerSupportC, m_lengthOfInnerSupportC);
 
   output << std::endl << "Parameters of outer support C:" << std::endl;
-  pUtilities->PrintTubeParameters(m_innerRadiusOfOuterSupportC,
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_innerRadiusOfOuterSupportC,
     m_outerRadiusOfOuterSupportC, m_lengthOfOuterSupportC);
 
   output << std::endl << "Parameters of main radiators C:" << std::endl;
@@ -175,7 +177,8 @@ void TRTParametersOfWheelsC::PrintParameters ATLAS_NOT_THREAD_SAFE () const // T
            << m_positionsOfMainRadiatorsC[i] << " mm" << std::endl;
 
   output << std::endl << "Parameters of main radiator C:" << std::endl;
-  pUtilities->PrintTubeParameters(m_innerRadiusOfMainRadiatorC,
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_innerRadiusOfMainRadiatorC,
     m_outerRadiusOfMainRadiatorC, m_lengthOfMainRadiatorC);
 
   output << std::endl << "Parameters of thin radiators C:" << std::endl;
@@ -186,7 +189,8 @@ void TRTParametersOfWheelsC::PrintParameters ATLAS_NOT_THREAD_SAFE () const // T
            << m_positionsOfThinRadiatorsC[i] << " mm" << std::endl;
 
   output << std::endl << "Parameters of thin radiator C:" << std::endl;
-  pUtilities->PrintTubeParameters(m_innerRadiusOfThinRadiatorC,
+  TRTUtilities::PrintTubeParameters(*pOutputFile,
+                                    m_innerRadiusOfThinRadiatorC,
     m_outerRadiusOfThinRadiatorC, m_lengthOfThinRadiatorC);
 
   output << std::endl << "Parameters of straw planes C:" << std::endl;
@@ -203,5 +207,5 @@ void TRTParametersOfWheelsC::PrintParameters ATLAS_NOT_THREAD_SAFE () const // T
 
   output << std::endl;
 
-  if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "######### Method TRTParametersOfWheelsC::PrintParameters done" << endmsg;
+  if (msg.level() <= MSG::VERBOSE) msg << MSG::VERBOSE << "######### Method TRTParametersOfWheelsC::PrintParameters done" << endmsg;
 }
diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTUtilities.cc b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTUtilities.cc
index 5527d533abad2beeaf93b68e25b39e545d35b56d..667fd2679beb00e7784df6f24870049105143695 100644
--- a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTUtilities.cc
+++ b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTUtilities.cc
@@ -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
 */
 
 
@@ -10,44 +10,6 @@
 
 
 
-TRTUtilities* TRTUtilities::s_pUtilities = NULL;
-
-
-  // Called by GetPointer
-
-TRTUtilities::TRTUtilities() : m_msg("TRTUtilities")
-{
-  if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "##### Constructor TRTUtilities" << endmsg;
-
-  m_pOutputFile = NULL;
-
-  if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "##### Constructor TRTUtilities done" << endmsg;
-}
-
-
-  // Called by TRTRunAction::EndOfRunAction
-
-TRTUtilities::~TRTUtilities()
-{
-  if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "####### Destructor TRTUtilities" << endmsg;
-
-  s_pUtilities = NULL;
-
-  if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "####### Destructor TRTUtilities done" << endmsg;
-}
-
-
-  // Called by PrintTubeParameters
-
-std::ofstream& TRTUtilities::GetReference()
-{
-  if (!m_pOutputFile)
-    m_pOutputFile = TRTOutputFile::GetPointer();
-
-  return m_pOutputFile->GetReference();
-}
-
-
   // Called on demand
 
 std::string TRTUtilities::NumberToString(int number)
@@ -69,9 +31,9 @@ std::string TRTUtilities::NumberToString(int number)
 
   // Called on demand
 
-void TRTUtilities::PrintTubeParameters(double outerRadius, double length)
+void TRTUtilities::PrintTubeParameters(TRTOutputFile& f, double outerRadius, double length)
 {
-  std::ofstream& output = GetReference();
+  std::ofstream& output = f.GetReference();
 
   output << "  outerRadius=" << outerRadius << " mm";
   output << "  length=" << length << " mm" << std::endl;
@@ -80,10 +42,11 @@ void TRTUtilities::PrintTubeParameters(double outerRadius, double length)
 
   // Called on demand
 
-void TRTUtilities::PrintTubeParameters(double innerRadius,
+void TRTUtilities::PrintTubeParameters(TRTOutputFile& f,
+                                       double innerRadius,
   double outerRadius, double length)
 {
-  std::ofstream& output = GetReference();
+  std::ofstream& output = f.GetReference();
 
   output << "  innerRadius=" << innerRadius << " mm";
   output << "  outerRadius=" << outerRadius << " mm";
@@ -93,10 +56,11 @@ void TRTUtilities::PrintTubeParameters(double innerRadius,
 
   // Called on demand
 
-void TRTUtilities::PrintTubeParameters(double innerRadius,
+void TRTUtilities::PrintTubeParameters(TRTOutputFile& f,
+                                       double innerRadius,
   double outerRadius, double length, double position)
 {
-  std::ofstream& output = GetReference();
+  std::ofstream& output = f.GetReference();
 
   output << "  innerRadius=" << innerRadius << " mm";
   output << "  outerRadius=" << outerRadius << " mm";
diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTVisualization.cc b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTVisualization.cc
index c9ae45a927ebd8f64d76f965f8fd5f4d218b80f4..79c817b123047c97917d4e000a9ebd93fc9d4bf0 100644
--- a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTVisualization.cc
+++ b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTVisualization.cc
@@ -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
 */
 
 
@@ -10,11 +10,6 @@
 #include "G4Colour.hh"
 
 
-TRTVisualization* TRTVisualization::s_pVisualization = NULL;
-
-
-  // Called by GetPointer
-
 TRTVisualization::TRTVisualization(): m_msg("TRTVisualization")
 {
   if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "##### Constructor TRTVisualization" << endmsg;
@@ -31,8 +26,6 @@ TRTVisualization::~TRTVisualization()
 {
   if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "##### Destructor TRTVisualization" << endmsg;
 
-  s_pVisualization = NULL;
-
   if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "##### Destructor TRTVisualization done" << endmsg;
 }
 
@@ -104,6 +97,6 @@ void TRTVisualization::Visualize(G4LogicalVolume* pLogicalVolume,
       std::cerr << "***** TRTVisualization::Visualize *****" << std::endl;
       std::cerr << "  Invalid colour index " << colourIndex << "." << std::endl;
       std::cerr << "  Exit!" << std::endl << std::endl;
-      exit(0);
+      std::abort();
   }
 }
diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/test/ut_TRTParametersTest.cxx b/InnerDetector/InDetG4/TRT_G4Utilities/test/ut_TRTParametersTest.cxx
index ab30309f4b96caa87426f3656e4a77404b2ff83c..1cc6c05f33437104082e5895855438f498848e82 100644
--- a/InnerDetector/InDetG4/TRT_G4Utilities/test/ut_TRTParametersTest.cxx
+++ b/InnerDetector/InDetG4/TRT_G4Utilities/test/ut_TRTParametersTest.cxx
@@ -9,7 +9,6 @@
 #include "TRT_G4Utilities/TRTParameters.hh"
 #include "TRT_G4Utilities/TRTOutputFile.hh"
 
-ATLAS_NO_CHECK_FILE_THREAD_SAFETY; // This unit test uses thread unsafe TRTParameters and TRTOutputFile classes.
 
 namespace utf = boost::unit_test;
 
@@ -22,7 +21,6 @@ struct setupParameters{
  
   ~setupParameters(){
     BOOST_TEST_MESSAGE("ending test");
-    delete p;
   }
 };
 
@@ -35,7 +33,6 @@ struct setupOutputFile{
  
   ~setupOutputFile(){
     BOOST_TEST_MESSAGE("ending test");
-    delete p;
   }
 };
 
@@ -94,6 +91,7 @@ BOOST_AUTO_TEST_CASE(GetPartOfExistingDoubleArray, * utf::tolerance(0.01) ){
 BOOST_AUTO_TEST_SUITE_END()
 
 
+// cppcheck-suppress unknownMacro
 BOOST_FIXTURE_TEST_SUITE(Test_TRTOutputFile , setupOutputFile)
 BOOST_AUTO_TEST_CASE(OutputToFile  ){
   auto & f(p->GetReference());
diff --git a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTParametersForBarrelHits.cxx b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTParametersForBarrelHits.cxx
index c5ca836bcee8b50e7dc54131ac97b5b0d434ff85..efb0fd16073d265f8273635322c2df6002c79ebc 100644
--- a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTParametersForBarrelHits.cxx
+++ b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTParametersForBarrelHits.cxx
@@ -154,7 +154,7 @@ void TRTParametersForBarrelHits::DefineParameters() const
 
 // Called by TRTParametersForBarrelHits
 
-void TRTParametersForBarrelHits::PrintParameters ATLAS_NOT_THREAD_SAFE () const // Thread unsafe TRTOutputFile is used.
+void TRTParametersForBarrelHits::PrintParameters() const
 {
 
   if (m_verboseLevel>5) { G4cout << "######### Method TRTParametersForBarrelHits::PrintParameters" << G4endl; }
diff --git a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTParametersForBarrelHits.h b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTParametersForBarrelHits.h
index 541580f50800ee96f9d8bdefb7c6f3263684e3ee..aef7f11f8458adf4b49d527a80c5c7f75a16e1af 100644
--- a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTParametersForBarrelHits.h
+++ b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTParametersForBarrelHits.h
@@ -10,7 +10,7 @@
 class TRTParameters;
 class TRTProcessingOfBarrelHits;
 
-class ATLAS_NOT_THREAD_SAFE TRTParametersForBarrelHits // Thread unsafe TRTParameters and TRTProcessingOfBarrelHits classes are used.
+class TRTParametersForBarrelHits
 {
 public:
   TRTParametersForBarrelHits(TRTProcessingOfBarrelHits*);
@@ -22,7 +22,7 @@ private:
 
   int m_printMessages; //FIXME not used
 
-  TRTParameters* m_pParameters;
+  const TRTParameters* m_pParameters;
   TRTProcessingOfBarrelHits* m_pProcessingOfBarrelHits;
 
   int m_verboseLevel;
diff --git a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTParametersForEndCapHits.cxx b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTParametersForEndCapHits.cxx
index 080e2776426c5268e4c8efc9442bc075a4616c08..545d8e624d6c0b0401b2c5dae5acf57904e61f31 100644
--- a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTParametersForEndCapHits.cxx
+++ b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTParametersForEndCapHits.cxx
@@ -102,7 +102,7 @@ void TRTParametersForEndCapHits::DefineParameters() const
 
 // Called by TRTParametersForEndCapHits
 
-void TRTParametersForEndCapHits::PrintParameters ATLAS_NOT_THREAD_SAFE () const // Thread unsafe TRTOutputFile class is used.
+void TRTParametersForEndCapHits::PrintParameters() const
 {
   if (m_verboseLevel>5) { G4cout << "######### Method TRTParametersForEndCapHits::PrintParameters" << G4endl; }
 
diff --git a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTParametersForEndCapHits.h b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTParametersForEndCapHits.h
index af25dcf46a0e60acb6d94e4aa81f1b5af5e9c3cb..197081207fc35cf4024e9d46d65bd01ee396063f 100644
--- a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTParametersForEndCapHits.h
+++ b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTParametersForEndCapHits.h
@@ -10,7 +10,7 @@
 class TRTParameters;
 class TRTProcessingOfEndCapHits;
 
-class ATLAS_NOT_THREAD_SAFE TRTParametersForEndCapHits // Thread unsafe TRTParameters and TRTProcessingOfEndCapHits classes are used.
+class TRTParametersForEndCapHits
 {
 public:
   TRTParametersForEndCapHits(TRTProcessingOfEndCapHits*);
@@ -22,7 +22,7 @@ private:
 
   int m_printMessages; // FIXME not used?
 
-  TRTParameters* m_pParameters;
+  const TRTParameters* m_pParameters;
   TRTProcessingOfEndCapHits* m_pProcessingOfEndCapHits;
 
   int m_verboseLevel;
diff --git a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTPrintingOfHits.cxx b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTPrintingOfHits.cxx
index f6ca6c31915bcd43b0f4fbc44020021890a4e337..be2060cf80599911a60c78c4c7c3cf65be12c808 100644
--- a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTPrintingOfHits.cxx
+++ b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTPrintingOfHits.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
 */
 
 // Class header
@@ -17,7 +17,7 @@
 
 TRTPrintingOfHits::TRTPrintingOfHits(): m_msg("TRTPrintingOfHits")
 {
-  TRTParameters* pParameters = TRTParameters::GetPointer();
+  const TRTParameters* pParameters = TRTParameters::GetPointer();
 
   m_printMessages = pParameters->GetInteger("PrintMessages");
 
diff --git a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTPrintingOfHits.h b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTPrintingOfHits.h
index abe80a0441e4f165e23cd9400330ab0ce5de9f98..834e0c3a7b2fe0de7f13e9f46ae8be4fc90e3708 100644
--- a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTPrintingOfHits.h
+++ b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTPrintingOfHits.h
@@ -12,7 +12,7 @@
 class TRTUncompressedHit;
 class TRTOutputFile;
 
-class ATLAS_NOT_THREAD_SAFE TRTPrintingOfHits // Thread unsafe TRTOutputFile class is used.
+class TRTPrintingOfHits
 {
   public:
     TRTPrintingOfHits();
@@ -20,7 +20,7 @@ class ATLAS_NOT_THREAD_SAFE TRTPrintingOfHits // Thread unsafe TRTOutputFile cla
 
     void PrintUncompressedHit(TRTUncompressedHit*);
 
-    MsgStream& msg (MSG::Level lvl) const { return m_msg << lvl; }
+    MsgStream& msg (MSG::Level lvl) { return m_msg << lvl; }
     bool msgLevel (MSG::Level lvl)    { return m_msg.get().level() <= lvl; }
 
   private:
@@ -31,8 +31,7 @@ class ATLAS_NOT_THREAD_SAFE TRTPrintingOfHits // Thread unsafe TRTOutputFile cla
 
     TRTOutputFile* m_pOutputFile;
 
-    mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE;
-
+    Athena::MsgStreamMember m_msg;
 };
 
 #endif //TRT_G4_SD_TRTPrintingOfHits_hh
diff --git a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTProcessingOfBarrelHits.h b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTProcessingOfBarrelHits.h
index 03308dd8cc8d062e474458411b5e87f3891db082..41ff36832d5e5220631009d960c3d2a5654db7ca 100644
--- a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTProcessingOfBarrelHits.h
+++ b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTProcessingOfBarrelHits.h
@@ -12,7 +12,7 @@ class TRTSensitiveDetector;
 
 class G4Step;
 
-class ATLAS_NOT_THREAD_SAFE TRTProcessingOfBarrelHits // Thread unsafe TRTParameters and TRTSensitiveDetector classes are used.
+class TRTProcessingOfBarrelHits
 {
   friend class TRTParametersForBarrelHits;
 
@@ -51,7 +51,7 @@ private:
   int* m_strawIDToLayerIDB;
   int* m_strawIDToLayerIDC;
 
-  TRTParameters* m_pParameters;
+  const TRTParameters* m_pParameters;
   TRTSensitiveDetector* m_pSensitiveDetector;
 
   int m_verboseLevel;
diff --git a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTProcessingOfEndCapHits.cxx b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTProcessingOfEndCapHits.cxx
index cb16877c6fb45c71f7aafc82badfc1e2e3a95c38..0301aab20f5e1031201e5116bebdc9a43a16e894 100644
--- a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTProcessingOfEndCapHits.cxx
+++ b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTProcessingOfEndCapHits.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
 */
 
 // Class header
diff --git a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTProcessingOfEndCapHits.h b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTProcessingOfEndCapHits.h
index 56cc07d087dd590a70d7af673fd513b2a4b45775..76ded35f0c328978c8bc1340f8f4904cb1ffd499 100644
--- a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTProcessingOfEndCapHits.h
+++ b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTProcessingOfEndCapHits.h
@@ -12,7 +12,7 @@ class TRTSensitiveDetector;
 
 class G4Step;
 
-class ATLAS_NOT_THREAD_SAFE TRTProcessingOfEndCapHits // Thread unsafe TRTParameters and TRTSensitiveDetector classes are used.
+class TRTProcessingOfEndCapHits
 {
   friend class TRTParametersForEndCapHits;
 
@@ -46,7 +46,7 @@ private:
   int m_numberOfStrawsInIDSectorsAB;
   int m_numberOfStrawsInIDSectorC;
 
-  TRTParameters* m_pParameters;
+  const TRTParameters* m_pParameters;
   TRTSensitiveDetector* m_pSensitiveDetector;
 
   int m_verboseLevel;
diff --git a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTSensitiveDetector.cxx b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTSensitiveDetector.cxx
index 51765600f816753eadefd131e92d504c040c9487..86bf1ad85eb5e2b697494e19db5c3dc0e8dc143a 100644
--- a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTSensitiveDetector.cxx
+++ b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTSensitiveDetector.cxx
@@ -70,7 +70,7 @@ TRTSensitiveDetector::TRTSensitiveDetector(const std::string& name, const std::s
 // Called by TRTSensitiveDetector
 // Once per run
 
-void TRTSensitiveDetector::InitializeHitProcessing ATLAS_NOT_THREAD_SAFE () // Thread unsafe TRTParametersForBarrelHits, TRTParametersForEndCapHits  classes are used.
+void TRTSensitiveDetector::InitializeHitProcessing()
 {
   if(verboseLevel>4)
     {
diff --git a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTSensitiveDetector.h b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTSensitiveDetector.h
index 50dfe58d5b82849cd8f696508b615a1a72f6578e..f195ea1ffdee85ceeb8e7eed02a15c3df8c50bd6 100644
--- a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTSensitiveDetector.h
+++ b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTSensitiveDetector.h
@@ -21,7 +21,7 @@ class G4HCofThisEvent;
 class G4Step;
 class G4TouchableHistory;
 
-class ATLAS_NOT_THREAD_SAFE TRTSensitiveDetector : public G4VSensitiveDetector // Thread unsafe TRTParameters, TRTProcessingOfBarrelHits, TRTProcessingOfEndCapHits classes is used.
+class TRTSensitiveDetector : public G4VSensitiveDetector
 {
  FRIEND_TEST( TRTSensitiveDetectortest, Initialize);
  FRIEND_TEST( TRTSensitiveDetectortest, ProcessHits );
@@ -84,7 +84,7 @@ class ATLAS_NOT_THREAD_SAFE TRTSensitiveDetector : public G4VSensitiveDetector /
   // The hits collection
   SG::WriteHandle<TRTUncompressedHitCollection> m_HitColl; //pUncompressedHitCollection;
 
-  TRTParameters* m_pParameters;
+  const TRTParameters* m_pParameters;
 
   TRTProcessingOfBarrelHits* m_pProcessingOfBarrelHits;
   TRTProcessingOfEndCapHits* m_pProcessingOfEndCapHits;
diff --git a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTSensitiveDetectorTool.cxx b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTSensitiveDetectorTool.cxx
index d2d769c6f438130aa4b98db6be7c07efe7c0c297..a16d587ee6681145a38d39395faef8dbbd9d4456 100644
--- a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTSensitiveDetectorTool.cxx
+++ b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTSensitiveDetectorTool.cxx
@@ -18,7 +18,7 @@ TRTSensitiveDetectorTool::TRTSensitiveDetectorTool(const std::string& type, cons
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
-G4VSensitiveDetector* TRTSensitiveDetectorTool::makeSD ATLAS_NOT_THREAD_SAFE () const // Thread unsafe TRTSensitiveDetector class is used.
+G4VSensitiveDetector* TRTSensitiveDetectorTool::makeSD() const
 {
 
   ATH_MSG_DEBUG( "Initializing SD" );
diff --git a/InnerDetector/InDetG4/TRT_G4_SD/test/TRTSensitiveDetector_gtest.cxx b/InnerDetector/InDetG4/TRT_G4_SD/test/TRTSensitiveDetector_gtest.cxx
index d669dbf77d46febcfea4e4c8499b5b8215f59210..aaed580ea6b50a9429026019dab61339650e53de 100644
--- a/InnerDetector/InDetG4/TRT_G4_SD/test/TRTSensitiveDetector_gtest.cxx
+++ b/InnerDetector/InDetG4/TRT_G4_SD/test/TRTSensitiveDetector_gtest.cxx
@@ -32,7 +32,7 @@
 #include "G4AtlasTools/DerivedG4SensitiveDetectorTestSetting.h"
 #include "MCTruth/TrackHelper.h"
 
-ATLAS_NO_CHECK_FILE_THREAD_SAFETY; // Thread unsafe TRTSensitiveDetector class is tested in this unit test.
+ATLAS_NO_CHECK_FILE_THREAD_SAFETY; // googletest
 
 //set environment
 class GaudiEnvironment : public ::testing::Environment {
diff --git a/InnerDetector/InDetMonitoring/InDetDiMuonMonitoring/src/DiMuMon.cxx b/InnerDetector/InDetMonitoring/InDetDiMuonMonitoring/src/DiMuMon.cxx
index 55c8e18d5f58aa7113d533e49094f36a075a31f9..4cd7b6f0df4c17367d0967b6d13c9111290df7ad 100644
--- a/InnerDetector/InDetMonitoring/InDetDiMuonMonitoring/src/DiMuMon.cxx
+++ b/InnerDetector/InDetMonitoring/InDetDiMuonMonitoring/src/DiMuMon.cxx
@@ -4,6 +4,7 @@
 
 #include <sstream>
 #include "GaudiKernel/PhysicalConstants.h"
+#include "AthContainers/ConstDataVector.h"
 
 #include "DiMuMon.h"
 
@@ -243,7 +244,7 @@ StatusCode DiMuMon::bookHistograms()
 }
 
 
-StatusCode DiMuMon::fillHistograms ATLAS_NOT_THREAD_SAFE () // const_cast is used.
+StatusCode DiMuMon::fillHistograms()
 {
 
   const double muonMass = 105.66*Gaudi::Units::MeV;
@@ -255,7 +256,7 @@ StatusCode DiMuMon::fillHistograms ATLAS_NOT_THREAD_SAFE () // const_cast is use
   } else ATH_MSG_DEBUG("Muon container successfully retrieved.");
 
   //make a new container
-  xAOD::MuonContainer* goodMuons = new xAOD::MuonContainer( SG::VIEW_ELEMENTS );
+  ConstDataVector<xAOD::MuonContainer> goodMuons( SG::VIEW_ELEMENTS );
 
   //pick out the good muon tracks and store in the new container
   for(const auto* muon : *muons ) {
@@ -287,15 +288,15 @@ StatusCode DiMuMon::fillHistograms ATLAS_NOT_THREAD_SAFE () // const_cast is use
     if (fabs(idTrkEta)>2.5) continue;
     m_stat->Fill("eta<2.5",1);
 
-    goodMuons->push_back(const_cast<xAOD::Muon*>(muon));
+    goodMuons.push_back(muon);
   }
 
   //pair up the tracks of the good muons and fill histograms
-  int nMuons = goodMuons->size();
+  int nMuons = goodMuons.size();
 
   if (nMuons>1){
-    xAOD::MuonContainer::const_iterator mu1 = goodMuons->begin();
-    xAOD::MuonContainer::const_iterator muEnd = goodMuons->end();
+    xAOD::MuonContainer::const_iterator mu1 = goodMuons.begin();
+    xAOD::MuonContainer::const_iterator muEnd = goodMuons.end();
     for (; mu1!=muEnd;mu1++){
       const xAOD::TrackParticle *id1 = (*mu1)->trackParticle(xAOD::Muon::InnerDetectorTrackParticle);
       xAOD::MuonContainer::const_iterator mu2 = mu1+1;
@@ -451,7 +452,7 @@ StatusCode DiMuMon::fillHistograms ATLAS_NOT_THREAD_SAFE () // const_cast is use
 }
 
 
-StatusCode DiMuMon::procHistograms ATLAS_NOT_THREAD_SAFE () // Thread unsafe DiMuMon::iterativeGausFit is used.
+StatusCode DiMuMon::procHistograms()
 {
 
 
@@ -483,7 +484,7 @@ StatusCode DiMuMon::procHistograms ATLAS_NOT_THREAD_SAFE () // Thread unsafe DiM
 }
 
 
-void DiMuMon::iterativeGausFit ATLAS_NOT_THREAD_SAFE (TH2F* hin, std::vector<TH1F*> hout, int mode){ // Global gStyle is used.
+void DiMuMon::iterativeGausFit (TH2F* hin, std::vector<TH1F*> hout, int mode){
   // a canvas may be needed when implmenting this into the post-processing file
   TString hname =  hin->GetName();
   TString psName = hname + m_triggerChainName + ".ps";
@@ -511,7 +512,7 @@ void DiMuMon::iterativeGausFit ATLAS_NOT_THREAD_SAFE (TH2F* hin, std::vector<TH1
 	sigma= fn->GetParameter(2);
 	fn->SetRange(mean-1.2*sigma,mean+1.2*sigma);
 	fn->SetParameters(float(htemp->GetEntries())/10.,mean,sigma);
-	gStyle->SetOptStat(1);
+	//gStyle->SetOptStat(1); // not thread-safe
 	if (m_doSaveFits) {
 	  htemp->Fit("fn","RML");
 	  ctemp->Print(psName);
diff --git a/InnerDetector/InDetMonitoring/InDetVertexMonitoring/run/Mon_topOptions.py b/InnerDetector/InDetMonitoring/InDetVertexMonitoring/run/Mon_topOptions.py
index 050790e557b2cb4c3b749f60c4fe8dde293b8cf9..715351dadc3ee8bfcdccfe2ffdd11ba5c8b8c33c 100644
--- a/InnerDetector/InDetMonitoring/InDetVertexMonitoring/run/Mon_topOptions.py
+++ b/InnerDetector/InDetMonitoring/InDetVertexMonitoring/run/Mon_topOptions.py
@@ -81,7 +81,7 @@ myVx.DoControlPlots = False
 myVx.OutputLevel = WARNING
 
 if not 'DQMonFlags' in dir():
-    print "DQMonFlags not yet imported - I import them now"
+    print("DQMonFlags not yet imported - I import them now")
     from AthenaMonitoring.DQMonFlags import DQMonFlags
 
 #DQMonFlags.useTrigger = False 
diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/python/PixelMonitoringConfig.py b/InnerDetector/InDetMonitoring/PixelMonitoring/python/PixelMonitoringConfig.py
index 77bdacc15a1688a0b7cdbe3760944e06702e4151..64331dad8eff2214ac9cfa5b9f49186049cc99ca 100644
--- a/InnerDetector/InDetMonitoring/PixelMonitoring/python/PixelMonitoringConfig.py
+++ b/InnerDetector/InDetMonitoring/PixelMonitoring/python/PixelMonitoringConfig.py
@@ -70,13 +70,10 @@ def PixelMonitoringConfig(flags):
         
         PixelAthClusterMonAlgCfg(helper, pixelAthClusterMonAlg, **kwargsClusMonAlg)
 
-        from PixelMonitoring.PixelMonitoringConf import PixelAthErrorMonAlg
         from PixelMonitoring.PixelAthErrorMonAlgCfg import PixelAthErrorMonAlgCfg
-        pixelAthMonAlgErrorMonAlg = helper.addAlgorithm(PixelAthErrorMonAlg, 'PixelAthErrorMonAlg')
+        pixelAthMonAlgErrorMonAlg = helper.addAlgorithm(CompFactory.PixelAthErrorMonAlg, 'PixelAthErrorMonAlg')
         for k, v in kwargsErrMonAlg.items():
             setattr(pixelAthMonAlgErrorMonAlg, k, v)
-        from PixelConditionsTools.PixelConditionsToolsConf import PixelByteStreamErrorsTool
-        pixelAthMonAlgErrorMonAlg.PixelByteStreamErrorsTool = PixelByteStreamErrorsTool(ReadingESD = (flags.DQ.Environment == 'tier0ESD'))
         PixelAthErrorMonAlgCfg(helper, pixelAthMonAlgErrorMonAlg, **kwargsErrMonAlg)
         acc.merge(helper.result())
 
diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/python/SCTTracksMonAlg.py b/InnerDetector/InDetMonitoring/SCT_Monitoring/python/SCTTracksMonAlg.py
index e0d34db1d10f20a294ffc2fdae866a98890920e0..7fb4538d006549bafdb09a1cc6aacba1e9474fc4 100644
--- a/InnerDetector/InDetMonitoring/SCT_Monitoring/python/SCTTracksMonAlg.py
+++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/python/SCTTracksMonAlg.py
@@ -35,7 +35,7 @@ def SCTTracksMonAlgConfig(inputFlags):
         myMonAlg.FilterTools += [GetFilledBunchFilterTool()]
 
     doTrigger = False
-    if not inputFlags.isMC:
+    if not inputFlags.Input.isMC:
         if inputFlags.Trigger.doHLT:
             doTrigger = True
     myMonAlg.doTrigger = doTrigger
diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/python/TrackSummaryToolWorkaround.py b/InnerDetector/InDetMonitoring/SCT_Monitoring/python/TrackSummaryToolWorkaround.py
index c589bb357c64fc53953358605719dec1cb327c62..a66b8c0877b0c46476221270b46496095b0eae9d 100644
--- a/InnerDetector/InDetMonitoring/SCT_Monitoring/python/TrackSummaryToolWorkaround.py
+++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/python/TrackSummaryToolWorkaround.py
@@ -20,8 +20,8 @@ def TrackSummaryToolWorkaround(flags):
     result.merge(PixelConfigCondAlgCfg(flags,
                                     UseCalibConditions=True,
                                     UseDeadmapConditions=True,
-                                    UseDCSStateConditions=False,
-                                    UseDCSStatusConditions=False,
+                                    UseDCSStateConditions=(not flags.Input.isMC and flags.InDet.usePixelDCS),
+                                    UseDCSStatusConditions=(not flags.Input.isMC and flags.InDet.usePixelDCS),
                                     UseDCSHVConditions=True,
                                     UseDCSTemperatureConditions=True,
                                     UseTDAQConditions=False))
@@ -87,15 +87,15 @@ def TrackSummaryToolWorkaround(flags):
                                                           CountDeadModulesAfterLastHit = True,
                                                           BoundaryCheckTool=InDetBoundaryCheckTool)
     result.addPublicTool(InDetHoleSearchTool)
-    InDetPrdAssociationTool = CompFactory.InDet.InDetPRD_AssociationToolGangedPixels(name                           = "InDetPrdAssociationTool",
+    InDetPrdAssociationTool = CompFactory.InDet.InDetPRD_AssociationToolGangedPixels(name                           = "InDetPrdAssociationTool_setup",
                                                                           PixelClusterAmbiguitiesMapName = "PixelClusterAmbiguitiesMap",
                                                                           SetupCorrect                   = True,
                                                                           addTRToutliers                 = True)
     result.addPublicTool(InDetPrdAssociationTool)
     InDetTrackSummaryHelperTool = CompFactory.InDet.InDetTrackSummaryHelperTool(name            = "InDetSummaryHelper",
                                                                      AssoTool        = InDetPrdAssociationTool,
-                                                                     PixelToTPIDTool = None,
-                                                                     TestBLayerTool  = None,
+                                                                     PixelToTPIDTool = '',
+                                                                     TestBLayerTool  = '',
                                                                      RunningTIDE_Ambi = True,
                                                                      DoSharedHits    = False,
                                                                      HoleSearch      = InDetHoleSearchTool,
@@ -106,9 +106,9 @@ def TrackSummaryToolWorkaround(flags):
                                                   InDetSummaryHelperTool = InDetTrackSummaryHelperTool,
                                                   doSharedHits           = False,
                                                   doHolesInDet           = True,
-                                                  TRT_ElectronPidTool    = None,
-                                                  TRT_ToT_dEdxTool       = None,
-                                                  PixelToTPIDTool        = None)
+                                                  TRT_ElectronPidTool    = '',
+                                                  TRT_ToT_dEdxTool       = '',
+                                                  PixelToTPIDTool        = '')
     result.setPrivateTools(InDetTrackSummaryTool)
     ############################## WORKAROUND (END) ############################
 
diff --git a/InnerDetector/InDetMonitoring/TRTMonitoringRun3/python/TRTMonitoringRun3RAW_Alg.py b/InnerDetector/InDetMonitoring/TRTMonitoringRun3/python/TRTMonitoringRun3RAW_Alg.py
index ceae33541b167555346b8c4f31ce3bbb82d53bb3..4ff8ded4e02d4821e7d50d05f8ffbeb456df2eb7 100644
--- a/InnerDetector/InDetMonitoring/TRTMonitoringRun3/python/TRTMonitoringRun3RAW_Alg.py
+++ b/InnerDetector/InDetMonitoring/TRTMonitoringRun3/python/TRTMonitoringRun3RAW_Alg.py
@@ -2,16 +2,28 @@
 #  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 #
 def TRTMonitoringRun3RAW_AlgConfig(inputFlags):
-    from AthenaMonitoring import AthMonitorCfgHelperOld as AthMonitorCfgHelper
+    from AthenaConfiguration.ComponentFactory import isRun3Cfg
+    if isRun3Cfg():
+        from AthenaMonitoring import AthMonitorCfgHelper
+        isOnline = inputFlags.Common.isOnline
+        from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+        rv = ComponentAccumulator()
+    else:
+        from AthenaMonitoring import AthMonitorCfgHelperOld as AthMonitorCfgHelper
+        from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
+        isOnline = athenaCommonFlags.isOnline
     helper = AthMonitorCfgHelper(inputFlags, 'TRTMonitoringCfg')
 
     from AthenaConfiguration.ComponentFactory import CompFactory
     algTRTMonitoringRun3RAW = helper.addAlgorithm(CompFactory.TRTMonitoringRun3RAW_Alg,
                                                   'AlgTRTMonitoringRun3RAW',
-                                                  ByteStreamErrors= "" if inputFlags.isMC else "TRT_ByteStreamErrs"
+                                                  ByteStreamErrors= "" if inputFlags.Input.isMC else "TRT_ByteStreamErrs",
+                                                  TrackSummaryTool= "InDetTrackSummaryTool"
                                               )
 
-    from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
+    if isRun3Cfg():
+        from SCT_Monitoring.TrackSummaryToolWorkaround import TrackSummaryToolWorkaround
+        algTRTMonitoringRun3RAW.TrackSummaryTool = rv.popToolsAndMerge(TrackSummaryToolWorkaround(inputFlags))
 
     maxLumiBlock         = 200
     numberOfBarrelStacks = 32
@@ -108,7 +120,7 @@ def TRTMonitoringRun3RAW_AlgConfig(inputFlags):
                 rdoEndcapGroup.defineHistogram('HitWMap_Ar_passed,HitWMap_Ar;hHitWMap_Ar_{0}'.format(side[iside]),type='TEfficiency',title='Leading Edge in Time Window: Argon Straws (E{0});Straw Number in Stack;Probability'.format(side[iside]),path='TRT/Shift/{0}'.format(barrelOrEndcap[ibe]),xbins=strawMax[ibe],xmin=0,xmax=strawMax[ibe])   
         for iside in range(2):
             regionTag = ' (' + beId[ibe] + sideId[iside] + ')'
-            regionMarker = (beId[ibe] + sideId[iside]) if athenaCommonFlags.isOnline is True else (sideId[iside])
+            regionMarker = (beId[ibe] + sideId[iside]) if isOnline is True else (sideId[iside])
             rdoLLHLOccGroup = helper.addGroup(algTRTMonitoringRun3RAW,'RDOLLHLOccHistograms{0}{1}'.format(ibe,iside))
             rdoLLHLOccGroup.defineHistogram('AvgHLOcc_side_x,AvgHLOcc_side_y;hAvgHLOcc_{0}'.format(regionMarker),type='TProfile',title='Avg. HL Occupancy{0};{1};Occupancy'.format(regionTag,stackOrSector[ibe]),path='TRT/Shift/{0}'.format(barrelOrEndcap[ibe]),xbins=32,xmin=1,xmax=33)
             rdoLLHLOccGroup.defineHistogram('AvgLLOcc_side_x,AvgLLOcc_side_y;hAvgLLOcc_{0}'.format(regionMarker),type='TProfile',title='Avg. LL Occupancy{0};{1};Occupancy'.format(regionTag,stackOrSector[ibe]),path='TRT/Shift/{0}'.format(barrelOrEndcap[ibe]),xbins=32,xmin=1,xmax=33)
@@ -209,4 +221,8 @@ def TRTMonitoringRun3RAW_AlgConfig(inputFlags):
                 shiftTrackEndcapGroup.defineHistogram('StrawEffDetPhi_E_passed,StrawEffDetPhi_E;hStrawEffDetPhi_{0}'.format(sideId[iside]),type='TEfficiency',title='Straw Efficiency on Track with {0} mm Cut vs #phi(2D){1};Stack;Avg. Straw Efficiency'.format(distance,regionTag),path='TRT/Shift/{0}'.format(barrelOrEndcap[ibe]),xbins=32,xmin=0,xmax=32)
     ### Finished Booking TRT Hits Histograms ###
 
-    return helper.result()
+    if isRun3Cfg():
+        rv.merge(helper.result())
+        return rv
+    else:
+        return helper.result()
diff --git a/InnerDetector/InDetRawAlgs/InDetOverlay/CMakeLists.txt b/InnerDetector/InDetRawAlgs/InDetOverlay/CMakeLists.txt
index ca37b502fa8e2364c39bb826bda9b85110537a8d..ed109d04c803d8c547f1a236f90b626385dafca0 100644
--- a/InnerDetector/InDetRawAlgs/InDetOverlay/CMakeLists.txt
+++ b/InnerDetector/InDetRawAlgs/InDetOverlay/CMakeLists.txt
@@ -6,6 +6,7 @@ atlas_subdir( InDetOverlay )
 # External dependencies:
 find_package( CLHEP )
 find_package( GTest )
+find_package( GMock )
 
 # Helper variable(s):
 set( _jobOPath
@@ -29,6 +30,15 @@ atlas_add_test( SCTOverlay_test
                 LINK_LIBRARIES AthenaBaseComps IDC_OverlayBase GaudiKernel InDetRawData CxxUtils StoreGateLib SGtests GeneratorObjects InDetIdentifier InDetSimData TrkTrack IdDictParser ${GTEST_LIBRARIES}
                 ENVIRONMENT "JOBOPTSEARCHPATH=${_jobOPath}" )
 
+atlas_add_test( TRTOverlay_test
+                SOURCES src/TRTOverlay.cxx test/TRTOverlay_test.cxx
+                INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} ${GTEST_INCLUDE_DIRS} ${GMOCK_INCLUDE_DIRS}
+                LINK_LIBRARIES ${CLHEP_LIBRARIES} AthenaBaseComps IDC_OverlayBase GaudiKernel InDetRawData StoreGateLib SGtests GeneratorObjects InDetIdentifier InDetSimData TrkTrack TRT_ConditionsServicesLib TRT_ElectronPidToolsLib IdDictParser ${GTEST_LIBRARIES} ${GMOCK_LIBRARIES}
+                ENVIRONMENT "JOBOPTSEARCHPATH=${_jobOPath}" )
+
+# Needed for the plugin service to see the test components
+# defined in the test binary.
+set_target_properties( InDetOverlay_TRTOverlay_test PROPERTIES ENABLE_EXPORTS True )
 
 # Component(s) in the package:
 atlas_add_component( InDetOverlay
diff --git a/InnerDetector/InDetRawAlgs/InDetOverlay/InDetOverlay/TRTOverlay.h b/InnerDetector/InDetRawAlgs/InDetOverlay/InDetOverlay/TRTOverlay.h
index 07ed78bc47d89f91c29d9eb4bc5ee133331bd6e8..74b33959965484113667d7b241eccf600b8b78eb 100644
--- a/InnerDetector/InDetRawAlgs/InDetOverlay/InDetOverlay/TRTOverlay.h
+++ b/InnerDetector/InDetRawAlgs/InDetOverlay/InDetOverlay/TRTOverlay.h
@@ -20,10 +20,16 @@ namespace CLHEP {
   class HepRandomEngine;
 }
 
+namespace OverlayTesting {
+  class TRTOverlay_test;
+}
+
 class TRTOverlay : public AthReentrantAlgorithm
 {
 public:
 
+  friend class OverlayTesting::TRTOverlay_test;
+
   TRTOverlay(const std::string &name, ISvcLocator *pSvcLocator);
 
   virtual StatusCode initialize() override final;
@@ -53,12 +59,12 @@ private:
   // Following tools, services and configurables are there only for the correct of HT hits
   ServiceHandle<IAthRNGSvc> m_rndmSvc{this, "RndmSvc", "AthRNGSvc", "Random Number Service"};      // Random number service
 
-  double                                 m_HTOccupancyCorrectionB;
-  double                                 m_HTOccupancyCorrectionEC;
-  double                                 m_HTOccupancyCorrectionB_noE;
-  double                                 m_HTOccupancyCorrectionEC_noE;
-  ToolHandle<InDet::ITRT_LocalOccupancy> m_TRT_LocalOccupancyTool{this, "TRT_LocalOccupancyTool", "TRT_LocalOccupancy", ""};
-  ToolHandle<ITRT_StrawStatusSummaryTool>   m_TRTStrawSummaryTool{this, "TRTStrawSummaryTool", "TRT_StrawStatusSummaryTool", ""};
+  Gaudi::Property<double> m_HTOccupancyCorrectionB{this, "TRT_HT_OccupancyCorrectionBarrel", 0.110, ""};
+  Gaudi::Property<double> m_HTOccupancyCorrectionEC{this, "TRT_HT_OccupancyCorrectionEndcap", 0.090, ""};
+  Gaudi::Property<double> m_HTOccupancyCorrectionB_noE{this, "TRT_HT_OccupancyCorrectionBarrelNoE", 0.060, ""};
+  Gaudi::Property<double> m_HTOccupancyCorrectionEC_noE{this, "TRT_HT_OccupancyCorrectionEndcapNoE", 0.050, ""};
+  ToolHandle<InDet::ITRT_LocalOccupancy>  m_TRT_LocalOccupancyTool{this, "TRT_LocalOccupancyTool", "TRT_LocalOccupancy", ""};
+  ToolHandle<ITRT_StrawStatusSummaryTool> m_TRTStrawSummaryTool{this, "TRTStrawSummaryTool", "TRT_StrawStatusSummaryTool", ""};
 
 };
 
diff --git a/InnerDetector/InDetRawAlgs/InDetOverlay/src/TRTOverlay.cxx b/InnerDetector/InDetRawAlgs/InDetOverlay/src/TRTOverlay.cxx
index 0b6a8f1b013a685559468385154db13da03c5a10..a0a565fe4bfac8a1492adf02779345960ffe70cf 100644
--- a/InnerDetector/InDetRawAlgs/InDetOverlay/src/TRTOverlay.cxx
+++ b/InnerDetector/InDetRawAlgs/InDetOverlay/src/TRTOverlay.cxx
@@ -45,10 +45,6 @@ namespace Overlay
 TRTOverlay::TRTOverlay(const std::string &name, ISvcLocator *pSvcLocator)
   : AthReentrantAlgorithm(name, pSvcLocator)
 {
-  declareProperty("TRT_HT_OccupancyCorrectionBarrel", m_HTOccupancyCorrectionB=0.110);
-  declareProperty("TRT_HT_OccupancyCorrectionEndcap", m_HTOccupancyCorrectionEC=0.090);
-  declareProperty("TRT_HT_OccupancyCorrectionBarrelNoE", m_HTOccupancyCorrectionB_noE=0.060);
-  declareProperty("TRT_HT_OccupancyCorrectionEndcapNoE", m_HTOccupancyCorrectionEC_noE=0.050);
 }
 
 
diff --git a/InnerDetector/InDetRawAlgs/InDetOverlay/test/TRTOverlay_test.cxx b/InnerDetector/InDetRawAlgs/InDetOverlay/test/TRTOverlay_test.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..76a29520ee30bb260b9bbbcd91f85f608646b5ee
--- /dev/null
+++ b/InnerDetector/InDetRawAlgs/InDetOverlay/test/TRTOverlay_test.cxx
@@ -0,0 +1,946 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+/**
+ * @author John Chapman
+ * @brief Tests for TRTOverlay.
+ */
+
+#undef NDEBUG
+
+// Tested AthAlgorithm
+#include "../InDetOverlay/TRTOverlay.h"
+
+#include <vector>
+
+#include "InDetIdentifier/TRT_ID.h"
+#include "IdDictParser/IdDictParser.h"
+#include "GaudiKernel/MsgStream.h"
+
+// HepMC includes
+#include "HepMC/GenEvent.h"
+#include "HepMC/GenParticle.h"
+#include "HepMC/GenVertex.h"
+
+// CLHEP includes
+#include "CLHEP/Vector/LorentzVector.h"
+#include "CLHEP/Units/SystemOfUnits.h"
+
+#include "GeneratorObjects/McEventCollection.h"
+#include "InDetSimData/InDetSimData.h"
+#include "InDetSimData/InDetSimDataCollection.h"
+
+// Framework includes
+#include "AthenaBaseComps/AthService.h"
+#include "AthenaBaseComps/AthAlgTool.h"
+#include "GaudiKernel/IAppMgrUI.h"
+#include "GaudiKernel/IJobOptionsSvc.h"
+#include "GaudiKernel/SmartIF.h"
+#include "GaudiKernel/SystemOfUnits.h"
+#include "GaudiKernel/PhysicalConstants.h"
+
+// Google Test
+#include "gtest/gtest.h"
+// Google Mock
+#include "gmock/gmock.h"
+
+
+namespace OverlayTesting {
+
+  // Athena Tool to emulate TRT_LocalOccupancy Tool
+  //
+  const std::string mockTRT_LocalOccupancyName = "OverlayTesting::MockTRT_LocalOccupancy/MyTestLocalOccupancy";
+
+  class MockTRT_LocalOccupancy : public extends<AthAlgTool, InDet::ITRT_LocalOccupancy> {
+  public:
+    /// constructor
+    MockTRT_LocalOccupancy(const std::string& type, const std::string& name, const IInterface* parent)
+      : base_class(type,name,parent)
+    { };
+
+    /// destructor
+    virtual ~MockTRT_LocalOccupancy() = default;
+
+    /** Return a map of the occupancy in the barrel (-1,+1) and endcaps (-2,+2) */
+    MOCK_CONST_METHOD1(getDetectorOccupancy, std::map<int, double>(const TRT_RDO_Container*) );
+
+    // Dummy methods to confirm status
+    virtual StatusCode initialize() override final {
+      ATH_MSG_INFO ("initializing MockTRT_LocalOccupancy: " << name());
+      return StatusCode::SUCCESS;
+    };
+
+    // dummy methods implementing in pure virtual interface methods (to make class non-abstract)
+    /** Return the local occupancy for the sectors crossed by a given track */
+    virtual float LocalOccupancy( const Trk::Track& ) const { return 1.0; }; // not used - dummy implementation
+    virtual float LocalOccupancy(const double, const double) const  { return 1.0; }; // not used - dummy implementation
+
+    /** Return the global occupancy of the event*/
+    virtual std::vector<float> GlobalOccupancy( ) const { std::vector<float> dummyVect{}; return dummyVect; }; // not used - dummy implementation
+  };
+
+  DECLARE_COMPONENT( MockTRT_LocalOccupancy )
+
+  // Athena Service to emulate TRT_StrawStatusSummaryTool
+  //
+  const std::string mockTRT_StrawStatusSummaryToolName = "OverlayTesting::MockTRT_StrawStatusSummaryTool/MyTestTRT_StrawStatusSummaryTool";
+  class MockTRT_StrawStatusSummaryTool : public extends<AthAlgTool, ITRT_StrawStatusSummaryTool> {
+  public:
+
+    /// constructor
+    MockTRT_StrawStatusSummaryTool(const std::string& type, const std::string& name, const IInterface* parent)
+      : base_class(type,name,parent)
+    { };
+
+    /// destructor
+    virtual ~MockTRT_StrawStatusSummaryTool() = default;
+
+    // Dummy methods to confirm status
+    virtual StatusCode initialize() override final {
+      ATH_MSG_INFO ("initializing MockTRT_StrawStatusSummaryTool: " << name());
+      return StatusCode::SUCCESS;
+    };
+
+    virtual int getStatus(const Identifier ) const { return 1; }; // not used - dummy implementation
+    virtual int getStatusPermanent(const Identifier) const { return 1; }; // not used - dummy implementation
+    MOCK_CONST_METHOD1(getStatusHT, int(const Identifier)); // This is the only method that we actually need! <--------------
+    virtual bool get_status(const Identifier) const { return false; }; // not used - dummy implementation
+    virtual bool get_statusHT(const Identifier) const { return false; }; // not used - dummy implementation
+    virtual const StrawStatusContainer* getStrawStatusHTContainer() const {return nullptr;}; // not used - dummy implementation
+
+    virtual int getStatus(const Identifier, const EventContext&  ) const { return 1; }; // not used - dummy implementation
+    virtual int getStatusPermanent(const Identifier, const EventContext& ) const { return 1; }; // not used - dummy implementation
+    virtual int getStatusHT(const Identifier, const EventContext& ) const { return 1; }; // not used - dummy implementation
+    virtual bool get_status(const Identifier, const EventContext& ) const { return false; }; // not used - dummy implementation
+    virtual bool get_statusHT(const Identifier, const EventContext& ) const { return false; }; // not used - dummy implementation
+
+  };
+
+  DECLARE_COMPONENT( MockTRT_StrawStatusSummaryTool )
+
+
+  // Gaudi Test fixture that provides a clean Gaudi environment for
+  // each individual test case
+  class GaudiFixture {
+
+  protected:
+    GaudiFixture() {
+      SetUpGaudi();
+    }
+
+    ~GaudiFixture() {
+      TearDownGaudi();
+    }
+
+    void SetUpGaudi() {
+      m_appMgr = Gaudi::createApplicationMgr();
+      ASSERT_TRUE( m_appMgr!=nullptr );
+
+      m_svcLoc = m_appMgr;
+      ASSERT_TRUE( m_svcLoc.isValid() );
+
+      m_svcMgr = m_appMgr;
+      ASSERT_TRUE( m_svcMgr.isValid() );
+
+      m_propMgr = m_appMgr;
+      ASSERT_TRUE( m_propMgr.isValid() );
+      ASSERT_TRUE( m_propMgr->setProperty( "EvtSel",         "NONE" ).isSuccess() );
+      ASSERT_TRUE( m_propMgr->setProperty( "JobOptionsType", "FILE" ).isSuccess() );
+      ASSERT_TRUE( m_propMgr->setProperty( "JobOptionsPath", "StoreGateTestCommon.txt" ).isSuccess() );
+
+      m_toolSvc = m_svcLoc->service("ToolSvc");
+      ASSERT_TRUE( m_toolSvc.isValid() );
+
+      ASSERT_TRUE( m_appMgr->configure().isSuccess() );
+      ASSERT_TRUE( m_appMgr->initialize().isSuccess() );
+
+      m_jobOptionsSvc = m_svcLoc->service("JobOptionsSvc");
+      ASSERT_TRUE( m_jobOptionsSvc.isValid() );
+    }
+
+    void TearDownGaudi() {
+      ASSERT_TRUE( m_svcMgr->finalize().isSuccess() );
+      ASSERT_TRUE( m_appMgr->finalize().isSuccess() );
+      ASSERT_TRUE( m_appMgr->terminate().isSuccess() );
+      m_svcLoc->release();
+      m_svcMgr->release();
+      Gaudi::setInstance( static_cast<IAppMgrUI*>(nullptr) );
+    }
+
+    // protected member variables for Core Gaudi components
+    IAppMgrUI*               m_appMgr = nullptr;
+    SmartIF<ISvcLocator>     m_svcLoc;
+    SmartIF<ISvcManager>     m_svcMgr;
+    SmartIF<IJobOptionsSvc>  m_jobOptionsSvc;
+    SmartIF<IToolSvc>        m_toolSvc;
+    SmartIF<IProperty>       m_propMgr;
+  };
+
+
+  class TRTOverlay_test : public ::testing::Test, public GaudiFixture {
+
+  protected:
+    virtual void SetUp() override {
+      // DetectorStore and ID Helper
+      StoreGateSvc *detStore(nullptr);
+      ASSERT_TRUE( m_svcLoc->service("DetectorStore", detStore, true).isSuccess() );
+      if (detStore) {
+        if (not detStore->contains<TRT_ID>("TRT_ID")) {
+          auto trt_id = std::make_unique<TRT_ID>();
+          IdDictParser parser;
+          parser.register_external_entity ("InnerDetector",
+                                           "IdDictInnerDetector.xml");
+          IdDictMgr& idd = parser.parse ("IdDictParser/ATLAS_IDS.xml");
+          trt_id->initialize_from_dictionary (idd);
+          ASSERT_TRUE( detStore->record (std::move (trt_id), "TRT_ID").isSuccess() );
+        }
+      }
+      ASSERT_TRUE( m_svcLoc->service("StoreGateSvc", m_sg, true).isSuccess() );
+
+      // the tested Algorithm
+      m_alg = new TRTOverlay{"TRTOverlay", m_svcLoc};
+      m_alg->addRef();
+      ASSERT_TRUE( m_alg->setProperties().isSuccess() );
+      // ordering B, A, C, D is on purpose to test for unintended alphabetic ordering
+      std::string        inputSigPropertyValue = "'StoreGateSvc+TRT_RDOs_SIG'";
+      std::string        inputBkgPropertyValue = "'StoreGateSvc+TRT_RDOs_BKG'";
+      std::string          outputPropertyValue = "'StoreGateSvc+TRT_RDOs'";
+      std::string     inputSigSDOPropertyValue = "'StoreGateSvc+TRT_SDO_Map_SIG'";
+      ASSERT_TRUE( m_alg->setProperty( "SignalInputKey",   inputSigPropertyValue).isSuccess() );
+      ASSERT_TRUE( m_alg->setProperty( "BkgInputKey",   inputBkgPropertyValue).isSuccess() );
+      ASSERT_TRUE( m_alg->setProperty( "OutputKey", outputPropertyValue).isSuccess() );
+      ASSERT_TRUE( m_alg->setProperty( "SignalInputSDOKey",   inputSigSDOPropertyValue).isSuccess() );
+      ASSERT_TRUE( m_alg->setProperty( "TRT_LocalOccupancyTool", mockTRT_LocalOccupancyName).isSuccess() );
+      ASSERT_TRUE( m_alg->setProperty( "TRTStrawSummaryTool", mockTRT_StrawStatusSummaryToolName).isSuccess() );
+    }
+
+    virtual void TearDown() override {
+      // let the Gaudi ServiceManager finalize all services
+      ASSERT_TRUE( m_svcMgr->finalize().isSuccess() );
+      ASSERT_TRUE( m_alg->finalize().isSuccess() );
+      delete m_alg;
+    }
+
+    template<typename T>
+    T* retrieveService(const std::string& name) {
+      T* service = nullptr;
+      SmartIF<IService>& serviceSmartPointer = m_svcLoc->service(name);
+      service = dynamic_cast<T*>(serviceSmartPointer.get());
+      EXPECT_NE(nullptr, service);
+      if(!service) {
+        return nullptr;
+      }
+      EXPECT_TRUE( service->setProperties().isSuccess() );
+      EXPECT_TRUE( service->configure().isSuccess() );
+      EXPECT_TRUE( m_svcMgr->addService(service).isSuccess() );
+      // assert that finalize() gets called once per test case
+      EXPECT_CALL( *service, finalize() )
+        .Times(1)
+        .WillOnce(::testing::Return(StatusCode::SUCCESS));
+
+      return service;
+    }
+
+    template<typename T>
+    T* retrieveTool(const std::string& name) {
+      IAlgTool* toolInterface = nullptr;
+      EXPECT_TRUE( m_toolSvc->retrieveTool(name, toolInterface).isSuccess() );
+      EXPECT_NE(nullptr, toolInterface);
+
+      T* tool = dynamic_cast<T*>(toolInterface);
+      EXPECT_NE(nullptr, tool);
+      if(!tool) {
+        return nullptr;
+      }
+
+      EXPECT_TRUE( tool->setProperties().isSuccess() );
+      EXPECT_TRUE( tool->configure().isSuccess() );
+
+      // assert that finalize() gets called once per test case
+      EXPECT_CALL( *tool, finalize() )
+        .Times(1)
+        .WillOnce(::testing::Return(StatusCode::SUCCESS));
+
+      return tool;
+    }
+
+    unsigned int encodeDigit(const std::vector<unsigned int>& bits)
+    {
+      unsigned digit(0);
+      const unsigned one(1);
+      for (unsigned int bit=0; bit < bits.size(); ++bit) {
+        if (bits[bit]==1) {
+          digit += one << (31-bit);
+        }
+      }
+      return digit;
+    }
+
+    bool initMcEventCollection(std::vector<HepMC::GenParticle*>& genPartList)
+    {
+      // create dummy input McEventCollection with a name that
+      // HepMcParticleLink knows about
+      SG::WriteHandle<McEventCollection> inputTestDataHandle{"TruthEvent"};
+      inputTestDataHandle = std::make_unique<McEventCollection>();
+      // Add a dummy GenEvent
+      const int process_id1(20);
+      const int event_number1(17);
+      inputTestDataHandle->push_back(new HepMC::GenEvent(process_id1, event_number1));
+      HepMC::GenEvent& ge1 = *(inputTestDataHandle->at(0));
+      populateGenEvent(ge1,-11,11,genPartList);
+      populateGenEvent(ge1,-13,13,genPartList);
+      populateGenEvent(ge1,-11,11,genPartList);
+      populateGenEvent(ge1,-13,13,genPartList);
+      populateGenEvent(ge1,-11,11,genPartList);
+      populateGenEvent(ge1,22,22,genPartList);
+      return true;
+    }
+
+    void populateGenEvent(HepMC::GenEvent & ge, int pdgid1, int pdgid2, std::vector<HepMC::GenParticle*>& genPartList)
+    {
+      CLHEP::HepLorentzVector myPos( 0.0, 0.0, 0.0, 0.0);
+      HepMC::GenVertex *myVertex = new HepMC::GenVertex( myPos, -1 );
+      HepMC::FourVector fourMomentum1( 0.0, 0.0, 1.0, 1.0*CLHEP::TeV);
+      HepMC::GenParticle* inParticle1 = new HepMC::GenParticle(fourMomentum1, pdgid1, 2);
+      myVertex->add_particle_in(inParticle1);
+      HepMC::FourVector fourMomentum2( 0.0, 0.0, -1.0, 1.0*CLHEP::TeV);
+      HepMC::GenParticle* inParticle2 = new HepMC::GenParticle(fourMomentum2, pdgid2, 2);
+      myVertex->add_particle_in(inParticle2);
+      HepMC::FourVector fourMomentum3( 0.0, 1.0, 0.0, 1.0*CLHEP::TeV);
+      HepMC::GenParticle* inParticle3 = new HepMC::GenParticle(fourMomentum3, pdgid1, 1);
+      myVertex->add_particle_out(inParticle3);
+      genPartList.push_back(inParticle3);
+      HepMC::FourVector fourMomentum4( 0.0, -1.0, 0.0, 1.0*CLHEP::TeV);
+      HepMC::GenParticle* inParticle4 = new HepMC::GenParticle(fourMomentum4, pdgid2, 1);
+      myVertex->add_particle_out(inParticle4);
+      genPartList.push_back(inParticle4);
+      ge.add_vertex( myVertex );
+      ge.set_signal_process_vertex( myVertex );
+      ge.set_beam_particles(inParticle1,inParticle2);
+    }
+
+    void setPrivateToolPointers()
+    {
+      m_mockTRT_StrawStatusSummaryTool = dynamic_cast<OverlayTesting::MockTRT_StrawStatusSummaryTool*>(&*(m_alg->m_TRTStrawSummaryTool));
+      m_mockTRT_LocalOccupancy = dynamic_cast<OverlayTesting::MockTRT_LocalOccupancy*>(&*(m_alg->m_TRT_LocalOccupancyTool));
+    }
+    // the tested AthAlgorithm
+    TRTOverlay* m_alg{};
+
+    StoreGateSvc* m_sg{};
+    // mocked Athena components
+    OverlayTesting::MockTRT_LocalOccupancy* m_mockTRT_LocalOccupancy = nullptr;
+    OverlayTesting::MockTRT_StrawStatusSummaryTool* m_mockTRT_StrawStatusSummaryTool = nullptr;
+    const std::map<int, double> m_empty_occupancy = {{-2,0.0},{-1,0.0},{1,0.0},{2,0.0}};
+    const std::map<int, double> m_full_occupancy = {{-2,1.0},{-1,1.0},{1,1.0},{2,1.0}};
+  };   // TRTOverlay_test fixture
+
+
+  TEST_F(TRTOverlay_test, missing_inputs_alg_execute) {
+    EventContext ctx(0,0);
+    ctx.setExtension( Atlas::ExtendedEventContext( m_sg, 0 ) );
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    ASSERT_TRUE( m_alg->execute(ctx).isFailure() ); //inputs don't exist
+  }
+
+  TEST_F(TRTOverlay_test, empty_containers_alg_execute) {
+    EventContext ctx(0,0);
+    ctx.setExtension( Atlas::ExtendedEventContext( m_sg, 0 ) );
+    SG::WriteHandle<TRT_RDO_Container> inputSigDataHandle{"StoreGateSvc+TRT_RDOs_SIG"};
+    const unsigned int containerSize(19008);
+    inputSigDataHandle = std::make_unique<TRT_RDO_Container>(containerSize);
+    SG::WriteHandle<TRT_RDO_Container> inputBkgDataHandle{"StoreGateSvc+TRT_RDOs_BKG"};
+    inputBkgDataHandle = std::make_unique<TRT_RDO_Container>(containerSize);
+    SG::WriteHandle<InDetSimDataCollection> inputSigSDODataHandle{"StoreGateSvc+TRT_SDO_Map_SIG"};
+    inputSigSDODataHandle = std::make_unique<InDetSimDataCollection>();
+
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    setPrivateToolPointers();
+    EXPECT_CALL( *m_mockTRT_LocalOccupancy, getDetectorOccupancy(::testing::_) )
+      .Times(1)
+      .WillOnce(::testing::Return(m_full_occupancy));
+    ASSERT_TRUE( m_alg->execute(ctx).isSuccess() );
+    // check output makes sense
+    SG::ReadHandle<TRT_RDO_Container> outputDataHandle{"StoreGateSvc+TRT_RDOs"};
+    ASSERT_TRUE( outputDataHandle.isValid() );
+    ASSERT_EQ( outputDataHandle->numberOfCollections(), 0 );
+  }
+
+  TEST_F(TRTOverlay_test, containers_with_matching_empty_collections) {
+    EventContext ctx(0,0);
+    ctx.setExtension( Atlas::ExtendedEventContext( m_sg, 0 ) );
+    SG::WriteHandle<TRT_RDO_Container> inputSigDataHandle{"StoreGateSvc+TRT_RDOs_SIG"};
+    const unsigned int containerSize(19008);
+    IdentifierHash sigElementHash(10026);
+    IdentifierHash bkgElementHash(10026);
+    inputSigDataHandle = std::make_unique<TRT_RDO_Container>(containerSize);
+    std::unique_ptr<TRT_RDO_Collection> sigCollection = std::make_unique<TRT_RDO_Collection>(sigElementHash);
+    ASSERT_TRUE(inputSigDataHandle->addCollection(sigCollection.get(),sigElementHash).isSuccess());
+    sigCollection.release(); // Now owned by inputSigDataHandle
+    SG::WriteHandle<TRT_RDO_Container> inputBkgDataHandle{"StoreGateSvc+TRT_RDOs_BKG"};
+    inputBkgDataHandle = std::make_unique<TRT_RDO_Container>(containerSize);
+    std::unique_ptr<TRT_RDO_Collection> bkgCollection = std::make_unique<TRT_RDO_Collection>(bkgElementHash);
+    ASSERT_TRUE(inputBkgDataHandle->addCollection(bkgCollection.get(),bkgElementHash).isSuccess());
+    bkgCollection.release(); // Now owned by inputBkgDataHandle
+    SG::WriteHandle<InDetSimDataCollection> inputSigSDODataHandle{"StoreGateSvc+TRT_SDO_Map_SIG"};
+    inputSigSDODataHandle = std::make_unique<InDetSimDataCollection>();
+
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    setPrivateToolPointers();
+    EXPECT_CALL( *m_mockTRT_LocalOccupancy, getDetectorOccupancy(::testing::_) )
+      .Times(1)
+      .WillOnce(::testing::Return(m_full_occupancy));
+    ASSERT_TRUE( m_alg->execute(ctx).isSuccess() );
+    // check output makes sense
+    SG::ReadHandle<TRT_RDO_Container> outputDataHandle{"StoreGateSvc+TRT_RDOs"};
+    ASSERT_TRUE( outputDataHandle.isValid() );
+    ASSERT_EQ( outputDataHandle->numberOfCollections(),1 );
+    const TRT_RDO_Collection *outputCollection = outputDataHandle->indexFindPtr(sigElementHash);
+    ASSERT_NE( outputCollection, nullptr );
+    ASSERT_TRUE( outputCollection->empty() );
+  }
+
+  TEST_F(TRTOverlay_test, containers_with_different_empty_collections) {
+    EventContext ctx(0,0);
+    ctx.setExtension( Atlas::ExtendedEventContext( m_sg, 0 ) );
+    SG::WriteHandle<TRT_RDO_Container> inputSigDataHandle{"StoreGateSvc+TRT_RDOs_SIG"};
+    const unsigned int containerSize(19008);
+    IdentifierHash sigElementHash(10026);
+    IdentifierHash bkgElementHash(10025);
+    inputSigDataHandle = std::make_unique<TRT_RDO_Container>(containerSize);
+    std::unique_ptr<TRT_RDO_Collection> sigCollection = std::make_unique<TRT_RDO_Collection>(sigElementHash);
+    ASSERT_TRUE(inputSigDataHandle->addCollection(sigCollection.get(),sigElementHash).isSuccess());
+    sigCollection.release(); // Now owned by inputSigDataHandle
+    SG::WriteHandle<TRT_RDO_Container> inputBkgDataHandle{"StoreGateSvc+TRT_RDOs_BKG"};
+    inputBkgDataHandle = std::make_unique<TRT_RDO_Container>(containerSize);
+    std::unique_ptr<TRT_RDO_Collection> bkgCollection = std::make_unique<TRT_RDO_Collection>(bkgElementHash);
+    ASSERT_TRUE(inputBkgDataHandle->addCollection(bkgCollection.get(),bkgElementHash).isSuccess());
+    bkgCollection.release(); // Now owned by inputBkgDataHandle
+    SG::WriteHandle<InDetSimDataCollection> inputSigSDODataHandle{"StoreGateSvc+TRT_SDO_Map_SIG"};
+    inputSigSDODataHandle = std::make_unique<InDetSimDataCollection>();
+
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    setPrivateToolPointers();
+    EXPECT_CALL( *m_mockTRT_LocalOccupancy, getDetectorOccupancy(::testing::_) )
+      .Times(1)
+      .WillOnce(::testing::Return(m_full_occupancy));
+    ASSERT_TRUE( m_alg->execute(ctx).isSuccess() );
+    // check output makes sense
+    SG::ReadHandle<TRT_RDO_Container> outputDataHandle{"StoreGateSvc+TRT_RDOs"};
+    ASSERT_TRUE( outputDataHandle.isValid() );
+    ASSERT_EQ( outputDataHandle->numberOfCollections(), 2 );
+    const TRT_RDO_Collection *outputCollection1 = outputDataHandle->indexFindPtr(sigElementHash);
+    ASSERT_NE( outputCollection1, nullptr );
+    ASSERT_TRUE( outputCollection1->empty() );
+    const TRT_RDO_Collection *outputCollection2 = outputDataHandle->indexFindPtr(bkgElementHash);
+    ASSERT_NE( outputCollection2, nullptr );
+    ASSERT_TRUE( outputCollection2->empty() );
+  }
+
+  TEST_F(TRTOverlay_test, containers_with_matching_collections_one_with_an_RDO) {
+    EventContext ctx(0,0);
+    ctx.setExtension( Atlas::ExtendedEventContext( m_sg, 0 ) );
+    SG::WriteHandle<TRT_RDO_Container> inputSigDataHandle{"StoreGateSvc+TRT_RDOs_SIG"};
+    const unsigned int containerSize(19008);
+    const IdentifierHash sigElementHash(10026);
+    const IdentifierHash bkgElementHash(10026);
+    Identifier::value_type value = 0x1612282000000000;
+    Identifier sigStrawID = Identifier(value); //Digit ID 2229569 Digit 2147483696
+    const std::vector<unsigned int> sigBits = {
+      1, // overlay flag
+      0,0,0,0, // msb and unused bits - always zero
+      0, // leading HT bit - always zero
+      0,0,0,0,0,0,0,0, // LT bits for leading BC
+      0, // In-time HT bit
+      0,0,0,0,0,0,0,0, // LT bits for in-time BC
+      0, // trailing HT bit - always zero
+      0,0,1,1,0,0,0,0  // LT bits for trailing BC (last 4 LT bits always zero)
+    };
+    const unsigned int sigWord = encodeDigit(sigBits);
+    const unsigned int checkWord(2147483696); //10000000000000000000000000110000
+    ASSERT_EQ( sigWord, checkWord ); // Cross-check of encodeDigit function
+    inputSigDataHandle = std::make_unique<TRT_RDO_Container>(containerSize);
+    std::unique_ptr<TRT_RDO_Collection> sigCollection = std::make_unique<TRT_RDO_Collection>(sigElementHash);
+    //Add a TRT_LoLumRawData object
+    std::unique_ptr<TRT_LoLumRawData> sigDigit = std::make_unique<TRT_LoLumRawData>(sigStrawID,sigWord);
+    const auto sigHT=sigDigit->highLevel();
+    const auto sigTOT=sigDigit->timeOverThreshold();
+    const auto sigDriftTimeBin=sigDigit->driftTimeBin();
+    sigCollection->push_back(sigDigit.release());
+    ASSERT_TRUE(inputSigDataHandle->addCollection(sigCollection.get(),sigElementHash).isSuccess());
+    sigCollection.release(); // Now owned by inputSigDataHandle
+    SG::WriteHandle<TRT_RDO_Container> inputBkgDataHandle{"StoreGateSvc+TRT_RDOs_BKG"};
+    inputBkgDataHandle = std::make_unique<TRT_RDO_Container>(containerSize);
+    std::unique_ptr<TRT_RDO_Collection> bkgCollection = std::make_unique<TRT_RDO_Collection>(bkgElementHash);
+    ASSERT_TRUE(inputBkgDataHandle->addCollection(bkgCollection.get(),bkgElementHash).isSuccess());
+    bkgCollection.release(); // Now owned by inputBkgDataHandle
+    SG::WriteHandle<InDetSimDataCollection> inputSigSDODataHandle{"StoreGateSvc+TRT_SDO_Map_SIG"};
+    inputSigSDODataHandle = std::make_unique<InDetSimDataCollection>();
+
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    setPrivateToolPointers();
+    EXPECT_CALL( *m_mockTRT_LocalOccupancy, getDetectorOccupancy(::testing::_) )
+      .Times(1)
+      .WillOnce(::testing::Return(m_full_occupancy));
+    ASSERT_TRUE( m_alg->execute(ctx).isSuccess() );
+    // check output makes sense
+    SG::ReadHandle<TRT_RDO_Container> outputDataHandle{"StoreGateSvc+TRT_RDOs"};
+    ASSERT_TRUE( outputDataHandle.isValid() );
+    ASSERT_EQ( outputDataHandle->numberOfCollections(), 1 );
+    const TRT_RDO_Collection *outputCollection1 = outputDataHandle->indexFindPtr(sigElementHash);
+    ASSERT_NE( outputCollection1, nullptr );
+    ASSERT_EQ( outputCollection1->size(), 1 );
+    const TRT_LoLumRawData* outputDigit1 = dynamic_cast<const TRT_LoLumRawData*>(outputCollection1->at(0));
+    ASSERT_NE( outputDigit1, nullptr );
+    ASSERT_EQ( outputDigit1->highLevel(), sigHT );
+    ASSERT_EQ( outputDigit1->timeOverThreshold(), sigTOT );
+    ASSERT_EQ( outputDigit1->driftTimeBin(), sigDriftTimeBin );
+  }
+
+  TEST_F(TRTOverlay_test, containers_with_different_collections_one_RDO_each) {
+    EventContext ctx(0,0);
+    ctx.setExtension( Atlas::ExtendedEventContext( m_sg, 0 ) );
+    SG::WriteHandle<TRT_RDO_Container> inputSigDataHandle{"StoreGateSvc+TRT_RDOs_SIG"};
+    const unsigned int containerSize(19008);
+    const IdentifierHash sigElementHash(10026);
+    const Identifier::value_type sigValue = 0x1612282000000000;
+    const Identifier sigStrawID = Identifier(sigValue);
+    const std::vector<unsigned int> sigBits = {
+      1, // overlay flag
+      0,0,0,0, // msb and unused bits - always zero
+      0, // leading HT bit - always zero
+      0,0,0,0,0,0,0,0, // LT bits for leading BC
+      0, // In-time HT bit
+      0,0,0,0,0,0,0,0, // LT bits for in-time BC
+      0, // trailing HT bit - always zero
+      0,0,1,1,0,0,0,0  // LT bits for trailing BC (last 4 LT bits always zero)
+    };
+    const unsigned int sigWord = encodeDigit(sigBits);
+    inputSigDataHandle = std::make_unique<TRT_RDO_Container>(containerSize);
+    std::unique_ptr<TRT_RDO_Collection> sigCollection = std::make_unique<TRT_RDO_Collection>(sigElementHash);
+    //Add a TRT_LoLumRawData object
+    std::unique_ptr<TRT_LoLumRawData> sigDigit = std::make_unique<TRT_LoLumRawData>(sigStrawID,sigWord);
+    const auto sigHT=sigDigit->highLevel();
+    const auto sigTOT=sigDigit->timeOverThreshold();
+    const auto sigDriftTimeBin=sigDigit->driftTimeBin();
+    sigCollection->push_back(sigDigit.release());
+    ASSERT_TRUE(inputSigDataHandle->addCollection(sigCollection.get(),sigElementHash).isSuccess());
+    sigCollection.release(); // Now owned by inputSigDataHandle
+    SG::WriteHandle<TRT_RDO_Container> inputBkgDataHandle{"StoreGateSvc+TRT_RDOs_BKG"};
+    const IdentifierHash bkgElementHash(10027);
+    const Identifier::value_type bkgValue = 0x16122ce000000000;
+    const Identifier bkgStrawID = Identifier(bkgValue);
+    const std::vector<unsigned int> bkgBits = {
+      1, // overlay flag
+      0,0,0,0, // msb and unused bits - always zero
+      0, // leading HT bit - always zero
+      0,0,0,0,0,0,0,0, // LT bits for leading BC
+      0, // In-time HT bit
+      0,0,0,1,1,1,1,1, // LT bits for in-time BC
+      0, // trailing HT bit - always zero
+      1,1,0,0,0,0,0,0  // LT bits for trailing BC (last 4 LT bits always zero)
+    };
+    const unsigned int bkgWord = encodeDigit(bkgBits);
+    inputBkgDataHandle = std::make_unique<TRT_RDO_Container>(containerSize);
+    std::unique_ptr<TRT_RDO_Collection> bkgCollection = std::make_unique<TRT_RDO_Collection>(bkgElementHash);
+    //Add a TRT_LoLumRawData object
+    std::unique_ptr<TRT_LoLumRawData> bkgDigit = std::make_unique<TRT_LoLumRawData>(bkgStrawID,bkgWord);
+    const auto bkgHT=bkgDigit->highLevel();
+    const auto bkgTOT=bkgDigit->timeOverThreshold();
+    const auto bkgDriftTimeBin=bkgDigit->driftTimeBin();
+    bkgCollection->push_back(bkgDigit.release());
+    ASSERT_TRUE(inputBkgDataHandle->addCollection(bkgCollection.get(),bkgElementHash).isSuccess());
+    bkgCollection.release(); // Now owned by inputBkgDataHandle
+    SG::WriteHandle<InDetSimDataCollection> inputSigSDODataHandle{"StoreGateSvc+TRT_SDO_Map_SIG"};
+    inputSigSDODataHandle = std::make_unique<InDetSimDataCollection>();
+
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    setPrivateToolPointers();
+    EXPECT_CALL( *m_mockTRT_LocalOccupancy, getDetectorOccupancy(::testing::_) )
+      .Times(1)
+      .WillOnce(::testing::Return(m_full_occupancy));
+    ASSERT_TRUE( m_alg->execute(ctx).isSuccess() );
+    // check output makes sense
+    SG::ReadHandle<TRT_RDO_Container> outputDataHandle{"StoreGateSvc+TRT_RDOs"};
+    ASSERT_TRUE( outputDataHandle.isValid() );
+    const TRT_RDO_Collection *outputCollection1 = outputDataHandle->indexFindPtr(sigElementHash);
+    ASSERT_NE( outputCollection1, nullptr );
+    ASSERT_EQ( outputCollection1->size(), 1 );
+    const TRT_LoLumRawData* outputDigit1 = dynamic_cast<const TRT_LoLumRawData*>(outputCollection1->at(0));
+    ASSERT_NE( outputDigit1, nullptr );
+    ASSERT_EQ( outputDigit1->highLevel(), sigHT );
+    ASSERT_EQ( outputDigit1->timeOverThreshold(), sigTOT );
+    ASSERT_EQ( outputDigit1->driftTimeBin(), sigDriftTimeBin );
+    const TRT_RDO_Collection *outputCollection2 = outputDataHandle->indexFindPtr(bkgElementHash);
+    ASSERT_NE( outputCollection2, nullptr );
+    ASSERT_EQ( outputCollection2->size(), 1 );
+    const TRT_LoLumRawData* outputDigit2 = dynamic_cast<const TRT_LoLumRawData*>(outputCollection2->at(0));
+    ASSERT_NE( outputDigit2, nullptr );
+    ASSERT_EQ( outputDigit2->highLevel(), bkgHT );
+    ASSERT_EQ( outputDigit2->timeOverThreshold(), bkgTOT );
+    ASSERT_EQ( outputDigit2->driftTimeBin(), bkgDriftTimeBin );
+  }
+
+  TEST_F(TRTOverlay_test, containers_with_matching_collections_with_matching_RDOs) {
+    EventContext ctx(0,0);
+    ctx.setExtension( Atlas::ExtendedEventContext( m_sg, 0 ) );
+    SG::WriteHandle<TRT_RDO_Container> inputSigDataHandle{"StoreGateSvc+TRT_RDOs_SIG"};
+    const unsigned int containerSize(19008);
+    const IdentifierHash sigElementHash(10027);
+    const Identifier::value_type sigValue = 0x16122ce000000000;
+    const Identifier sigStrawID = Identifier(sigValue);
+    const std::vector<unsigned int> sigBits = {
+      1, // overlay flag
+      0,0,0,0, // msb and unused bits - always zero
+      0, // leading HT bit - always zero
+      0,0,0,0,0,0,0,0, // LT bits for leading BC
+      0, // In-time HT bit
+      0,0,0,1,1,1,1,1, // LT bits for in-time BC
+      0, // trailing HT bit - always zero
+      1,1,0,0,0,0,0,0  // LT bits for trailing BC (last 4 LT bits always zero)
+    };
+    const unsigned int sigWord = encodeDigit(sigBits);
+    inputSigDataHandle = std::make_unique<TRT_RDO_Container>(containerSize);
+    std::unique_ptr<TRT_RDO_Collection> sigCollection = std::make_unique<TRT_RDO_Collection>(sigElementHash);
+    //Add a TRT_LoLumRawData object
+    std::unique_ptr<TRT_LoLumRawData> sigDigit = std::make_unique<TRT_LoLumRawData>(sigStrawID,sigWord);
+    const auto sigHT=sigDigit->highLevel();
+    const auto sigTOT=sigDigit->timeOverThreshold();
+    const auto sigDriftTimeBin=sigDigit->driftTimeBin();
+    sigCollection->push_back(sigDigit.release());
+    ASSERT_TRUE(inputSigDataHandle->addCollection(sigCollection.get(),sigElementHash).isSuccess());
+    sigCollection.release(); // Now owned by inputSigDataHandle
+    SG::WriteHandle<TRT_RDO_Container> inputBkgDataHandle{"StoreGateSvc+TRT_RDOs_BKG"};
+    inputBkgDataHandle = std::make_unique<TRT_RDO_Container>(containerSize);
+    std::unique_ptr<TRT_RDO_Collection> bkgCollection = std::make_unique<TRT_RDO_Collection>(sigElementHash);
+    //Add a TRT_LoLumRawData object
+    std::unique_ptr<TRT_LoLumRawData> bkgDigit = std::make_unique<TRT_LoLumRawData>(sigStrawID,sigWord);
+    bkgCollection->push_back(bkgDigit.release());
+    ASSERT_TRUE(inputBkgDataHandle->addCollection(bkgCollection.get(),sigElementHash).isSuccess());
+    bkgCollection.release(); // Now owned by inputBkgDataHandle
+
+    std::vector<HepMC::GenParticle*> genPartList;
+    initMcEventCollection(genPartList);
+    SG::WriteHandle<InDetSimDataCollection> inputSigSDODataHandle{"StoreGateSvc+TRT_SDO_Map_SIG"};
+    inputSigSDODataHandle = std::make_unique<InDetSimDataCollection>();
+    const HepMC::GenParticle* pGenParticle = genPartList.at(0);
+    HepMcParticleLink trkLink(pGenParticle->barcode(),pGenParticle->parent_event()->event_number());
+    InDetSimData::Deposit deposit( trkLink, 0.0 );
+    std::vector<InDetSimData::Deposit> depositVector(1);
+    depositVector.push_back(deposit);
+    inputSigSDODataHandle->insert(std::make_pair(sigStrawID, InDetSimData(depositVector)));
+
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    setPrivateToolPointers();
+    EXPECT_CALL( *m_mockTRT_LocalOccupancy, getDetectorOccupancy(::testing::_) )
+      .Times(1)
+      .WillOnce(::testing::Return(m_full_occupancy));
+    ASSERT_TRUE( m_alg->execute(ctx).isSuccess() );
+    // check output makes sense
+    SG::ReadHandle<TRT_RDO_Container> outputDataHandle{"StoreGateSvc+TRT_RDOs"};
+    ASSERT_TRUE( outputDataHandle.isValid() );
+    const TRT_RDO_Collection *outputCollection1 = outputDataHandle->indexFindPtr(sigElementHash);
+    ASSERT_NE( outputCollection1, nullptr );
+    ASSERT_EQ( outputCollection1->size(), 1 );
+    const TRT_LoLumRawData* outputDigit1 = dynamic_cast<const TRT_LoLumRawData*>(outputCollection1->at(0));
+    ASSERT_NE( outputDigit1, nullptr );
+    ASSERT_EQ( outputDigit1->highLevel(), sigHT );
+    ASSERT_EQ( outputDigit1->timeOverThreshold(), sigTOT );
+    ASSERT_EQ( outputDigit1->driftTimeBin(), sigDriftTimeBin );
+  }
+
+  TEST_F(TRTOverlay_test, containers_with_matching_collections_with_differing_RDOs_same_strawID) {
+    EventContext ctx(0,0);
+    ctx.setExtension( Atlas::ExtendedEventContext( m_sg, 0 ) );
+    SG::WriteHandle<TRT_RDO_Container> inputSigDataHandle{"StoreGateSvc+TRT_RDOs_SIG"};
+    const unsigned int containerSize(19008);
+    const IdentifierHash sigElementHash(10027);
+    const Identifier::value_type sigValue = 0x16122ce000000000;
+    const Identifier sigStrawID = Identifier(sigValue);
+    const std::vector<unsigned int> sigBits = {
+      1, // overlay flag
+      0,0,0,0, // msb and unused bits - always zero
+      0, // leading HT bit - always zero
+      0,0,0,0,0,0,1,1, // LT bits for leading BC
+      1, // In-time HT bit
+      1,1,1,1,1,1,1,1, // LT bits for in-time BC
+      0, // trailing HT bit - always zero
+      1,1,1,1,0,0,0,0  // LT bits for trailing BC (last 4 LT bits always zero)
+    };
+
+    const unsigned int sigWord = encodeDigit(sigBits);
+    const std::vector<unsigned int> bkgBits = {
+      0, // overlay flag
+      0,0,0,0, // msb and unused bits - always zero
+      0, // leading HT bit - always zero
+      0,0,0,0,0,1,1,1, // LT bits for leading BC
+      1, // In-time HT bit
+      1,1,1,1,0,0,0,0, // LT bits for in-time BC
+      0, // trailing HT bit - always zero
+      0,0,0,0,0,0,0,0  // LT bits for trailing BC (last 4 LT bits always zero)
+    };
+    const unsigned int bkgWord = encodeDigit(bkgBits);
+    inputSigDataHandle = std::make_unique<TRT_RDO_Container>(containerSize);
+    std::unique_ptr<TRT_RDO_Collection> sigCollection = std::make_unique<TRT_RDO_Collection>(sigElementHash);
+    //Add a TRT_LoLumRawData object
+    std::unique_ptr<TRT_LoLumRawData> sigDigit = std::make_unique<TRT_LoLumRawData>(sigStrawID,sigWord);
+    const auto sigHT=sigDigit->highLevel();
+    sigCollection->push_back(sigDigit.release());
+    ASSERT_TRUE(inputSigDataHandle->addCollection(sigCollection.get(),sigElementHash).isSuccess());
+    sigCollection.release(); // Now owned by inputSigDataHandle
+    SG::WriteHandle<TRT_RDO_Container> inputBkgDataHandle{"StoreGateSvc+TRT_RDOs_BKG"};
+    inputBkgDataHandle = std::make_unique<TRT_RDO_Container>(containerSize);
+    std::unique_ptr<TRT_RDO_Collection> bkgCollection = std::make_unique<TRT_RDO_Collection>(sigElementHash);
+    //Add a TRT_LoLumRawData object
+    std::unique_ptr<TRT_LoLumRawData> bkgDigit = std::make_unique<TRT_LoLumRawData>(sigStrawID,bkgWord);
+    bkgCollection->push_back(bkgDigit.release());
+    ASSERT_TRUE(inputBkgDataHandle->addCollection(bkgCollection.get(),sigElementHash).isSuccess());
+    bkgCollection.release(); // Now owned by inputBkgDataHandle
+
+    std::vector<unsigned int> outBits(32,0);
+    for(unsigned int i=0; i<32; ++i) {
+      outBits[i]=std::max(sigBits[i], bkgBits[i]);
+    }
+    const unsigned int outWord = encodeDigit(outBits);
+    const double outputTOT = TRT_LoLumRawData::timeOverThreshold(outWord);
+    const unsigned int outputDriftTimeBin = TRT_LoLumRawData::driftTimeBin(outWord);
+
+    std::vector<HepMC::GenParticle*> genPartList;
+    initMcEventCollection(genPartList);
+    SG::WriteHandle<InDetSimDataCollection> inputSigSDODataHandle{"StoreGateSvc+TRT_SDO_Map_SIG"};
+    inputSigSDODataHandle = std::make_unique<InDetSimDataCollection>();
+    const HepMC::GenParticle* pGenParticle = genPartList.at(0);
+    HepMcParticleLink trkLink(pGenParticle->barcode(),pGenParticle->parent_event()->event_number());
+    InDetSimData::Deposit deposit( trkLink, 0.0 );
+    std::vector<InDetSimData::Deposit> depositVector(1);
+    depositVector.push_back(deposit);
+    inputSigSDODataHandle->insert(std::make_pair(sigStrawID, InDetSimData(depositVector)));
+
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    setPrivateToolPointers();
+    EXPECT_CALL( *m_mockTRT_LocalOccupancy, getDetectorOccupancy(::testing::_) )
+      .Times(1)
+      .WillOnce(::testing::Return(m_full_occupancy));
+    ASSERT_TRUE( m_alg->execute(ctx).isSuccess() );
+    // check output makes sense
+    SG::ReadHandle<TRT_RDO_Container> outputDataHandle{"StoreGateSvc+TRT_RDOs"};
+    ASSERT_TRUE( outputDataHandle.isValid() );
+    const TRT_RDO_Collection *outputCollection1 = outputDataHandle->indexFindPtr(sigElementHash);
+    ASSERT_NE( outputCollection1, nullptr );
+    ASSERT_EQ( outputCollection1->size(), 1 );
+    const TRT_LoLumRawData* outputDigit1 = dynamic_cast<const TRT_LoLumRawData*>(outputCollection1->at(0));
+    ASSERT_NE( outputDigit1, nullptr );
+    ASSERT_EQ( outputDigit1->highLevel(), sigHT );
+    ASSERT_EQ( outputDigit1->timeOverThreshold(), outputTOT );
+    ASSERT_EQ( outputDigit1->driftTimeBin(), outputDriftTimeBin );
+  }
+
+  TEST_F(TRTOverlay_test, containers_with_matching_collections_with_differing_LT_RDOs_same_strawID) {
+
+    EventContext ctx(0,0);
+    ctx.setExtension( Atlas::ExtendedEventContext( m_sg, 0 ) );
+    SG::WriteHandle<TRT_RDO_Container> inputSigDataHandle{"StoreGateSvc+TRT_RDOs_SIG"};
+    const unsigned int containerSize(19008);
+    const IdentifierHash sigElementHash(10027);
+    const Identifier::value_type sigValue = 0x16122ce000000000;
+    const Identifier sigStrawID = Identifier(sigValue);
+    const std::vector<unsigned int> sigBits = {
+      0, // overlay flag
+      0,0,0,0, // msb and unused bits - always zero
+      0, // leading HT bit - always zero
+      0,0,0,0,0,0,1,1, // LT bits for leading BC
+      0, // In-time HT bit
+      1,1,1,1,1,1,1,1, // LT bits for in-time BC
+      0, // trailing HT bit - always zero
+      1,1,1,1,0,0,0,0  // LT bits for trailing BC (last 4 LT bits always zero)
+    };
+    const unsigned int sigWord = encodeDigit(sigBits);
+    // const std::vector<unsigned int> bkgBits = {
+    //   0,0,0,0,0, // msb and unused bits - always zero
+    //   0, // leading HT bit - always zero
+    //   1,1,1,1,1,1,1,1, // LT bits for leading BC
+    //   1, // In-time HT bit
+    //   1,1,1,1,0,0,0,0, // LT bits for in-time BC
+    //   0, // trailing HT bit - always zero
+    //   0,0,0,0,0,0,0,0  // LT bits for trailing BC (last 4 LT bits always zero)
+    // };
+    const std::vector<unsigned int> bkgBits = {
+      0, // overlay flag
+      0,0,0,0, // msb and unused bits - always zero
+      0, // leading HT bit - always zero
+      0,0,0,0,0,1,1,1, // LT bits for leading BC
+      0, // In-time HT bit
+      1,1,1,1,0,0,0,0, // LT bits for in-time BC
+      0, // trailing HT bit - always zero
+      0,0,0,0,0,0,0,0  // LT bits for trailing BC (last 4 LT bits always zero)
+    };
+    const unsigned int bkgWord = encodeDigit(bkgBits);
+    inputSigDataHandle = std::make_unique<TRT_RDO_Container>(containerSize);
+    std::unique_ptr<TRT_RDO_Collection> sigCollection = std::make_unique<TRT_RDO_Collection>(sigElementHash);
+    //Add a TRT_LoLumRawData object
+    std::unique_ptr<TRT_LoLumRawData> sigDigit = std::make_unique<TRT_LoLumRawData>(sigStrawID,sigWord);
+    const auto sigHT=sigDigit->highLevel();
+    sigCollection->push_back(sigDigit.release());
+    ASSERT_TRUE(inputSigDataHandle->addCollection(sigCollection.get(),sigElementHash).isSuccess());
+    sigCollection.release(); // Now owned by inputSigDataHandle
+    SG::WriteHandle<TRT_RDO_Container> inputBkgDataHandle{"StoreGateSvc+TRT_RDOs_BKG"};
+    inputBkgDataHandle = std::make_unique<TRT_RDO_Container>(containerSize);
+    std::unique_ptr<TRT_RDO_Collection> bkgCollection = std::make_unique<TRT_RDO_Collection>(sigElementHash);
+    //Add a TRT_LoLumRawData object
+    std::unique_ptr<TRT_LoLumRawData> bkgDigit = std::make_unique<TRT_LoLumRawData>(sigStrawID,bkgWord);
+    bkgCollection->push_back(bkgDigit.release());
+    ASSERT_TRUE(inputBkgDataHandle->addCollection(bkgCollection.get(),sigElementHash).isSuccess());
+    bkgCollection.release(); // Now owned by inputBkgDataHandle
+
+    std::vector<unsigned int> outBits(32,0);
+    for(unsigned int i=0; i<32; ++i) {
+      outBits[i]=std::max(sigBits[i], bkgBits[i]);
+    }
+    const unsigned int outWord = encodeDigit(outBits);
+    const double outputTOT = TRT_LoLumRawData::timeOverThreshold(outWord);
+    const unsigned int outputDriftTimeBin = TRT_LoLumRawData::driftTimeBin(outWord);
+
+    std::vector<HepMC::GenParticle*> genPartList;
+    initMcEventCollection(genPartList);
+    SG::WriteHandle<InDetSimDataCollection> inputSigSDODataHandle{"StoreGateSvc+TRT_SDO_Map_SIG"};
+    inputSigSDODataHandle = std::make_unique<InDetSimDataCollection>();
+    const HepMC::GenParticle* pGenParticle = genPartList.at(0);
+    HepMcParticleLink trkLink(pGenParticle->barcode(),pGenParticle->parent_event()->event_number());
+    ASSERT_EQ(trkLink.cptr()->pdg_id(), -11); // Sanity check to confirm that we are linking to a positron as expected
+    InDetSimData::Deposit deposit( trkLink, 0.0 );
+    std::vector<InDetSimData::Deposit> depositVector(1);
+    depositVector.push_back(deposit);
+    inputSigSDODataHandle->insert(std::make_pair(sigStrawID, InDetSimData(depositVector)));
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    setPrivateToolPointers();
+    EXPECT_CALL( *m_mockTRT_StrawStatusSummaryTool, getStatusHT(::testing::_) )
+      .Times(1)
+      .WillOnce(::testing::Return(TRTCond::StrawStatus::Good));
+    EXPECT_CALL( *m_mockTRT_LocalOccupancy, getDetectorOccupancy(::testing::_) )
+      .Times(1)
+      .WillOnce(::testing::Return(m_full_occupancy));
+    ASSERT_TRUE( m_alg->execute(ctx).isSuccess() );
+    // check output makes sense
+    SG::ReadHandle<TRT_RDO_Container> outputDataHandle{"StoreGateSvc+TRT_RDOs"};
+    ASSERT_TRUE( outputDataHandle.isValid() );
+    const TRT_RDO_Collection *outputCollection1 = outputDataHandle->indexFindPtr(sigElementHash);
+    ASSERT_NE( outputCollection1, nullptr );
+    ASSERT_EQ( outputCollection1->size(), 1 );
+    const TRT_LoLumRawData* outputDigit1 = dynamic_cast<const TRT_LoLumRawData*>(outputCollection1->at(0));
+    ASSERT_NE( outputDigit1, nullptr );
+    ASSERT_EQ( outputDigit1->highLevel(), sigHT );
+    ASSERT_EQ( outputDigit1->timeOverThreshold(), outputTOT );
+    ASSERT_EQ( outputDigit1->driftTimeBin(), outputDriftTimeBin );
+  }
+
+  TEST_F(TRTOverlay_test, containers_with_matching_collections_with_differing_LT_RDOs_same_strawID_ForceHTbit) {
+
+    EventContext ctx(0,0);
+    ctx.setExtension( Atlas::ExtendedEventContext( m_sg, 0 ) );
+    SG::WriteHandle<TRT_RDO_Container> inputSigDataHandle{"StoreGateSvc+TRT_RDOs_SIG"};
+    const unsigned int containerSize(19008);
+    const IdentifierHash sigElementHash(10027);
+    const Identifier::value_type sigValue = 0x16122ce000000000;
+    const Identifier sigStrawID = Identifier(sigValue);
+    const std::vector<unsigned int> sigBits = {
+      0, // overlay flag
+      0,0,0,0, // msb and unused bits - always zero
+      0, // leading HT bit - always zero
+      0,0,0,0,0,0,1,1, // LT bits for leading BC
+      0, // In-time HT bit
+      1,1,1,1,1,1,1,1, // LT bits for in-time BC
+      0, // trailing HT bit - always zero
+      1,1,1,1,0,0,0,0  // LT bits for trailing BC (last 4 LT bits always zero)
+    };
+    const unsigned int sigWord = encodeDigit(sigBits);
+
+    const std::vector<unsigned int> bkgBits = {
+      0, // overlay flag
+      0,0,0,0, // msb and unused bits - always zero
+      0, // leading HT bit - always zero
+      0,0,0,0,0,1,1,1, // LT bits for leading BC
+      0, // In-time HT bit
+      1,1,1,1,0,0,0,0, // LT bits for in-time BC
+      0, // trailing HT bit - always zero
+      0,0,0,0,0,0,0,0  // LT bits for trailing BC (last 4 LT bits always zero)
+    };
+    const unsigned int bkgWord = encodeDigit(bkgBits);
+
+    std::vector<unsigned int> outBits(32,0);
+    for(unsigned int i=0; i<32; ++i) {
+      outBits[i]=std::max(sigBits[i], bkgBits[i]);
+    }
+    outBits[17]=1;    // force in-time HT bit to be true
+
+    const unsigned int outWord = encodeDigit(outBits);
+    const double outputTOT = TRT_LoLumRawData::timeOverThreshold(outWord);
+    const unsigned int outputDriftTimeBin = TRT_LoLumRawData::driftTimeBin(outWord);
+
+    inputSigDataHandle = std::make_unique<TRT_RDO_Container>(containerSize);
+    std::unique_ptr<TRT_RDO_Collection> sigCollection = std::make_unique<TRT_RDO_Collection>(sigElementHash);
+    //Add a TRT_LoLumRawData object
+    std::unique_ptr<TRT_LoLumRawData> sigDigit = std::make_unique<TRT_LoLumRawData>(sigStrawID,sigWord);
+    sigCollection->push_back(sigDigit.release());
+    ASSERT_TRUE(inputSigDataHandle->addCollection(sigCollection.get(),sigElementHash).isSuccess());
+    sigCollection.release(); // Now owned by inputSigDataHandle
+    SG::WriteHandle<TRT_RDO_Container> inputBkgDataHandle{"StoreGateSvc+TRT_RDOs_BKG"};
+    inputBkgDataHandle = std::make_unique<TRT_RDO_Container>(containerSize);
+    std::unique_ptr<TRT_RDO_Collection> bkgCollection = std::make_unique<TRT_RDO_Collection>(sigElementHash);
+    //Add a TRT_LoLumRawData object
+    std::unique_ptr<TRT_LoLumRawData> bkgDigit = std::make_unique<TRT_LoLumRawData>(sigStrawID,bkgWord);
+    bkgCollection->push_back(bkgDigit.release());
+    ASSERT_TRUE(inputBkgDataHandle->addCollection(bkgCollection.get(),sigElementHash).isSuccess());
+    bkgCollection.release(); // Now owned by inputBkgDataHandle
+
+    std::vector<HepMC::GenParticle*> genPartList;
+    initMcEventCollection(genPartList);
+    SG::WriteHandle<InDetSimDataCollection> inputSigSDODataHandle{"StoreGateSvc+TRT_SDO_Map_SIG"};
+    inputSigSDODataHandle = std::make_unique<InDetSimDataCollection>();
+    const HepMC::GenParticle* pGenParticle = genPartList.at(0);
+    HepMcParticleLink trkLink(pGenParticle->barcode(),pGenParticle->parent_event()->event_number());
+    ASSERT_EQ(trkLink.cptr()->pdg_id(), -11); // Sanity check to confirm that we are linking to a positron as expected
+    InDetSimData::Deposit deposit( trkLink, 0.0 );
+    std::vector<InDetSimData::Deposit> depositVector(1);
+    depositVector.push_back(deposit);
+    inputSigSDODataHandle->insert(std::make_pair(sigStrawID, InDetSimData(depositVector)));
+
+    // Override Occupancy correction, so that HT bit will always be set
+    ASSERT_TRUE( m_alg->setProperty( "TRT_HT_OccupancyCorrectionBarrel", 1.0).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "TRT_HT_OccupancyCorrectionEndcap", 1.0).isSuccess() );
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    setPrivateToolPointers();
+    EXPECT_CALL( *m_mockTRT_StrawStatusSummaryTool, getStatusHT(::testing::_) )
+      .Times(1)
+      .WillOnce(::testing::Return(TRTCond::StrawStatus::Good));
+    EXPECT_CALL( *m_mockTRT_LocalOccupancy, getDetectorOccupancy(::testing::_) )
+      .Times(1)
+      .WillOnce(::testing::Return(m_full_occupancy));
+    ASSERT_TRUE( m_alg->execute(ctx).isSuccess() );
+
+    // check output makes sense
+    SG::ReadHandle<TRT_RDO_Container> outputDataHandle{"StoreGateSvc+TRT_RDOs"};
+    ASSERT_TRUE( outputDataHandle.isValid() );
+    const TRT_RDO_Collection *outputCollection1 = outputDataHandle->indexFindPtr(sigElementHash);
+    ASSERT_NE( outputCollection1, nullptr );
+    ASSERT_EQ( outputCollection1->size(), 1 );
+    const TRT_LoLumRawData* outputDigit1 = dynamic_cast<const TRT_LoLumRawData*>(outputCollection1->at(0));
+    ASSERT_NE( outputDigit1, nullptr );
+    ASSERT_EQ( outputDigit1->highLevel(), true );
+    ASSERT_EQ( outputDigit1->timeOverThreshold(), outputTOT );
+    ASSERT_EQ( outputDigit1->driftTimeBin(), outputDriftTimeBin );
+  }
+
+} // <-- namespace OverlayTesting
+
+
+int main(int argc, char *argv[])
+{
+  ::testing::InitGoogleTest( &argc, argv );
+
+  //return RUN_ALL_TESTS();
+  // if the above gets stuck forever while trying to finalize Boost stuff
+  // inside SGTools, try to use the following:
+  // skips proper finalization:
+  std::quick_exit( RUN_ALL_TESTS() );
+}
diff --git a/InnerDetector/InDetRecAlgs/InDetLowBetaFinder/InDetLowBetaFinder/TrtToolsBetaLiklihood.h b/InnerDetector/InDetRecAlgs/InDetLowBetaFinder/InDetLowBetaFinder/TrtToolsBetaLiklihood.h
index fc0361116468bf478025c84856c4d4b3e129ac9c..3b251f7ef3f4c84acca82a85c671e8ae92bfbc87 100644
--- a/InnerDetector/InDetRecAlgs/InDetLowBetaFinder/InDetLowBetaFinder/TrtToolsBetaLiklihood.h
+++ b/InnerDetector/InDetRecAlgs/InDetLowBetaFinder/InDetLowBetaFinder/TrtToolsBetaLiklihood.h
@@ -101,7 +101,8 @@ private:
   void TRT_SelectFEhits();                                                                                        //chooses decent looking hits to pass on to fitting
   void TRT_BitPattern(int hitP, int *lowPat, int *highPat, HIT &hit);                                             //parses TRT hits into useful info.  
   void TRT_PropLenCorr(HIT hit, int *corrLBits, float *corrLBitWeight, int *corrFBits, float *corrFBitWeight);    //fixes reflection in electronics.  
-  void TRT_FEbeta_min(float &beta, float &betaSigmaLo, float &betaSigmaUp);                                       //handles MINUIT for the TRT FE beta fit. 
+  void TRT_FEbeta_min ATLAS_NOT_THREAD_SAFE
+    (float &beta, float &betaSigmaLo, float &betaSigmaUp);                                       //handles MINUIT for the TRT FE beta fit. 
   void TRT_SelectFEpriors(TrtToolBetaLiklihood::HIT hit, int *corrLBits, float *corrLBitWeight);
   //void TRT_solveCubic(float DCrad, float &estDrift);
 };
diff --git a/InnerDetector/InDetRecAlgs/InDetLowBetaFinder/src/TrtToolsBetaLiklihood.cxx b/InnerDetector/InDetRecAlgs/InDetLowBetaFinder/src/TrtToolsBetaLiklihood.cxx
index a92be98d31d51b8b933e36d1c62f6fed998bddf8..e49c33ec4ca12ec22140c39559e3411d75cc8db2 100644
--- a/InnerDetector/InDetRecAlgs/InDetLowBetaFinder/src/TrtToolsBetaLiklihood.cxx
+++ b/InnerDetector/InDetRecAlgs/InDetLowBetaFinder/src/TrtToolsBetaLiklihood.cxx
@@ -199,11 +199,11 @@ void TrtToolBetaLiklihood::TRT_BitPattern(int hitP, int *lowPat, int *highPat, H
 
 
 //MINUIT apparently doesn't cope with member functions...
-void TRT_FEbeta_fcn(Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t iflag);
+void TRT_FEbeta_fcn ATLAS_NOT_THREAD_SAFE (Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t iflag);
 //...and also functions called therein:
 void TRT_solveCubic(float DCrad, float &estDrift);
 
-void TrtToolBetaLiklihood::TRT_FEbeta_min(float &beta, float &betaSigmaLo, float &betaSigmaUp){
+void TrtToolBetaLiklihood::TRT_FEbeta_min ATLAS_NOT_THREAD_SAFE (float &beta, float &betaSigmaLo, float &betaSigmaUp){
   //std::cout << "waypoint 6" << std::endl;
   // Minuit variables
   Double_t arglist[10] = {0,0,0,0,0,0,0,0,0,0};
diff --git a/InnerDetector/InDetRecAlgs/InDetLowBetaFinder/src/TrtToolsBetaWrapper.cxx b/InnerDetector/InDetRecAlgs/InDetLowBetaFinder/src/TrtToolsBetaWrapper.cxx
index 44dfdad41131c939476bf2d94a641b4f80c49041..ad7cdebaf596dbbe844506933b5f791d6b07ddbd 100644
--- a/InnerDetector/InDetRecAlgs/InDetLowBetaFinder/src/TrtToolsBetaWrapper.cxx
+++ b/InnerDetector/InDetRecAlgs/InDetLowBetaFinder/src/TrtToolsBetaWrapper.cxx
@@ -566,17 +566,18 @@ StatusCode InDet::LowBetaAlg::parseDataForTrtToolBetaLiklihood(const Trk::Track&
 
 // Prints the input of TRT_FEbeta() to file (hard-set)
 // This is a temporary debug method, and may be removed later
-int printTrtToolBetaLiklihoodDebugFile ATLAS_NOT_THREAD_SAFE // This method is not thread safe because static variable is used.
+int printTrtToolBetaLiklihoodDebugFile
 (std::vector<int> TRT_bitpattern, std::vector<int> TRT_bec, std::vector<int> TRT_strawlayer, std::vector<int> TRT_layer,
  std::vector<float> TRT_t0, std::vector<float> TRT_R, std::vector<float> TRT_R_track,
  std::vector<float> TrackX, std::vector<float> TrackY, std::vector<float> TrackZ, float RecPt, float RecEta)
 {
-    static int trackNum = 0; // static variable is not thread safe.
+        static std::atomic<int> trackNum = 0;
 	const char* FILENAME_C = "/afs/cern.ch/user/s/sschramm/testarea/16.0.2/InnerDetector/InDetRecAlgs/InDetLowBetaFinder/debugFile.log";
 	FILE* outFile;
 	unsigned int i;
-	
-	if (trackNum == 0)
+
+        int tn = trackNum++;
+	if (tn == 0)
 	  outFile = fopen(FILENAME_C,"w");
 	else
 	  outFile = fopen(FILENAME_C,"a");
@@ -584,7 +585,7 @@ int printTrtToolBetaLiklihoodDebugFile ATLAS_NOT_THREAD_SAFE // This method is n
 	if (outFile == NULL)
 	  return -1;
 	
-	fprintf(outFile,"#\n#Track Number %d\n#RecPt = %f, RecEta = %f\n#\n",trackNum++,RecPt,RecEta);
+	fprintf(outFile,"#\n#Track Number %d\n#RecPt = %f, RecEta = %f\n#\n",tn,RecPt,RecEta);
 	
 	fprintf(outFile,"%%Start TRT_bitpattern:\n");
 	for (i = 0; i < TRT_bitpattern.size(); i++)
diff --git a/InnerDetector/InDetRecTools/InDetAmbiTrackSelectionTool/InDetAmbiTrackSelectionTool/InDetAmbiTrackSelectionTool.h b/InnerDetector/InDetRecTools/InDetAmbiTrackSelectionTool/InDetAmbiTrackSelectionTool/InDetAmbiTrackSelectionTool.h
index 1f5483216a5caaf849f41a6938374c9a3cd2f528..4e6fbbe456a5b3049cb06a52bd3e6ffe924e62b1 100755
--- a/InnerDetector/InDetRecTools/InDetAmbiTrackSelectionTool/InDetAmbiTrackSelectionTool/InDetAmbiTrackSelectionTool.h
+++ b/InnerDetector/InDetRecTools/InDetAmbiTrackSelectionTool/InDetAmbiTrackSelectionTool/InDetAmbiTrackSelectionTool.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
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -57,7 +57,8 @@ namespace InDet
     /** standard Athena-Algorithm method */
     virtual StatusCode finalize() override;
 
-    virtual std::tuple<Trk::Track*,bool> getCleanedOutTrack(const Trk::Track *track, const Trk::TrackScore score, Trk::PRDtoTrackMap &prd_to_track_map) const override;
+    virtual std::tuple<Trk::Track*,bool> getCleanedOutTrack ATLAS_NOT_THREAD_SAFE
+      (const Trk::Track *track, const Trk::TrackScore score, Trk::PRDtoTrackMap &prd_to_track_map) const override;
 
   private:
       
diff --git a/InnerDetector/InDetRecTools/InDetAmbiTrackSelectionTool/InDetAmbiTrackSelectionTool/InDetDenseEnvAmbiTrackSelectionTool.h b/InnerDetector/InDetRecTools/InDetAmbiTrackSelectionTool/InDetAmbiTrackSelectionTool/InDetDenseEnvAmbiTrackSelectionTool.h
index 4a8ce5c7fefc99016021699a390b7af2ec269cc4..062edc8c302d69cb1fbb2ffb94549edd2c47fa65 100755
--- a/InnerDetector/InDetRecTools/InDetAmbiTrackSelectionTool/InDetAmbiTrackSelectionTool/InDetDenseEnvAmbiTrackSelectionTool.h
+++ b/InnerDetector/InDetRecTools/InDetAmbiTrackSelectionTool/InDetAmbiTrackSelectionTool/InDetDenseEnvAmbiTrackSelectionTool.h
@@ -28,6 +28,8 @@
 #include "TrkToolInterfaces/IPRDtoTrackMapTool.h"
 #include "TrkEventUtils/PRDtoTrackMap.h"
 
+#include "CxxUtils/checker_macros.h"
+
 #include "GaudiKernel/ToolHandle.h"
 
 #include <cmath> //for std::fabs in implementation of structs in this header
@@ -69,9 +71,10 @@ namespace InDet
     /** standard Athena-Algorithm method */
     virtual StatusCode finalize() override;
 
-    virtual std::tuple<Trk::Track*,bool> getCleanedOutTrack(const Trk::Track*,
-                                                            const Trk::TrackScore score,
-                                                            Trk::PRDtoTrackMap &prd_to_track_map) const override;
+    virtual std::tuple<Trk::Track*,bool> getCleanedOutTrack ATLAS_NOT_THREAD_SAFE
+      (const Trk::Track*,
+       const Trk::TrackScore score,
+       Trk::PRDtoTrackMap &prd_to_track_map) const override;
 
   private:
     
@@ -286,7 +289,7 @@ namespace InDet
                                CacheEntry* ent) const;
 
     /** Update the pixel clusters split information*/
-    void updatePixelClusterInformation(TSoS_Details& tsosDetails) const;
+    void updatePixelClusterInformation ATLAS_NOT_THREAD_SAFE (TSoS_Details& tsosDetails) const;
       
     /** Check if the cluster is compatible with a hadronic cluster*/
     bool isHadCaloCompatible(const Trk::TrackParameters& Tp, CacheEntry* ent) const;
diff --git a/InnerDetector/InDetRecTools/InDetBoundaryCheckTool/CMakeLists.txt b/InnerDetector/InDetRecTools/InDetBoundaryCheckTool/CMakeLists.txt
index 8340c6d1b9175cd20a6000a0f1213bbac5100f2f..b4e81d934322cd3a1660f120a8ecb2502a7689c5 100644
--- a/InnerDetector/InDetRecTools/InDetBoundaryCheckTool/CMakeLists.txt
+++ b/InnerDetector/InDetRecTools/InDetBoundaryCheckTool/CMakeLists.txt
@@ -6,16 +6,6 @@ atlas_subdir(
     InDetBoundaryCheckTool
 )
 
-# Declare the package's dependencies
-atlas_depends_on_subdirs( 
-    PUBLIC
-    Control/AthenaBaseComps
-    Tracking/TrkTools/TrkToolInterfaces
-    InnerDetector/InDetConditions/InDetConditionsSummaryService
-    InnerDetector/InDetDetDescr/InDetReadoutGeometry
-    InnerDetector/InDetRecToolInterfaces
-)
-
 # Component(s) in the package:
 atlas_add_component(
     InDetBoundaryCheckTool
@@ -28,6 +18,8 @@ atlas_add_component(
     TrkToolInterfaces
     TrkTrack
     InDetReadoutGeometry
+    InDetConditionsSummaryService
+    InDetRecToolInterfaces
 )
 
 # Install files from the package:
diff --git a/InnerDetector/InDetRecTools/InDetSecVtxTrackSelectionTool/InDetSecVtxTrackSelectionTool/InDetSecVtxTrackSelectionTool.h b/InnerDetector/InDetRecTools/InDetSecVtxTrackSelectionTool/InDetSecVtxTrackSelectionTool/InDetSecVtxTrackSelectionTool.h
index c6f3291b1d10beffbb3bf9401f7bab6e41f47a8f..7909befc4727a1b07b5be19fa3fcc26973c02f24 100644
--- a/InnerDetector/InDetRecTools/InDetSecVtxTrackSelectionTool/InDetSecVtxTrackSelectionTool/InDetSecVtxTrackSelectionTool.h
+++ b/InnerDetector/InDetRecTools/InDetSecVtxTrackSelectionTool/InDetSecVtxTrackSelectionTool/InDetSecVtxTrackSelectionTool.h
@@ -39,7 +39,7 @@ namespace InDet {
 
     /// Create a proper constructor for Athena
     ASG_TOOL_CLASS2( InDetSecVtxTrackSelectionTool,
-		     CP::ISelectionTool,
+		     IAsgSelectionTool,
 		     InDet::IInDetTrackSelectionTool )
     
   public:
diff --git a/InnerDetector/InDetRecTools/InDetTrackSelectionTool/InDetTrackSelectionTool/IInDetTrackSelectionTool.h b/InnerDetector/InDetRecTools/InDetTrackSelectionTool/InDetTrackSelectionTool/IInDetTrackSelectionTool.h
index 1a92b89c762b0eca6df72d7135cb22318e1a786a..773d9ca2129583602c94b81f1c8232234d56bf6b 100644
--- a/InnerDetector/InDetRecTools/InDetTrackSelectionTool/InDetTrackSelectionTool/IInDetTrackSelectionTool.h
+++ b/InnerDetector/InDetRecTools/InDetTrackSelectionTool/InDetTrackSelectionTool/IInDetTrackSelectionTool.h
@@ -8,7 +8,7 @@
 #define INDETTRACKSELECTIONTOOL_IINDETTRACKSELECTIONTOOL_H
 
 // Framework include(s):
-#include "AsgAnalysisInterfaces/ISelectionTool.h"
+#include "PATCore/IAsgSelectionTool.h"
 #include "PATCore/AcceptData.h"
 #include "PATCore/AcceptInfo.h"
 
@@ -48,7 +48,7 @@ namespace InDet {
   /// @author Michael Clark <michael.ryan.clark@cern.ch>
   /// 
   ///
-  class IInDetTrackSelectionTool : public virtual CP::ISelectionTool
+  class IInDetTrackSelectionTool : public virtual IAsgSelectionTool
 { 
     /// Declare the interface that the class provides
     ASG_TOOL_INTERFACE( InDet::IInDetTrackSelectionTool )
diff --git a/InnerDetector/InDetRecTools/InDetTrackSelectionTool/InDetTrackSelectionTool/InDetTrackSelectionTool.h b/InnerDetector/InDetRecTools/InDetTrackSelectionTool/InDetTrackSelectionTool/InDetTrackSelectionTool.h
index 26cb7d8096788c96f1c0ac37bf6862a5bbca37df..f29f1343228391cc9e712337a28ac9be22cafe34 100644
--- a/InnerDetector/InDetRecTools/InDetTrackSelectionTool/InDetTrackSelectionTool/InDetTrackSelectionTool.h
+++ b/InnerDetector/InDetRecTools/InDetTrackSelectionTool/InDetTrackSelectionTool/InDetTrackSelectionTool.h
@@ -40,7 +40,7 @@ namespace InDet {
 
     /// Create a proper constructor for Athena
     ASG_TOOL_CLASS2( InDetTrackSelectionTool,
-		     CP::ISelectionTool,
+		     IAsgSelectionTool,
 		     InDet::IInDetTrackSelectionTool )
     
   public:
diff --git a/InnerDetector/InDetRecTools/InDetTrackSelectionTool/test/ut_InDetTrackSelectionTool.cxx b/InnerDetector/InDetRecTools/InDetTrackSelectionTool/test/ut_InDetTrackSelectionTool.cxx
index eed21a37bfd4e12e233dd2c178b2b078f01a97eb..b545ab9afd1c2bc6704f2d71f0ce79a27a5c4246 100644
--- a/InnerDetector/InDetRecTools/InDetTrackSelectionTool/test/ut_InDetTrackSelectionTool.cxx
+++ b/InnerDetector/InDetRecTools/InDetTrackSelectionTool/test/ut_InDetTrackSelectionTool.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
 */
 
 // A unit test for the track selection tool. Currently this compares the pre-defined cut levels
@@ -46,7 +46,7 @@ uint8_t getSum(const TrackParticle&, xAOD::SummaryType);
 void dumpTrack( const TrackParticle& );
 
 int main( int argc, char* argv[] ) {
-  
+
    // The application's name:
    const char* APP_NAME = argv[ 0 ];
 #define CHECK( ARG ) do {ASG_CHECK_SA( APP_NAME, ARG );} while (false)
@@ -58,7 +58,7 @@ int main( int argc, char* argv[] ) {
      Error( APP_NAME, "Could not find $ROOTCORE_TEST_FILE." );
      return 1;
    }
- 
+
   // fail on an unchecked StatusCode
    StatusCode::enableFailure();
 
@@ -113,8 +113,10 @@ int main( int argc, char* argv[] ) {
       if( e < entries ) {
          entries = e;
       }
+   } else if( entries > 100 ) {
+      entries = 100;
    }
-   
+
    for (Long64_t entry = 0; entry < entries; ++entry) {
      CHECK( !event.getEntry(entry) );
 
@@ -179,7 +181,7 @@ bool passNoCut( const TrackParticle&, const xAOD::Vertex* )
 bool passLoose( const TrackParticle& trk, const xAOD::Vertex* )
 {
   if (std::fabs(trk.eta()) > 2.5) return false;
-  
+
   uint8_t nPixHits = getSum(trk, xAOD::numberOfPixelHits) + getSum(trk, xAOD::numberOfPixelDeadSensors);
   uint8_t nSctHits = getSum(trk, xAOD::numberOfSCTHits) + getSum(trk, xAOD::numberOfSCTDeadSensors);
   if (nPixHits + nSctHits < 7) return false;
@@ -193,7 +195,7 @@ bool passLoose( const TrackParticle& trk, const xAOD::Vertex* )
   if (nSiHoles > 2) return false;
   if (nPixHoles > 1) return false;
 
-  return true;  
+  return true;
 }
 
 bool passLoosePrimary( const TrackParticle& trk, const xAOD::Vertex* )
@@ -300,7 +302,7 @@ bool passMinBias( const TrackParticle& trk, const xAOD::Vertex* vtx )
   if (nPixHits < 1) return false;
   uint8_t nSctHits = getSum(trk, xAOD::numberOfSCTHits) + getSum(trk, xAOD::numberOfSCTDeadSensors);
   if (nSctHits < 6) return false;
-  
+
   if (trk.pt() > 10.0*1e3 && TMath::Prob(trk.chiSquared(), trk.numberDoF()) < 0.01) return false;
 
   if (std::fabs(trk.d0()) > 1.5) return false;
@@ -331,7 +333,7 @@ bool passHILoose( const TrackParticle& trk, const xAOD::Vertex* vtx )
   if (pt >= 0.4 && nSctHits < 6) return false;
   else if (pt >= 0.3 && nSctHits < 4) return false;
   else if (nSctHits < 2) return false;
-  
+
   if (std::fabs(trk.d0()) > 1.5) return false;
   if (vtx != nullptr) {
     if (std::fabs(trk.z0() + trk.vz() - vtx->z())*std::sin(trk.theta()) > 1.5) return false;
@@ -360,14 +362,14 @@ bool passHITight( const TrackParticle& trk, const xAOD::Vertex* vtx )
   if (pt >= 0.4 && nSctHits < 8) return false;
   else if (pt >= 0.3 && nSctHits < 6) return false;
   else if (nSctHits < 4) return false;
-  
+
   if (std::fabs(trk.d0()) > 1.0) return false;
   if (vtx != nullptr) {
     if (std::fabs(trk.z0() + trk.vz() - vtx->z())*std::sin(trk.theta()) > 1.0) return false;
   }
 
   if (trk.chiSquared() / trk.numberDoF() > 6.0) return false;
-  
+
   return true;
 }
 
@@ -381,7 +383,7 @@ bool passExpPix( const TrackParticle& trk, const xAOD::Vertex* )
   uint8_t nIBLHits = getSum(trk, xAOD::numberOfInnermostPixelLayerHits);
   uint8_t expectBL = getSum(trk, xAOD::expectNextToInnermostPixelLayerHit);
   uint8_t nBLHits = getSum(trk, xAOD::numberOfNextToInnermostPixelLayerHits);
-  
+
   // make an exception is there is an IBL hit, and the hole is in the BLayer
   if (nIBLHits >= 1) {
     if (expectBL && nBLHits ==0) return true;
diff --git a/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/InDetVKalVxInJetTool/InDetVKalVxInJetTool.h b/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/InDetVKalVxInJetTool/InDetVKalVxInJetTool.h
index fd3f55764ebc16778cdeb644d866e402d3d23ec7..4304da94a3302dc0392bbfa45dbdb45e13fe746f 100755
--- a/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/InDetVKalVxInJetTool/InDetVKalVxInJetTool.h
+++ b/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/InDetVKalVxInJetTool/InDetVKalVxInJetTool.h
@@ -144,8 +144,6 @@ namespace InDet {
       TH1D* m_hb_sig3D2tr{};
       TH1D* m_hb_sig3DNtr{};
       TH1D* m_hb_trkPtMax{};
-      TH1F* m_hb_blshared{};
-      TH1F* m_hb_pxshared{};
       TH1F* m_hb_rawVrtN{};
       TH1F* m_hb_lifetime{};
       TH1F* m_hb_trkPErr{};
@@ -203,7 +201,8 @@ namespace InDet {
       double m_rLayer2{};
       double m_rLayer3{};
 
-      bool     m_useVertexCleaning{};
+      bool     m_useVertexCleaningPix{};
+      bool     m_useVertexCleaningFMP{};
       bool     m_multiVertex{};
       bool     m_multiWithPrimary{};
       bool     m_getNegativeTail{};
@@ -258,7 +257,7 @@ namespace InDet {
        float    wgtB[maxNTrk];
        float    wgtL[maxNTrk];
        float    wgtG[maxNTrk];
-       float   Sig3D[maxNTrk];
+       float   sig3D[maxNTrk];
        int    chg[maxNTrk];
        int  nVrtT[maxNTrk];
        float TotM;
@@ -267,6 +266,7 @@ namespace InDet {
        float VrtSig3D[maxNVrt];
        float VrtSig2D[maxNVrt];
        float VrtDR[maxNVrt];
+       float VrtErrR[maxNVrt];
        float mass[maxNVrt];
        float Chi2[maxNVrt];
        int   itrk[maxNVrt];
@@ -274,6 +274,7 @@ namespace InDet {
        int badVrt[maxNVrt];
        int    ibl[maxNVrt];
        int     bl[maxNVrt];
+       float fhitR[maxNVrt];
        int        NTHF;
        int   itHF[maxNVrt];
        //---
@@ -488,9 +489,9 @@ namespace InDet {
      StatusCode VKalVrtFitFastBase(const std::vector<const xAOD::TrackParticle*>& listPart,Amg::Vector3D& Vertex, Trk::IVKalState& istate) const;
 
      template <class Track>
-     bool  Check2TrVertexInPixel( const Track* p1, const Track* p2, Amg::Vector3D &, std::vector<double> &) const;
+     bool  check2TrVertexInPixel( const Track* p1, const Track* p2, Amg::Vector3D &, std::vector<double> &) const;
      template <class Track>
-     bool  Check1TrVertexInPixel( const Track* p1, Amg::Vector3D &, std::vector<double> & ) const;
+     bool  check1TrVertexInPixel( const Track* p1, Amg::Vector3D &, std::vector<double> & ) const;
 
      void  getPixelLayers(const xAOD::TrackParticle* Part, int &blHit, int &l1Hit, int &l2Hit, int &nLay) const;
      void  getPixelDiscs(const xAOD::TrackParticle* Part, int &d0Hit, int &d1Hit, int &d2Hit) const;
@@ -548,7 +549,7 @@ namespace InDet {
   };
 
    template <class Track>
-   bool InDetVKalVxInJetTool::Check1TrVertexInPixel( const Track* p1, Amg::Vector3D &FitVertex, std::vector<double> &VrtCov)
+   bool InDetVKalVxInJetTool::check1TrVertexInPixel( const Track* p1, Amg::Vector3D &FitVertex, std::vector<double> &VrtCov)
    const
    {
 	int blTrk=0, blP=0, l1Trk=0, l1P=0, l2Trk=0, nLays=0; 
diff --git a/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/BTagVrtSec.cxx b/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/BTagVrtSec.cxx
index ff661fb9eac40db9642c63938ea9b1667f164a20..8b97cb857af1cf86ac8b8b075dcc1549c07ebfbe 100755
--- a/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/BTagVrtSec.cxx
+++ b/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/BTagVrtSec.cxx
@@ -196,24 +196,21 @@ namespace InDet{
       if( listSecondTracks.size()==2 ){         // If there are 2 only tracks
         if(msgLvl(MSG::DEBUG))msg(MSG::DEBUG)<<" Start Ntr=2 vertex check"<<endmsg;
         int Charge=0;
-	uint8_t BLshared=0;
-	uint8_t PXshared=0;
-        for (auto i_ntrk : listSecondTracks) {
-            Charge +=  (int) i_ntrk->charge();
-            uint8_t retval=0;
-            if( i_ntrk->summaryValue( retval, xAOD::numberOfPixelSharedHits)  )  PXshared  += retval;
-            if( i_ntrk->summaryValue( retval, xAOD::numberOfInnermostPixelLayerSharedHits) )  BLshared  += retval;
-        }
+        for (auto i_ntrk : listSecondTracks) { Charge +=  (int) i_ntrk->charge();}
 	vrtVrtDist(primVrt, fitVertex, errorMatrix, Signif3D);
-        if(m_useVertexCleaning){
-          if(!Check2TrVertexInPixel(listSecondTracks[0],listSecondTracks[1],fitVertex,errorMatrix)) return 0;
-          if(m_fillHist){
-            double xDif=fitVertex.x()-m_xLayerB, yDif=fitVertex.y()-m_yLayerB ; 
-            double Dist2D=std::sqrt(xDif*xDif+yDif*yDif);
-            if     (Dist2D < m_rLayerB-vrtRadiusError(fitVertex,errorMatrix))  m_hb_blshared->Fill((float)BLshared,m_w_1);
-            else if(Dist2D > m_rLayerB+vrtRadiusError(fitVertex,errorMatrix))  m_hb_pxshared->Fill((float)PXshared,m_w_1);
-         }
-        } //end 2tr vertex cleaning code
+// Check track pixel hit patterns vs vertex position.
+        if(m_useVertexCleaningPix){
+          if(!check2TrVertexInPixel(listSecondTracks[0],listSecondTracks[1],fitVertex,errorMatrix)) return 0;
+        }
+// Check track first measured points vs vertex position.
+        if(m_useVertexCleaningFMP){
+          float hitR1  = listSecondTracks[0]->radiusOfFirstHit();
+          float hitR2  = listSecondTracks[1]->radiusOfFirstHit();
+          float vrErr  = vrtRadiusError(fitVertex, errorMatrix);
+          if(std::abs(hitR1-hitR2)>25.) return 0;                                 // Hits in different pixel layers
+          if( fitVertex.perp()-std::min(hitR1,hitR2) > 2.*vrErr) return 0; // Vertex is behind hit in pixel 
+        }
+//--------
 //
         if(m_fillHist){ if(Charge){m_hb_totmass2T1->Fill(Momentum.M(),m_w_1);}else{m_hb_totmass2T0->Fill(Momentum.M(),m_w_1);} }
         if( !Charge && std::abs(Momentum.M()-m_massK0)<15. ) {       // Final rejection of K0
@@ -522,10 +519,11 @@ namespace InDet{
                  if(getIdHF(selectedTracks[i]))m_curTup->idMC[i]=2;
 	         if(getMCPileup(selectedTracks[i]))m_curTup->idMC[i]=3;
 		 m_curTup->wgtB[i]=trkScore[i][0]; m_curTup->wgtL[i]=trkScore[i][1]; m_curTup->wgtG[i]=trkScore[i][2]; 
-		 m_curTup->Sig3D[i]=TrkSig3D[i];
+		 m_curTup->sig3D[i]=TrkSig3D[i];
 		 m_curTup->chg[i]=tmpPerigee[4]<0. ? 1: -1;
                  m_curTup->ibl[i]=hitIBL[i];
 		 m_curTup->bl[i]=hitBL[i];
+                 m_curTup->fhitR[i]=selectedTracks[i]->radiusOfFirstHit();
 		 TLorentzVector TLV=selectedTracks[i]->p4();
 		 m_curTup->pTvsJet[i]=TLV.Perp(jetDir.Vect());
 		 TLorentzVector normJ;  normJ.SetPtEtaPhiM(1.,jetDir.Eta(),jetDir.Phi(),0.);
@@ -569,7 +567,7 @@ namespace InDet{
              }
              m_fitSvc->setApproximateVertex(iniVrt.x(), iniVrt.y(), iniVrt.z(),*state);
              tmpVrt.i=i; tmpVrt.j=j;
-             m_fitSvc->setRobustness(4, *state);
+             m_fitSvc->setRobustness(6, *state);
              sc=VKalVrtFitBase(tracksForFit,tmpVrt.fitVertex, tmpVrt.momentum, Charge,
                                tmpVrt.errorMatrix, tmpVrt.chi2PerTrk, tmpVrt.trkAtVrt, tmpVrt.chi2,
                                *state, true);
@@ -578,13 +576,15 @@ namespace InDet{
 	     if(std::abs(tmpVrt.fitVertex.z())> 650.)     continue;  // definitely outside of Pixel detector
              Dist2D=tmpVrt.fitVertex.perp(); 
 	     if(Dist2D    > 180. )             continue;  // can't be from B decay
+
+	     double vrErr  = vrtRadiusError(tmpVrt.fitVertex, tmpVrt.errorMatrix);
+             if(vrErr>1.5&&getVrtScore(i,j,trkScore) < 4.*m_cutBVrtScore) continue;
+
              double mass_PiPi =  tmpVrt.momentum.M();  
 	     if(mass_PiPi > m_Vrt2TrMassLimit)      continue;  // can't be from B decay
              vrtVrtDist(primVrt, tmpVrt.fitVertex, tmpVrt.errorMatrix, Signif3D);
 	     tmpVrt.signif3D=Signif3D;
              vrtVrtDist2D(primVrt, tmpVrt.fitVertex, tmpVrt.errorMatrix, tmpVrt.signif2D);
-//This selection should not be used in the multi-vertex with primary mode
-	     if(!m_multiWithPrimary)if(getVrtScore(i,j,trkScore)*(1.-TMath::Prob(Signif3D*Signif3D,3)) < m_cutBVrtScore) continue;
 //---
              TVector3 SVmPV(tmpVrt.fitVertex.x()-primVrt.x(),tmpVrt.fitVertex.y()-primVrt.y(),tmpVrt.fitVertex.z()-primVrt.z());
              tmpVrt.dRSVPV=jetDir.DeltaR(TLorentzVector(SVmPV, 1.)); //DeltaR SV-PV vs jet
@@ -595,8 +595,15 @@ namespace InDet{
              if((!m_multiWithPrimary) &&(!m_getNegativeTail) && (!m_getNegativeTag) &&  jetVrtDir<0. )  continue; /* secondary vertex behind primary*/
 	     if(vPos<-100.) continue;                                              /* Secondary vertex is too far behind primary*/
 //
-// Check pixel hits vs vertex positions.
-             if(m_useVertexCleaning && !Check2TrVertexInPixel(selectedTracks[i],selectedTracks[j],tmpVrt.fitVertex,tmpVrt.errorMatrix)) continue;
+// Check track pixel hit patterns vs vertex position.
+             if(m_useVertexCleaningPix && !check2TrVertexInPixel(selectedTracks[i],selectedTracks[j],tmpVrt.fitVertex,tmpVrt.errorMatrix)) continue;
+// Check track first measured points vs vertex position.
+             if(m_useVertexCleaningFMP){
+               float ihitR  = selectedTracks[i]->radiusOfFirstHit();
+               float jhitR  = selectedTracks[j]->radiusOfFirstHit();
+               if(std::abs(ihitR-jhitR)>25.) continue;                            // Hits in different pixel layers
+               if( tmpVrt.fitVertex.perp()-std::min(ihitR,jhitR) > 2.*vrErr) continue; // Vertex is behind hit in pixel 
+             }
 //--------
 //
              double signif3Dproj=vrtVrtDist( primVrt, tmpVrt.fitVertex, tmpVrt.errorMatrix, jetDir);
@@ -776,7 +783,7 @@ namespace InDet{
 
 
    template <class Track>
-   bool InDetVKalVxInJetTool::Check2TrVertexInPixel( const Track* p1, const Track* p2,
+   bool InDetVKalVxInJetTool::check2TrVertexInPixel( const Track* p1, const Track* p2,
                                               Amg::Vector3D &fitVertex, std::vector<double> & vrtErr)
    const
    {
diff --git a/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/BTagVrtSecMulti.cxx b/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/BTagVrtSecMulti.cxx
index 3971a4807f7e418e9fa40b779ae43f5d3d016db2..13e8cdfd2973cf8f09e8ddcef1a4979df525266a 100755
--- a/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/BTagVrtSecMulti.cxx
+++ b/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/BTagVrtSecMulti.cxx
@@ -450,7 +450,7 @@ InDetVKalVxInJetTool::getVrtSecMulti(workVectorArrxAOD* xAODwrk,
           vrtVrtDist(primVrt,curVrt.vertex, curVrt.vertexCov, Signif3D); //VK non-projected Signif3D is worse
           double tmpProb=TMath::Prob( curVrt.chi2, 1);                 //Chi2 of the original 2tr vertex
           bool trkGood=false;
-          if(xAODwrk)trkGood=Check1TrVertexInPixel(xAODwrk->listJetTracks[curVrt.selTrk[0]],curVrt.vertex,curVrt.vertexCov);
+          if(xAODwrk)trkGood=check1TrVertexInPixel(xAODwrk->listJetTracks[curVrt.selTrk[0]],curVrt.vertex,curVrt.vertexCov);
           if(trkGood && tmpProb>0.01){  /* accept only good tracks coming from good 2tr vertex*/
              //if( useMaterialRejection && insideMatLayer(curVrt.vertex.x(),curVrt.vertex.y()) ) continue;
              std::vector<double> Impact,ImpactError;   double Signif3DP = 0;
@@ -489,10 +489,19 @@ InDetVKalVxInJetTool::getVrtSecMulti(workVectorArrxAOD* xAODwrk,
 //        Dist3D=((*wrkVrtSet)[iv].vertex-primVrt.position()).mag();            /* Not needed currently*/
 //        if(PrmVrtAdded && iv==PrmVrtAdded && Dist3D<3.5) continue;  /* Skip added primary vertex */
 //-----------------------------------------------------------------------------------------
-          if(nth==2 && m_useVertexCleaning){
-        if(xAODwrk){
-	       if(!Check2TrVertexInPixel(xAODwrk->tmpListTracks[0],xAODwrk->tmpListTracks[1],curVrt.vertex,curVrt.vertexCov))continue;
-            }
+          if(nth==2 && xAODwrk){
+// Check track pixel hit patterns vs vertex position.
+             if(m_useVertexCleaningPix){
+	       if(!check2TrVertexInPixel(xAODwrk->tmpListTracks[0],xAODwrk->tmpListTracks[1],curVrt.vertex,curVrt.vertexCov))continue;
+             }
+// Check track first measured points vs vertex position.
+             if(m_useVertexCleaningFMP){
+               float ihitR  = xAODwrk->tmpListTracks[0]->radiusOfFirstHit();
+               float jhitR  = xAODwrk->tmpListTracks[1]->radiusOfFirstHit();
+	       float vrErr  = vrtRadiusError(curVrt.vertex, curVrt.vertexCov);
+               if(std::abs(ihitR-jhitR)>25.) continue;                            // Hits in different pixel layers
+               if( curVrt.vertex.perp()-std::min(ihitR,jhitR) > 2.*vrErr) continue; // Vertex is behind hit in pixel 
+             }
 	  }
 //
 //---  Check interactions on pixel layers
diff --git a/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/InDetVKalVxInJetTool.cxx b/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/InDetVKalVxInJetTool.cxx
index f2c8e4a0935bfb7bbbe778f84ad1caeded161d2f..ca297c489c9f48acf32a672146bc06bf49aa37e5 100755
--- a/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/InDetVKalVxInJetTool.cxx
+++ b/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/InDetVKalVxInJetTool.cxx
@@ -62,7 +62,8 @@ InDetVKalVxInJetTool::InDetVKalVxInJetTool(const std::string& type,
     m_rLayerB   (0.),  // in jobO or initialize()
     m_rLayer1   (0.),
     m_rLayer2   (0.),
-    m_useVertexCleaning(false),
+    m_useVertexCleaningPix(false),
+    m_useVertexCleaningFMP(false),
     m_multiVertex(false),
     m_multiWithPrimary(false),
     m_getNegativeTail(false),
@@ -120,7 +121,8 @@ InDetVKalVxInJetTool::InDetVKalVxInJetTool(const std::string& type,
     declareProperty("Rlayer1",   m_rLayer1  );
     declareProperty("Rlayer2",   m_rLayer2  );
 
-    declareProperty("useVertexCleaning",     m_useVertexCleaning,    "Clean vertices by requiring pixel hit presence according to vertex position" );
+    declareProperty("useVertexCleaningPix", m_useVertexCleaningPix, "Clean vertices requiring track pixel hit patterns according to vertex position" );
+    declareProperty("useVertexCleaningFMP", m_useVertexCleaningFMP, "Clean vertices requiring track F(irst) M(easured) P(oints) matching to vertex position" );
 
     declareProperty("MultiVertex",        m_multiVertex,       "Run Multiple Secondary Vertices in jet finder"  );
     declareProperty("MultiWithPrimary",   m_multiWithPrimary,  "Find Multiple Secondary Vertices + primary vertex in jet. MultiVertex Finder only!"  );
@@ -245,8 +247,6 @@ InDetVKalVxInJetTool::InDetVKalVxInJetTool(const std::string& type,
          m_hb_distVV     = new TH1D("distvv","Vertex-Vertex dist", 100,0., 20.);
          m_hb_diffPS     = new TH1D("diffPS","Primary-Secondary assoc", 200,-20., 20.);
          m_hb_trkPtMax   = new TH1D("trkPtMax","Maximal track Pt to jet", 100, 0., 5000.);
-         m_hb_blshared   = new TH1F("blshared","Number of shared hits in B-layer for R<BL", 5, 0., 5.);
-         m_hb_pxshared   = new TH1F("pxshared","Number of shared hits in pixel for R>BL", 5, 0., 5.);
          m_hb_rawVrtN    = new TH1F("rawVrtN","Number of raw vertices multivertex case", 20, 0., 20.);
          m_hb_lifetime   = new TH1F("lifetime","Distance/momentum", 100, 0., 5.);
          m_hb_trkPErr    = new TH1F("trkPErr","Track momentum error for P>10 GeV", 100, 0., 0.5);
@@ -299,8 +299,6 @@ InDetVKalVxInJetTool::InDetVKalVxInJetTool(const std::string& type,
        sc = hist_root->regHist(histDir+"distVV",    m_hb_distVV);
        sc = hist_root->regHist(histDir+"diffPS",    m_hb_diffPS);
        sc = hist_root->regHist(histDir+"trkPtMax",  m_hb_trkPtMax);
-       sc = hist_root->regHist(histDir+"blshared",  m_hb_blshared);
-       sc = hist_root->regHist(histDir+"pxshared",  m_hb_pxshared);
        sc = hist_root->regHist(histDir+"rawVrtN",   m_hb_rawVrtN);
        sc = hist_root->regHist(histDir+"lifetime",  m_hb_lifetime);
        sc = hist_root->regHist(histDir+"trkPErr",   m_hb_trkPErr);
@@ -332,10 +330,11 @@ InDetVKalVxInJetTool::InDetVKalVxInJetTool(const std::string& type,
           m_tuple->Branch("wgtB",        &m_curTup->wgtB,      "wgtB[ntrk]/F");
           m_tuple->Branch("wgtL",        &m_curTup->wgtL,      "wgtL[ntrk]/F");
           m_tuple->Branch("wgtG",        &m_curTup->wgtG,      "wgtG[ntrk]/F");
-          m_tuple->Branch("Sig3D",       &m_curTup->Sig3D,     "Sig3D[ntrk]/F");
+          m_tuple->Branch("sig3D",       &m_curTup->sig3D,     "sig3D[ntrk]/F");
           m_tuple->Branch("idMC",        &m_curTup->idMC,      "idMC[ntrk]/I");
           m_tuple->Branch("ibl",         &m_curTup->ibl,       "ibl[ntrk]/I");
           m_tuple->Branch("bl",          &m_curTup->bl,        "bl[ntrk]/I");
+          m_tuple->Branch("fhitR",       &m_curTup->fhitR,     "fhitRR[ntrk]/F");
           m_tuple->Branch("SigR",        &m_curTup->SigR,      "SigR[ntrk]/F");
           m_tuple->Branch("SigZ",        &m_curTup->SigZ,      "SigZ[ntrk]/F");
           m_tuple->Branch("d0",          &m_curTup->d0,        "d0[ntrk]/F");
@@ -352,6 +351,7 @@ InDetVKalVxInJetTool::InDetVKalVxInJetTool(const std::string& type,
           m_tuple->Branch("VrtSig3D",    &m_curTup->VrtSig3D,  "VrtSig3D[nvrt]/F");
           m_tuple->Branch("VrtSig2D",    &m_curTup->VrtSig2D,  "VrtSig2D[nvrt]/F");
           m_tuple->Branch("VrtDR",       &m_curTup->VrtDR,     "VrtDR[nvrt]/F");
+          m_tuple->Branch("VrtErrR",     &m_curTup->VrtErrR,   "VrtErrR[nvrt]/F");
           m_tuple->Branch("itrk",        &m_curTup->itrk,      "itrk[nvrt]/I");
           m_tuple->Branch("jtrk",        &m_curTup->jtrk,      "jtrk[nvrt]/I");
           m_tuple->Branch("badV",        &m_curTup->badVrt,    "badV[nvrt]/I");
diff --git a/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx b/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx
index 486b9f8105d930c2ef989faff51746ee67167a48..afdf92fa24efc35589d9a685f9a6312a5249e8ff 100755
--- a/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx
+++ b/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx
@@ -605,6 +605,7 @@ namespace InDet{
 	   m_curTup->Chi2[ipnt]=vrt.chi2;
 	   m_curTup->badVrt[ipnt]=vrt.badVrt;
 	   m_curTup->VrtDR[ipnt]=vrt.dRSVPV;
+	   m_curTup->VrtErrR[ipnt]= vrtRadiusError(vrt.fitVertex, vrt.errorMatrix);
            ipnt++; m_curTup->nVrt=ipnt;
         }
   } 
diff --git a/InnerDetector/InDetRecTools/SiClusterizationTool/CMakeLists.txt b/InnerDetector/InDetRecTools/SiClusterizationTool/CMakeLists.txt
index 5c1639fc50ed9244cbc831e414104b6ed1046c27..f9cf31ff72354a4de4e828ced343303d586d214f 100644
--- a/InnerDetector/InDetRecTools/SiClusterizationTool/CMakeLists.txt
+++ b/InnerDetector/InDetRecTools/SiClusterizationTool/CMakeLists.txt
@@ -41,27 +41,33 @@ atlas_depends_on_subdirs(
    Tracking/TrkEvent/VxVertex )
 
 # External dependencies:
+find_package( lwtnn )
 find_package( CLHEP )
 find_package( ROOT COMPONENTS Core MathCore Hist )
+find_package( COOL COMPONENTS CoolKernel CoolApplication )
 
 # Component(s) in the package:
 atlas_add_library( SiClusterizationToolLib
    SiClusterizationTool/*.h src/*.cxx
    PUBLIC_HEADERS SiClusterizationTool
-   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-   PRIVATE_INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS}
+   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${LWTNN_INCLUDE_DIRS}
+   PRIVATE_INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} ${COOL_INCLUDE_DIRS}
    PRIVATE_DEFINITIONS ${CLHEP_DEFINITIONS}
-   LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaBaseComps AthenaKernel GeoPrimitives
+   LINK_LIBRARIES ${ROOT_LIBRARIES} ${LWTNN_LIBRARIES} AthenaBaseComps AthenaKernel GeoPrimitives
    Identifier EventPrimitives GaudiKernel InDetSimData InDetIdentifier
    InDetReadoutGeometry PixelReadoutGeometry SCT_ReadoutGeometry InDetRawData InDetPrepRawData InDetRecToolInterfaces InDetConditionsSummaryService
    TrkParameters TrkNeuralNetworkUtilsLib PixelConditionsData
    PixelGeoModelLib PixelCablingLib BeamSpotConditionsData
-   PRIVATE_LINK_LIBRARIES ${CLHEP_LIBRARIES} AthenaPoolUtilities FileCatalog AtlasDetDescr
-   TrkSurfaces TrkEventPrimitives VxVertex PixelGeoModelLib PoolSvcLib DetDescrCondToolsLib )
+   PRIVATE_LINK_LIBRARIES ${CLHEP_LIBRARIES} ${COOL_LIBRARIES} AthenaPoolUtilities FileCatalog AtlasDetDescr
+   TrkSurfaces TrkEventPrimitives VxVertex PixelGeoModelLib PoolSvcLib DetDescrCondToolsLib stdc++fs)
 
 atlas_add_component( SiClusterizationTool
    src/components/*.cxx
-   LINK_LIBRARIES GaudiKernel PixelConditionsData SiClusterizationToolLib PoolSvcLib )
+   INCLUDE_DIRS ${COOL_INCLUDE_DIRS}
+   LINK_LIBRARIES ${COOL_LIBRARIES} GaudiKernel PixelConditionsData SiClusterizationToolLib PoolSvcLib )
 
 # Install files from the package:
 atlas_install_joboptions( share/*.py )
+# These files can be added by the user for testing in Grid environments,
+# in which case un-comment this line and re-cmake
+# atlas_install_data( share/*.db )
diff --git a/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/LWTNNCollection.h b/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/LWTNNCollection.h
new file mode 100644
index 0000000000000000000000000000000000000000..885b24a055afa75a0856b938d9c8b7c4ea294759
--- /dev/null
+++ b/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/LWTNNCollection.h
@@ -0,0 +1,30 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef _LWTNNCollection_H_
+#define _LWTNNCollection_H_
+
+//#include <vector>
+#include "lwtnn/LightweightGraph.hh"
+
+class LWTNNCollection 
+  :  public std::map<int, std::unique_ptr<lwt::LightweightGraph> >
+{
+public:
+
+private:
+
+};
+
+// These values produced using clid script.
+// clid LWTNNCollection
+// 1196174442 LWTNNCollection None
+#include "AthenaKernel/CLASS_DEF.h"
+CLASS_DEF(LWTNNCollection, 1196174442, 1)
+// clid -cs LWTNNCollection
+// 1226994220
+#include "AthenaKernel/CondCont.h"
+CONDCONT_DEF(LWTNNCollection, 1226994220);
+
+#endif
diff --git a/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/MergedPixelsTool.h b/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/MergedPixelsTool.h
index 3a232c2015e9dbf0e5b59017392e21d658c14e90..74506f93da9c41848d40bb84a89951190e30d41d 100644
--- a/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/MergedPixelsTool.h
+++ b/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/MergedPixelsTool.h
@@ -31,6 +31,7 @@
 
 #include <atomic>
 #include <vector>
+#include <array>
 
 class PixelID;
 
@@ -56,25 +57,18 @@ namespace InDet {
     Identifier ID ;
   };
 
-  class network {
+  struct network {
   public:
-    network():
-      NC(0), CON({0,0,0,0,0,0,0,0}) {};
-      
-    ~network() {};
-
-    int               NC;
-    std::array<int,8> CON;
+    int               NC{};
+    std::array<int,8> CON{};
   };
   
   const auto pixel_less = [] (rowcolID const&  id1,rowcolID const& id2) -> bool {
-    if(id1.COL == id2.COL) 
-      return id1.ROW < id2.ROW;
+    if(id1.COL == id2.COL) return id1.ROW < id2.ROW;
     return id1.COL < id2.COL;
   };
  
-  class MergedPixelsTool : public PixelClusteringToolBase
-  {
+  class MergedPixelsTool : public PixelClusteringToolBase{
   public:
 
 
diff --git a/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/NnClusterizationFactory.h b/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/NnClusterizationFactory.h
index a84861a41e9446725e2bbb316f6bc76fcb8d77f1..01039990556ad36cd7d109f2c81b47e038c8c773 100644
--- a/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/NnClusterizationFactory.h
+++ b/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/NnClusterizationFactory.h
@@ -2,13 +2,13 @@
   Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
- #ifndef BTAGTOOL_NnClusterizationFactory_C
- #define BTAGTOOL_NnClusterizationFactory_C
+ #ifndef SICLUSTERIZATIONTOOL_NnClusterizationFactory_C
+ #define SICLUSTERIZATIONTOOL_NnClusterizationFactory_C
 
  /******************************************************
      @class NnClusterizationFactory
      @author Giacinto Piacquadio (PH-ADE-ID)
-     Package : JetTagTools
+     Package : SiClusterizationTool
      Created : January 2011
      DESCRIPTION: Load neural networks used for clustering
                   and deal with:
@@ -37,6 +37,7 @@
 #include "EventPrimitives/EventPrimitives.h"
 #include "InDetCondTools/ISiLorentzAngleTool.h"
 #include "SiClusterizationTool/TTrainedNetworkCollection.h"
+#include "SiClusterizationTool/LWTNNCollection.h"
 #include "PixelCabling/IPixelCablingSvc.h"
 #include "PixelConditionsData/PixelModuleData.h"
 #include "PixelConditionsData/PixelChargeCalibCondData.h"
@@ -46,6 +47,11 @@
  class TH1;
  class ICoolHistSvc;
 
+namespace lwt {
+  class NanReplacer;    
+  class LightweightGraph;
+}
+
 namespace Trk {
   class NeuralNetworkToHistoTool;
   class Surface;
@@ -106,6 +112,7 @@ namespace InDet {
                                                   int sizeX=7,
                                                   int sizeY=7) const;
 
+    /* Public-facing method 1: no track parameters */
     std::vector<Amg::Vector2D> estimatePositions(const InDet::PixelCluster& pCluster,
                                                       Amg::Vector3D & beamSpotPosition,
                                                       std::vector<Amg::MatrixX> & errors,
@@ -113,7 +120,7 @@ namespace InDet {
                                                       int sizeX=7,
                                                       int sizeY=7) const;
 
-
+    /* Public-facing method 1: with track parameters */
     std::vector<Amg::Vector2D> estimatePositions(const InDet::PixelCluster& pCluster,
                                                       const Trk::Surface& pixelSurface,
                                                       const Trk::TrackParameters& trackParsAtSurface,
@@ -124,8 +131,13 @@ namespace InDet {
 
    private:
 
-    /* estimate position for both with and w/o tracks */
-    std::vector<Amg::Vector2D> estimatePositions(const TTrainedNetworkCollection &nn_collection,
+    // Handling lwtnn inputs
+    typedef std::map<std::string, std::map<std::string, double> > InputMap;
+
+    /* Estimate position for both with and w/o tracks */
+    /* Method 1: using older TTrainedNetworks */
+    std::vector<Amg::Vector2D> estimatePositionsTTN(
+                                                 const TTrainedNetworkCollection &nn_collection,
                                                  std::vector<double> inputData,
                                                  const NNinput& input,
                                                  const InDet::PixelCluster& pCluster,
@@ -134,6 +146,20 @@ namespace InDet {
                                                  int numberSubClusters,
                                                  std::vector<Amg::MatrixX> & errors) const;
 
+    /* Estimate position for both with and w/o tracks */
+    /* Method 2: using lwtnn for more flexible interfacing */
+    std::vector<Amg::Vector2D> estimatePositionsLWTNN(
+                                                NnClusterizationFactory::InputMap & input, 
+                                                NNinput& rawInput,
+                                                const InDet::PixelCluster& pCluster,
+                                                int numberSubClusters,
+                                                std::vector<Amg::MatrixX> & errors) const;
+
+    // For error formatting in lwtnn cases
+    double correctedRMSX(double posPixels) const;
+
+    double correctedRMSY(double posPixels, double sizeY, std::vector<float>& pitches) const; 
+
      /* algorithmic component */
     NNinput createInput(const InDet::PixelCluster& pCluster,
                         Amg::Vector3D & beamSpotPosition,
@@ -157,7 +183,7 @@ namespace InDet {
                                       int sizeX,
                                       int sizeY) const;
 
-
+    InputMap flattenInput(NNinput & input) const;
 
     std::vector<Amg::Vector2D> getPositionsFromOutput(std::vector<double> & output,
                                                       const NNinput & input,
@@ -225,6 +251,10 @@ namespace InDet {
        {this, "NnCollectionWithTrackReadKey", "PixelClusterNNWithTrack",
         "The conditions store key for the pixel cluster NNs which needs tracks as input"};
 
+    SG::ReadCondHandleKey<LWTNNCollection> m_readKeyJSON
+       {this, "NnCollectionJSONReadKey", "PixelClusterNNJSON",
+        "The conditions key for the pixel cluster NNs configured via JSON file and accessed with lwtnn"};
+
     Gaudi::Property<unsigned int> m_maxSubClusters
        {this, "MaxSubClusters", 3, "Maximum number of sub cluster supported by the networks." };
 
@@ -243,6 +273,9 @@ namespace InDet {
     Gaudi::Property<bool> m_doRunI
        {this, "doRunI", false, "Use runI style network (outputs are not normalised; add pitches; use charge if not m_useToT)"};
 
+    Gaudi::Property<bool> m_useTTrainedNetworks
+       {this, "useTTrainedNetworks", false, "Use earlier (release-21-like) neural networks stored in ROOT files and accessed via TTrainedNetowrk."};
+
     Gaudi::Property<bool> m_useRecenteringNNWithouTracks
        {this, "useRecenteringNNWithoutTracks",false,"Recenter x position when evaluating NN without track input."};
 
diff --git a/InnerDetector/InDetRecTools/SiClusterizationTool/src/LWTNNCondAlg.cxx b/InnerDetector/InDetRecTools/SiClusterizationTool/src/LWTNNCondAlg.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..0a733ff61e79d3c64db91b08bd7bc25b4514ac8b
--- /dev/null
+++ b/InnerDetector/InDetRecTools/SiClusterizationTool/src/LWTNNCondAlg.cxx
@@ -0,0 +1,182 @@
+/*
+  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+*/
+/*
+ *   */
+
+#include "LWTNNCondAlg.h"
+
+#include "AthenaPoolUtilities/CondAttrListCollection.h"
+#include "AthenaPoolUtilities/AthenaAttributeList.h"
+#include "CoolKernel/IObject.h"
+#include "FileCatalog/IFileCatalog.h"
+
+// NN includes
+#include "lwtnn/parse_json.hh"
+#include "lwtnn/Exceptions.hh"
+#include "lwtnn/lightweight_nn_streamers.hh"
+#include "lwtnn/NanReplacer.hh"
+
+// JSON parsers
+#include <boost/property_tree/ptree.hpp>
+#include <boost/property_tree/json_parser.hpp>
+#include "boost/property_tree/exceptions.hpp"
+
+
+// for error messages
+#include <typeinfo>
+
+namespace InDet {
+
+  LWTNNCondAlg::LWTNNCondAlg (const std::string& name, ISvcLocator* pSvcLocator)
+    : ::AthAlgorithm( name, pSvcLocator )
+  {}
+
+  StatusCode LWTNNCondAlg::initialize() {
+    ATH_CHECK( m_condSvc.retrieve() );
+
+    // Condition Handles
+    ATH_CHECK( m_readKey.initialize() );
+    ATH_CHECK( m_writeKey.initialize() );
+
+    // Register write handle
+    if (m_condSvc->regHandle(this, m_writeKey).isFailure()) {
+      ATH_MSG_ERROR("Unable to register WriteCondHandle " << m_writeKey.fullKey() << " with CondSvc");
+      return StatusCode::FAILURE;
+    }
+
+    return StatusCode::SUCCESS;
+  }
+
+  StatusCode LWTNNCondAlg::finalize()
+  {
+    return StatusCode::SUCCESS;
+  }
+
+  StatusCode LWTNNCondAlg::configureLwtnn(std::unique_ptr<lwt::LightweightGraph> & thisNN, 
+                                        std::string thisJson) {
+
+    // Read DNN weights from input json config
+    lwt::GraphConfig config;
+    try {
+      std::istringstream input_cfg( thisJson );
+      config = lwt::parse_json_graph(input_cfg);
+    } catch (boost::property_tree::ptree_error& err) {
+      ATH_MSG_ERROR("NN file unreadable!");
+      return StatusCode::FAILURE;
+    }
+
+    // Build the network
+    try {
+      thisNN.reset(new lwt::LightweightGraph(config, "merge_1"));
+    } catch (lwt::NNConfigurationException& exc) {
+      ATH_MSG_ERROR("NN configuration problem: " << exc.what());
+      return StatusCode::FAILURE;
+    }
+
+    return StatusCode::SUCCESS;   
+
+  }
+
+  StatusCode LWTNNCondAlg::execute() {
+
+    SG::WriteCondHandle<LWTNNCollection> NnWriteHandle{m_writeKey};
+    if (NnWriteHandle.isValid()) {
+      ATH_MSG_DEBUG("Write CondHandle "<< NnWriteHandle.fullKey() << " is already valid");
+      return StatusCode::SUCCESS;
+    }
+
+    SG::ReadCondHandle<CondAttrListCollection> readHandle{m_readKey};
+    if(!readHandle.isValid()) {
+      ATH_MSG_ERROR("Invalid read handle " << m_readKey.key());
+      return StatusCode::FAILURE;
+    }
+    const CondAttrListCollection* atrcol{*readHandle};
+    assert( atrcol != nullptr);
+
+    // So now we have the string containing the json. Access it.
+    // Retrieve channel 0 (only channel there is)
+    const coral::AttributeList& attrList=atrcol->attributeList(0);
+
+    // Check that it is filled as expected
+    if ((attrList["NNConfigurations"]).isNull()) {
+      ATH_MSG_ERROR( "NNConfigurations is NULL !" );
+      return StatusCode::FAILURE;
+    }
+
+    // Retrieve the string
+    // This is for a single LOB when it is all a giant block
+    const std::string megajson = attrList["NNConfigurations"].data<cool::String16M>();
+
+    // Parse the large json to extract the individual configurations for the NNs
+    std::istringstream initializerStream(megajson);
+    namespace pt = boost::property_tree;    
+    pt::ptree parentTree;
+    pt::read_json(initializerStream, parentTree);
+    std::ostringstream configStream;
+
+    // This is for handling IOVs
+    EventIDRange cdo_iov;
+    if(!readHandle.range(cdo_iov)) {
+      ATH_MSG_ERROR("Failed to get valid validity range from  " << readHandle.key());
+      return StatusCode::FAILURE;
+    }
+
+    // Here I create a pointer to the object I want to write
+    // And what I want to write is the map with my lwtnn networks.
+    std::unique_ptr<LWTNNCollection> writeCdo{std::make_unique<LWTNNCollection>()};
+
+    // First, extract configuration for the number network.
+    pt::ptree subtreeNumberNetwork = parentTree.get_child("NumberNetwork");
+    writeCdo->insert(std::make_pair(0,std::unique_ptr<lwt::LightweightGraph>(nullptr)));
+    // If this json is empty, just fill a null pointer.
+    if(subtreeNumberNetwork.empty()) {
+      ATH_MSG_INFO("Not using lwtnn for number network.");
+    }
+    // Otherwise, set up lwtnn.
+    else {      
+      ATH_MSG_INFO("Setting up lwtnn for number network...");
+      pt::write_json(configStream, subtreeNumberNetwork);
+      std::string numberNetworkConfig = configStream.str();
+      if ((configureLwtnn(writeCdo->at(0), numberNetworkConfig)).isFailure())
+        return StatusCode::FAILURE;     
+    }
+
+    // Now extract configuration for each position network.
+    // For simplicity, we'll require all three configurations
+    // in order to use lwtnn for positions.
+    for (int i=1; i<4; i++) {
+      const std::string key = "PositionNetwork_N"+std::to_string(i);
+      configStream.str("");
+      pt::ptree subtreePosNetwork = parentTree.get_child(key);
+      pt::write_json(configStream, subtreePosNetwork);
+      std::string posNetworkConfig = configStream.str();
+      
+      // Put a lwt network into the map
+      writeCdo->insert(std::make_pair(i,std::unique_ptr<lwt::LightweightGraph>(nullptr)));
+
+      // Now do empty check: if any one of these is empty we won't use lwtnn
+      if(subtreePosNetwork.empty()) {
+        ATH_MSG_INFO("Not using lwtnn for position networks.");
+      } else {
+        // Otherwise, set up lwtnn
+        ATH_MSG_INFO("Setting up lwtnn for n = " << i << " position network...");
+        if ((configureLwtnn(writeCdo->at(i), posNetworkConfig)).isFailure())
+          return StatusCode::FAILURE;
+      }
+
+    }
+    
+    // Write the networks to the store
+
+    if(NnWriteHandle.record(cdo_iov,std::move(writeCdo)).isFailure()) {
+      ATH_MSG_ERROR("Failed to record Trained network collection to " 
+                    << NnWriteHandle.key()
+                    << " with IOV " << cdo_iov );
+      return StatusCode::FAILURE;
+    }
+
+    return StatusCode::SUCCESS;
+  }
+
+}
diff --git a/InnerDetector/InDetRecTools/SiClusterizationTool/src/LWTNNCondAlg.h b/InnerDetector/InDetRecTools/SiClusterizationTool/src/LWTNNCondAlg.h
new file mode 100644
index 0000000000000000000000000000000000000000..23a94d535fa2610d5b6512d1441b74e9bda146db
--- /dev/null
+++ b/InnerDetector/InDetRecTools/SiClusterizationTool/src/LWTNNCondAlg.h
@@ -0,0 +1,85 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef _InDet_LWTNNCondAlg_H_
+#define _InDet_LWTNNCondAlg_H_
+
+#include "AthenaBaseComps/AthAlgorithm.h"
+#include "StoreGate/ReadCondHandleKey.h"
+#include "StoreGate/WriteCondHandleKey.h"
+
+#include "GaudiKernel/ICondSvc.h"
+#include "PoolSvc/IPoolSvc.h"
+
+//#include "TrkNeuralNetworkUtils/NeuralNetworkToHistoTool.h"
+#include "SiClusterizationTool/LWTNNCollection.h"
+#include "AthenaPoolUtilities/CondAttrListCollection.h"
+#include <string>
+
+class IPoolSvc;
+
+namespace lwt {
+  class NanReplacer;    
+  class LightweightGraph;
+}
+
+namespace InDet {
+
+  /**
+  */
+class LWTNNCondAlg : public AthAlgorithm {
+
+ public:
+
+  LWTNNCondAlg (const std::string& name, ISvcLocator* pSvcLocator);
+  ~LWTNNCondAlg() = default;
+
+  StatusCode initialize();
+  StatusCode execute();
+  StatusCode finalize();
+
+ private:
+//  TTrainedNetwork* retrieveNetwork(TFile &input_file, const std::string& folder) const;
+
+  ServiceHandle<ICondSvc> m_condSvc
+    {this, "CondSvc", "CondSvc", "The conditions service to register new conditions data."};
+/*  ServiceHandle<IPoolSvc> m_poolsvc
+    {this, "PoolSvc", "PoolSvc", "The service to retrieve files by GUID."};
+  ToolHandle<Trk::NeuralNetworkToHistoTool> m_networkToHistoTool
+    {this,"NetworkToHistoTool", "Trk::NeuralNetworkToHistoTool/NeuralNetworkToHistoTool", "Tool to create a neural network from a set of histograms." };
+*/
+  StatusCode configureLwtnn(std::unique_ptr<lwt::LightweightGraph> & thisNN, std::string thisJson);
+
+  SG::ReadCondHandleKey<CondAttrListCollection> m_readKey
+    {this, "ReadKey", "/PIXEL/PixelClustering/PixelNNCalibJSON", "Cool folder name for the cluster NN input histogram file."};
+
+  SG::WriteCondHandleKey<LWTNNCollection> m_writeKey
+    {this, "WriteKey", "PixelClusterNNJSON", "The conditions statore key for the pixel cluster NNs"};
+
+  Gaudi::Property< std::vector<std::string> > m_nnOrder
+    {this, "NetworkNames", {
+          "NumberNetwork",
+          "PositionNetwork_N1",
+          "PositionNetwork_N2",
+          "PositionNetwork_N3"},
+        "List of network names, which are indexe in map in this order"};
+/*
+  Gaudi::Property<std::string> m_layerInfoHistogram
+  {this, "LayerInfoHistogram",      "LayersInfo","Name about the layer info histogram."};
+
+  Gaudi::Property<std::string> m_layerPrefix
+  {this, "LayerPrefix",             "Layer",     "Prefix of the pre layer weight and threshold histograms."}; 
+
+  Gaudi::Property<std::string> m_weightIndicator
+  {this, "LayerWeightIndicator",    "_weights",  "Suffix of the weight histograms."};
+
+  Gaudi::Property<std::string> m_thresholdIndicator
+  {this, "LayerThresholdIndicator", "_thresholds","Suffix of the threshold histograms."};
+
+  Gaudi::Property<bool> m_getInputsInfo
+  {this, "GetInputsInfo", false,"Also read a histogram which contains information about the inputs (Run I)."};
+  */
+};
+}
+#endif
diff --git a/InnerDetector/InDetRecTools/SiClusterizationTool/src/MergedPixelsTool.cxx b/InnerDetector/InDetRecTools/SiClusterizationTool/src/MergedPixelsTool.cxx
index 37edd8fb85d5009fbcf24ffb0a99609fac3ad363..0f0d077f69929b926511302b1472d18b397a3d36 100644
--- a/InnerDetector/InDetRecTools/SiClusterizationTool/src/MergedPixelsTool.cxx
+++ b/InnerDetector/InDetRecTools/SiClusterizationTool/src/MergedPixelsTool.cxx
@@ -25,6 +25,7 @@
 
 #include "GeoPrimitives/GeoPrimitives.h"
 #include "EventPrimitives/EventPrimitives.h"
+#include <unordered_set>
 
 using CLHEP::micrometer;
 
@@ -41,15 +42,12 @@ namespace InDet {
     }
   
   StatusCode  MergedPixelsTool::initialize(){
-    
     if (m_IBLParameterSvc.retrieve().isFailure()) { 
       ATH_MSG_WARNING( "Could not retrieve IBLParameterSvc"); 
     } else { 
       m_IBLParameterSvc->setBoolParameters(m_IBLAbsent,"IBLAbsent");
     }  
-    
     ATH_CHECK(m_pixelDetEleCollKey.initialize());
-    
     return PixelClusteringToolBase::initialize();
   }
 
@@ -340,12 +338,15 @@ namespace InDet {
     // loop on the rdo collection and save the relevant quantities for each fired pixel
     // rowcolID contains: number of connected pixels, phi/eta pixel indices, tot, lvl1, rdo identifier
     std::vector<rowcolID> collectionID;
-
+    std::unordered_set<Identifier> setOfIdentifiers{};
     for(const auto & rdo : collection) {
-      
       const Identifier rdoID= rdo->identify();
       if (m_usePixelMap and !(m_summaryTool->isGood(idHash,rdoID))) continue;
-          
+      //check for duplication:
+      //add to set of existing identifiers. If it fails (.second = false) then skip it.
+      if (not setOfIdentifiers.insert(rdoID).second)   continue;
+      // note that we don't understand, for now, why these duplicated RDO's occur
+      //
       const int lvl1= rdo->getLVL1A();      
       if (m_checkDuplicatedRDO and checkDuplication(pixelID, rdoID, lvl1, collectionID)) continue;
       
@@ -353,7 +354,6 @@ namespace InDet {
       
       rowcolID   RCI(-1, pixelID.phi_index(rdoID), pixelID.eta_index(rdoID), tot, lvl1, rdoID); 
       collectionID.push_back(RCI);
-      
       // check if this is a ganged pixel    
       Identifier gangedID;
       const bool ganged = isGanged(rdoID, element, gangedID);  
@@ -376,8 +376,7 @@ namespace InDet {
 
     // Network production
     //
-    int collectionSize = collectionID.size();
-    
+    int collectionSize = collectionID.size();    
     // the maximum number of elements to save can be either 2 or 3
     // m_addCorners == true requires saving the bottom (or top), the side and the corner connection for each pixel,
     // otherwise you only save bottom (or top) and the side
@@ -389,16 +388,16 @@ namespace InDet {
       int NB  = 0;
       int row = collectionID.at(currentPixel).ROW;
       int col = collectionID.at(currentPixel).COL; 
-      
+      //
+      auto & currentConnection = connections.at(currentPixel);
       for(int otherPixel = currentPixel+1; otherPixel!=collectionSize; ++otherPixel) {
+        auto & otherConnection = connections.at(otherPixel);
         int deltaCol = std::abs(collectionID.at(otherPixel).COL - col);
         int deltaRow = std::abs(collectionID.at(otherPixel).ROW - row);
-
         // break if you are too far way in columns, as these ones will be taken in the next iterations
         if( deltaCol > 1) {
           break;
         }
-        
         // if you need the corners, you jump the next rows, as these ones will be taken in the next iterations
         if ( m_addCorners and deltaRow > 1 ) {
           continue;
@@ -415,8 +414,12 @@ namespace InDet {
         
         // this builds the single pixel connection and breaks if the max number of elements is reached:        
         if( (deltaCol+deltaRow) == 1 or (m_addCorners and deltaCol == 1 and deltaRow == 1) ) {
-          connections.at(currentPixel).CON.at(connections.at(currentPixel).NC++) = otherPixel;
-          connections.at(otherPixel).CON.at(connections.at(otherPixel).NC++) = currentPixel ;
+          try{
+            currentConnection.CON.at(currentConnection.NC++) = otherPixel;
+            otherConnection.CON.at(otherConnection.NC++) = currentPixel ;
+          } catch (const std::out_of_range & ){
+            throw std::runtime_error("attempt to access connection array beyond its size in MergedPixelsTool::clusterize");
+          }
           if(++NB==maxElements) {
             break;
           }
@@ -512,7 +515,7 @@ namespace InDet {
                                           const int& Ncluster,
                                           const std::vector<network>& connections,                                         
                                           std::vector<rowcolID>& collectionID) const {
-    for(int i=0; i!=connections.at(r).NC; ++i) {      
+    for(int i=0; i!=connections.at(r).NC; ++i) {  
       const int k = connections.at(r).CON.at(i);
       if(collectionID.at(k).NCL < 0) {
         collectionID.at(k).NCL = Ncluster;
diff --git a/InnerDetector/InDetRecTools/SiClusterizationTool/src/NnClusterizationFactory.cxx b/InnerDetector/InDetRecTools/SiClusterizationTool/src/NnClusterizationFactory.cxx
index e847f6f1ad5dcf44de3e59f377a44573c340aa9d..28feb5fa6854f19666b0c1e0261130cade50a654 100644
--- a/InnerDetector/InDetRecTools/SiClusterizationTool/src/NnClusterizationFactory.cxx
+++ b/InnerDetector/InDetRecTools/SiClusterizationTool/src/NnClusterizationFactory.cxx
@@ -156,6 +156,7 @@ namespace InDet {
 
     ATH_CHECK( m_readKeyWithoutTrack.initialize( !m_readKeyWithoutTrack.key().empty() ) );
     ATH_CHECK( m_readKeyWithTrack.initialize( !m_readKeyWithTrack.key().empty() ) );
+    ATH_CHECK( m_readKeyJSON.initialize( !m_readKeyJSON.key().empty() ) );
 
     return StatusCode::SUCCESS;
   }
@@ -255,6 +256,43 @@ namespace InDet {
     return inputData;
   }
 
+  NnClusterizationFactory::InputMap NnClusterizationFactory::flattenInput(NNinput & input) const
+  {
+
+    // Format for use with lwtnn
+    std::map<std::string, std::map<std::string, double> > flattened;
+
+    // Fill it!
+    // Variable names here need to match the ones in the configuration.    
+
+    std::map<std::string, double> simpleInputs;
+    for (unsigned int x = 0; x < input.matrixOfToT.size(); x++) {
+      for (unsigned int y = 0; y < input.matrixOfToT.at(0).size(); y++) {
+        unsigned int index = x*input.matrixOfToT.at(0).size()+y;
+        std::string varname = "NN_matrix"+std::to_string(index);
+        simpleInputs[varname] = input.matrixOfToT.at(x).at(y);
+      }
+    }
+
+    for (unsigned int p = 0; p < input.vectorOfPitchesY.size(); p++) {
+      std::string varname = "NN_pitches" + std::to_string(p);
+      simpleInputs[varname] = input.vectorOfPitchesY.at(p);
+    }
+
+    simpleInputs["NN_layer"] = input.ClusterPixLayer;
+    simpleInputs["NN_barrelEC"] = input.ClusterPixBarrelEC;
+    simpleInputs["NN_phi"] = input.phi;
+    simpleInputs["NN_theta"] = input.theta;
+
+    if (input.useTrackInfo) simpleInputs["NN_etaModule"] = input.etaModule;
+
+    // We have only one node for now, so we just store things there.
+    flattened["NNinputs"] = simpleInputs;
+
+    return flattened;
+
+
+  }
 
   std::vector<double> NnClusterizationFactory::estimateNumberOfParticles(const InDet::PixelCluster& pCluster,
                                                                          Amg::Vector3D & beamSpotPosition,
@@ -339,12 +377,6 @@ namespace InDet {
                                                                              int sizeY) const
   {
 
-    SG::ReadCondHandle<TTrainedNetworkCollection> nn_collection( m_readKeyWithoutTrack );
-    if (!nn_collection.isValid()) {
-      std::stringstream msg; msg << "Failed to get trained network collection with key " << m_readKeyWithoutTrack.key();
-      throw std::runtime_error( msg.str() );
-    }
-
     ATH_MSG_VERBOSE(" Starting to estimate positions...");
 
     double tanl=0;
@@ -360,14 +392,23 @@ namespace InDet {
       return std::vector<Amg::Vector2D>();
     }
 
-
     std::vector<double> inputData=(this->*m_assembleInput)(input,sizeX,sizeY);
 
+    // If using old TTrainedNetworks, fetch correct ones for the
+    // without-track situation and call them now.
+    if (m_useTTrainedNetworks) {
+      SG::ReadCondHandle<TTrainedNetworkCollection> nn_collection( m_readKeyWithoutTrack );
+      if (!nn_collection.isValid()) {
+        std::stringstream msg; msg << "Failed to get trained network collection with key " << m_readKeyWithoutTrack.key();
+        throw std::runtime_error( msg.str() );
+      }
+      // *(ReadCondHandle<>) returns a pointer rather than a reference ...
+      return estimatePositionsTTN(**nn_collection, inputData,input,pCluster,sizeX,sizeY,numberSubClusters,errors);
+    }
 
-    // *(ReadCondHandle<>) returns a pointer rather than a reference ...
-    return estimatePositions(**nn_collection, inputData,input,pCluster,sizeX,sizeY,numberSubClusters,errors);
-
-
+    // Otherwise, prepare lwtnn input map and use new networks.
+    NnClusterizationFactory::InputMap nnInputData = flattenInput(input);
+    return estimatePositionsLWTNN(nnInputData,input,pCluster,numberSubClusters,errors);
 
   }
 
@@ -380,12 +421,8 @@ namespace InDet {
                                                                         int sizeX,
                                                                         int sizeY) const
   {
-    SG::ReadCondHandle<TTrainedNetworkCollection> nn_collection( m_readKeyWithTrack );
-    if (!nn_collection.isValid()) {
-      std::stringstream msg; msg << "Failed to get trained network collection with key " << m_readKeyWithTrack.key();
-      throw std::runtime_error( msg.str() );
-    }
 
+    ATH_MSG_VERBOSE(" Starting to estimate positions...");
 
     Amg::Vector3D dummyBS(0,0,0);
 
@@ -402,24 +439,39 @@ namespace InDet {
        return std::vector<Amg::Vector2D>();
     }
 
-
     addTrackInfoToInput(input,pixelSurface,trackParsAtSurface,tanl);
 
     std::vector<double> inputData=(this->*m_assembleInput)(input,sizeX,sizeY);
 
+    // If using old TTrainedNetworks, fetch correct ones for the
+    // without-track situation and call them now.
+    if (m_useTTrainedNetworks) {
+      SG::ReadCondHandle<TTrainedNetworkCollection> nn_collection( m_readKeyWithTrack );
+      if (!nn_collection.isValid()) {
+        std::stringstream msg; msg << "Failed to get trained network collection with key " << m_readKeyWithTrack.key();
+        throw std::runtime_error( msg.str() );
+      }
+
+      return estimatePositionsTTN(**nn_collection, inputData,input,pCluster,sizeX,sizeY,numberSubClusters,errors);
+    }
+
+    // Otherwise, prepare lwtnn input map and use new networks.
+    NnClusterizationFactory::InputMap nnInputData = flattenInput(input);
+    return estimatePositionsLWTNN(nnInputData,input,pCluster,numberSubClusters,errors);
 
-    return estimatePositions(**nn_collection, inputData,input,pCluster,sizeX,sizeY,numberSubClusters,errors);
   }
 
-  std::vector<Amg::Vector2D> NnClusterizationFactory::estimatePositions(const TTrainedNetworkCollection &nn_collection,
-                                                                        std::vector<double> inputData,
-                                                                        const NNinput& input,
-                                                                        const InDet::PixelCluster& pCluster,
-                                                                        int sizeX,
-                                                                        int sizeY,
-                                                                        int numberSubClusters,
-                                                                        std::vector<Amg::MatrixX> & errors) const
+  std::vector<Amg::Vector2D> NnClusterizationFactory::estimatePositionsTTN(
+                                                const TTrainedNetworkCollection &nn_collection,
+                                                std::vector<double> inputData,
+                                                const NNinput& input,
+                                                const InDet::PixelCluster& pCluster,
+                                                int sizeX,
+                                                int sizeY,
+                                                int numberSubClusters,
+                                                std::vector<Amg::MatrixX> & errors) const
   {
+
     bool applyRecentering=(!input.useTrackInfo && m_useRecenteringNNWithouTracks)  || (input.useTrackInfo && m_useRecenteringNNWithTracks);
 
     std::vector<Amg::Vector2D> allPositions;
@@ -432,8 +484,8 @@ namespace InDet {
 
       assert( position1P.size() % 2 == 0);
       for (unsigned int i=0; i<position1P.size()/2 ; ++i) {
-        ATH_MSG_VERBOSE(" RAW Estimated positions (" << i << ") x: " << back_posX(position1P[0+i*2],applyRecentering) << " y: " << back_posY(position1P[1+i*2]));
-        ATH_MSG_VERBOSE(" Estimated myPositions ("   << i << ") x: " << myPosition1[i][Trk::locX] << " y: " << myPosition1[i][Trk::locY]);
+        ATH_MSG_DEBUG(" Original RAW Estimated positions (" << i << ") x: " << back_posX(position1P[0+i*2],applyRecentering) << " y: " << back_posY(position1P[1+i*2]));
+        ATH_MSG_DEBUG(" Original estimated myPositions ("   << i << ") x: " << myPosition1[i][Trk::locX] << " y: " << myPosition1[i][Trk::locY]);
       }
 
       std::vector<double> inputDataNew=inputData;
@@ -462,7 +514,99 @@ namespace InDet {
     return allPositions;
   }
 
+  std::vector<Amg::Vector2D> NnClusterizationFactory::estimatePositionsLWTNN(
+                                                                NnClusterizationFactory::InputMap & input, 
+                                                                NNinput& rawInput,
+                                                                const InDet::PixelCluster& pCluster,
+                                                                int numberSubClusters,
+                                                                std::vector<Amg::MatrixX> & errors) const 
+    {
+    
+    SG::ReadCondHandle<LWTNNCollection> lwtnn_collection(m_readKeyJSON) ;
+    if (!lwtnn_collection.isValid()) {
+      std::stringstream msg; msg << "Failed to get LWTNN network collection with key " << m_readKeyJSON.key();
+      throw std::runtime_error( msg.str() );      
+    }
+
+    // Need to evaluate the correct network once per cluster we're interested in.
+    // Save the output
+    std::vector<double> positionValues;
+    std::vector<Amg::MatrixX> errorMatrices;
+    for (int cluster = 1; cluster < numberSubClusters+1; cluster++) {
+
+      // Check that the network is defined. 
+      // If not, we are outside an IOV and should fail
+      if (not lwtnn_collection->at(numberSubClusters)) {
+        std::stringstream msg; msg << "No lwtnn network configured for this run! If you are outside the valid range for lwtnn-based configuration, plesae run with useNNTTrainedNetworks instead." << m_readKeyJSON.key();
+        throw std::runtime_error( msg.str() );
+      }
+
+      std::string outNodeName = "merge_"+std::to_string(cluster);
+      std::map<std::string, double> position = lwtnn_collection->at(numberSubClusters)->compute(input, {},outNodeName);
+
+      ATH_MSG_DEBUG("Testing for numberSubClusters " << numberSubClusters << " and cluster " << cluster);
+      for (auto item : position) {
+        ATH_MSG_DEBUG(item.first << ": " << item.second);
+      }
+      positionValues.push_back(position["mean_x"]);
+      positionValues.push_back(position["mean_y"]);
+
+      // Fill errors.
+      // Values returned by NN are inverse of variance, and we want variances.
+      float rawRmsX = sqrt(1.0/position["prec_x"]);
+      float rawRmsY = sqrt(1.0/position["prec_y"]);
+      // Now convert to real space units
+      double rmsX = correctedRMSX(rawRmsX);
+      double rmsY = correctedRMSY(rawRmsY, 7., rawInput.vectorOfPitchesY);
+      ATH_MSG_DEBUG(" Estimated RMS errors (1) x: " << rmsX << ", y: " << rmsY);  
+
+      // Fill matrix    
+      Amg::MatrixX erm(2,2);
+      erm.setZero();
+      erm(0,0)=rmsX*rmsX;
+      erm(1,1)=rmsY*rmsY;
+      errorMatrices.push_back(erm); 
+
+    }
+
+    std::vector<Amg::Vector2D> myPositions = getPositionsFromOutput(positionValues,rawInput,pCluster);
+    ATH_MSG_DEBUG(" Estimated myPositions (1) x: " << myPositions[0][Trk::locX] << " y: " << myPositions[0][Trk::locY]);
+    
+    for (unsigned int index = 0; index < errorMatrices.size(); index++) errors.push_back(errorMatrices.at(index));
+
+    return myPositions;
+
+  }
+
+  double NnClusterizationFactory::correctedRMSX(double posPixels) const
+  {
+
+    // This gives location in pixels
+    double pitch = 0.05;
+    double corrected = posPixels * pitch;
+
+    return corrected;
+  }
+
+  double NnClusterizationFactory::correctedRMSY(double posPixels,
+         double sizeY,
+        std::vector<float>& pitches) const
+  {
+    double p = posPixels + (sizeY - 1) / 2.0;
+    double p_Y = -100;
+    double p_center = -100;
+    double p_actual = 0;
+
+    for (int i = 0; i < sizeY; i++) {
+      if (p >= i && p <= (i + 1))
+        p_Y = p_actual + (p - i + 0.5) * pitches.at(i);
+      if (i == (sizeY - 1) / 2)
+        p_center = p_actual + 0.5 * pitches.at(i);
+      p_actual += pitches.at(i);
+    }
 
+    return abs(p_Y - p_center);
+  }  
 
   void NnClusterizationFactory::getErrorMatrixFromOutput(std::vector<double>& outputX,
                                                          std::vector<double>& outputY,
diff --git a/InnerDetector/InDetRecTools/SiClusterizationTool/src/components/SiClusterizationTool_entries.cxx b/InnerDetector/InDetRecTools/SiClusterizationTool/src/components/SiClusterizationTool_entries.cxx
index 19e4588a84fb29fe994d4aee4818a3831c6a02fc..c6f4dc085f7b7d492ad492565b9029fc8010e053 100644
--- a/InnerDetector/InDetRecTools/SiClusterizationTool/src/components/SiClusterizationTool_entries.cxx
+++ b/InnerDetector/InDetRecTools/SiClusterizationTool/src/components/SiClusterizationTool_entries.cxx
@@ -10,7 +10,7 @@
 #include "SiClusterizationTool/TruthPixelClusterSplitter.h"
 #include "SiClusterizationTool/TruthClusterizationFactory.h"
 #include "SiClusterizationTool/TruthPixelClusterSplitProbTool.h"
-
+#include "../LWTNNCondAlg.h"
 #include "../TTrainedNetworkCondAlg.h"
 
 DECLARE_COMPONENT( InDet::MergedPixelsTool )
@@ -21,6 +21,7 @@ DECLARE_COMPONENT( InDet::TotPixelClusterSplitter )
 DECLARE_COMPONENT( InDet::NnPixelClusterSplitter )
 DECLARE_COMPONENT( InDet::NnClusterizationFactory )
 DECLARE_COMPONENT( InDet::TTrainedNetworkCondAlg )
+DECLARE_COMPONENT( InDet::LWTNNCondAlg )
 DECLARE_COMPONENT( InDet::NnPixelClusterSplitProbTool )
 DECLARE_COMPONENT( InDet::TruthPixelClusterSplitter )
 DECLARE_COMPONENT( InDet::TruthClusterizationFactory )
diff --git a/InnerDetector/InDetRecTools/SiCombinatorialTrackFinderTool_xk/src/SiCombinatorialTrackFinder_xk.cxx b/InnerDetector/InDetRecTools/SiCombinatorialTrackFinderTool_xk/src/SiCombinatorialTrackFinder_xk.cxx
index aa95b7edc00cf1eb3ab8a2e9cb26ed1b2a9d6801..75e10775baa53f072d58fd328c9e70329f4cd3ad 100644
--- a/InnerDetector/InDetRecTools/SiCombinatorialTrackFinderTool_xk/src/SiCombinatorialTrackFinder_xk.cxx
+++ b/InnerDetector/InDetRecTools/SiCombinatorialTrackFinderTool_xk/src/SiCombinatorialTrackFinder_xk.cxx
@@ -283,7 +283,15 @@ void InDet::SiCombinatorialTrackFinder_xk::newEvent(const EventContext& ctx, SiC
 void InDet::SiCombinatorialTrackFinder_xk::newEvent
 (const EventContext& ctx, SiCombinatorialTrackFinderData_xk& data, Trk::TrackInfo info, const TrackQualityCuts& Cuts) const
 {
-  if (not data.isInitialized()) initializeCombinatorialData(ctx, data);
+  
+  if (not data.isInitialized()) {
+    //Check if to use PRDAssociation before initializing all the tools
+    int useasso;
+    if(!Cuts.getIntCut   ("UseAssociationTool"  ,useasso      )) useasso = 0;
+    data.tools().setAssociation(useasso);
+
+    initializeCombinatorialData(ctx, data);
+  }
 
   newEvent(ctx, data);
   data.trackinfo() = info;
diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/CMakeLists.txt b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/CMakeLists.txt
index d610f999664d6ed90183a061fa945e6f7dba8bdf..06f807baf05aa72fda842aaed4d8a2af773b11ad 100644
--- a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/CMakeLists.txt
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/CMakeLists.txt
@@ -25,17 +25,20 @@ atlas_depends_on_subdirs(
    Event/xAOD/xAODTracking
    PRIVATE
    Event/xAOD/xAODEventInfo
+   Tools/PathResolver
    ${extra_deps} )
 
 # External dependencies:
 find_package( ROOT COMPONENTS Core Hist RIO )
+find_package( lwtnn REQUIRED )
 
 # Libraries in the package:
 atlas_add_library( TrackVertexAssociationToolLib
    Root/*.cxx
    PUBLIC_HEADERS TrackVertexAssociationTool
-   LINK_LIBRARIES AthContainers AthLinks AsgTools xAODCore xAODTracking AsgDataHandlesLib
-   PRIVATE_LINK_LIBRARIES xAODEventInfo )
+   INCLUDE_DIRS ${LWTNN_INCLUDE_DIRS}
+   LINK_LIBRARIES AthContainers AthLinks AsgTools xAODCore xAODTracking AsgDataHandlesLib ${LWTNN_LIBRARIES}
+   PRIVATE_LINK_LIBRARIES xAODEventInfo PathResolver )
 
 if( NOT XAOD_STANDALONE )
    atlas_add_component( TrackVertexAssociationTool
diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVAInputEvaluator.cxx b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVAInputEvaluator.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..a2742eb20f70228b3cb280b6948ad79efc20ed17
--- /dev/null
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVAInputEvaluator.cxx
@@ -0,0 +1,450 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "TrackVertexAssociationTool/MVAInputEvaluator.h"
+
+#include "AthLinks/ElementLink.h"
+
+#include "xAODTracking/TrackParticleContainer.h"
+#include "xAODTracking/TrackParticlexAODHelpers.h"
+#include "xAODTracking/Vertex.h"
+
+#include <cmath>
+#include <stdexcept>
+#include <vector>
+
+// Private
+namespace {
+
+using MiniEvaluator = CP::MVAInputEvaluator::MiniEvaluator;
+
+class Pt: public MiniEvaluator {
+public:
+  Pt() {};
+  ~Pt() override final {};
+  float eval(const xAOD::TrackParticle& trk, __attribute__((unused)) const xAOD::Vertex& vx, __attribute__((unused)) const xAOD::EventInfo& evt) const override final {
+    return trk.pt();
+  }
+};
+
+class Eta: public MiniEvaluator {
+public:
+  Eta() {};
+  ~Eta() override final {};
+  float eval(const xAOD::TrackParticle& trk, __attribute__((unused)) const xAOD::Vertex& vx, __attribute__((unused)) const xAOD::EventInfo& evt) const override final {
+    return trk.eta();
+  }
+};
+
+class M: public MiniEvaluator {
+public:
+  M() {};
+  ~M() override final {};
+  float eval(const xAOD::TrackParticle& trk, __attribute__((unused)) const xAOD::Vertex& vx, __attribute__((unused)) const xAOD::EventInfo& evt) const override final {
+    return trk.m();
+  }
+};
+
+class D0: public MiniEvaluator {
+public:
+  D0() {};
+  ~D0() override final {};
+  float eval(const xAOD::TrackParticle& trk, __attribute__((unused)) const xAOD::Vertex& vx, __attribute__((unused)) const xAOD::EventInfo& evt) const override final {
+    return trk.d0();
+  }
+};
+
+class ErrD0: public MiniEvaluator {
+public:
+  ErrD0() {};
+  ~ErrD0() override final {};
+  float eval(const xAOD::TrackParticle& trk, __attribute__((unused)) const xAOD::Vertex& vx, __attribute__((unused)) const xAOD::EventInfo& evt) const override final {
+    return std::sqrt(trk.definingParametersCovMatrix()(0, 0));
+  }
+};
+
+class Z0: public MiniEvaluator {
+public:
+  Z0() {};
+  ~Z0() override final {};
+  float eval(const xAOD::TrackParticle& trk, __attribute__((unused)) const xAOD::Vertex& vx, __attribute__((unused)) const xAOD::EventInfo& evt) const override final {
+    return trk.z0();
+  }
+};
+
+class ErrZ0: public MiniEvaluator {
+public:
+  ErrZ0() {};
+  ~ErrZ0() override final {};
+  float eval(const xAOD::TrackParticle& trk, __attribute__((unused)) const xAOD::Vertex& vx, __attribute__((unused)) const xAOD::EventInfo& evt) const override final {
+    return std::sqrt(trk.definingParametersCovMatrix()(1, 1));
+  }
+};
+
+class Phi: public MiniEvaluator {
+public:
+  Phi() {};
+  ~Phi() override final {};
+  float eval(const xAOD::TrackParticle& trk, __attribute__((unused)) const xAOD::Vertex& vx, __attribute__((unused)) const xAOD::EventInfo& evt) const override final {
+    return trk.phi();
+  }
+};
+
+class ErrPhi: public MiniEvaluator {
+public:
+  ErrPhi() {};
+  ~ErrPhi() override final {};
+  float eval(const xAOD::TrackParticle& trk, __attribute__((unused)) const xAOD::Vertex& vx, __attribute__((unused)) const xAOD::EventInfo& evt) const override final {
+    return std::sqrt(trk.definingParametersCovMatrix()(2, 2));
+  }
+};
+
+class Theta: public MiniEvaluator {
+public:
+  Theta() {};
+  ~Theta() override final {};
+  float eval(const xAOD::TrackParticle& trk, __attribute__((unused)) const xAOD::Vertex& vx, __attribute__((unused)) const xAOD::EventInfo& evt) const override final {
+    return trk.theta();
+  }
+};
+
+class ErrTheta: public MiniEvaluator {
+public:
+  ErrTheta() {};
+  ~ErrTheta() override final {};
+  float eval(const xAOD::TrackParticle& trk, __attribute__((unused)) const xAOD::Vertex& vx, __attribute__((unused)) const xAOD::EventInfo& evt) const override final {
+    return std::sqrt(trk.definingParametersCovMatrix()(3, 3));
+  }
+};
+
+class QOverP: public MiniEvaluator {
+public:
+  QOverP() {};
+  ~QOverP() override final {};
+  float eval(const xAOD::TrackParticle& trk, __attribute__((unused)) const xAOD::Vertex& vx, __attribute__((unused)) const xAOD::EventInfo& evt) const override final {
+    return trk.qOverP();
+  }
+};
+
+class ErrQOverP: public MiniEvaluator {
+public:
+  ErrQOverP() {};
+  ~ErrQOverP() override final {};
+  float eval(const xAOD::TrackParticle& trk, __attribute__((unused)) const xAOD::Vertex& vx, __attribute__((unused)) const xAOD::EventInfo& evt) const override final {
+    return std::sqrt(trk.definingParametersCovMatrix()(4, 4));
+  }
+};
+
+class ChiSq: public MiniEvaluator {
+public:
+  ChiSq() {};
+  ~ChiSq() override final {};
+  float eval(const xAOD::TrackParticle& trk, __attribute__((unused)) const xAOD::Vertex& vx, __attribute__((unused)) const xAOD::EventInfo& evt) const override final {
+    return trk.chiSquared();
+  }
+};
+
+class RedChiSq: public MiniEvaluator {
+public:
+  RedChiSq() {};
+  ~RedChiSq() override final {};
+  float eval(const xAOD::TrackParticle& trk, __attribute__((unused)) const xAOD::Vertex& vx, __attribute__((unused)) const xAOD::EventInfo& evt) const override final {
+    return (trk.chiSquared() / trk.numberDoF());
+  }
+};
+
+class D0Sig: public MiniEvaluator {
+public:
+  D0Sig() {};
+  ~D0Sig() override final {};
+  float eval(const xAOD::TrackParticle& trk, __attribute__((unused)) const xAOD::Vertex& vx, const xAOD::EventInfo& evt) const override final {
+    return xAOD::TrackingHelpers::d0significance(&trk, evt.beamPosSigmaX(), evt.beamPosSigmaY(), evt.beamPosSigmaXY());
+  }
+};
+
+class DZ: public MiniEvaluator {
+public:
+  DZ() {};
+  ~DZ() override final {};
+  float eval(const xAOD::TrackParticle& trk, const xAOD::Vertex& vx, __attribute__((unused)) const xAOD::EventInfo& evt) const override final {
+    return (trk.z0() + trk.vz() - vx.z());
+  }
+};
+
+class ErrDZ: public MiniEvaluator {
+public:
+  ErrDZ() {};
+  ~ErrDZ() override final {};
+  float eval(const xAOD::TrackParticle& trk, const xAOD::Vertex& vx, __attribute__((unused)) const xAOD::EventInfo& evt) const override final {
+    return std::sqrt(trk.definingParametersCovMatrix()(1, 1) + vx.covariancePosition()(2, 2));
+  }
+};
+
+class DZSinTheta: public MiniEvaluator {
+public:
+  DZSinTheta() {};
+  ~DZSinTheta() override final {};
+  float eval(const xAOD::TrackParticle& trk, const xAOD::Vertex& vx, __attribute__((unused)) const xAOD::EventInfo& evt) const override final {
+    return (trk.z0() + trk.vz() - vx.z()) * std::sin(trk.theta());
+  }
+};
+
+class ErrDZSinTheta: public MiniEvaluator {
+public:
+  ErrDZSinTheta() {};
+  ~ErrDZSinTheta() override final {};
+  float eval(const xAOD::TrackParticle& trk, const xAOD::Vertex& vx, __attribute__((unused)) const xAOD::EventInfo& evt) const override final {
+    float dz         = (trk.z0() + trk.vz() - vx.z());
+    float sinTheta   = std::sin(trk.theta());
+    float cosTheta   = std::cos(trk.theta());
+    float errSqDZ    = trk.definingParametersCovMatrix()(1, 1) + vx.covariancePosition()(2, 2);
+    float errSqTheta = trk.definingParametersCovMatrix()(3, 3);
+    float covZ0Theta = trk.definingParametersCovMatrix()(1, 3);
+    return std::sqrt(errSqDZ * std::pow(sinTheta, 2) + std::pow(dz * cosTheta, 2) * errSqTheta + 2 * sinTheta * dz * cosTheta * covZ0Theta);
+  }
+};
+
+std::vector<const xAOD::TrackParticle*> toVector(const std::vector<ElementLink<xAOD::TrackParticleContainer>>& inTrks) {
+  std::vector<const xAOD::TrackParticle*> outTrks;
+  for (const auto& trkLink : inTrks) {
+    if (trkLink.isValid()) {
+      outTrks.push_back((const xAOD::TrackParticle*)(*trkLink));
+    }
+  }
+  return outTrks;
+}
+
+int inVector(const xAOD::TrackParticle* trk, const std::vector<const xAOD::TrackParticle*>& vec) {
+  int i = 0;
+  for (const auto& ele : vec) {
+    if (trk == ele) {
+      return i;
+    }
+    i++;
+  }
+  return -1;
+}
+
+class FitWeight: public MiniEvaluator {
+public:
+  FitWeight() {};
+  ~FitWeight() override final {};
+  float eval(const xAOD::TrackParticle& trk, const xAOD::Vertex& vx, __attribute__((unused)) const xAOD::EventInfo& evt) const override final {
+    std::vector<const xAOD::TrackParticle*> fitTrks = toVector(vx.trackParticleLinks());
+    float weight = 0.0;
+    int pos = inVector(&trk, fitTrks);
+    if (pos != -1) {
+      weight = vx.trackWeights().at(pos);
+    }
+    return weight;
+  }
+};
+
+class VxX: public MiniEvaluator {
+public:
+  VxX() {};
+  ~VxX() override final {};
+  float eval(__attribute__((unused)) const xAOD::TrackParticle& trk, const xAOD::Vertex& vx, __attribute__((unused)) const xAOD::EventInfo& evt) const override final {
+    return vx.x();
+  }
+};
+
+class ErrVxX: public MiniEvaluator {
+public:
+  ErrVxX() {};
+  ~ErrVxX() override final {};
+  float eval(__attribute__((unused)) const xAOD::TrackParticle& trk, const xAOD::Vertex& vx, __attribute__((unused)) const xAOD::EventInfo& evt) const override final {
+    return std::sqrt(vx.covariancePosition()(0, 0));
+  }
+};
+
+class VxY: public MiniEvaluator {
+public:
+  VxY() {};
+  ~VxY() override final {};
+  float eval(__attribute__((unused)) const xAOD::TrackParticle& trk, const xAOD::Vertex& vx, __attribute__((unused)) const xAOD::EventInfo& evt) const override final {
+    return vx.y();
+  }
+};
+
+class ErrVxY: public MiniEvaluator {
+public:
+  ErrVxY() {};
+  ~ErrVxY() override final {};
+  float eval(__attribute__((unused)) const xAOD::TrackParticle& trk, const xAOD::Vertex& vx, __attribute__((unused)) const xAOD::EventInfo& evt) const override final {
+    return std::sqrt(vx.covariancePosition()(1, 1));
+  }
+};
+
+class VxZ: public MiniEvaluator {
+public:
+  VxZ() {};
+  ~VxZ() override final {};
+  float eval(__attribute__((unused)) const xAOD::TrackParticle& trk, const xAOD::Vertex& vx, __attribute__((unused)) const xAOD::EventInfo& evt) const override final {
+    return vx.z();
+  }
+};
+
+class ErrVxZ: public MiniEvaluator {
+public:
+  ErrVxZ() {};
+  ~ErrVxZ() override final {};
+  float eval(__attribute__((unused)) const xAOD::TrackParticle& trk, const xAOD::Vertex& vx, __attribute__((unused)) const xAOD::EventInfo& evt) const override final {
+    return std::sqrt(vx.covariancePosition()(2, 2));
+  }
+};
+
+} // namespace
+
+namespace CP {
+
+MVAInputEvaluator::~MVAInputEvaluator() {
+  clear();
+}
+
+void MVAInputEvaluator::add(const std::string& name, const MVAInputEvaluator::Input& type) {
+  using Input = MVAInputEvaluator::Input;
+  for (const auto& kv : m_evalMap) {
+    if (name == kv.first) {
+      throw std::runtime_error("ERROR in CP::MVAInputEvaluator::add : input name is already present in map: " + name);
+    }
+  }
+  switch (type) {
+    case Input::Pt: {
+      m_evalMap[name] = std::make_unique<::Pt>(::Pt());
+      break;
+    }
+    case Input::Eta: {
+      m_evalMap[name] = std::make_unique<::Eta>(::Eta());
+      break;
+    }
+    case Input::M: {
+      m_evalMap[name] = std::make_unique<::M>(::M());
+      break;
+    }
+    case Input::D0: {
+      m_evalMap[name] = std::make_unique<::D0>(::D0());
+      break;
+    }
+    case Input::ErrD0: {
+      m_evalMap[name] = std::make_unique<::ErrD0>(::ErrD0());
+      break;
+    }
+    case Input::Z0: {
+      m_evalMap[name] = std::make_unique<::Z0>(::Z0());
+      break;
+    }
+    case Input::ErrZ0: {
+      m_evalMap[name] = std::make_unique<::ErrZ0>(::ErrZ0());
+      break;
+    }
+    case Input::Phi: {
+      m_evalMap[name] = std::make_unique<::Phi>(::Phi());
+      break;
+    }
+    case Input::ErrPhi: {
+      m_evalMap[name] = std::make_unique<::ErrPhi>(::ErrPhi());
+      break;
+    }
+    case Input::Theta: {
+      m_evalMap[name] = std::make_unique<::Theta>(::Theta());
+      break;
+    }
+    case Input::ErrTheta: {
+      m_evalMap[name] = std::make_unique<::ErrTheta>(::ErrTheta());
+      break;
+    }
+    case Input::QOverP: {
+      m_evalMap[name] = std::make_unique<::QOverP>(::QOverP());
+      break;
+    }
+    case Input::ErrQOverP: {
+      m_evalMap[name] = std::make_unique<::ErrQOverP>(::ErrQOverP());
+      break;
+    }
+    case Input::ChiSq: {
+      m_evalMap[name] = std::make_unique<::ChiSq>(::ChiSq());
+      break;
+    }
+    case Input::RedChiSq: {
+      m_evalMap[name] = std::make_unique<::RedChiSq>(::RedChiSq());
+      break;
+    }
+    case Input::D0Sig: {
+      m_evalMap[name] = std::make_unique<::D0Sig>(::D0Sig());
+      break;
+    }
+    case Input::DZ: {
+      m_evalMap[name] = std::make_unique<::DZ>(::DZ());
+      break;
+    }
+    case Input::ErrDZ: {
+      m_evalMap[name] = std::make_unique<::ErrDZ>(::ErrDZ());
+      break;
+    }
+    case Input::DZSinTheta: {
+      m_evalMap[name] = std::make_unique<::DZSinTheta>(::DZSinTheta());
+      break;
+    }
+    case Input::ErrDZSinTheta: {
+      m_evalMap[name] = std::make_unique<::ErrDZSinTheta>(::ErrDZSinTheta());
+      break;
+    }
+    case Input::FitWeight: {
+      m_evalMap[name] = std::make_unique<::FitWeight>(::FitWeight());
+      break;
+    }
+    case Input::VxX: {
+      m_evalMap[name] = std::make_unique<::VxX>(::VxX());
+      break;
+    }
+    case Input::ErrVxX: {
+      m_evalMap[name] = std::make_unique<::ErrVxX>(::ErrVxX());
+      break;
+    }
+    case Input::VxY: {
+      m_evalMap[name] = std::make_unique<::VxY>(::VxY());
+      break;
+    }
+    case Input::ErrVxY: {
+      m_evalMap[name] = std::make_unique<::ErrVxY>(::ErrVxY());
+      break;
+    }
+    case Input::VxZ: {
+      m_evalMap[name] = std::make_unique<::VxZ>(::VxZ());
+      break;
+    }
+    case Input::ErrVxZ: {
+      m_evalMap[name] = std::make_unique<::ErrVxZ>(::ErrVxZ());
+      break;
+    }
+    default: {
+      throw std::runtime_error("ERROR in CP::MVAInputEvaluator::add : unknown input enum: " + std::to_string(type));
+    }
+  }
+  return;
+}
+
+void MVAInputEvaluator::load(const MVAInputEvaluator::InputSelectionMap& selection) {
+  clear();
+  for (const auto& kv : selection) {
+    add(kv.first, kv.second);
+  }
+  return;
+}
+
+void MVAInputEvaluator::eval(const xAOD::TrackParticle& trk, const xAOD::Vertex& vx, const xAOD::EventInfo& evt, std::map<std::string, double>& input) const {
+  input.clear();
+  for (const auto& kv : m_evalMap) {
+    input[kv.first] = kv.second->eval(trk, vx, evt);
+  }
+  return;
+}
+
+void MVAInputEvaluator::clear() {
+  m_evalMap.clear();
+  return;
+}
+
+} // namespace CP
diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVATrackVertexAssociationTool.cxx b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVATrackVertexAssociationTool.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..3c7563ab8dce30872b895fbdeccb1b1cb38b3324
--- /dev/null
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/Root/MVATrackVertexAssociationTool.cxx
@@ -0,0 +1,282 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "TrackVertexAssociationTool/MVATrackVertexAssociationTool.h"
+
+#include "AsgDataHandles/ReadHandle.h"
+#include "xAODTracking/TrackParticle.h"
+#include "xAODTracking/TrackParticleContainer.h"
+#include "xAODTracking/Vertex.h"
+#include "xAODTracking/VertexContainer.h"
+#include "xAODTracking/TrackingPrimitives.h"
+
+#include "PathResolver/PathResolver.h"
+
+#include "lwtnn/NNLayerConfig.hh"
+#include "lwtnn/parse_json.hh"
+
+#include <fstream>
+#include <iterator>
+#include <stdexcept>
+
+namespace CP {
+
+MVATrackVertexAssociationTool::MVATrackVertexAssociationTool(const std::string& name) :
+  AsgTool(name)
+{
+  // For AnalysisBase
+  #ifdef XAOD_STANDALONE
+  declareProperty("NetworkFileName", m_fileName,        "Name of the input lwtnn network file."                                                              );
+  declareProperty("InputNames",      m_inputNames,      "Vector of the network's input variable names (std::vector<std::string>)."                           );
+  declareProperty("InputTypes",      m_inputTypes,      "Vector of the network's input variable evaluator types (std::vector<CP::MVAEvaluatorInput::Input>).");
+  declareProperty("OutputNodeName",  m_outputName,      "Name of the output node to cut on for TVA."                                                         );
+  declareProperty("IsSequential",    m_isSequential,    "Is the network sequential (true) or functional (false)."                                            );
+  declareProperty("WorkingPoint",    m_wp,              "TVA working point to apply."                                                                        );
+  declareProperty("OutputCut",       m_cut,             "TVA cut value on the output value (set manually with \"Custom\" WP)."                               );
+  declareProperty("UsePathResolver", m_usePathResolver, "Use the PathResolver for finding the input lwtnn network file."                                     );
+  #endif
+}
+
+StatusCode MVATrackVertexAssociationTool::initialize() {
+
+  ATH_MSG_INFO("Initializing MVATrackVertexAssociationTool.");
+
+  // Init EventInfo
+  ATH_CHECK(m_eventInfo.initialize());
+
+  // Init network
+  StatusCode initNetworkStatus = initializeNetwork();
+  if (initNetworkStatus != StatusCode::SUCCESS) {
+    return initNetworkStatus;
+  }
+
+  // Map our working point to a cut on the MVA output discriminant
+  if (m_wp == "Tight") {
+    m_cut = 0.85;
+  }
+  else if (m_wp == "Custom") {
+    // Nothing to do here
+  }
+  else {
+    ATH_MSG_ERROR("Invalid TVA working point \"" << m_wp << "\" - for a custom configuration, please provide \"Custom\" for the \"WorkingPoint\" property.");
+    return StatusCode::FAILURE;
+  }
+
+  // Some extra printout for Custom
+  if (m_wp == "Custom") {
+    ATH_MSG_INFO("TVA working point \"Custom\" provided - tool properties are initialized to default values unless explicitly set by the user.");
+  }
+  else {
+    ATH_MSG_INFO("TVA working point \"" << m_wp << "\" provided - tool properties have been configured accordingly.");
+  }
+
+  ATH_MSG_INFO("Cut on MVA output discriminant: " << m_cut);
+
+  return StatusCode::SUCCESS;
+}
+
+// For Athena
+#ifndef XAOD_STANDALONE
+StatusCode MVATrackVertexAssociationTool::finalize() {
+  ATH_MSG_INFO("Finalizing MVATrackVertexAssociationTool.");
+  return StatusCode::SUCCESS;
+}
+#endif
+
+bool MVATrackVertexAssociationTool::isCompatible(const xAOD::TrackParticle& trk, const xAOD::Vertex& vx) const {
+  float mvaOutput;
+  return isMatch(trk, vx, mvaOutput);
+}
+
+xAOD::TrackVertexAssociationMap MVATrackVertexAssociationTool::getMatchMap(std::vector<const xAOD::TrackParticle*>& trk_list, std::vector<const xAOD::Vertex*>& vx_list) const {
+  return getMatchMapInternal(trk_list, vx_list);
+}
+
+xAOD::TrackVertexAssociationMap MVATrackVertexAssociationTool::getMatchMap(const xAOD::TrackParticleContainer& trkCont, const xAOD::VertexContainer& vxCont) const {
+  return getMatchMapInternal(trkCont, vxCont);
+}
+
+const xAOD::Vertex* MVATrackVertexAssociationTool::getUniqueMatchVertex(const xAOD::TrackParticle& trk, std::vector<const xAOD::Vertex*>& vx_list) const {
+  return getUniqueMatchVertexInternal(trk, vx_list);
+}
+
+ElementLink<xAOD::VertexContainer> MVATrackVertexAssociationTool::getUniqueMatchVertexLink(const xAOD::TrackParticle& trk, const xAOD::VertexContainer& vxCont) const {
+  ElementLink<xAOD::VertexContainer> vx_link_tmp;
+  const xAOD::Vertex* vx_tmp = getUniqueMatchVertexInternal(trk, vxCont);
+  if (vx_tmp) {
+    vx_link_tmp.toContainedElement(vxCont, vx_tmp);
+  }
+  return vx_link_tmp;
+}
+
+xAOD::TrackVertexAssociationMap MVATrackVertexAssociationTool::getUniqueMatchMap(std::vector<const xAOD::TrackParticle*>& trk_list, std::vector<const xAOD::Vertex*>& vx_list) const {
+  return getUniqueMatchMapInternal(trk_list, vx_list);
+}
+
+xAOD::TrackVertexAssociationMap MVATrackVertexAssociationTool::getUniqueMatchMap(const xAOD::TrackParticleContainer& trkCont, const xAOD::VertexContainer& vxCont) const {
+  return getUniqueMatchMapInternal(trkCont, vxCont);
+}
+
+// --------------- //
+// Private methods //
+// --------------- //
+
+bool MVATrackVertexAssociationTool::isMatch(const xAOD::TrackParticle& trk, const xAOD::Vertex& vx, float& mvaOutput) const {
+
+  // Fake vertex, return false
+  if (vx.vertexType() == xAOD::VxType::NoVtx) {
+    return false;
+  }
+
+  // Retrieve our EventInfo
+  SG::ReadHandle<xAOD::EventInfo> evt(m_eventInfo);
+  if (!evt.isValid()) {
+    throw std::runtime_error("ERROR in CP::MVATrackVertexAssociationTool::isMatch : could not retrieve xAOD::EventInfo.");
+  }
+
+  // Evaluate our network and compare against our TVA cut (">= cut" := associated)
+  mvaOutput = this->evaluateNetwork(trk, vx, *evt);
+  return (mvaOutput >= m_cut);
+}
+
+template <typename T, typename V>
+xAOD::TrackVertexAssociationMap MVATrackVertexAssociationTool::getMatchMapInternal(const T& trk_list, const V& vx_list) const {
+
+  xAOD::TrackVertexAssociationMap trktovxmap;
+
+  for (const auto& vertex : vx_list) {
+    xAOD::TrackVertexAssociationList trktovxlist;
+    trktovxlist.reserve(100);
+    for (const auto& track : trk_list) {
+      if (isCompatible(*track, *vertex)) {
+        trktovxlist.push_back(track);
+      }
+    }
+    trktovxmap[vertex] = trktovxlist;
+  }
+
+  return trktovxmap;
+}
+
+template <typename T>
+const xAOD::Vertex* MVATrackVertexAssociationTool::getUniqueMatchVertexInternal(const xAOD::TrackParticle& trk, const T& vx_list) const {
+
+  bool match;
+  float mvaOutput;
+  float maxValue = -1.0; // MVA output ranges between 0 and 1
+  const xAOD::Vertex* bestMatchVertex = nullptr;
+
+  for (const auto& vertex : vx_list) {
+    match = isMatch(trk, *vertex, mvaOutput);
+    if (match && (maxValue < mvaOutput)) {
+      maxValue = mvaOutput;
+      bestMatchVertex = vertex;
+    }
+  }
+
+  // check if get the matched Vertex, for the tracks not used in vertex fit
+  if (!bestMatchVertex) {
+    ATH_MSG_DEBUG("Could not find any matched vertex for this track.");
+  }
+
+  return bestMatchVertex;
+}
+
+template <typename T, typename V>
+xAOD::TrackVertexAssociationMap MVATrackVertexAssociationTool::getUniqueMatchMapInternal(const T& trk_list, const V& vx_list) const {
+
+  xAOD::TrackVertexAssociationMap trktovxmap;
+
+  // Initialize map
+  for (const auto& vertex : vx_list) {
+    xAOD::TrackVertexAssociationList trktovxlist;
+    trktovxlist.clear();
+    trktovxmap[vertex] = trktovxlist;
+  }
+
+  // Perform matching
+  for (const auto& track : trk_list) {
+    const xAOD::Vertex* vx_match = getUniqueMatchVertexInternal(*track, vx_list);
+    if (vx_match) {
+      // Found matched vertex
+      trktovxmap[vx_match].push_back(track);
+    }
+  }
+
+  return trktovxmap;
+}
+
+StatusCode MVATrackVertexAssociationTool::initializeNetwork() {
+
+  // Load our input evaluator
+  if (m_inputNames.size() != m_inputTypes.size()) {
+    ATH_MSG_ERROR("Size of input variable names (" + std::to_string(m_inputNames.size()) + ") does not equal size of input variable types (" + std::to_string(m_inputTypes.size()) + ").");
+    return StatusCode::FAILURE;
+  }
+  m_inputMap.clear();
+  for (size_t i = 0; i < m_inputNames.size(); i++) {
+    m_inputMap[m_inputNames[i]] = static_cast<MVAInputEvaluator::Input>(m_inputTypes[i]);
+  }
+  m_inputEval.load(m_inputMap);
+
+  // Load our input file
+  std::string fileName; 
+  if (m_usePathResolver) {
+    fileName = PathResolverFindCalibFile(m_fileName);
+    if (fileName.empty()) {
+      ATH_MSG_ERROR("Could not find input network file: " + m_fileName);
+      return StatusCode::FAILURE;
+    }
+  }
+  else {
+    fileName = m_fileName;
+  }
+  std::ifstream netFile(fileName);
+  if (!netFile) {
+    ATH_MSG_ERROR("Could not properly open input network file: " + fileName);
+    return StatusCode::FAILURE;
+  }
+
+  // For sequential:
+  if (m_isSequential) {
+    lwt::JSONConfig netDef = lwt::parse_json(netFile);
+    m_network = std::move(std::unique_ptr<lwt::LightweightNeuralNetwork>(new lwt::LightweightNeuralNetwork(netDef.inputs, netDef.layers, netDef.outputs)));
+  }
+  // For functional:
+  else {
+    lwt::GraphConfig netDef = lwt::parse_json_graph(netFile);
+    if (netDef.inputs.size() != 1) {
+      ATH_MSG_ERROR("Network in file \"" + fileName + "\" has more than 1 input node: # of input nodes = " + std::to_string(netDef.inputs.size()));
+      return StatusCode::FAILURE;
+    }
+    m_inputNodeName = netDef.inputs[0].name;
+    m_graph = std::move(std::unique_ptr<lwt::LightweightGraph>(new lwt::LightweightGraph(netDef)));
+  }
+
+  return StatusCode::SUCCESS;
+}
+
+float MVATrackVertexAssociationTool::evaluateNetwork(const xAOD::TrackParticle& trk, const xAOD::Vertex& vx, const xAOD::EventInfo& evt) const {
+
+  // Evaluate our inputs
+  std::map<std::string, double> input;
+  m_inputEval.eval(trk, vx, evt, input);
+
+  // Evaluate our network
+  std::map<std::string, double> output;
+  // For sequential:
+  if (m_isSequential) {
+    output = m_network->compute(input);
+  }
+  // For functional:
+  else {
+    std::map<std::string, std::map<std::string, double>> wrappedInput;
+    wrappedInput[m_inputNodeName] = input;
+    output = m_graph->compute(wrappedInput);
+  }
+
+  return output[m_outputName];
+}
+
+} // namespace CP
diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/MVAInputEvaluator.h b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/MVAInputEvaluator.h
new file mode 100644
index 0000000000000000000000000000000000000000..741343fd6489b7261fe618dcc688383b56a597a7
--- /dev/null
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/MVAInputEvaluator.h
@@ -0,0 +1,78 @@
+#ifndef MVAINPUTEVALUATOR_H
+#define MVAINPUTEVALUATOR_H
+
+#include "xAODEventInfo/EventInfo.h"
+#include "xAODTracking/TrackParticleFwd.h"
+#include "xAODTracking/VertexFwd.h"
+
+#include <iterator>
+#include <map>
+#include <memory>
+#include <string>
+
+namespace CP {
+
+class MVAInputEvaluator {
+public:
+  MVAInputEvaluator() {};
+  ~MVAInputEvaluator();
+
+  // Nested class for evaluating single input features
+  class MiniEvaluator {
+  public:
+    MiniEvaluator() {};
+    virtual ~MiniEvaluator() {};
+    virtual float eval(const xAOD::TrackParticle& trk, const xAOD::Vertex& vx, const xAOD::EventInfo& evt) const = 0;
+  };
+
+  // Enumerate the different possible inputs
+  enum Input {
+    Pt,
+    Eta,
+    M,
+    D0,
+    ErrD0,
+    Z0,
+    ErrZ0,
+    Phi,
+    ErrPhi,
+    Theta,
+    ErrTheta,
+    QOverP,
+    ErrQOverP,
+    ChiSq,
+    RedChiSq,
+    D0Sig,
+    DZ,
+    ErrDZ,
+    DZSinTheta,
+    ErrDZSinTheta,
+    FitWeight,
+    VxX,
+    ErrVxX,
+    VxY,
+    ErrVxY,
+    VxZ,
+    ErrVxZ
+  };
+
+  // Handy typedefs
+  // Defines the mapping of strings to Inputs:
+  typedef std::map<std::string, Input> InputSelectionMap;
+  // Defines the mapping of those same strings to MiniEvaluators:
+  typedef std::map<std::string, std::unique_ptr<MiniEvaluator>> InputEvaluatorMap;
+
+  void add(const std::string& name, const MVAInputEvaluator::Input& type);
+  void load(const MVAInputEvaluator::InputSelectionMap& selection);
+  void eval(const xAOD::TrackParticle& trk, const xAOD::Vertex& vx, const xAOD::EventInfo& evt, std::map<std::string, double>& input) const;
+  void clear();
+
+private:
+  // Loaded evaluator map
+  InputEvaluatorMap m_evalMap = {};
+
+};
+
+} // namepace CP
+
+#endif // MVAINPUTEVALUATOR_H
diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/MVATrackVertexAssociationTool.h b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/MVATrackVertexAssociationTool.h
new file mode 100644
index 0000000000000000000000000000000000000000..91ee4575fcbc566786a143153650f6c46fa3e360
--- /dev/null
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/MVATrackVertexAssociationTool.h
@@ -0,0 +1,147 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef MVATRACKVERTEXASSOCIATIONTOOL_H
+#define MVATRACKVERTEXASSOCIATIONTOOL_H
+
+#include "AsgTools/AsgTool.h"
+#include "AthLinks/ElementLink.h"
+#include "AsgDataHandles/ReadHandleKey.h"
+
+#include "TrackVertexAssociationTool/ITrackVertexAssociationTool.h"
+#include "TrackVertexAssociationTool/MVAInputEvaluator.h"
+
+#include "xAODEventInfo/EventInfo.h"
+#include "xAODTracking/TrackParticleFwd.h"
+#include "xAODTracking/TrackParticleContainerFwd.h"
+#include "xAODTracking/VertexFwd.h"
+#include "xAODTracking/VertexContainerFwd.h"
+
+#include "lwtnn/LightweightNeuralNetwork.hh"
+#include "lwtnn/LightweightGraph.hh"
+
+#include <map>
+#include <memory>
+#include <string>
+#include <vector>
+
+namespace CP {
+
+class MVATrackVertexAssociationTool : public asg::AsgTool, virtual public ITrackVertexAssociationTool
+{
+  ASG_TOOL_CLASS(MVATrackVertexAssociationTool, ITrackVertexAssociationTool)
+public:
+
+  MVATrackVertexAssociationTool(const std::string& name);
+
+  virtual StatusCode initialize() override;
+  // For Athena
+  #ifndef XAOD_STANDALONE
+  virtual StatusCode finalize() override;
+  #endif
+
+  virtual bool isCompatible(const xAOD::TrackParticle& trk, const xAOD::Vertex& vx) const override;
+
+  virtual xAOD::TrackVertexAssociationMap getMatchMap(std::vector<const xAOD::TrackParticle*>& trk_list, std::vector<const xAOD::Vertex*>& vx_list) const override;
+  virtual xAOD::TrackVertexAssociationMap getMatchMap(const xAOD::TrackParticleContainer& trk_cont, const xAOD::VertexContainer& vx_cont) const override;
+
+  virtual ElementLink<xAOD::VertexContainer> getUniqueMatchVertexLink(const xAOD::TrackParticle& trk, const xAOD::VertexContainer& vx_cont) const override;
+  virtual const xAOD::Vertex* getUniqueMatchVertex(const xAOD::TrackParticle& trk, std::vector<const xAOD::Vertex*>& vx_list) const override;
+
+  virtual xAOD::TrackVertexAssociationMap getUniqueMatchMap(std::vector<const xAOD::TrackParticle*>& trk_list, std::vector<const xAOD::Vertex*>& vx_list) const override;
+  virtual xAOD::TrackVertexAssociationMap getUniqueMatchMap(const xAOD::TrackParticleContainer& trk_cont, const xAOD::VertexContainer& vx_cont) const override;
+
+private:
+
+  bool isMatch(const xAOD::TrackParticle& trk, const xAOD::Vertex& vx, float& mvaOutput) const;
+
+  template <typename T, typename V>
+  xAOD::TrackVertexAssociationMap getMatchMapInternal(const T& trk_list, const V& vx_list) const;
+
+  template <typename T, typename V>
+  xAOD::TrackVertexAssociationMap getUniqueMatchMapInternal(const T& trk_list, const V& vx_list) const;
+
+  template <typename T>
+  const xAOD::Vertex* getUniqueMatchVertexInternal(const xAOD::TrackParticle& trk, const T& vx_list) const;
+
+  StatusCode initializeNetwork();
+  float evaluateNetwork(const xAOD::TrackParticle& trk, const xAOD::Vertex& vx, const xAOD::EventInfo& evt) const;
+
+  // For AnalysisBase
+  #ifdef XAOD_STANDALONE
+
+  // Input lwtnn network file
+  std::string m_fileName = "";
+
+  // Vector of input variable names
+  std::vector<std::string> m_inputNames = {};
+
+  // Vector of input variable types
+  std::vector<int> m_inputTypes = {};
+
+  // Name of the output node to cut on
+  std::string m_outputName = "";
+
+  // Is the network sequential or functional
+  bool m_isSequential = true;
+
+  // TVA working point
+  std::string m_wp = "Tight";
+
+  // TVA cut value on the output discriminant
+  float m_cut = -1.0;
+
+  // Use the PathResolver to find our input file
+  bool m_usePathResolver = true;
+
+  // For Athena
+  #else
+
+  // Input lwtnn network file
+  StringProperty m_fileName {this, "NetworkFileName", "", "Name of the input lwtnn network file."};
+
+  // Vector of input variable names
+  StringArrayProperty m_inputNames {this, "InputNames", {}, "Vector of the network's input variable names (std::vector<std::string>)."};
+
+  // Vector of input variable types
+  IntegerArrayProperty m_inputTypes {this, "InputTypes", {}, "Vector of the network's input variable evaluator types (std::vector<CP::MVAEvaluatorInput::Input>)."};
+
+  // Name of the output node to cut on
+  StringProperty m_outputName {this, "OutputNodeName", "", "Name of the output node to cut on for TVA."};
+
+  // Is the network sequential or functional
+  BooleanProperty m_isSequential {this, "IsSequential", true, "Is the network sequential (true) or functional (false)."};
+
+  // TVA working point
+  StringProperty m_wp {this, "WorkingPoint", "Tight", "TVA working point to apply."};
+
+  // TVA cut value on the output discriminant
+  FloatProperty m_cut {this, "OutputCut", -1.0, "TVA cut value on the output value (set manually with \"Custom\" WP)."};
+
+  // Use the PathResolver to find our input file
+  BooleanProperty m_usePathResolver {this, "UsePathResolver", true, "Use the PathResolver for finding the input lwtnn network file."};
+
+  #endif
+
+  // Input variable name/type map
+  MVAInputEvaluator::InputSelectionMap m_inputMap;
+
+  // Input variable evaluator
+  MVAInputEvaluator m_inputEval;
+
+  // EventInfo key
+  SG::ReadHandleKey<xAOD::EventInfo> m_eventInfo {this, "EventInfo", "EventInfo", "EventInfo key"};
+
+  // Name of the input node (for functional modes)
+  std::string m_inputNodeName = ""; //!
+
+  // Network as implemented using lwtnn
+  std::unique_ptr<lwt::LightweightNeuralNetwork> m_network; //!
+  std::unique_ptr<lwt::LightweightGraph>         m_graph;   //!
+
+};
+
+} // namespace CP
+
+#endif // MVATRACKVERTEXASSOCIATIONTOOL_H
diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/TrackVertexAssociationToolDict.h b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/TrackVertexAssociationToolDict.h
index 252ba8881f1225f8234335979c5f12b6c59bde28..d7745a294ec8768f504bed6751292cf71be634fd 100644
--- a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/TrackVertexAssociationToolDict.h
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/TrackVertexAssociationToolDict.h
@@ -14,5 +14,6 @@
 #include "TrackVertexAssociationTool/BaseTrackVertexAssociationTool.h"
 #include "TrackVertexAssociationTool/ElectronTrackVertexAssociationTool.h"
 #include "TrackVertexAssociationTool/MuonTrackVertexAssociationTool.h"
+#include "TrackVertexAssociationTool/MVATrackVertexAssociationTool.h"
 
 #endif //TrackVertexAssociationTool
diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/selection.xml b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/selection.xml
index 457a3ebfd5bd5eae3042a8b0d75bbaed013a232b..29a9e40a43b5ac199fa527d3b7f66fc3e952fa02 100644
--- a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/selection.xml
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/selection.xml
@@ -3,4 +3,5 @@
   <class name="CP::BaseTrackVertexAssociationTool" />
   <class name="CP::ElectronTrackVertexAssociationTool" />
   <class name="CP::MuonTrackVertexAssociationTool" />
+  <class name="CP::MVATrackVertexAssociationTool" />
 </lcgdict>
diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/src/components/TrackVertexAssociationTool_entries.cxx b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/src/components/TrackVertexAssociationTool_entries.cxx
index 1bc9a64064344d86ec36ab4149df54c13878a07d..31eda59b3a3a55c199b9b710a56483529681f475 100644
--- a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/src/components/TrackVertexAssociationTool_entries.cxx
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/src/components/TrackVertexAssociationTool_entries.cxx
@@ -2,6 +2,7 @@
 #include "TrackVertexAssociationTool/BaseTrackVertexAssociationTool.h"
 #include "TrackVertexAssociationTool/ElectronTrackVertexAssociationTool.h"
 #include "TrackVertexAssociationTool/MuonTrackVertexAssociationTool.h"
+#include "TrackVertexAssociationTool/MVATrackVertexAssociationTool.h"
 
 #include "../TrackVertexAssoTestAlg.h"
 
@@ -11,5 +12,6 @@ DECLARE_COMPONENT( CP::TrackVertexAssociationTool )
 DECLARE_COMPONENT( CP::BaseTrackVertexAssociationTool )
 DECLARE_COMPONENT( CP::ElectronTrackVertexAssociationTool )
 DECLARE_COMPONENT( CP::MuonTrackVertexAssociationTool )
+DECLARE_COMPONENT( CP::MVATrackVertexAssociationTool )
 DECLARE_COMPONENT( TrackVertexAssoTestAlg )
 
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/run/PhysVal_jobOptions.py b/InnerDetector/InDetValidation/InDetPhysValMonitoring/run/PhysVal_jobOptions.py
index 007395fc9d28058a2b534e1761779b210dec05cb..02bd8e2dfb598fb02bec16247e7e58375b17e9ec 100644
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/run/PhysVal_jobOptions.py
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/run/PhysVal_jobOptions.py
@@ -8,19 +8,11 @@ FNAME = "AOD.pool.root"
 mode = "Fwd" #Set this to "Back" for backtracking
 usingTrackSelection = False
 #
-#options for Max to explore backtracking
-if (getpass.getuser())=="mbaugh":
-  mode="Back"
-  FNAME = "../command/target.pool.root"
-  '''
-  The following sets an environment variable to enable backtracking debug messages.
-  To use in C++:
-  const char * debugBacktracking = std::getenv("BACKTRACKDEBUG");
-  '''
-  os.environ["BACKTRACKDEBUG"] = "1"
-  #
-include( "AthenaPython/iread_file.py" )
+from InDetRecExample.InDetJobProperties import InDetFlags
+InDetFlags.doSlimming.set_Value_and_Lock(False)
+rec.doTrigger.set_Value_and_Lock(False);
 
+include( "AthenaPython/iread_file.py" )
 # Access the algorithm sequence:
 from AthenaCommon.AlgSequence import AlgSequence
 topSequence = AlgSequence()
@@ -36,42 +28,21 @@ for decorator in InDetPhysValMonitoring.InDetPhysValDecoration.getDecorators() :
   topSequence += decorator
 
 from AthenaMonitoring.AthenaMonitoringConf import AthenaMonManager
-monMan = AthenaMonManager( "PhysValMonManager" )
-monMan.ManualDataTypeSetup = True
-monMan.DataType            = "monteCarlo"
-monMan.Environment         = "altprod"
-monMan.ManualRunLBSetup    = True
-monMan.Run                 = 1
-monMan.LumiBlock           = 1
-monMan.FileKey = "M_output"
+monMan = AthenaMonManager( "PhysValMonManager",
+  FileKey = "M_output",
+  Environment = "altprod",
+  ManualDataTypeSetup = True,
+  DataType = "monteCarlo",
+  ManualRunLBSetup = True,
+  Run = 1,
+  LumiBlock = 1  )
+  
+print (monMan)
+
 topSequence += monMan
 
 
-#this works:
-'''
-from InDetTrackSelectionTool.InDetTrackSelectionToolConf import InDet__InDetTrackSelectionTool
-InDetTrackSelectorTool = InDet__InDetTrackSelectionTool(name = "InDetTrackSelectorTool",
-                                                        CutLevel = InDetPrimaryVertexingCuts.TrackCutLevel(),
-                                                        minPt = InDetPrimaryVertexingCuts.minPT(),
-                                                        maxD0 = InDetPrimaryVertexingCuts.IPd0Max(),
-                                                        maxZ0 = InDetPrimaryVertexingCuts.z0Max(),
-                                                        maxZ0SinTheta = InDetPrimaryVertexingCuts.IPz0Max(),
-                                                        maxSigmaD0 = InDetPrimaryVertexingCuts.sigIPd0Max(),
-                                                        maxSigmaZ0SinTheta = InDetPrimaryVertexingCuts.sigIPz0Max(),
-                                                        # maxChiSqperNdf = InDetPrimaryVertexingCuts.fitChi2OnNdfMax(), # Seems not to be implemented?
-                                                        maxAbsEta = InDetPrimaryVertexingCuts.etaMax(),
-                                                        minNInnermostLayerHits = InDetPrimaryVertexingCuts.nHitInnermostLayer(),
-                                                        minNPixelHits = InDetPrimaryVertexingCuts.nHitPix(),
-                                                        maxNPixelHoles = InDetPrimaryVertexingCuts.nHolesPix(),
-                                                        minNSctHits = InDetPrimaryVertexingCuts.nHitSct(),
-                                                        minNTrtHits = InDetPrimaryVertexingCuts.nHitTrt(),
-                                                        minNSiHits = InDetPrimaryVertexingCuts.nHitSi(),
-                                                        TrackSummaryTool = InDetTrackSummaryTool,
-                                                        Extrapolator = InDetExtrapolator)
 
-
-ToolSvc += InDetTrackSelectorTool
-'''
 from InDetTrackSelectionTool.InDetTrackSelectionToolConf import InDet__InDetTrackSelectionTool
 InDetTrackSelectorTool=InDet__InDetTrackSelectionTool()
 ToolSvc += InDetTrackSelectorTool
@@ -90,8 +61,7 @@ if mode=="Back":
   AthTruthSelectionTool.poselectronfromgamma = True
   os.environ["BACKTRACKDEBUG"] = "1"
 
-print AthTruthSelectionTool
-#ToolSvc += AthTruthSelectionTool
+print (AthTruthSelectionTool)
 
 from InDetPhysValMonitoring.InDetPhysValMonitoringConf import InDetPhysValMonitoringTool
 tool1 = InDetPhysValMonitoringTool()
@@ -99,8 +69,10 @@ tool1.TruthSelectionTool = AthTruthSelectionTool
 tool1.useTrackSelection = usingTrackSelection
 tool1.TrackSelectionTool=InDetTrackSelectorTool
 tool1.FillTrackInJetPlots = True
-print tool1
-#ToolSvc += tool1
+print (tool1)
+tool1.ManagerName = 'PhysValMonManager'
+
+
 
 monMan.AthenaMonTools += [tool1]
 
@@ -113,7 +85,7 @@ ToolSvc += InDetBoundaryCheckTool
 from InDetTrackHoleSearch.InDetTrackHoleSearchConf import InDet__InDetTrackHoleSearchTool
 InDetHoleSearchTool = InDet__InDetTrackHoleSearchTool(name = "InDetHoleSearchTool", Extrapolator = InDetExtrapolator, BoundaryCheckTool=InDetBoundaryCheckTool, CountDeadModulesAfterLastHit = True)
 ToolSvc += InDetHoleSearchTool
-print InDetHoleSearchTool
+print (InDetHoleSearchTool)
 
 from GaudiSvc.GaudiSvcConf import THistSvc
 ServiceMgr += THistSvc()
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/scripts/getSomeData.sh b/InnerDetector/InDetValidation/InDetPhysValMonitoring/scripts/getSomeData.sh
old mode 100644
new mode 100755
index 060c2d8da9d7b398d8816a91badd894de3240140..e1949268b37ec554eae7fdbaa6c050567412b18a
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/scripts/getSomeData.sh
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/scripts/getSomeData.sh
@@ -8,7 +8,7 @@
 #Itk
 #rucio download mc15_14TeV.117050.PowhegPythia_P2011C_ttbar.recon.DAOD_IDTRKVALID.e2176_s2897_s2901_r8209
 rm -f ~$USER/run/AOD.pool.root
-ln -s ~npetters/workDir/public/OUT.ESD.pool.root ~$USER/run/AOD.pool.root
+ln -s ~npetters/workDir/public/forShaun/group.perf-idtracking.21564941.EXT0._000008.RDO.pool.root ~$USER/run/AOD.pool.root
 rm -f ~$USER/run/*.xml
 
 
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValTruthDecoratorAlg.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValTruthDecoratorAlg.cxx
index 49039874fec26c715d45911426bb50dfb8d67d69..e6c6f8b5facf310112930d186c2c64cc77ddb62a 100644
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValTruthDecoratorAlg.cxx
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValTruthDecoratorAlg.cxx
@@ -207,7 +207,7 @@ InDetPhysValTruthDecoratorAlg::decorateTruth(const xAOD::TruthParticle& particle
 /** Email from Andi Salzburger to Shaun Roe **
 
    the correct way is actually to extrapolate it.
-   So you'd need to retrieve the extrapolator:
+   So you would need to retrieve the extrapolator:
     TooHandle<IExtrapolator> m_extrapolator;
 
    -> retrieve it in your code and use the AtlasExtrapolator (which is fully configured, and can be imported in python
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/ParameterErrDecoratorAlg.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/ParameterErrDecoratorAlg.cxx
index b0c825494765cdb870ac0b6dc7e067dbe361b41c..f382935c788b7274be716cb243b0b33864e84fda 100644
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/ParameterErrDecoratorAlg.cxx
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/ParameterErrDecoratorAlg.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 /**
@@ -23,18 +23,22 @@ ParameterErrDecoratorAlg::~ParameterErrDecoratorAlg() {
 
 StatusCode
 ParameterErrDecoratorAlg::initialize() {
-  ATH_CHECK( m_trkParticleName.initialize() );
+  ATH_CHECK( m_trkParticleKey.initialize() );
 
-  std::vector<std::string> decor_names(kNDecorators);
-  decor_names[kDecorD0err]="d0err";
-  decor_names[kDecorZ0err]="z0err";
-  decor_names[kDecorPhierr]="phierr";
-  decor_names[kDecorThetaerr]="thetaerr";
-  decor_names[kDecorQopterr]="qopterr";
-
-  IDPVM::createDecoratorKeys(*this, m_trkParticleName, m_prefix, decor_names, m_decor);
+  std::vector<std::string> decorationNames(kNDecorators);
+  decorationNames[kDecorD0err]="d0err";
+  decorationNames[kDecorZ0err]="z0err";
+  decorationNames[kDecorPhierr]="phierr";
+  decorationNames[kDecorThetaerr]="thetaerr";
+  decorationNames[kDecorQopterr]="qopterr";
+  std::string message{"The following decorations should be added by ParameterErrDecoratorAlg:\n"};
+  for (const auto & thisName: decorationNames){
+    message += thisName+"\n";
+  }
+  ATH_MSG_INFO(message);
+  IDPVM::createDecoratorKeys(*this, m_trkParticleKey, m_prefix, decorationNames, m_decor);
   assert( m_decor.size() == kNDecorators);
-
+  
   return StatusCode::SUCCESS;
 }
 
@@ -45,23 +49,25 @@ ParameterErrDecoratorAlg::finalize() {
 
 StatusCode
 ParameterErrDecoratorAlg::execute(const EventContext &ctx) const {
-  SG::ReadHandle<xAOD::TrackParticleContainer> ptracks(m_trkParticleName, ctx);
+  SG::ReadHandle<xAOD::TrackParticleContainer> ptracks(m_trkParticleKey, ctx);
   if ((not ptracks.isValid())) {
+    ATH_MSG_ERROR("The track particle container '"<< m_trkParticleKey.key()<<"' could not be read.");
     return StatusCode::FAILURE;
   }
-
   std::vector< SG::WriteDecorHandle<xAOD::TrackParticleContainer,float> >
-    float_decor( IDPVM::createDecorators<xAOD::TrackParticleContainer,float>(m_decor, ctx) );
-
-  for (const xAOD::TrackParticle *trk_particle : *ptracks) {
-    if (not decorateTrack(*trk_particle, float_decor) ) return StatusCode::FAILURE;
+    floatDecoration( IDPVM::createDecorators<xAOD::TrackParticleContainer,float>(m_decor, ctx) );
+  for (const xAOD::TrackParticle *pTrkParticle : *ptracks) {
+    if (not decorateTrack(*pTrkParticle, floatDecoration) ) {
+      ATH_MSG_ERROR("Decoration failed in ParameterErrDecoratorAlg::execute.");
+      return StatusCode::FAILURE;
+    }
   }
   return StatusCode::SUCCESS;
 }
 
 bool
 ParameterErrDecoratorAlg::decorateTrack(const xAOD::TrackParticle& particle,
-                                         std::vector< SG::WriteDecorHandle<xAOD::TrackParticleContainer,float> > &float_decor) const {
+                                         std::vector< SG::WriteDecorHandle<xAOD::TrackParticleContainer,float> > &floatDecoration) const {
   ATH_MSG_VERBOSE("Decorate track with errors ");
   bool success(true);
   const AmgSymMatrix(5)  errorMat = particle.definingParametersCovMatrix();
@@ -70,42 +76,10 @@ ParameterErrDecoratorAlg::decorateTrack(const xAOD::TrackParticle& particle,
   Trk::JacobianThetaPToCotThetaPt TheJac(mtheta, mqp);
   AmgSymMatrix(5) covVert;
   covVert = errorMat.similarity(TheJac);
-  float_decor[kDecorD0err](particle)=Amg::error(covVert, 0);
-  float_decor[kDecorZ0err](particle)=Amg::error(covVert, 1);
-  float_decor[kDecorPhierr](particle)=Amg::error(covVert, 2);
-  float_decor[kDecorThetaerr](particle)=Amg::error(errorMat, Trk::theta);
-  float_decor[kDecorQopterr](particle)=Amg::error(covVert, 4) * 1000.;
+  floatDecoration[kDecorD0err](particle)=Amg::error(covVert, 0);
+  floatDecoration[kDecorZ0err](particle)=Amg::error(covVert, 1);
+  floatDecoration[kDecorPhierr](particle)=Amg::error(covVert, 2);
+  floatDecoration[kDecorThetaerr](particle)=Amg::error(errorMat, Trk::theta);
+  floatDecoration[kDecorQopterr](particle)=Amg::error(covVert, 4) * 1000.;
   return success;
 }
-
-/**
-   AmgVector(5) perigeeParams = startPerigee->parameters();
-      trkd0    = perigeeParams[Trk::d0];
-      trkz0    = perigeeParams[Trk::z0];
-      trkphi   = perigeeParams[Trk::phi0];
-      trktheta = perigeeParams[Trk::theta];
-      //trkcot   = 1./tan(trktheta);
-      trketa   = - log(tan(trktheta / 2.0));
-      trkqOverPt  = perigeeParams[Trk::qOverP]*1000./sin(trktheta);
-      trkpt    = abs(1.0 / trkqOverPt);
-      if (trkqOverPt<0) charge=-1;
-      else charge=+1;
-      const AmgSymMatrix(5) * ErrorMat = startPerigee->covariance();
-      double mtheta = (startPerigee->parameters())[Trk::theta];
-      double mqp = (startPerigee->parameters())[Trk::qOverP];
-      Trk::JacobianThetaPToCotThetaPt TheJac(mtheta,mqp);
-      AmgSymMatrix(5) covVert;
-      covVert = ErrorMat->similarity(TheJac);
-      // trkd0err = sqrt(covVert[0][0]);
-      // trkz0err = sqrt(covVert[1][1]);
-      // trkphierr = sqrt(covVert[2][2]);
-      // trkcoterr = sqrt(covVert[3][3]);
-      // trkqopterr = sqrt(covVert[4][4])*1000.;
-      // trkthetaerr = ErrorMat->error(Trk::theta);
-      trkd0err = Amg::error(covVert,0);
-      trkz0err = Amg::error(covVert,1);
-      trkphierr = Amg::error(covVert,2);
-      //trkcoterr = Amg::error(covVert,3);
-      trkqopterr = Amg::error(covVert,4)*1000.;
-      trkthetaerr = Amg::error((*ErrorMat),Trk::theta);
- **/
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/ParameterErrDecoratorAlg.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/ParameterErrDecoratorAlg.h
index 02ad809325d407a51bcac8acb3cd10e668d9d6aa..302a6cca336fa477d19f9b82a124c368138320b3 100644
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/ParameterErrDecoratorAlg.h
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/ParameterErrDecoratorAlg.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 INDETPHYSVALMONITORING_ParameterErrDecoratorAlg_H
@@ -37,7 +37,7 @@ private:
     {this, "Prefix", "", "Decoration prefix to avoid clashes."};
 
   // need tracks particle key, to compose decoration keys
-  SG::ReadHandleKey<xAOD::TrackParticleContainer>  m_trkParticleName
+  SG::ReadHandleKey<xAOD::TrackParticleContainer>  m_trkParticleKey
     {this,"TrackParticleContainerName", "InDetTrackParticles",""};
 
   enum EDecorations {
diff --git a/LArCalorimeter/LArBadChannelTool/python/LArBadChannelConfig.py b/LArCalorimeter/LArBadChannelTool/python/LArBadChannelConfig.py
index 1e3fae2056c420060e68968b6dda3ce6925d5295..44ff1145650a2bf9441dcb75e3178dab7ca96bf2 100644
--- a/LArCalorimeter/LArBadChannelTool/python/LArBadChannelConfig.py
+++ b/LArCalorimeter/LArBadChannelTool/python/LArBadChannelConfig.py
@@ -4,46 +4,37 @@ from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
 from AthenaConfiguration.ComponentFactory import CompFactory
 LArBadChannelCondAlg, LArBadFebCondAlg, LArBadChannelMasker=CompFactory.getComps("LArBadChannelCondAlg","LArBadFebCondAlg","LArBadChannelMasker",)
 from LArCabling.LArCablingConfig import LArOnOffIdMappingCfg
-from IOVDbSvc.IOVDbSvcConfig import addFolders
+from IOVDbSvc.IOVDbSvcConfig import addFolders, addFoldersSplitOnline
 
-def LArBadChannelCfg(configFlags, tag=""):
+def LArBadChannelCfg(configFlags, tag=None):
 
     result=LArOnOffIdMappingCfg(configFlags)
-    
-    if configFlags.Common.isOnline or configFlags.Input.isMC:
-        foldername="/LAR/BadChannels/BadChannels"
-    else:
-        foldername="/LAR/BadChannelsOfl/BadChannels"
-        pass
-    
-    if configFlags.Common.isOnline: 
-        dbname="LAR"
-    else:
-        dbname="LAR_OFL"
+    rekey="/LAR/BadChannels/BadChannels"
 
-    result.merge(addFolders(configFlags,foldername + tag,detDb=dbname,className="CondAttrListCollection"))
-    
-    theLArBadChannelCondAlgo=LArBadChannelCondAlg(ReadKey=foldername)
+    if configFlags.Input.isMC:
+        result.merge(addFolders(configFlags,"/LAR/BadChannels/BadChannels","LAR_OFL",tag=tag,
+                                className="CondAttrListCollection"))
+    else:
+        result.merge(addFoldersSplitOnline(configFlags,"LAR","/LAR/BadChannels/BadChannels",
+                                        f"/LAR/BadChannelsOfl/BadChannels<key>{rekey}</key>",tag=tag,
+                                        className="CondAttrListCollection"))  
+    theLArBadChannelCondAlgo=LArBadChannelCondAlg(ReadKey=rekey)
     result.addCondAlgo(theLArBadChannelCondAlgo)
     return result
 
 
-def LArBadFebCfg(configFlags, tag=""):
+def LArBadFebCfg(configFlags, tag=None):
     result=ComponentAccumulator()
+    rekey="/LAR/BadChannels/MissingFEBs"
 
-    if configFlags.Common.isOnline or configFlags.Input.isMC:
-        foldername="/LAR/BadChannels/MissingFEBs"
-    else:
-        foldername="/LAR/BadChannelsOfl/MissingFEBs"
-        pass
-
-    if configFlags.Common.isOnline: 
-        dbname="LAR"
+    if configFlags.Input.isMC:
+        result.merge(addFolders(configFlags,"/LAR/BadChannels/MissingFEBs","LAR_OFL",tag=tag,
+                                className="AthenaAttributeList"))
     else:
-        dbname="LAR_OFL"
-
-    result.merge(addFolders(configFlags,foldername + tag,detDb=dbname,className="AthenaAttributeList"))
-    result.addCondAlgo(LArBadFebCondAlg(ReadKey=foldername))
+        result.merge(addFoldersSplitOnline(configFlags,"LAR","/LAR/BadChannels/MissingFEBs",
+                                           f"/LAR/BadChannelsOfl/MissingFEBs<key>{rekey}</key>",tag=tag,
+                                           className="AthenaAttributeList"))  
+    result.addCondAlgo(LArBadFebCondAlg(ReadKey=rekey))
     return result
 
 
diff --git a/LArCalorimeter/LArBadChannelTool/python/LArBadFebsConfig.py b/LArCalorimeter/LArBadChannelTool/python/LArBadFebsConfig.py
index ce39d215f7ab9688ad9c90c8b4c86354a6ef276e..f858414092167a66cadc2ee1585474123224812d 100644
--- a/LArCalorimeter/LArBadChannelTool/python/LArBadFebsConfig.py
+++ b/LArCalorimeter/LArBadChannelTool/python/LArBadFebsConfig.py
@@ -3,52 +3,34 @@
 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
 from AthenaConfiguration.ComponentFactory import CompFactory
 LArBadFebCondAlg=CompFactory.LArBadFebCondAlg
-from IOVDbSvc.IOVDbSvcConfig import addFolders
+from IOVDbSvc.IOVDbSvcConfig import addFoldersSplitOnline
 
-def LArKnownBadFebCfg(configFlags, tag=""):
+def LArKnownBadFebCfg(configFlags, tag=None):
     result=ComponentAccumulator()
 
     if configFlags.GeoModel.Run == "RUN1":
-        foldername=""
+        rekey=""
     else:    
-        if configFlags.Common.isOnline or configFlags.Input.isMC:
-            foldername="/LAR/BadChannels/KnownBADFEBs"
-        else:
-            foldername="/LAR/BadChannelsOfl/KnownBADFEBs"
-        pass
- 
-        if configFlags.Common.isOnline: 
-            dbname="LAR"
-        else:
-            dbname="LAR_OFL"
-        pass
-    pass    
+        rekey="/LAR/BadChannels/KnownBADFEBs"
+        result.merge(addFoldersSplitOnline(configFlags,"LAR","/LAR/BadChannels/KnownBADFEBs",
+                                           f"/LAR/BadChannelsOfl/KnownBADFEBs<key>{rekey}</key>",tag=tag,
+                                           className="AthenaAttributeList"))  
 
-    result.merge(addFolders(configFlags,foldername + tag,detDb=dbname,className="AthenaAttributeList"))
-    result.addCondAlgo(LArBadFebCondAlg("LArKonwnBadFebCondAlg",ReadKey=foldername,WriteKey="LArKnownBadFEBs"))
+    result.addCondAlgo(LArBadFebCondAlg("LArKnownBadFebAlg",ReadKey=rekey,WriteKey="LArKnownBadFEBs"))
     return result
 
-def LArKnownMNBFebCfg(configFlags, tag=""):
+def LArKnownMNBFebCfg(configFlags, tag=None):
     result=ComponentAccumulator()
 
     if configFlags.GeoModel.Run == "RUN1":
-        foldername=""
-    else:    
-        if configFlags.Common.isOnline or configFlags.Input.isMC:
-            foldername="/LAR/BadChannels/KnownMNBFEBs"
-        else:
-            foldername="/LAR/BadChannelsOfl/KnownMNBFEBs"
-        pass
- 
-        if configFlags.Common.isOnline: 
-            dbname="LAR"
-        else:
-            dbname="LAR_OFL"
-        pass
-    pass    
-
-    result.merge(addFolders(configFlags,foldername + tag,detDb=dbname,className="AthenaAttributeList"))
-    result.addCondAlgo(LArBadFebCondAlg("LArKonwnMNBFebCondAlg",ReadKey=foldername,WriteKey="LArKnownMNBFEBs"))
+        rekey=""
+    else:
+        rekey="/LAR/BadChannels/KnownMNBFEBs"
+        result.merge(addFoldersSplitOnline(configFlags,"LAR","/LAR/BadChannels/KnownMNBFEBs",
+                                           f"/LAR/BadChannelsOfl/KnownMNBFEBs<key>{rekey}</key>",tag=tag,
+                                           className="AthenaAttributeList"))   
+
+    result.addCondAlgo(LArBadFebCondAlg("LArKnownMNBFebAlg",ReadKey=rekey,WriteKey="LArKnownMNBFEBs"))
     return result
 
 
diff --git a/LArCalorimeter/LArCalibUtils/python/LArHVScaleConfig.py b/LArCalorimeter/LArCalibUtils/python/LArHVScaleConfig.py
index 772629cab37fb7c1554ea8887514019486bb7df8..1f3db3321df7f03a4fc5731ff1a87b23b311b64b 100644
--- a/LArCalorimeter/LArCalibUtils/python/LArHVScaleConfig.py
+++ b/LArCalorimeter/LArCalibUtils/python/LArHVScaleConfig.py
@@ -39,7 +39,7 @@ def LArHVScaleCfg(configFlags):
         result.addCondAlgo(hvpath)
 
         LArHVCondAlg=CompFactory.LArHVCondAlg
-        hvcond = LArHVCondAlg("LArHVPathologyAlg",HVPathologies="LArHVPathology",OutputHVData="LArHVData")
+        hvcond = LArHVCondAlg(HVPathologies="LArHVPathology",OutputHVData="LArHVData")
         result.addCondAlgo(hvcond)
 
         from LArConfiguration.LArElecCalibDBConfig import LArElecCalibDbCfg
diff --git a/LArCalorimeter/LArG4/LArG4H6SD/src/LArG4H6WarmTCSD.cc b/LArCalorimeter/LArG4/LArG4H6SD/src/LArG4H6WarmTCSD.cc
index cb401764dfb31fb8fd9b3a63024949922aa43c3c..20c296c9fabbe25b6e0a73d1a0efcfe442d12035 100644
--- a/LArCalorimeter/LArG4/LArG4H6SD/src/LArG4H6WarmTCSD.cc
+++ b/LArCalorimeter/LArG4/LArG4H6SD/src/LArG4H6WarmTCSD.cc
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "LArG4H6WarmTCSD.h"
@@ -181,9 +181,9 @@ void LArG4H6WarmTCSD::EndOfAthenaEvent()
   //G4int HCID;
   G4String cnam;
   hitIt i;
-  for (i = m_hits.begin(); i != m_hits.end(); i++ ) {
+  for (const auto& p : m_hits) {
     //      m_Collection->insert( i->second );
-    m_Collection->push_back(i->second);
+    m_Collection->push_back(p.second);
   }
   m_hits.clear();
 }
diff --git a/LArCalorimeter/LArG4/LArG4H6SD/src/LArG4TBECBeamChCalculator.cc b/LArCalorimeter/LArG4/LArG4H6SD/src/LArG4TBECBeamChCalculator.cc
index a30ac65cb4851e6d14200c02c509db442f8744c4..081e227cf5b86228b89fe8ac8bafd645a4df3f72 100644
--- a/LArCalorimeter/LArG4/LArG4H6SD/src/LArG4TBECBeamChCalculator.cc
+++ b/LArCalorimeter/LArG4/LArG4H6SD/src/LArG4TBECBeamChCalculator.cc
@@ -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
 */
 
 // LArG4TBECBeamChCalculator
@@ -12,10 +12,10 @@
 #include "globals.hh"
 
 LArG4TBECBeamChCalculator::LArG4TBECBeamChCalculator(void)
+  : m_number (-1),
+    m_x (0),
+    m_y (0)
 {
-  m_number = -1;
-  m_x = 0.;
-  m_y = 0.;
   G4cout << "LArG4TBECBeamChCalculator ready" << G4endl;
 }
 
diff --git a/LArCalorimeter/LArG4/LArG4H6SD/src/LArG4TBECBeamChCalculator.h b/LArCalorimeter/LArG4/LArG4H6SD/src/LArG4TBECBeamChCalculator.h
index 32c9e8ed12bce7f961fa6660f30916564a6e3a3f..db0133d3bfdfb077f8932673391e2c04353fe78d 100644
--- a/LArCalorimeter/LArG4/LArG4H6SD/src/LArG4TBECBeamChCalculator.h
+++ b/LArCalorimeter/LArG4/LArG4H6SD/src/LArG4TBECBeamChCalculator.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 __LArG4TBECBeamChCalculator_H__
-#define __LArG4TBECBeamChCalculator_H__
+#ifndef LARG4H6SD_LARG4TBECBEAMCHCALCULATOR_H
+#define LARG4H6SD_LARG4TBECBEAMCHCALCULATOR_H
 
 #include "globals.hh"
 #include "G4ThreeVector.hh"
diff --git a/LArCalorimeter/LArG4/LArG4H6SD/src/LArG4TBECBeamChSensitiveDetector.cc b/LArCalorimeter/LArG4/LArG4H6SD/src/LArG4TBECBeamChSensitiveDetector.cc
index ae95f9549ebc3ae94496ec2b0eac84e90a89396d..71e51032f2594f5165fcb3b31b1bd935d4246d8c 100644
--- a/LArCalorimeter/LArG4/LArG4H6SD/src/LArG4TBECBeamChSensitiveDetector.cc
+++ b/LArCalorimeter/LArG4/LArG4H6SD/src/LArG4TBECBeamChSensitiveDetector.cc
@@ -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
 */
 
 // LArG4TBECBeamChSensitiveDetector
@@ -85,8 +85,8 @@ G4bool LArG4TBECBeamChSensitiveDetector::ProcessHits(G4Step* a_step,
 #endif
 
         G4bool found = false;
-        for(m_Hit_pointer i = m_Hits.begin(); i != m_Hits.end(); i ++){
-                if((*i)->getIdentifier() == ident){
+        for (const LArG4TBECBeamChHit* hit : m_Hits) {
+                if(hit->getIdentifier() == ident){
                         found = true;
                         break;
                 }
diff --git a/LArCalorimeter/LArG4/LArG4H6SD/src/LArG4TBECBeamChSensitiveDetector.h b/LArCalorimeter/LArG4/LArG4H6SD/src/LArG4TBECBeamChSensitiveDetector.h
index 0064ec9f55769f1958e8e5083d54bd6f47ac7a26..727a0575e5967498226abbb935e08c284e50838e 100644
--- a/LArCalorimeter/LArG4/LArG4H6SD/src/LArG4TBECBeamChSensitiveDetector.h
+++ b/LArCalorimeter/LArG4/LArG4H6SD/src/LArG4TBECBeamChSensitiveDetector.h
@@ -1,10 +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
 */
 
 // LArG4TBECBeamChSensitiveDetector.hh
-#ifndef __LArG4TBECBeamChSensitiveDetector_H__
-#define __LArG4TBECBeamChSensitiveDetector_H__
+#ifndef  LARG4H6SD_LARG4TBECBEAMCHSENSITIVEDETECTOR_H
+#define  LARG4H6SD_LARG4TBECBEAMCHSENSITIVEDETECTOR_H
 
 #include "LArG4TBECBeamChHit.h"
 
diff --git a/LArCalorimeter/LArMonitoring/python/LArFEBMonAlg.py b/LArCalorimeter/LArMonitoring/python/LArFEBMonAlg.py
index 513447a42d1d6c7e391b6a1c0fd82f66415a4df6..ac701c906374d76dabd1a368708489d543231b80 100644
--- a/LArCalorimeter/LArMonitoring/python/LArFEBMonAlg.py
+++ b/LArCalorimeter/LArMonitoring/python/LArFEBMonAlg.py
@@ -12,14 +12,22 @@ def LArFEBMonConfigOld(inputFlags, cellDebug=False, dspDebug=False):
 
 
 def LArFEBMonConfig(inputFlags, cellDebug=False, dspDebug=False):
-
+    from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
     from AthenaMonitoring import AthMonitorCfgHelper
     helper = AthMonitorCfgHelper(inputFlags,'LArFEBMonAlgCfg')
 
     from AthenaConfiguration.ComponentFactory import CompFactory
     LArFEBMonConfigCore(helper, CompFactory.LArFEBMonAlg,inputFlags,cellDebug, dspDebug)
 
-    return helper.result()
+    rv = ComponentAccumulator()
+
+    # adding LArFebErrorSummary algo
+    from LArROD.LArFebErrorSummaryMakerConfig import LArFebErrorSummaryMakerCfg
+    rv.merge(LArFebErrorSummaryMakerCfg(inputFlags))
+    
+    rv.merge(helper.result())
+
+    return rv
 
 def LArFEBMonConfigCore(helper,algoinstance,inputFlags, cellDebug=False, dspDebug=False):
 
@@ -74,14 +82,7 @@ def LArFEBMonConfigCore(helper,algoinstance,inputFlags, cellDebug=False, dspDebu
            conddb.addFolder (db, fld, className=obj)
        larFEBMonAlg.Run1DSPThresholdsKey = 'LArDSPThresholds'
 
-    # adding LArFebErrorSummary algo
-    if isRun3Cfg() :
-        from LArROD.LArFebErrorSummaryMakerConfig import LArFebErrorSummaryMakerCfg
-        acc = LArFebErrorSummaryMakerCfg(inputFlags)
-        helper.resobj.merge(acc)
-    else :
-        #put here what to do else
-        pass
+
     Group = helper.addGroup(
         larFEBMonAlg,
         GroupName,
diff --git a/LArCalorimeter/LArROD/LArROD/LArRawChannelBuilderAlg.h b/LArCalorimeter/LArROD/LArROD/LArRawChannelBuilderAlg.h
index 64a61755bde9070aa0664d33367a7e4c5ff83a1f..110d90c70253b374b6145467fd00c727d5c74b88 100644
--- a/LArCalorimeter/LArROD/LArROD/LArRawChannelBuilderAlg.h
+++ b/LArCalorimeter/LArROD/LArROD/LArRawChannelBuilderAlg.h
@@ -14,6 +14,7 @@
 
 #include "LArElecCalib/ILArPedestal.h"
 #include "LArRawConditions/LArADC2MeV.h"
+#include "LArRawConditions/LArDSPThresholdsComplete.h"
 #include "LArElecCalib/ILArOFC.h"
 #include "LArElecCalib/ILArShape.h" 
 #include "LArCabling/LArOnOffIdMapping.h"
@@ -51,7 +52,8 @@ class LArRawChannelBuilderAlg : public AthReentrantAlgorithm {
 
 
   SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey{this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"};
-  SG::ReadCondHandleKey<AthenaAttributeList> m_thresholdsKey{this, "DSPThresholdsKey","/LAR/NoiseOfl/DSPThresholds", "SG Key for thresholds to compute time and quality"};
+  SG::ReadCondHandleKey<LArDSPThresholdsComplete> m_run1DSPThresholdsKey{this, "Run1DSPThresholdsKey","", "SG Key for thresholds to compute time and quality, run 1"};
+  SG::ReadCondHandleKey<AthenaAttributeList> m_run2DSPThresholdsKey{this, "Run2DSPThresholdsKey","", "SG Key for thresholds to compute time and quality, run 2"};
 
 
   //Other jobOptions:
diff --git a/LArCalorimeter/LArROD/python/LArRODConfig.py b/LArCalorimeter/LArROD/python/LArRODConfig.py
index 48053f898a741810a460e94d8e04dbc603ca5146..6c300275aa379bcf7dd002a935ceffbc40b6fcc3 100644
--- a/LArCalorimeter/LArROD/python/LArRODConfig.py
+++ b/LArCalorimeter/LArROD/python/LArRODConfig.py
@@ -1,9 +1,8 @@
-# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 from AthenaCommon import CfgMgr
 
 def getLArRawChannelBuilder(name="LArRawChannelBuilder" , **kwargs):
-    
     from AthenaCommon.AppMgr import ToolSvc
 
     kwargs.setdefault('LArRawChannelKey', "LArRawChannels")
@@ -36,6 +35,7 @@ def getLArRawChannelBuilder(name="LArRawChannelBuilder" , **kwargs):
     condSeq = AthSequencer("AthCondSeq")
     condLoader=condSeq.CondInputLoader
     fld="/LAR/NoiseOfl/DSPThresholds"
+    kwargs.setdefault('Run2DSPThresholdsKey', fld)
     iovDbSvc.Folders.append(fld+"<db>COOLOFL_LAR/OFLP200</db>")
     condLoader.Load.append(("AthenaAttributeList",fld))
     
diff --git a/LArCalorimeter/LArROD/python/LArRawChannelBuilderAlgConfig.py b/LArCalorimeter/LArROD/python/LArRawChannelBuilderAlgConfig.py
index 5aed1203514da3f8528b87274b8b6738be87835e..580530e7c80c36641c2cfb79924d849c7f703b46 100644
--- a/LArCalorimeter/LArROD/python/LArRawChannelBuilderAlgConfig.py
+++ b/LArCalorimeter/LArROD/python/LArRawChannelBuilderAlgConfig.py
@@ -11,12 +11,15 @@ def LArRawChannelBuilderAlgCfg(configFlags, **kwargs):
 
     kwargs.setdefault("name", "LArRawChannelBuilder")
     kwargs.setdefault("firstSample", configFlags.LAr.ROD.FirstSample)
+    obj = "AthenaAttributeList"
+    dspkey = 'Run2DSPThresholdsKey'
     if configFlags.Input.isMC:
         # need OFC configuration, which includes appropriate ElecCalibDb
         acc.merge(LArOFCCondAlgCfg(configFlags))
         kwargs.setdefault("LArRawChannelKey", "LArRawChannels")
         kwargs.setdefault("ShapeKey", "LArShapeSym")
         fld="/LAR/NoiseOfl/DSPThresholds"
+        sgkey=fld
         dbString="OFLP200"
         dbInstance="LAR_OFL"
         if configFlags.Digitization.PileUpPremixing:
@@ -30,14 +33,21 @@ def LArRawChannelBuilderAlgCfg(configFlags, **kwargs):
             kwargs.setdefault("LArRawChannelKey", "LArRawChannels")
         else:
             kwargs.setdefault("LArRawChannelKey", "LArRawChannels_FromDigits")
-        fld="/LAR/Configuration/DSPThresholdFlat/Thresholds"
+        if 'COMP200' in configFlags.IOVDb.DatabaseInstance:
+            fld='/LAR/Configuration/DSPThreshold/Thresholds'
+            obj='LArDSPThresholdsComplete'
+            dspkey = 'Run1DSPThresholdsKey'
+            sgkey='LArDSPThresholds'
+        else:
+            fld="/LAR/Configuration/DSPThresholdFlat/Thresholds"
+            sgkey=fld
         dbString="CONDBR2"
         dbInstance="LAR_ONL"
 
     from IOVDbSvc.IOVDbSvcConfig import addFolders
-    acc.merge(addFolders(configFlags,fld, dbInstance, className="AthenaAttributeList", db=dbString))
+    acc.merge(addFolders(configFlags,fld, dbInstance, className=obj, db=dbString))
 
-    kwargs.setdefault("DSPThresholdsKey",fld)
+    kwargs.setdefault(dspkey, sgkey)
 
     acc.addEventAlgo(LArRawChannelBuilderAlg(**kwargs))
 
diff --git a/LArCalorimeter/LArROD/python/LArRawChannelBuilderDefault.py b/LArCalorimeter/LArROD/python/LArRawChannelBuilderDefault.py
index 2856101b1d6af156ecc575f1322097884c0f6270..aba9745ef5b95e16bc73bbf9115a37fc96409f76 100644
--- a/LArCalorimeter/LArROD/python/LArRawChannelBuilderDefault.py
+++ b/LArCalorimeter/LArROD/python/LArRawChannelBuilderDefault.py
@@ -1,4 +1,4 @@
-from __future__ import print_function
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 from LArROD.LArRODFlags import larRODFlags
 from AthenaCommon.GlobalFlags import globalflags
@@ -7,7 +7,6 @@ from LArByteStream.LArByteStreamConf import LArRawDataReadingAlg
 def LArRawChannelBuilderDefault():
     from AthenaCommon.AlgSequence import AlgSequence
     topSequence = AlgSequence()
-    from AthenaCommon.AppMgr import ServiceMgr as svcMgr
 
     if larRODFlags.readDigits() and globalflags.InputFormat() == 'bytestream':
         if LArRawDataReadingAlg() not in topSequence:
@@ -23,16 +22,24 @@ def LArRawChannelBuilderDefault():
         if larRODFlags.keepDSPRaw():
             theLArRawChannelBuilder.LArRawChannelKey=larRODFlags.RawChannelFromDigitsContainerName()
 
+        obj = "AthenaAttributeList"
+        db = 'LAR_ONL'
         if globalflags.DataSource() == 'data':
-           fld="/LAR/Configuration/DSPThresholdFlat/Thresholds"
-           dbString="<db>COOLONL_LAR/CONDBR2</db>"
+            from IOVDbSvc.CondDB import conddb
+            if conddb.GetInstance() == 'COMP200':
+                fld='/LAR/Configuration/DSPThreshold/Thresholds'
+                theLArRawChannelBuilder.Run1DSPThresholdsKey='LArDSPThresholds'
+                obj='LArDSPThresholdsComplete'
+            else:
+                fld="/LAR/Configuration/DSPThresholdFlat/Thresholds"
+                theLArRawChannelBuilder.Run2DSPThresholdsKey=fld
         else:   
            fld="/LAR/NoiseOfl/DSPThresholds"
-           dbString="<db>COOLOFL_LAR/OFLP200</db>"
+           theLArRawChannelBuilder.Run2DSPThresholdsKey=fld
+           db = 'LAR_OFL'
 
-        theLArRawChannelBuilder.DSPThresholdsKey=fld
         from IOVDbSvc.CondDB import conddb
-        conddb.addFolder ("", fld+dbString, className="AthenaAttributeList")   
+        conddb.addFolder (db, fld, className=obj)
 
         topSequence += theLArRawChannelBuilder
 
diff --git a/LArCalorimeter/LArROD/src/LArRawChannelBuilderAlg.cxx b/LArCalorimeter/LArROD/src/LArRawChannelBuilderAlg.cxx
index fa210727ac5007e90cec4a00b11452c528c6b5e7..929fd976e6f4ef12760fab41f204939f3e348169 100644
--- a/LArCalorimeter/LArROD/src/LArRawChannelBuilderAlg.cxx
+++ b/LArCalorimeter/LArROD/src/LArRawChannelBuilderAlg.cxx
@@ -21,12 +21,22 @@ StatusCode LArRawChannelBuilderAlg::initialize() {
   ATH_CHECK(m_ofcKey.initialize());	 
   ATH_CHECK(m_shapeKey.initialize());
   ATH_CHECK(m_cablingKey.initialize() );
-  ATH_CHECK(m_thresholdsKey.initialize(m_useDBFortQ) );
+  ATH_CHECK(m_run1DSPThresholdsKey.initialize(SG::AllowEmpty) );
+  ATH_CHECK(m_run2DSPThresholdsKey.initialize(SG::AllowEmpty) );
+  if (m_useDBFortQ) {
+    if (m_run1DSPThresholdsKey.empty() && m_run2DSPThresholdsKey.empty()) {
+      ATH_MSG_ERROR ("useDB requested but neither Run1DSPThresholdsKey nor Run2DSPThresholdsKey initialized.");
+      return StatusCode::FAILURE;
+    }
+  }
 
   ATH_CHECK(detStore()->retrieve(m_onlineId,"LArOnlineID"));
 
   const std::string cutmsg = m_absECutFortQ.value() ? " fabs(E) < " : " E < "; 
-  ATH_MSG_INFO("Energy cut for time and quality computation: " << cutmsg << " taken from COOL folder "<<m_thresholdsKey.key());
+  ATH_MSG_INFO("Energy cut for time and quality computation: " << cutmsg << 
+               " taken from COOL folder "<<
+               m_run1DSPThresholdsKey.key() << " (run1) " <<
+               m_run2DSPThresholdsKey.key() << " (run2) ");
   return StatusCode::SUCCESS;
 }     
 
@@ -58,15 +68,26 @@ StatusCode LArRawChannelBuilderAlg::execute(const EventContext& ctx) const {
 
   SG::ReadCondHandle<LArOnOffIdMapping> cabling(m_cablingKey,ctx);
   
-  std::unique_ptr<LArDSPThresholdsFlat> dspThreshFlat;
+  std::unique_ptr<LArDSPThresholdsFlat> run2DSPThresh;
+  const LArDSPThresholdsComplete* run1DSPThresh = nullptr;
   if (m_useDBFortQ) {
-     SG::ReadCondHandle<AthenaAttributeList> dspThrshAttr (m_thresholdsKey, ctx);
-     dspThreshFlat = std::unique_ptr<LArDSPThresholdsFlat>(new LArDSPThresholdsFlat(*dspThrshAttr));
-     if (ATH_UNLIKELY(!dspThreshFlat->good())) {
-         ATH_MSG_ERROR( "Failed to initialize LArDSPThresholdFlat from attribute list loaded from " << m_thresholdsKey.key()
-                   << ". Aborting." ); 
-         return StatusCode::FAILURE;
-     }
+    if (!m_run2DSPThresholdsKey.empty()) {
+      SG::ReadCondHandle<AthenaAttributeList> dspThrshAttr (m_run2DSPThresholdsKey, ctx);
+      run2DSPThresh = std::unique_ptr<LArDSPThresholdsFlat>(new LArDSPThresholdsFlat(*dspThrshAttr));
+      if (ATH_UNLIKELY(!run2DSPThresh->good())) {
+        ATH_MSG_ERROR( "Failed to initialize LArDSPThresholdFlat from attribute list loaded from " << m_run2DSPThresholdsKey.key()
+                       << ". Aborting." ); 
+        return StatusCode::FAILURE;
+      }
+    }
+    else if (!m_run1DSPThresholdsKey.empty()) {
+      SG::ReadCondHandle<LArDSPThresholdsComplete> dspThresh (m_run1DSPThresholdsKey, ctx);
+      run1DSPThresh = dspThresh.cptr();
+    }
+    else {
+      ATH_MSG_ERROR( "No DSP threshold configured.");
+      return StatusCode::FAILURE;
+    }
   }
 
   //Loop over digits:
@@ -130,7 +151,21 @@ StatusCode LArRawChannelBuilderAlg::execute(const EventContext& ctx) const {
 
     const float E1=m_absECutFortQ.value() ? std::fabs(E) : E;
     float ecut(0.);
-    if (m_useDBFortQ) { ecut = dspThreshFlat->tQThr(id);} else { ecut = m_eCutFortQ;}
+    if (m_useDBFortQ) {
+      if (run2DSPThresh) {
+        ecut = run2DSPThresh->tQThr(id);
+      }
+      else if (run1DSPThresh) {
+        ecut = run1DSPThresh->tQThr(id);
+      }
+      else {
+        ATH_MSG_ERROR ("DSP threshold problem");
+        return StatusCode::FAILURE;
+      }
+    }
+    else {
+      ecut = m_eCutFortQ;
+    }
     if (E1 > ecut) {
       ATH_MSG_VERBOSE("Channel " << m_onlineId->channel_name(id) << " gain " << gain << " above threshold for tQ computation");
       prov|=0x2000; //  fill bit in provenance that time+quality information are available
diff --git a/LArCalorimeter/LArRawEvent/LArRawEvent/ATLAS_CHECK_THREAD_SAFETY b/LArCalorimeter/LArRawEvent/LArRawEvent/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..dadd1ea69efe387cf6c09e1caecc4ea370a47909
--- /dev/null
+++ b/LArCalorimeter/LArRawEvent/LArRawEvent/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+LArCalorimeter/LArRawEvent
diff --git a/LArCalorimeter/LArRawEvent/LArRawEvent/LArAccumulatedDigit.h b/LArCalorimeter/LArRawEvent/LArRawEvent/LArAccumulatedDigit.h
index 667e24ee8d1f9c064fbcdd7a7a9f2f1ecdcae092..3a3b72c496ee76fd1b65ebdf7313d7b86a9f684a 100755
--- a/LArCalorimeter/LArRawEvent/LArRawEvent/LArAccumulatedDigit.h
+++ b/LArCalorimeter/LArRawEvent/LArRawEvent/LArAccumulatedDigit.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
 */
 
 
@@ -102,8 +102,10 @@ public:
 
 
   /** @brief Accumulate new values  */
-  bool setAddSubStep(const CaloGain::CaloGain gain_value, const HWIdentifier chid, 
-		     const std::vector<uint64_t> sampleSum, const std::vector <uint64_t> sampleSquare, 
+  bool setAddSubStep(const CaloGain::CaloGain gain_value,
+                     const HWIdentifier chid, 
+		     const std::vector<uint64_t>& sampleSum,
+                     const std::vector <uint64_t>& sampleSquare, 
 		     const unsigned nTrigger);
 
   void setAddSubStep(CaloGain::CaloGain gain_value, std::vector<uint32_t> sampleSum, 
diff --git a/LArCalorimeter/LArRawEvent/LArRawEvent/LArAccumulatedDigitContainer.h b/LArCalorimeter/LArRawEvent/LArRawEvent/LArAccumulatedDigitContainer.h
index edf1bef9d17537aa0a5114138f8c10cdb09df12a..f81541587bfb78965b3d2707c1405d3d0106ff3a 100755
--- a/LArCalorimeter/LArRawEvent/LArRawEvent/LArAccumulatedDigitContainer.h
+++ b/LArCalorimeter/LArRawEvent/LArRawEvent/LArAccumulatedDigitContainer.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,8 +34,6 @@ class LArAccumulatedDigitContainer : public DataVector<LArAccumulatedDigit> {
   inline int isLastStep() const { return (m_StepIndex==m_NStep-1); }
   //private:    
 
-  /** @brief SG ownership policy  */
-  SG::OwnershipPolicy  m_ownPolicy ;
   unsigned int m_NStep, m_StepIndex;
 };
 
diff --git a/LArCalorimeter/LArRawEvent/LArRawEvent/LArDigit.h b/LArCalorimeter/LArRawEvent/LArRawEvent/LArDigit.h
index e7664a36caa6e1ea7ab607bd48c617fea634d2ac..d1c0888805ba8cfe1964c0c617098a6cb36940bd 100755
--- a/LArCalorimeter/LArRawEvent/LArRawEvent/LArDigit.h
+++ b/LArCalorimeter/LArRawEvent/LArRawEvent/LArDigit.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 LARDIGIT_H
@@ -73,7 +73,7 @@ class LArDigit  {
     /** @brief Set new digits in object.
         @param[in] samples  vector of ADC time samples
     */
-    void setSamples( std::vector < short > samples);
+    void setSamples( const std::vector < short >& samples);
 
     /** @brief Destructor */
     virtual ~LArDigit() { }
diff --git a/LArCalorimeter/LArRawEvent/LArRawEvent/LArFebErrorSummary.h b/LArCalorimeter/LArRawEvent/LArRawEvent/LArFebErrorSummary.h
index 2333b158a8af5f3295604bc6bb41b6af54366f8f..dd8aa2f36433e0592a4cd1da01f56ea2222523cf 100755
--- a/LArCalorimeter/LArRawEvent/LArRawEvent/LArFebErrorSummary.h
+++ b/LArCalorimeter/LArRawEvent/LArRawEvent/LArFebErrorSummary.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 LARFEBERRORSUMMARY_H
@@ -54,7 +54,7 @@ class LArFebErrorSummary
   /** @brief  error is stored in a map with key = feb id */
   std::map<unsigned int,uint16_t> m_feb_errors; 
 
-  static std::string  m_errorStrings[N_LArFebErrorType] ; 
+  static const std::string  m_errorStrings[N_LArFebErrorType] ; 
 };
 
 CLASS_DEF(LArFebErrorSummary,223531796,0)
diff --git a/LArCalorimeter/LArRawEvent/LArRawEvent/LArFebHeader.h b/LArCalorimeter/LArRawEvent/LArRawEvent/LArFebHeader.h
index 093bd614bbedb6440ca2719ab245d84c9dd5c980..8964dd43f6a5836b0cc500941c049b8906fd80cc 100755
--- a/LArCalorimeter/LArRawEvent/LArRawEvent/LArFebHeader.h
+++ b/LArCalorimeter/LArRawEvent/LArRawEvent/LArFebHeader.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 LARFEBHEADER_H
@@ -184,7 +184,7 @@ class LArFebHeader
  private:
 
   /** @brief like explained in: http://mathworld.wolfram.com/GrayCode.html */
-  int degray(int x);
+  int degray(unsigned int x);
 
   /** @brief Feb Identifier */
   const HWIdentifier m_FEBId;  
diff --git a/LArCalorimeter/LArRawEvent/LArRawEvent/LArRawChannel.h b/LArCalorimeter/LArRawEvent/LArRawEvent/LArRawChannel.h
index d824feebd254d1ac585f1179232f30b02debc3af..9ed675d010727a6c69f6ec21405a0e961c6bdf1e 100755
--- a/LArCalorimeter/LArRawEvent/LArRawEvent/LArRawChannel.h
+++ b/LArCalorimeter/LArRawEvent/LArRawEvent/LArRawChannel.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 LArRawChannel_H
@@ -140,6 +140,7 @@ LArRawChannel::LArRawChannel( HWIdentifier chan_id,
         m_time(time), 
         m_gain(gain)
 { m_qualProv[0] = quality;
+  // cppcheck-suppress objectIndex
   m_qualProv[1] = provenance;
 } 
 
@@ -169,7 +170,11 @@ LArRawChannel::quality() const { return m_qualProv[0]; }
 
 inline
 uint16_t
-LArRawChannel::provenance() const { return m_qualProv[1]; }
+LArRawChannel::provenance() const
+{
+  // cppcheck-suppress objectIndex
+  return m_qualProv[1];
+}
 
 inline
 CaloGain::CaloGain 
diff --git a/LArCalorimeter/LArRawEvent/src/LArAccumulatedDigit.cxx b/LArCalorimeter/LArRawEvent/src/LArAccumulatedDigit.cxx
index 5fb170c11cca3e28339ab1121639010055f068b6..c2be80ae14dc7e28d738aa85793ad209f0f9e8de 100755
--- a/LArCalorimeter/LArRawEvent/src/LArAccumulatedDigit.cxx
+++ b/LArCalorimeter/LArRawEvent/src/LArAccumulatedDigit.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 "LArRawEvent/LArAccumulatedDigit.h"
@@ -32,10 +32,10 @@ LArAccumulatedDigit::LArAccumulatedDigit(HWIdentifier & channel_value,
 
   /** @brief Constructor (second type)*/      
 LArAccumulatedDigit::LArAccumulatedDigit(HWIdentifier & channel_value)
+  : m_hardwareID (channel_value),
+    m_gain       ((CaloGain::CaloGain) 0),
+    m_nTrigger   (0)
 {
-  m_hardwareID = channel_value;
-  m_gain       = (CaloGain::CaloGain) 0;
-  m_nTrigger   = 0;
 }
 
 /** Destructor */
@@ -114,8 +114,10 @@ bool LArAccumulatedDigit::setAddDigit(const std::vector<short>& digit) {
 
 
 
-bool LArAccumulatedDigit::setAddSubStep(const CaloGain::CaloGain gain_value, const HWIdentifier chid, 
-					const std::vector<uint64_t> sampleSum, const std::vector <uint64_t> sampleSquare, 
+bool LArAccumulatedDigit::setAddSubStep(const CaloGain::CaloGain gain_value,
+                                        const HWIdentifier chid, 
+					const std::vector<uint64_t>& sampleSum,
+                                        const std::vector <uint64_t>& sampleSquare, 
 					const unsigned nTrigger)
 {
   size_t i;
diff --git a/LArCalorimeter/LArRawEvent/src/LArAccumulatedDigitContainer.cxx b/LArCalorimeter/LArRawEvent/src/LArAccumulatedDigitContainer.cxx
index 08ff2f4147bcaa55526e4b6028060c4f9e6601c5..e7568c99acc5a1b53eae10adb167bd6954eb44dd 100755
--- a/LArCalorimeter/LArRawEvent/src/LArAccumulatedDigitContainer.cxx
+++ b/LArCalorimeter/LArRawEvent/src/LArAccumulatedDigitContainer.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 "LArRawEvent/LArAccumulatedDigitContainer.h" 
@@ -7,7 +7,7 @@
 
 LArAccumulatedDigitContainer::LArAccumulatedDigitContainer(SG::OwnershipPolicy ownPolicy ) : 
   DataVector<LArAccumulatedDigit>(ownPolicy),
-  m_ownPolicy(ownPolicy),m_NStep(0),m_StepIndex(0)
+  m_NStep(0),m_StepIndex(0)
 {}
 
 LArAccumulatedDigitContainer::~LArAccumulatedDigitContainer() 
diff --git a/LArCalorimeter/LArRawEvent/src/LArDigit.cxx b/LArCalorimeter/LArRawEvent/src/LArDigit.cxx
index 93ba0440e634377cb0f34d111a5d99547ac22726..e40b053352659c0176ed9ad6ec6ff38facc3fa48 100755
--- a/LArCalorimeter/LArRawEvent/src/LArDigit.cxx
+++ b/LArCalorimeter/LArRawEvent/src/LArDigit.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 <typeinfo>
@@ -68,7 +68,7 @@ LArDigit::operator std::string() const{
 }
 
 // set method
-void LArDigit::setSamples(std::vector<short> samples)
+void LArDigit::setSamples(const std::vector<short>& samples)
 {
   m_samples.clear();
   m_samples = samples;
diff --git a/LArCalorimeter/LArRawEvent/src/LArDigitContainer.cxx b/LArCalorimeter/LArRawEvent/src/LArDigitContainer.cxx
index 4280c8bbd86932e15abb619abec6288e65dded68..12e82b09fd1c071c9533389743cc460b42f6b95c 100755
--- a/LArCalorimeter/LArRawEvent/src/LArDigitContainer.cxx
+++ b/LArCalorimeter/LArRawEvent/src/LArDigitContainer.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "LArRawEvent/LArDigitContainer.h"
@@ -27,7 +27,7 @@ LArDigitContainer::operator std::string () const {
  int counter = 0 ;
  const LArDigit * digit ;    
  
-     for(it = this->begin() ; it != this->end() ; it++ ){ // Loop over Hits
+     for(it = this->begin() ; it != this->end() ; ++it ){ // Loop over Hits
      
        digit = *it ;
              
diff --git a/LArCalorimeter/LArRawEvent/src/LArFebErrorSummary.cxx b/LArCalorimeter/LArRawEvent/src/LArFebErrorSummary.cxx
index 0ef4c543f59af315ace34f2ffcf4fdc9b072ee79..0be28049001f492a7b692ac03b9cd316ad442eb2 100644
--- a/LArCalorimeter/LArRawEvent/src/LArFebErrorSummary.cxx
+++ b/LArCalorimeter/LArRawEvent/src/LArFebErrorSummary.cxx
@@ -1,11 +1,11 @@
 /*
-  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 "LArRawEvent/LArFebErrorSummary.h"
 
 // static constants
-std::string LArFebErrorSummary::m_errorStrings[N_LArFebErrorType] = {
+const std::string LArFebErrorSummary::m_errorStrings[N_LArFebErrorType] = {
     "Parity","BCID","SampleHeader","EVTID","ScacStatus","ScaOutOfRange",
     "GainMismatch","TypeMismatch","NumOfSamples","EmptyDataBlock","DspBlockSize","CheckSum", "MissingHeader",
     "BadGain" } ;
diff --git a/LArCalorimeter/LArRawEvent/src/LArFebHeader.cxx b/LArCalorimeter/LArRawEvent/src/LArFebHeader.cxx
index 222a9ed5b7074a041b281bf327f94c8b4eb354c1..6a5220183aa4bc486526eae0cbf39e1d98ab43c0 100755
--- a/LArCalorimeter/LArRawEvent/src/LArFebHeader.cxx
+++ b/LArCalorimeter/LArRawEvent/src/LArFebHeader.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 "LArRawEvent/LArFebHeader.h"
@@ -35,7 +35,7 @@ LArFebHeader::LArFebHeader(const HWIdentifier febid):m_FEBId(febid) {
 LArFebHeader::~LArFebHeader() 
 {}
 
-int LArFebHeader::degray(int x)
+int LArFebHeader::degray(unsigned int x)
 { // like explained in: http://mathworld.wolfram.com/GrayCode.html
 
   int i,j,sum;
@@ -62,7 +62,7 @@ int LArFebHeader::degray(int x)
               else
                 tmp1 = 0;
               if (i>0)
-                tmp2 = x & ((1<<i)-1);
+                tmp2 = x & ((1u<<i)-1);
               //    printf("tmp1 =%x tmp2=%x\n",tmp1,tmp2 );
 
               x=tmp1|tmp2;
diff --git a/MuonSpectrometer/Amdcsimrec/AmdcDb/AmdcDb/AmdcDb.h b/MuonSpectrometer/Amdcsimrec/AmdcDb/AmdcDb/AmdcDb.h
index a856709c32cc462951650da4a170f4bdca42f2a5..14b6f95fd171a2c0ed4f18c74bde3940d44d18b5 100755
--- a/MuonSpectrometer/Amdcsimrec/AmdcDb/AmdcDb/AmdcDb.h
+++ b/MuonSpectrometer/Amdcsimrec/AmdcDb/AmdcDb/AmdcDb.h
@@ -108,6 +108,8 @@ class AmdcDb final : public AthService, virtual public IRDBAccessSvcWithUpdate {
    std::vector<int>         m_ValFromRDBEpsLengthCM  ; //!< Control precision printing  
    std::vector<int>         m_ValFromRDBEpsAngle     ; //!< Control precision printing
    
+   IRDBRecordset_ptr m_emptyRecordset ; //!< Pointer on an empty Recordset
+
    ServiceHandle<AmdcsimrecAthenaSvc> p_AmdcsimrecAthenaSvc;  //!< Pointer On AmdcsimrecAthenaSvc
 
    //Db Keys
diff --git a/MuonSpectrometer/Amdcsimrec/AmdcDb/src/AmdcDb.cxx b/MuonSpectrometer/Amdcsimrec/AmdcDb/src/AmdcDb.cxx
index d5b99e55be7839c82d432293f920f418f3f5162f..98baf256284f9383a2bdd3b3b60e6c3cf9eb9671 100755
--- a/MuonSpectrometer/Amdcsimrec/AmdcDb/src/AmdcDb.cxx
+++ b/MuonSpectrometer/Amdcsimrec/AmdcDb/src/AmdcDb.cxx
@@ -21,6 +21,7 @@
 /// Standard Constructor
 AmdcDb::AmdcDb(const std::string& name,ISvcLocator* svc)
   : AthService(name,svc) 
+  , m_emptyRecordset(new AmdcDbRecordset())
   , p_AmdcsimrecAthenaSvc ( "AmdcsimrecAthenaSvc",name )
 {
   p_AmdcDbSvcFromAmdc = 0 ;
@@ -306,15 +307,15 @@ IRDBRecordset_ptr AmdcDb::getRecordsetPtr(const std::string& node,
                                           const std::string& /*tag2node*/ ,
                                           const std::string& /*connName*/)
 {
-  IRDBRecordset_ptr pIRDBRecordset; 
   if(tag=="RDB") {
-    pIRDBRecordset = p_AmdcDbSvcFromRDB->getRecordset(node);
+    return p_AmdcDbSvcFromRDB->getRecordset(node);
   }
   else if(tag=="Amdc") {
-    pIRDBRecordset = p_AmdcDbSvcFromAmdc->getRecordset(node);
+    return p_AmdcDbSvcFromAmdc->getRecordset(node);
+  }
+  else {
+    return m_emptyRecordset;
   }
-
-  return pIRDBRecordset;
 }
 
 // Functions of IRDBAccessSvc Not implemented
diff --git a/MuonSpectrometer/MuonCalib/MuonCalibPatRec/MuonCalibPatRec/MuonSegmentToCalibSegment.h b/MuonSpectrometer/MuonCalib/MuonCalibPatRec/MuonCalibPatRec/MuonSegmentToCalibSegment.h
index 63a2daad71d68fa371fe7caca397944e263221bf..e0f33a3339d7676ca3a12d281cbb9b0aa8197732 100644
--- a/MuonSpectrometer/MuonCalib/MuonCalibPatRec/MuonCalibPatRec/MuonSegmentToCalibSegment.h
+++ b/MuonSpectrometer/MuonCalib/MuonCalibPatRec/MuonCalibPatRec/MuonSegmentToCalibSegment.h
@@ -44,10 +44,6 @@ output the muon calibration input.
     StatusCode execute();
 
   private:
-
-    /** retrieve patterns and segments from storegate */
-    //    const Muon::MuonSegmentCollection* retrieveSegments();
-  
     /** retrieve patterns from storegate */
     const MuonSegmentCombinationCollection* retrieveSegmentCombinations() const;
     const Trk::SegmentCollection* retrieveSegments(const std::string colName) const;
diff --git a/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/MuonByteStreamCnvTest/RpcDigitToRpcRDO.h b/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/MuonByteStreamCnvTest/RpcDigitToRpcRDO.h
index 6d11c6fef7491860cd7ffbf03cdca60d0019bc7a..254e219210b75b4f30090b9df4f3caa31265316b 100644
--- a/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/MuonByteStreamCnvTest/RpcDigitToRpcRDO.h
+++ b/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/MuonByteStreamCnvTest/RpcDigitToRpcRDO.h
@@ -53,7 +53,7 @@ private:
   //       RDOs produced in release 22. The fillTagInfo() function thus needs to stay in release 22 until the workflow changes
   StatusCode fillTagInfo() const;
 
-  const MuonGM::MuonDetectorManager* m_MuonMgr;
+  const MuonGM::MuonDetectorManager* m_MuonMgr; // no ReadCondHandleKey used here for now, since no alignment applied in digitisation
 
   IntegerProperty m_fast_debug{this, "FastDebug", 0, "bits for debugging 'fast' algos"};
   IntegerProperty m_monitoring{this, "Monitoring", 0, "bits for monitoring sequence"};
diff --git a/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/src/MuonRdoToMuonDigitTool.cxx b/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/src/MuonRdoToMuonDigitTool.cxx
index d0d22e912dd2460491c2741c18c881b64924c5e2..cee890b39e6168294addbd190532127d0cc17b8c 100644
--- a/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/src/MuonRdoToMuonDigitTool.cxx
+++ b/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/src/MuonRdoToMuonDigitTool.cxx
@@ -714,11 +714,10 @@ StatusCode MuonRdoToMuonDigitTool::decodeTgc (const TgcRdo& rdoColl,
               }
 
 	      // check duplicate digits
-	      TgcDigitCollection::const_iterator it_tgcDigit;
 	      bool duplicate = false;
-	      for (it_tgcDigit=coll->begin(); it_tgcDigit != coll->end(); it_tgcDigit++) {
-		if ((newDigit->identify() == (*it_tgcDigit)->identify()) && 
-		    (newDigit->bcTag()    == (*it_tgcDigit)->bcTag())) {
+              for (const TgcDigit* digit : *coll) {
+		if ((newDigit->identify() == digit->identify()) && 
+		    (newDigit->bcTag()    == digit->bcTag())) {
 		  duplicate = true;
 		  ATH_MSG_DEBUG( "Duplicate TGC Digit removed"   );
 		  break;
diff --git a/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/src/TgcRdoToTgcDigit.cxx b/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/src/TgcRdoToTgcDigit.cxx
index f0ce17ddafc33dc1e87367133e26c072a841772e..cac20878035f444e9af7458a2758c5d364bc7b31 100644
--- a/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/src/TgcRdoToTgcDigit.cxx
+++ b/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/src/TgcRdoToTgcDigit.cxx
@@ -99,10 +99,8 @@ StatusCode TgcRdoToTgcDigit::decodeTgc( const TgcRdo *rdoColl,
       }
     }
     // Covert to original hit patterns
-    std::map<std::vector<uint16_t>, uint16_t>::iterator jtMap   = stripMap.begin();
-    std::map<std::vector<uint16_t>, uint16_t>::iterator jtMap_e = stripMap.end();
-    for(; jtMap!=jtMap_e; jtMap++) {
-      if(jtMap->second<=31) {
+    for (auto& jtPair : stripMap) {
+      if(jtPair.second<=31) {
         // x    : 5-bit variable
         // f(x) : OR function above, Digit->RDO conversion
         // g(x) : originalHitBits which satisfies f(g(f(x))) = f(x), RDO->Digit conversion
@@ -116,9 +114,9 @@ StatusCode TgcRdoToTgcDigit::decodeTgc( const TgcRdo *rdoColl,
           // 24  25  26  27  28  29  30  31
           16, 17,  0, 19, 24, 25, 28, 31
         };
-        jtMap->second = originalHitBits[jtMap->second];
+        jtPair.second = originalHitBits[jtPair.second];
       } else {
-        jtMap->second = 0;
+        jtPair.second = 0;
       }
     }
     // TGC2 Endcap Strip OR channel treatement preparation end
@@ -248,11 +246,10 @@ StatusCode TgcRdoToTgcDigit::decodeTgc( const TgcRdo *rdoColl,
           }
 
           // check duplicate digits
-          TgcDigitCollection::const_iterator it_tgcDigit;
           bool duplicate = false;
-          for (it_tgcDigit=collection->begin(); it_tgcDigit != collection->end(); it_tgcDigit++) {
-            if ((newDigit->identify() == (*it_tgcDigit)->identify()) &&
-                (newDigit->bcTag()    == (*it_tgcDigit)->bcTag())) {
+          for (const TgcDigit* digit : *collection) {
+            if ((newDigit->identify() == digit->identify()) &&
+                (newDigit->bcTag()    == digit->bcTag())) {
               duplicate = true;
               ATH_MSG_DEBUG( "Duplicate TGC Digit removed"   );
               break;
diff --git a/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/src/CSC_RawDataProviderToolCore.cxx b/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/src/CSC_RawDataProviderToolCore.cxx
index f8364e43444e0f1f840a5b1b2df7058dcc830820..42a115e25837d6c1dc5551ee1a4566e6f24c4d97 100644
--- a/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/src/CSC_RawDataProviderToolCore.cxx
+++ b/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/src/CSC_RawDataProviderToolCore.cxx
@@ -2,10 +2,6 @@
   Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
-///////////////////////////////////////////////////////////////////
-// CSC_RawDataProviderToolCore.cxx, (c) ATLAS Detector software
-///////////////////////////////////////////////////////////////////
-
 #include "CSC_RawDataProviderToolCore.h"
 #include "MuonReadoutGeometry/MuonDetectorManager.h"
 #include "ByteStreamData/ROBData.h"
@@ -28,7 +24,6 @@ Muon::CSC_RawDataProviderToolCore::CSC_RawDataProviderToolCore(const std::string
                                                        const std::string& n,
                                                        const IInterface*  p) :
   AthAlgTool(t, n, p),
-  m_muonMgr(nullptr),
   m_robDataProvider("ROBDataProviderSvc",n),
   m_cabling("CSCcablingSvc", n)
 {
@@ -40,7 +35,6 @@ Muon::CSC_RawDataProviderToolCore::CSC_RawDataProviderToolCore(const std::string
 StatusCode Muon::CSC_RawDataProviderToolCore::initialize()
 {
   
-  ATH_CHECK( detStore()->retrieve( m_muonMgr ) );
   ATH_CHECK( m_cabling.retrieve() );
   ATH_CHECK( m_robDataProvider.retrieve() );
   ATH_MSG_INFO ( "Retrieved service " << m_robDataProvider );
@@ -52,8 +46,6 @@ StatusCode Muon::CSC_RawDataProviderToolCore::initialize()
   ATH_CHECK(m_decoder.retrieve());
   ATH_MSG_INFO ( "Retrieved tool " << m_decoder );
 
-  ATH_MSG_INFO ( "The Muon Geometry version is " << m_muonMgr->geometryVersion() );
-
   ATH_CHECK( m_containerKey.initialize() );
   ATH_CHECK( m_eventInfoKey.initialize() );
 
diff --git a/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/src/CSC_RawDataProviderToolCore.h b/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/src/CSC_RawDataProviderToolCore.h
index 5f321b068458c3bcc4ae7060b81894496d3221bb..0a62b270e04749434a509b545219f866ad82a7ac 100644
--- a/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/src/CSC_RawDataProviderToolCore.h
+++ b/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/src/CSC_RawDataProviderToolCore.h
@@ -18,11 +18,6 @@
 #include "MuonIdHelpers/IMuonIdHelperSvc.h"
 #include "ByteStreamCnvSvcBase/IROBDataProviderSvc.h"
 
-namespace MuonGM
-{
-    class MuonDetectorManager;
-}
-
 namespace Muon
 {
 
@@ -47,8 +42,6 @@ protected:
 
   /** member variables for algorithm properties: */
   ToolHandle<ICSC_ROD_Decoder> m_decoder{this,"Decoder","Muon::CscROD_Decoder/CscROD_Decoder"};
-
-  const MuonGM::MuonDetectorManager* m_muonMgr;
   
   ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
 
diff --git a/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MdtRdoToPrepDataToolCore.cxx b/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MdtRdoToPrepDataToolCore.cxx
index 753250ad4d107dc53e183c0c65303082aa4f6c15..fd346bf9618ddc1ae960f21772a72fbb94cd5810 100644
--- a/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MdtRdoToPrepDataToolCore.cxx
+++ b/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MdtRdoToPrepDataToolCore.cxx
@@ -29,7 +29,6 @@ namespace {
 
 Muon::MdtRdoToPrepDataToolCore::MdtRdoToPrepDataToolCore(const std::string& t, const std::string& n, const IInterface* p) :
   AthAlgTool(t,n,p),
-  m_muonMgr(nullptr),
   m_mdtCalibSvcSettings(new MdtCalibrationSvcSettings()),
   m_calibratePrepData(true),
   m_fullEventDone(false),
@@ -63,7 +62,8 @@ Muon::MdtRdoToPrepDataToolCore::MdtRdoToPrepDataToolCore(const std::string& t, c
 
 StatusCode Muon::MdtRdoToPrepDataToolCore::initialize() {
   ATH_CHECK(AthAlgTool::initialize());
-  ATH_CHECK(detStore()->retrieve(m_muonMgr));
+  const MuonGM::MuonDetectorManager* muDetMgr=nullptr;
+  ATH_CHECK(detStore()->retrieve(muDetMgr));
   ATH_CHECK(m_calibrationTool.retrieve());
   ATH_MSG_VERBOSE("MdtCalibrationTool retrieved with pointer = "<<m_calibrationTool);
   ATH_CHECK(m_idHelperSvc.retrieve());
@@ -102,10 +102,10 @@ StatusCode Muon::MdtRdoToPrepDataToolCore::initialize() {
     for(int phi=6; phi<8; phi++) { // phi sectors
       for(int eta=1; eta<4; eta++) { // eta sectors
         for(int side=-1; side<2; side+=2) { // side
-          if( !m_muonMgr->getMuonStation("BMG", side*eta, phi) ) continue;
-          for(int roe=1; roe<=( m_muonMgr->getMuonStation("BMG", side*eta, phi) )->nMuonReadoutElements(); roe++) { // iterate on readout elemets
+          if( !muDetMgr->getMuonStation("BMG", side*eta, phi) ) continue;
+          for(int roe=1; roe<=( muDetMgr->getMuonStation("BMG", side*eta, phi) )->nMuonReadoutElements(); roe++) { // iterate on readout elemets
             const MdtReadoutElement* mdtRE =
-                  dynamic_cast<const MdtReadoutElement*> ( ( m_muonMgr->getMuonStation("BMG", side*eta, phi) )->getMuonReadoutElement(roe) ); // has to be an MDT
+                  dynamic_cast<const MdtReadoutElement*> ( ( muDetMgr->getMuonStation("BMG", side*eta, phi) )->getMuonReadoutElement(roe) ); // has to be an MDT
             if(mdtRE) initDeadChannels(mdtRE);
           }
         }
diff --git a/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MdtRdoToPrepDataToolCore.h b/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MdtRdoToPrepDataToolCore.h
index 4b938535173e8beb8aeab6d139f8137629f60b0c..d31aa3d533b11bbb76723eeeb0c07df65bfd05b0 100644
--- a/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MdtRdoToPrepDataToolCore.h
+++ b/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MdtRdoToPrepDataToolCore.h
@@ -88,10 +88,7 @@ namespace Muon
 
     const MdtCsmContainer* getRdoContainer();
     void processPRDHashes( const std::vector<IdentifierHash>& chamberHashInRobs, std::vector<IdentifierHash>& idWithDataVect );
-    bool handlePRDHash( IdentifierHash hash, const MdtCsmContainer& rdoContainer, std::vector<IdentifierHash>& idWithDataVect );
-  
-    /// Muon Detector Descriptor
-    const MuonGM::MuonDetectorManager* m_muonMgr;
+    bool handlePRDHash( IdentifierHash hash, const MdtCsmContainer& rdoContainer, std::vector<IdentifierHash>& idWithDataVect );    
         
     ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
         
diff --git a/MuonSpectrometer/MuonCnv/MuonRdoToPrepData/src/MdtRdoToMdtPrepData.cxx b/MuonSpectrometer/MuonCnv/MuonRdoToPrepData/src/MdtRdoToMdtPrepData.cxx
index bca0f102d8efb2bdfb3e857ed344477e3442f003..e4becf6d13fb4ffb17cf6361f6808decaffe5d9e 100755
--- a/MuonSpectrometer/MuonCnv/MuonRdoToPrepData/src/MdtRdoToMdtPrepData.cxx
+++ b/MuonSpectrometer/MuonCnv/MuonRdoToPrepData/src/MdtRdoToMdtPrepData.cxx
@@ -20,7 +20,6 @@ m_seededDecoding(false),
 m_roiCollectionKey("OutputRoIs"),
 m_mdtCollection("MDT_DriftCircles")
 {
-    declareProperty("DecodingTool",       m_tool,       "mdt rdo to prep data conversion tool" );
     declareProperty("PrintInputRdo",      m_print_inputRdo, "If true, will dump information about the input RDOs");
     declareProperty("PrintPrepData",      m_print_prepData, "If true, will dump information about the resulting PRDs");
     declareProperty("DoSeededDecoding",   m_seededDecoding, "If true decode only in RoIs");
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondTest/MuonCondTest/AlignCondAthTest.h b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondTest/MuonCondTest/AlignCondAthTest.h
index 0874ad5755acee09b95d8df242f3aec28fb1d98a..26f34292880e1756d2e698c879d97c0125ff0772 100755
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondTest/MuonCondTest/AlignCondAthTest.h
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondTest/MuonCondTest/AlignCondAthTest.h
@@ -1,9 +1,7 @@
 /*
-  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 ALIGNCONDATHTEST
 #define ALIGNCONDATHTEST
 
@@ -16,25 +14,16 @@
 
 #include <fstream>
 
-namespace MuonGM
-{
-    class MuonDetectorManager;
-    class MdtReadoutElement;
-}
-
 class AlignCondAthTest:public AthAlgorithm {
 public:
   AlignCondAthTest (const std::string& name, ISvcLocator* pSvcLocator);
 
 public:
-
    StatusCode initialize();
    StatusCode execute();
-   StatusCode finalize();
 
 private:
-
-   const MuonGM::MuonDetectorManager*  m_MuonDetMgrDS;
+   const MuonGM::MuonDetectorManager* m_MuonDetMgrDS; // nominal MuonDetectorManager (no alignment) from the DetectorStore (needed in this test alg to compare against the ConditionsObject)
    SG::ReadCondHandleKey<MuonGM::MuonDetectorManager> m_DetectorManagerKey {this, "DetectorManagerKey", 
       "MuonDetectorManager", 
       "Key of input MuonDetectorManager condition data"};    
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondTest/src/AlignCondAthTest.cxx b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondTest/src/AlignCondAthTest.cxx
index 0d1759254e2cd69dba7f40bf80649724075cd38d..5bfbdf761cce04b52e7d6b1d3b509d3ebb5e7d73 100755
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondTest/src/AlignCondAthTest.cxx
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondTest/src/AlignCondAthTest.cxx
@@ -2,16 +2,13 @@
   Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
-
 #include "MuonCondTest/AlignCondAthTest.h"
-#include "MuonReadoutGeometry/MuonDetectorManager.h"
+
 #include "MuonReadoutGeometry/MdtReadoutElement.h"
 #include "MuonReadoutGeometry/RpcReadoutElement.h"
 #include "MuonReadoutGeometry/TgcReadoutElement.h"
 #include "MuonReadoutGeometry/CscReadoutElement.h"
 #include "MuonAlignmentData/CorrContainer.h"
-#include "Identifier/IdentifierHash.h"
-#include "Identifier/Identifier.h"
 #include "GeoPrimitives/GeoPrimitivesToStringConverter.h"
 
 AlignCondAthTest::AlignCondAthTest(const std::string& name, ISvcLocator* pSvcLocator) :
@@ -32,13 +29,8 @@ AlignCondAthTest::AlignCondAthTest(const std::string& name, ISvcLocator* pSvcLoc
 }
  
 StatusCode AlignCondAthTest::initialize(){
-//
 
-  ATH_MSG_INFO( "in initialize()"  );
-  if (StatusCode::SUCCESS != detStore()->retrieve(m_MuonDetMgrDS)) {
-    ATH_MSG_FATAL("Couldn't load MuonDetectorManager");
-    return StatusCode::FAILURE;
-  }
+  ATH_CHECK(detStore()->retrieve(m_MuonDetMgrDS));
 
   ATH_CHECK(m_idHelperSvc.retrieve());
 
@@ -137,15 +129,6 @@ StatusCode AlignCondAthTest::execute() {
   return StatusCode::SUCCESS;
 //
 }
- 
-StatusCode AlignCondAthTest::finalize() {
-//
-
-  ATH_MSG_INFO( "in finalize()"  );
-//
-  return StatusCode::SUCCESS;
-//
-}
 
 StatusCode AlignCondAthTest::checkALines(const MuonGM::MuonDetectorManager* manager, std::ofstream* fout) 
 {
diff --git a/MuonSpectrometer/MuonConfig/python/CSC_DigitizationConfig.py b/MuonSpectrometer/MuonConfig/python/CSC_DigitizationConfig.py
index 7c30108400376955b3ab81367bac48503f202b5f..f215ecb6bd306db366c41f2ca05a76aed6cf111e 100644
--- a/MuonSpectrometer/MuonConfig/python/CSC_DigitizationConfig.py
+++ b/MuonSpectrometer/MuonConfig/python/CSC_DigitizationConfig.py
@@ -11,6 +11,7 @@ from MuonConfig.MuonByteStreamCnvTestConfig import CscDigitToCscRDOCfg
 from MuonConfig.MuonCablingConfig import CSCCablingConfigCfg
 from Digitization.TruthDigitizationOutputConfig import TruthDigitizationOutputCfg
 from Digitization.PileUpToolsConfig import PileUpToolsCfg
+from Digitization.PileUpMergeSvcConfigNew import PileUpMergeSvcCfg, PileUpXingFolderCfg
 
 
 # The earliest and last bunch crossing times for which interactions will be sent
@@ -23,14 +24,13 @@ def CSC_LastXing():
     return 175
 
 
-def CSC_RangeToolCfg(flags, name="CSC_Range", **kwargs):
+def CSC_RangeCfg(flags, name="CSC_Range", **kwargs):
     """Return a PileUpXingFolder tool configured for CSC"""
     kwargs.setdefault("FirstXing", CSC_FirstXing())
     kwargs.setdefault("LastXing",  CSC_LastXing())
     kwargs.setdefault("CacheRefreshFrequency", 1.0)
     kwargs.setdefault("ItemList", ["CSCSimHitCollection#CSC_Hits"])
-    PileUpXingFolder = CompFactory.PileUpXingFolder
-    return PileUpXingFolder(name, **kwargs)
+    return PileUpXingFolderCfg(flags, name, **kwargs)
 
 
 def CSC_DigitizationToolCommonCfg(flags, name="CscDigitizationTool", **kwargs):
@@ -58,13 +58,18 @@ def CSC_DigitizationToolCommonCfg(flags, name="CscDigitizationTool", **kwargs):
 
 def CSC_DigitizationToolCfg(flags, name="CscDigitizationTool", **kwargs):
     """Return a ComponentAccumulator with configured CscDigitizationTool"""
+    acc = ComponentAccumulator()
+    rangetool = acc.popToolsAndMerge(CSC_RangeCfg(flags))
+    acc.merge(PileUpMergeSvcCfg(flags, Intervals=rangetool))
     kwargs.setdefault("InputObjectName", "CSC_Hits")
     kwargs.setdefault("OutputObjectName", "CSC_DIGITS")
     if flags.Digitization.PileUpPremixing:
         kwargs.setdefault("CSCSimDataCollectionOutputName", flags.Overlay.BkgPrefix + "CSC_SDO")
     else:
         kwargs.setdefault("CSCSimDataCollectionOutputName", "CSC_SDO")
-    return CSC_DigitizationToolCommonCfg(flags, name, **kwargs)
+    tool = acc.popToolsAndMerge(CSC_DigitizationToolCommonCfg(flags, name, **kwargs))
+    acc.setPrivateTools(tool)
+    return acc
 
 
 def CSC_OverlayDigitizationToolCfg(flags, name="CscOverlayDigitizationTool", **kwargs):
diff --git a/MuonSpectrometer/MuonConfig/python/MDT_DigitizationConfig.py b/MuonSpectrometer/MuonConfig/python/MDT_DigitizationConfig.py
index 4826a2b8d2ec512857766a82a4a5b650d116d545..94ed7f1ad3ce7f1656dd70477cb713557c178c3d 100644
--- a/MuonSpectrometer/MuonConfig/python/MDT_DigitizationConfig.py
+++ b/MuonSpectrometer/MuonConfig/python/MDT_DigitizationConfig.py
@@ -11,6 +11,7 @@ from MuonConfig.MuonCablingConfig import MDTCablingConfigCfg
 from MuonConfig.MuonCalibConfig import MdtCalibrationDbToolCfg
 from Digitization.TruthDigitizationOutputConfig import TruthDigitizationOutputCfg
 from Digitization.PileUpToolsConfig import PileUpToolsCfg
+from Digitization.PileUpMergeSvcConfigNew import PileUpMergeSvcCfg, PileUpXingFolderCfg
 
 
 # The earliest and last bunch crossing times for which interactions will be sent
@@ -24,14 +25,13 @@ def MDT_LastXing():
     return 150
 
 
-def MDT_RangeToolCfg(flags, name="MDT_Range", **kwargs):
+def MDT_RangeCfg(flags, name="MDT_Range", **kwargs):
     """Return a PileUpXingFolder tool configured for MDT"""
     kwargs.setdefault("FirstXing", MDT_FirstXing())
     kwargs.setdefault("LastXing",  MDT_LastXing())
     kwargs.setdefault("CacheRefreshFrequency", 1.0)
     kwargs.setdefault("ItemList", ["MDTSimHitCollection#MDT_Hits"])
-    PileUpXingFolder=CompFactory.PileUpXingFolder
-    return PileUpXingFolder(name, **kwargs)
+    return PileUpXingFolderCfg(flags, name, **kwargs)
 
 
 def RT_Relation_DB_DigiToolCfg(flags, name="RT_Relation_DB_DigiTool", **kwargs):
@@ -82,12 +82,17 @@ def MDT_DigitizationToolCommonCfg(flags, name="MdtDigitizationTool", **kwargs):
 
 def MDT_DigitizationToolCfg(flags, name="MdtDigitizationTool", **kwargs):
     """Return ComponentAccumulator with configured MdtDigitizationTool"""
+    acc = ComponentAccumulator()
+    rangetool = acc.popToolsAndMerge(MDT_RangeCfg(flags))
+    acc.merge(PileUpMergeSvcCfg(flags, Intervals=rangetool))
     kwargs.setdefault("OutputObjectName", "MDT_DIGITS")
     if flags.Digitization.PileUpPremixing:
         kwargs.setdefault("OutputSDOName", flags.Overlay.BkgPrefix + "MDT_SDO")
     else:
         kwargs.setdefault("OutputSDOName", "MDT_SDO")
-    return MDT_DigitizationToolCommonCfg(flags, name, **kwargs)
+    tool = acc.popToolsAndMerge(MDT_DigitizationToolCommonCfg(flags, name, **kwargs))
+    acc.setPrivateTools(tool)
+    return acc
 
 
 def MDT_OverlayDigitizationToolCfg(flags, name="Mdt_OverlayDigitizationTool", **kwargs):
diff --git a/MuonSpectrometer/MuonConfig/python/RPC_DigitizationConfig.py b/MuonSpectrometer/MuonConfig/python/RPC_DigitizationConfig.py
index 50333b6e6fe71c96fed5928c67f97794194c19bd..11876f0d741e6d00dd458b6ff51af0ea0dd3f5d6 100644
--- a/MuonSpectrometer/MuonConfig/python/RPC_DigitizationConfig.py
+++ b/MuonSpectrometer/MuonConfig/python/RPC_DigitizationConfig.py
@@ -10,6 +10,7 @@ from MuonConfig.MuonByteStreamCnvTestConfig import RpcDigitToRpcRDOCfg
 from MuonConfig.MuonCablingConfig import RPCCablingConfigCfg
 from Digitization.TruthDigitizationOutputConfig import TruthDigitizationOutputCfg
 from Digitization.PileUpToolsConfig import PileUpToolsCfg
+from Digitization.PileUpMergeSvcConfigNew import PileUpMergeSvcCfg, PileUpXingFolderCfg
 
 
 # The earliest and last bunch crossing times for which interactions will be sent
@@ -22,14 +23,13 @@ def RPC_LastXing():
     return 125
 
 
-def RPC_RangeToolCfg(flags, name="RPC_Range", **kwargs):
+def RPC_RangeCfg(flags, name="RPC_Range", **kwargs):
     """Return a PileUpXingFolder tool configured for RPC"""
     kwargs.setdefault("FirstXing", RPC_FirstXing())
     kwargs.setdefault("LastXing", RPC_LastXing())
     kwargs.setdefault("CacheRefreshFrequency", 1.0)
     kwargs.setdefault("ItemList", ["RPCSimHitCollection#RPC_Hits"])
-    PileUpXingFolder = CompFactory.PileUpXingFolder
-    return PileUpXingFolder(name, **kwargs)
+    return PileUpXingFolderCfg(flags, name, **kwargs)
 
 
 def RPC_DigitizationToolCommonCfg(flags, name="RpcDigitizationTool", **kwargs):
@@ -84,12 +84,17 @@ def RPC_DigitizationToolCommonCfg(flags, name="RpcDigitizationTool", **kwargs):
 
 def RPC_DigitizationToolCfg(flags, name="RpcDigitizationTool", **kwargs):
     """Return ComponentAccumulator with configured RpcDigitizationTool"""
+    acc = ComponentAccumulator()
+    rangetool = acc.popToolsAndMerge(RPC_RangeCfg(flags))
+    acc.merge(PileUpMergeSvcCfg(flags, Intervals=rangetool))
     kwargs.setdefault("OutputObjectName", "RPC_DIGITS")
     if flags.Digitization.PileUpPremixing:
         kwargs.setdefault("OutputSDOName", flags.Overlay.BkgPrefix + "RPC_SDO")
     else:
         kwargs.setdefault("OutputSDOName", "RPC_SDO")
-    return RPC_DigitizationToolCommonCfg(flags, name, **kwargs)
+    tool = acc.popToolsAndMerge(RPC_DigitizationToolCommonCfg(flags, name, **kwargs))
+    acc.setPrivateTools(tool)
+    return acc
 
 
 def RPC_OverlayDigitizationToolCfg(flags, name="Rpc_OverlayDigitizationTool", **kwargs):
diff --git a/MuonSpectrometer/MuonConfig/python/TGC_DigitizationConfig.py b/MuonSpectrometer/MuonConfig/python/TGC_DigitizationConfig.py
index 8d91c5a29c17dafa782ab7b495ed864d769b51fc..e0b8f50e9c2d6cae2e281e1ee904e23527a1d397 100644
--- a/MuonSpectrometer/MuonConfig/python/TGC_DigitizationConfig.py
+++ b/MuonSpectrometer/MuonConfig/python/TGC_DigitizationConfig.py
@@ -10,6 +10,7 @@ from MuonConfig.MuonByteStreamCnvTestConfig import TgcDigitToTgcRDOCfg
 from MuonConfig.MuonCablingConfig import TGCCablingConfigCfg
 from Digitization.TruthDigitizationOutputConfig import TruthDigitizationOutputCfg
 from Digitization.PileUpToolsConfig import PileUpToolsCfg
+from Digitization.PileUpMergeSvcConfigNew import PileUpMergeSvcCfg, PileUpXingFolderCfg
 
 
 # The earliest and last bunch crossing times for which interactions will be sent
@@ -22,19 +23,20 @@ def TGC_LastXing():
     return 75
 
 
-def TGC_RangeToolCfg(flags, name="TGC_Range", **kwargs):
+def TGC_RangeCfg(flags, name="TGC_Range", **kwargs):
     """Return a PileUpXingFolder tool configured for TGC"""
     kwargs.setdefault("FirstXing", TGC_FirstXing())
     kwargs.setdefault("LastXing", TGC_LastXing())
     kwargs.setdefault("CacheRefreshFrequency", 1.0)
     kwargs.setdefault("ItemList", ["TGCSimHitCollection#TGC_Hits"])
-    PileUpXingFolder = CompFactory.PileUpXingFolder
-    return PileUpXingFolder(name, **kwargs)
+    return PileUpXingFolderCfg(flags, name, **kwargs)
 
 
 def TGC_DigitizationToolCfg(flags, name="TgcDigitizationTool", **kwargs):
     """Return ComponentAccumulator with configured TgcDigitizationTool"""
     acc = ComponentAccumulator()
+    rangetool = acc.popToolsAndMerge(TGC_RangeCfg(flags))
+    acc.merge(PileUpMergeSvcCfg(flags, Intervals=rangetool))
     if flags.Digitization.DoXingByXingPileUp:
         kwargs.setdefault("FirstXing", TGC_FirstXing())
         kwargs.setdefault("LastXing", TGC_LastXing())
diff --git a/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest.ref b/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest.ref
index dcb83378af3ee53e17f8a6e06dd0eec8d0cb80b4..25dd304d912e8c4e4be6b7f7cc3835732ae19d0d 100644
--- a/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest.ref
+++ b/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest.ref
@@ -1,21 +1,587 @@
+Flag Name                                : Value
+Beam.BunchSpacing                        : 25
+Beam.Energy                              : [function]
+Beam.NumberOfCollisions                  : [function]
+Beam.Type                                : [function]
+Beam.estimatedLuminosity                 : [function]
+Common.Project                           : 'Athena'
+Common.bunchCrossingSource               : [function]
+Common.doExpressProcessing               : False
+Common.isOnline                          : False
+Common.useOnlineLumi                     : [function]
+Concurrency.NumConcurrentEvents          : 0
+Concurrency.NumProcs                     : 0
+Concurrency.NumThreads                   : 0
+Exec.DebugStage                          : ''
+Exec.MaxEvents                           : -1
+Exec.OutputLevel                         : 3
+Exec.SkipEvents                          : 0
+GeoModel.Align.Dynamic                   : [function]
+GeoModel.AtlasVersion                    : 'ATLAS-R2-2016-01-00-01'
+GeoModel.IBLLayout                       : [function]
+GeoModel.Layout                          : 'atlas'
+GeoModel.Run                             : [function]
+GeoModel.StripGeoType                    : [function]
+GeoModel.Type                            : [function]
+IOVDb.DatabaseInstance                   : [function]
+IOVDb.GlobalTag                          : 'CONDBR2-BLKPA-2018-13'
+Input.Collections                        : [function]
+Input.Files                              : ['/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1']
+Input.Format                             : [function]
+Input.ProjectName                        : [function]
+Input.RunNumber                          : [function]
+Input.SecondaryCollections               : [function]
+Input.SecondaryFiles                     : []
+Input.isMC                               : [function]
+Output.AODFileName                       : ''
+Output.ESDFileName                       : ''
+Output.EVNTFileName                      : ''
+Output.HISTFileName                      : ''
+Output.HITSFileName                      : ''
+Output.RDOFileName                       : ''
+Output.RDO_SGNLFileName                  : ''
+Output.doESD                             : [function]
+Output.doWriteAOD                        : [function]
+Output.doWriteBS                         : False
+Output.doWriteESD                        : [function]
+Output.doWriteRDO                        : [function]
+Output.doWriteRDO_SGNL                   : [function]
+Random.Engine                            : 'dSFMT'
+Scheduler.CheckDependencies              : True
+Scheduler.ShowControlFlow                : True
+Scheduler.ShowDataDeps                   : True
+Scheduler.ShowDataFlow                   : True
+TrackingGeometry.MagneticFileMode        : 6
+TrackingGeometry.MaterialSource          : 'COOL'
+Flag categories that can be loaded dynamically
+Category                  :                 Generator name : Defined in
+BField                    :                       __bfield : AthenaConfiguration/AllConfigFlags.py
+BTagging                  :                     __btagging : AthenaConfiguration/AllConfigFlags.py
+Calo                      :                         __calo : AthenaConfiguration/AllConfigFlags.py
+DQ                        :                           __dq : AthenaConfiguration/AllConfigFlags.py
+Detector                  :                     __detector : AthenaConfiguration/AllConfigFlags.py
+Digitization              :                 __digitization : AthenaConfiguration/AllConfigFlags.py
+Egamma                    :                       __egamma : AthenaConfiguration/AllConfigFlags.py
+InDet                     :                        __indet : AthenaConfiguration/AllConfigFlags.py
+LAr                       :                          __lar : AthenaConfiguration/AllConfigFlags.py
+MET                       :                          __met : AthenaConfiguration/AllConfigFlags.py
+Muon                      :                         __muon : AthenaConfiguration/AllConfigFlags.py
+MuonCombined              :                 __muoncombined : AthenaConfiguration/AllConfigFlags.py
+Overlay                   :                      __overlay : AthenaConfiguration/AllConfigFlags.py
+PF                        :                        __pflow : AthenaConfiguration/AllConfigFlags.py
+PerfMon                   :                      __perfmon : AthenaConfiguration/AllConfigFlags.py
+Sim                       :                   __simulation : AthenaConfiguration/AllConfigFlags.py
+Tile                      :                         __tile : AthenaConfiguration/AllConfigFlags.py
+Trigger                   :                      __trigger : AthenaConfiguration/AllConfigFlags.py
+Py:Athena            INFO About to setup Raw data decoding
+Py:Athena            INFO using release [WorkDir-22.0.18] [x86_64-centos7-gcc8-opt] [removeDuplicateProp/12d6dd5] -- built on [2020-09-17T1141]
+Py:AutoConfigFlags    INFO Obtaining metadata of auto-configuration by peeking into /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1
+Py:MetaReader        INFO Current mode used: peeker
+Py:MetaReader        INFO Current filenames: ['/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1']
+Py:ConfigurableDb    INFO Read module info for 5566 configurables from 4 genConfDb files
+Py:ConfigurableDb    INFO No duplicates have been found: that's good !
+EventInfoMgtInit: Got release version  Athena-22.0.18
+Py:IOVDbSvc.CondDB    INFO Setting up conditions DB access to instance OFLP200
+Py:Athena            INFO Print Config
+Py:ComponentAccumulator    INFO Event Inputs
+Py:ComponentAccumulator    INFO Event Algorithm Sequences
+Py:ComponentAccumulator    INFO AthSequencer('AthAlgSeq', Sequential=True, Members=[RpcRawDataProvider('RpcRawDataProvider', ProviderTool=RPC_RawDataProviderToolMT('RPC_RawDataProviderToolMT', Decoder=RpcROD_Decoder('RpcROD_Decoder'), RdoLocation='RPCPAD')), TgcRawDataProvider('TgcRawDataProvider', ProviderTool=TGC_RawDataProviderToolMT('TGC_RawDataProviderToolMT', Decoder=TGC_RodDecoderReadout('TgcROD_Decoder'), RdoLocation='TGCRDO')), MdtRawDataProvider('MdtRawDataProvider', ProviderTool=MDT_RawDataProviderToolMT('MDT_RawDataProviderToolMT', Decoder=MdtROD_Decoder('MdtROD_Decoder'), RdoLocation='MDTCSM')), CscRawDataProvider('CscRawDataProvider', ProviderTool=CSC_RawDataProviderToolMT('CSC_RawDataProviderToolMT', Decoder=CscROD_Decoder('CscROD_Decoder'), RdoLocation='CSCRDO')), RpcRdoToRpcPrepData('RpcRdoToRpcPrepData', DecodingTool=RpcRdoToPrepDataToolMT('RpcRdoToRpcPrepDataTool'), PrintPrepData=False, RegSel_RPC=RegSelTool('RegSelTool_RPC', RegSelLUT='RegSelLUTCondData_RPC', Initialised=True)), TgcRdoToTgcPrepData('TgcRdoToTgcPrepData', DecodingTool=TgcRdoToPrepDataToolMT('TgcRdoToTgcPrepDataTool'), PrintPrepData=False, RegSel_TGC=RegSelTool('RegSelTool_TGC', RegSelLUT='RegSelLUTCondData_TGC', Initialised=True)), MdtRdoToMdtPrepData('MdtRdoToMdtPrepData', DecodingTool=MdtRdoToPrepDataToolMT('MdtRdoToMdtPrepDataTool'), PrintPrepData=False, RegSel_MDT=RegSelTool('RegSelTool_MDT', RegSelLUT='RegSelLUTCondData_MDT', Initialised=True)), CscRdoToCscPrepData('CscRdoToCscPrepData', CscRdoToCscPrepDataTool=CscRdoToCscPrepDataToolMT('CscRdoToCscPrepDataTool'), PrintPrepData=False, RegSel_CSC=RegSelTool('RegSelTool_CSC', RegSelLUT='RegSelLUTCondData_CSC', Initialised=True)), CscThresholdClusterBuilder('CscThresholdClusterBuilder', cluster_builder=CscThresholdClusterBuilderTool('CscThresholdClusterBuilderTool'))])
+Py:ComponentAccumulator    INFO Condition Algorithms
+Py:ComponentAccumulator    INFO  \__ CondInputLoader (cond alg)
+Py:ComponentAccumulator    INFO  \__ MuonAlignmentCondAlg (cond alg)
+Py:ComponentAccumulator    INFO  \__ MuonDetectorCondAlg (cond alg)
+Py:ComponentAccumulator    INFO  \__ RpcCablingCondAlg (cond alg)
+Py:ComponentAccumulator    INFO  \__ MuonMDT_CablingAlg (cond alg)
+Py:ComponentAccumulator    INFO  \__ AtlasFieldMapCondAlg (cond alg)
+Py:ComponentAccumulator    INFO  \__ AtlasFieldCacheCondAlg (cond alg)
+Py:ComponentAccumulator    INFO  \__ RpcCondDbAlg (cond alg)
+Py:ComponentAccumulator    INFO  \__ RegSelCondAlg_RPC (cond alg)
+Py:ComponentAccumulator    INFO  \__ RegSelCondAlg_TGC (cond alg)
+Py:ComponentAccumulator    INFO  \__ MdtCalibDbAlg (cond alg)
+Py:ComponentAccumulator    INFO  \__ RegSelCondAlg_MDT (cond alg)
+Py:ComponentAccumulator    INFO  \__ CscCondDbAlg (cond alg)
+Py:ComponentAccumulator    INFO  \__ RegSelCondAlg_CSC (cond alg)
+Py:ComponentAccumulator    INFO Services
+Py:ComponentAccumulator    INFO ['ByteStreamCnvSvc', 'ByteStreamInputSvc', 'EventSelector', 'EventPersistencySvc', 'ROBDataProviderSvc', 'ByteStreamAddressProviderSvc', 'MetaDataStore', 'InputMetaDataStore', 'MetaDataSvc', 'ProxyProviderSvc', 'GeoModelSvc', 'DetDescrCnvSvc', 'TagInfoMgr', 'AGDDtoGeoSvc', 'MuonIdHelperSvc', 'IOVDbSvc', 'PoolSvc', 'CondSvc', 'DBReplicaSvc', 'AthenaPoolCnvSvc', 'RPCcablingServerSvc', 'MuonRPC_CablingSvc', 'LVL1TGC::TGCRecRoiSvc', 'TGCcablingServerSvc', 'MuonMDT_CablingSvc', 'CSCcablingSvc']
+Py:ComponentAccumulator    INFO Public Tools
+Py:ComponentAccumulator    INFO [
+Py:ComponentAccumulator    INFO   IOVDbMetaDataTool/IOVDbMetaDataTool,
+Py:ComponentAccumulator    INFO   ByteStreamMetadataTool/ByteStreamMetadataTool,
+Py:ComponentAccumulator    INFO   RPCCablingDbTool/RPCCablingDbTool,
+Py:ComponentAccumulator    INFO   Muon::RPC_RawDataProviderToolMT/RPC_RawDataProviderToolMT,
+Py:ComponentAccumulator    INFO   Muon::TGC_RawDataProviderToolMT/TGC_RawDataProviderToolMT,
+Py:ComponentAccumulator    INFO   MDTCablingDbTool/MDTCablingDbTool,
+Py:ComponentAccumulator    INFO   Muon::MDT_RawDataProviderToolMT/MDT_RawDataProviderToolMT,
+Py:ComponentAccumulator    INFO   Muon::CSC_RawDataProviderToolMT/CSC_RawDataProviderToolMT,
+Py:ComponentAccumulator    INFO ]
+Py:ComponentAccumulator    INFO Private Tools
+Py:ComponentAccumulator    INFO [
+Py:ComponentAccumulator    INFO ]
+Py:ComponentAccumulator    INFO TheApp properties
+Py:ComponentAccumulator    INFO   EvtSel : EventSelector
+Py:Athena            INFO Save Config
+
+JOs reading stage finished, launching CARunner from pickle file
+
+ApplicationMgr    SUCCESS 
+====================================================================================================================================
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v34r0)
+                                          running on pcaz004 on Thu Sep 17 11:43:35 2020
+====================================================================================================================================
+ApplicationMgr       INFO Application Manager Configured successfully
+CoreDumpSvc          INFO Handling signals: 11(Segmentation fault) 7(Bus error) 4(Illegal instruction) 8(Floating point exception) 
+ClassIDSvc           INFO  getRegistryEntries: read 4008 CLIDRegistry entries for module ALL
+MetaDataSvc          INFO Initializing MetaDataSvc - package version AthenaServices-00-00-00
+PoolSvc              INFO io_register[PoolSvc](xmlcatalog_file:PoolFileCatalog.xml) [ok]
+PoolSvc              INFO Set connectionsvc retry/timeout/IDLE timeout to  'ConnectionRetrialPeriod':300/ 'ConnectionRetrialTimeOut':3600/ 'ConnectionTimeOut':5 seconds with connection cleanup disabled
+PoolSvc              INFO Frontier compression level set to 5
+DBReplicaSvc         INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy-atlas.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://atlasbpfrontier.cern.ch:3127)(proxyurl=http://atlasbpfrontier.fnal.gov:3127) will be considered for COOL data
+DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2020-09-16T2101/Athena/22.0.18/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 10 servers found for host pcaz004.dyndns.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
+DBReplicaSvc         INFO COOL SQLite replicas will be excluded if matching pattern /DBRelease/
+PoolSvc              INFO Successfully setup replica sorting algorithm
+PoolSvc              INFO Setting up APR FileCatalog and Streams
+PoolSvc              INFO Resolved path (via ATLAS_POOLCOND_PATH) is /cvmfs/atlas-condb.cern.ch/repo/conditions/poolcond/PoolFileCatalog.xml
+PoolSvc           WARNING Unable to locate catalog for prfile:poolcond/PoolCat_oflcond.xml check your ATLAS_POOLCOND_PATH and DATAPATH variables
+PoolSvc           WARNING Unable to locate catalog for apcfile:poolcond/PoolCat_oflcond.xml check your ATLAS_POOLCOND_PATH and DATAPATH variables
+PoolSvc           WARNING Unable to locate catalog for prfile:poolcond/PoolCat_comcond.xml check your ATLAS_POOLCOND_PATH and DATAPATH variables
+PoolSvc           WARNING Unable to locate catalog for apcfile:poolcond/PoolCat_comcond.xml check your ATLAS_POOLCOND_PATH and DATAPATH variables
+PoolSvc              INFO POOL WriteCatalog is xmlcatalog_file:PoolFileCatalog.xml
+DbSession            INFO     Open     DbSession    
+Domain[ROOT_All]     INFO >   Access   DbDomain     READ      [ROOT_All] 
+ToolSvc.ByteStr...   INFO Initializing ToolSvc.ByteStreamMetadataTool - package version ByteStreamCnvSvc-00-00-00
+MetaDataSvc          INFO Found MetaDataTools = PublicToolHandleArray(['IOVDbMetaDataTool/IOVDbMetaDataTool','ByteStreamMetadataTool/ByteStreamMetadataTool'])
+OutputStreamSeq...   INFO Initializing OutputStreamSequencerSvc - package version AthenaServices-00-00-00
+ByteStreamAddre...   INFO Initializing ByteStreamAddressProviderSvc - package version ByteStreamCnvSvcBase-00-00-00
+ByteStreamAddre...   INFO initialized 
+ByteStreamAddre...   INFO -- Will fill Store with id =  0
+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
+IOVDbSvc             INFO Global tag: CONDBR2-BLKPA-2018-13 set from joboptions
+IOVDbFolder          INFO Inputfile tag override disabled for /GLOBAL/BField/Maps
+IOVDbSvc             INFO Initialised with 10 connections and 29 folders
+IOVDbSvc             INFO Service IOVDbSvc initialised successfully
+ClassIDSvc           INFO  getRegistryEntries: read 2789 CLIDRegistry entries for module ALL
+IOVDbSvc             INFO Opening COOL connection for COOLOFL_MUONALIGN/CONDBR2
+IOVSvc               INFO No IOVSvcTool associated with store "StoreGateSvc"
+IOVSvc.IOVSvcTool    INFO IOVRanges will be checked at every Event
+IOVDbSvc             INFO Opening COOL connection for COOLONL_RPC/CONDBR2
+IOVDbSvc             INFO Disconnecting from COOLOFL_MUONALIGN/CONDBR2
+IOVDbSvc             INFO Opening COOL connection for COOLONL_TGC/CONDBR2
+IOVDbSvc             INFO Disconnecting from COOLONL_RPC/CONDBR2
+IOVDbSvc             INFO Opening COOL connection for COOLONL_MDT/CONDBR2
+IOVDbSvc             INFO Disconnecting from COOLONL_TGC/CONDBR2
+IOVDbSvc             INFO Opening COOL connection for COOLONL_GLOBAL/CONDBR2
+IOVDbSvc             INFO Disconnecting from COOLONL_MDT/CONDBR2
+IOVDbSvc             INFO Opening COOL connection for COOLOFL_DCS/CONDBR2
+IOVDbSvc             INFO Disconnecting from COOLONL_GLOBAL/CONDBR2
+IOVDbSvc             INFO Opening COOL connection for COOLOFL_RPC/CONDBR2
+IOVDbSvc             INFO Disconnecting from COOLOFL_DCS/CONDBR2
+IOVDbSvc             INFO Opening COOL connection for COOLOFL_MDT/CONDBR2
+IOVDbSvc             INFO Disconnecting from COOLOFL_RPC/CONDBR2
+IOVDbSvc             INFO Opening COOL connection for COOLOFL_CSC/CONDBR2
+IOVDbSvc             INFO Disconnecting from COOLOFL_MDT/CONDBR2
+IOVDbSvc             INFO Disconnecting from COOLOFL_CSC/CONDBR2
+IOVDbSvc             INFO Added taginfo remove for /CSC/FTHOLD
+IOVDbSvc             INFO Added taginfo remove for /CSC/NOISE
+IOVDbSvc             INFO Added taginfo remove for /CSC/PED
+IOVDbSvc             INFO Added taginfo remove for /CSC/PSLOPE
+IOVDbSvc             INFO Added taginfo remove for /CSC/RMS
+IOVDbSvc             INFO Added taginfo remove for /CSC/STAT
+IOVDbSvc             INFO Added taginfo remove for /CSC/T0BASE
+IOVDbSvc             INFO Added taginfo remove for /CSC/T0PHASE
+IOVDbSvc             INFO Added taginfo remove for /EXT/DCS/MAGNETS/SENSORDATA
+IOVDbSvc             INFO Added taginfo remove for /GLOBAL/BField/Maps
+IOVDbSvc             INFO Added taginfo remove for /MDT/CABLING/MAP_SCHEMA
+IOVDbSvc             INFO Added taginfo remove for /MDT/CABLING/MEZZANINE_SCHEMA
+IOVDbSvc             INFO Added taginfo remove for /MDT/RTBLOB
+IOVDbSvc             INFO Added taginfo remove for /MDT/T0BLOB
+IOVDbSvc             INFO Added taginfo remove for /MUONALIGN/CSC/ILINES
+IOVDbSvc             INFO Added taginfo remove for /MUONALIGN/MDT/ASBUILTPARAMS
+IOVDbSvc             INFO Added taginfo remove for /MUONALIGN/MDT/BARREL
+IOVDbSvc             INFO Added taginfo remove for /MUONALIGN/MDT/ENDCAP/SIDEA
+IOVDbSvc             INFO Added taginfo remove for /MUONALIGN/MDT/ENDCAP/SIDEC
+IOVDbSvc             INFO Added taginfo remove for /MUONALIGN/TGC/SIDEA
+IOVDbSvc             INFO Added taginfo remove for /MUONALIGN/TGC/SIDEC
+IOVDbSvc             INFO Added taginfo remove for /RPC/CABLING/MAP_SCHEMA
+IOVDbSvc             INFO Added taginfo remove for /RPC/CABLING/MAP_SCHEMA_CORR
+IOVDbSvc             INFO Added taginfo remove for /RPC/DCS/DeadRopanels
+IOVDbSvc             INFO Added taginfo remove for /RPC/DCS/OffRopanels
+IOVDbSvc             INFO Added taginfo remove for /RPC/DQMF/ELEMENT_STATUS
+IOVDbSvc             INFO Added taginfo remove for /RPC/TRIGGER/CM_THR_ETA
+IOVDbSvc             INFO Added taginfo remove for /RPC/TRIGGER/CM_THR_PHI
+IOVDbSvc             INFO Added taginfo remove for /TGC/CABLING/MAP_SCHEMA
+GeoModelSvc          INFO Explicitly initializing DetDescrCnvSvc
+DetDescrCnvSvc       INFO  initializing 
+DetDescrCnvSvc       INFO Found DetectorStore service
+DetDescrCnvSvc       INFO  filling proxies for detector managers 
+DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for SCT_ID with CLID 2517 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for TRT_ID with CLID 2518 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for SiliconID with CLID 129452393 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArEM_ID with CLID 163583365 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArEM_SuperCell_ID with CLID 99488227 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArHEC_ID with CLID 3870484 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArHEC_SuperCell_ID with CLID 254277678 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArFCAL_ID with CLID 45738051 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArFCAL_SuperCell_ID with CLID 12829437 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArMiniFCAL_ID with CLID 79264204 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArOnlineID with CLID 158698068 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for TTOnlineID with CLID 38321944 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArOnline_SuperCellID with CLID 115600394 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArHVLineID with CLID 27863673 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArElectrodeID with CLID 80757351 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for TileID with CLID 2901 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for Tile_SuperCell_ID with CLID 49557789 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for TileHWID with CLID 2902 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for TileTBID with CLID 2903 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for MDTIDHELPER with CLID 4170 and storage type 68 to detector store 
+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 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 
+DetDescrCnvSvc       INFO  filling address for CaloDM_ID with CLID 167756483 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for ZdcID with CLID 190591643 and storage type 68 to detector store 
+GeoModelSvc.Muo...   INFO Initializing ...
+GeoModelSvc::RD...WARNING  Getting PixTBMatComponents with default tag
+GeoModelSvc::RD...WARNING  Getting PixTBMaterials with default tag
+GeoModelSvc::RD...WARNING  Getting InDetMatComponents with default tag
+GeoModelSvc::RD...WARNING  Getting InDetMaterials with default tag
+MuonGeoModel         INFO MuonDetectorFactory - constructor  MuonSystem OuterRadius 13000 Length 22030
+GeoModelSvc.Muo...   INFO create MuonDetectorTool - package version = MuonGeoModel-00-00-00
+GeoModelSvc.Muo...   INFO (from GeoModelSvc)    AtlasVersion = <ATLAS-R2-2016-01-00-01>  MuonVersion = <>
+GeoModelSvc.Muo...   INFO Keys for Muon Switches are  (key) ATLAS-R2-2016-01-00-01 (node) ATLAS
+GeoModelSvc.Muo...   INFO (from GeoModelSvc) in AtlasVersion = <ATLAS-R2-2016-01-00-01>  default MuonVersion is <MuonSpectrometer-R.08.01>
+GeoModelSvc.Muo...   INFO Properties have been set as follows: 
+GeoModelSvc.Muo...   INFO     LayoutName                     R
+GeoModelSvc.Muo...   INFO     IncludeCutouts                 0
+GeoModelSvc.Muo...   INFO     IncludeCutoutsBog              0
+GeoModelSvc.Muo...   INFO     IncludeCtbBis                  0
+GeoModelSvc.Muo...   INFO     ControlAlines                  111111
+GeoModelSvc.Muo...   INFO     MinimalGeoFlag                 0
+GeoModelSvc.Muo...   INFO     EnableCscIntAlignment          1
+GeoModelSvc.Muo...   INFO     EnableCscIntAlignmentFromGM    0
+GeoModelSvc.Muo...   INFO     ControlCscIntAlines            111111
+GeoModelSvc.Muo...   INFO     EnableMdtDeformations          1
+GeoModelSvc.Muo...   INFO     EnableMdtAsBuiltParameters     1
+MuGM:MuonFactory     INFO MuonLayout set to <R.08.01> = Development version for DC3 - infrastructures 
+MuGM:MuonFactory     INFO                    BOG cutouts are activated 1 , all other cutouts are disabled 1
+MuGM:MuonFactory     INFO Manager created for geometry version R.08.01 from DB MuonVersion <MuonSpectrometer-R.08.01>
+MuonGeoModel.MYSQL   INFO GeometryVersion set to <R.08.01>
+MuGM:MuonFactory     INFO Mysql helper class created here for geometry version R.08.01 from DB MuonVersion <MuonSpectrometer-R.08.01>
+EventPersistenc...   INFO Added successfully Conversion service:ByteStreamCnvSvc
+EventPersistenc...   INFO Added successfully Conversion service:DetDescrCnvSvc
+MDT_IDDetDescrCnv    INFO in createObj: creating a MdtIdHelper object in the detector store
+IdDictDetDescrCnv    INFO in initialize
+IdDictDetDescrCnv    INFO in createObj: creating a IdDictManager object in the detector store
+IdDictDetDescrCnv    INFO IdDictName:  IdDictParser/ATLAS_IDS.xml
+IdDictDetDescrCnv    INFO Reading InnerDetector    IdDict file InDetIdDictFiles/IdDictInnerDetector_IBL3D25-03.xml
+IdDictDetDescrCnv    INFO Reading LArCalorimeter   IdDict file IdDictParser/IdDictLArCalorimeter_DC3-05-Comm-01.xml
+IdDictDetDescrCnv    INFO Reading TileCalorimeter  IdDict file IdDictParser/IdDictTileCalorimeter.xml
+IdDictDetDescrCnv    INFO Reading Calorimeter      IdDict file IdDictParser/IdDictCalorimeter_L1Onl.xml
+IdDictDetDescrCnv    INFO Reading MuonSpectrometer IdDict file IdDictParser/IdDictMuonSpectrometer_R.03.xml
+IdDictDetDescrCnv    INFO Reading ForwardDetectors IdDict file IdDictParser/IdDictForwardDetectors_2010.xml
+IdDictDetDescrCnv    INFO Found id dicts:
+IdDictDetDescrCnv    INFO Using dictionary tag: null
+IdDictDetDescrCnv    INFO Dictionary ATLAS                version default              DetDescr tag (using default) file 
+IdDictDetDescrCnv    INFO Dictionary Calorimeter          version default              DetDescr tag CaloIdentifier-LVL1-02 file IdDictParser/IdDictCalorimeter_L1Onl.xml
+IdDictDetDescrCnv    INFO Dictionary ForwardDetectors     version default              DetDescr tag ForDetIdentifier-01       file IdDictParser/IdDictForwardDetectors_2010.xml
+IdDictDetDescrCnv    INFO Dictionary InnerDetector        version IBL-DBM              DetDescr tag InDetIdentifier-IBL3D25-02 file InDetIdDictFiles/IdDictInnerDetector_IBL3D25-03.xml
+IdDictDetDescrCnv    INFO Dictionary LArCalorimeter       version fullAtlas            DetDescr tag LArIdentifier-DC3-05-Comm file IdDictParser/IdDictLArCalorimeter_DC3-05-Comm-01.xml
+IdDictDetDescrCnv    INFO Dictionary LArElectrode         version fullAtlas            DetDescr tag (using default) file 
+IdDictDetDescrCnv    INFO Dictionary LArHighVoltage       version fullAtlas            DetDescr tag (using default) file 
+IdDictDetDescrCnv    INFO Dictionary MuonSpectrometer     version R.03                 DetDescr tag MuonIdentifier-08         file IdDictParser/IdDictMuonSpectrometer_R.03.xml
+IdDictDetDescrCnv    INFO Dictionary TileCalorimeter      version fullAtlasAndTestBeam DetDescr tag TileIdentifier-00         file IdDictParser/IdDictTileCalorimeter.xml
+AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find mm region index: group, region size 0 0
+AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find stgc region index: group, region size 0 0
+AtlasDetectorID::initLevelsFromDict - there are no sTGC entries in the dictionary! 
+AtlasDetectorID::initLevelsFromDict - there are no MM entries in the dictionary! 
+ AtlasDetectorID::initialize_from_dictionary - OK 
+MdtIdHelper          INFO MultiRange built successfully to Technology: MultiRange size is 210
+MdtIdHelper          INFO MultiRange built successfully to detector element: Multilayer MultiRange size is 241
+MdtIdHelper          INFO MultiRange built successfully to tube: MultiRange size is 241
+MdtIdHelper          INFO Initializing MDT hash indices ... 
+MdtIdHelper          INFO The element hash max is 1188
+MdtIdHelper          INFO The detector element hash max is 2328
+MdtIdHelper          INFO Initializing MDT hash indices for finding neighbors ... 
+MuGM:MuonFactory     INFO MDTIDHELPER retrieved from DetStore
+RPC_IDDetDescrCnv    INFO in createObj: creating a RpcIdHelper object in the detector store
+AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find mm region index: group, region size 0 0
+AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find stgc region index: group, region size 0 0
+AtlasDetectorID::initLevelsFromDict - there are no sTGC entries in the dictionary! 
+AtlasDetectorID::initLevelsFromDict - there are no MM entries in the dictionary! 
+ AtlasDetectorID::initialize_from_dictionary - OK 
+RpcIdHelper          INFO MultiRange built successfully to doubletR: MultiRange size is 241
+RpcIdHelper          INFO MultiRange built successfully to detectorElement: DetectorElement MultiRange size is 241
+RpcIdHelper          INFO MultiRange built successfully to rpcStrip: MultiRange size is 241
+RpcIdHelper          INFO Initializing RPC hash indices ... 
+RpcIdHelper          INFO The element hash max is 600
+RpcIdHelper          INFO The detector element hash max is 1122
+RpcIdHelper          INFO Initializing RPC hash indices for finding neighbors ... 
+MuGM:MuonFactory     INFO RPCIDHELPER retrieved from DetStore
+TGC_IDDetDescrCnv    INFO in createObj: creating a TgcIdHelper object in the detector store
+AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find mm region index: group, region size 0 0
+AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find stgc region index: group, region size 0 0
+AtlasDetectorID::initLevelsFromDict - there are no sTGC entries in the dictionary! 
+AtlasDetectorID::initLevelsFromDict - there are no MM entries in the dictionary! 
+ AtlasDetectorID::initialize_from_dictionary - OK 
+TgcIdHelper          INFO MultiRange built successfully to Technology: MultiRange size is 210
+TgcIdHelper          INFO MultiRange built successfully to detector element: Multilayer MultiRange size is 210
+TgcIdHelper          INFO MultiRange built successfully to channel: MultiRange size is 241
+TgcIdHelper          INFO Initializing TGC hash indices ... 
+TgcIdHelper          INFO The element hash max is 1578
+TgcIdHelper          INFO The detector element hash max is 1578
+TgcIdHelper          INFO Initializing TGC hash indices for finding neighbors ... 
+MuGM:MuonFactory     INFO TGCIDHELPER retrieved from DetStore
+CSC_IDDetDescrCnv    INFO in createObj: creating a CcscIdHelper object in the detector store
+AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find mm region index: group, region size 0 0
+AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find stgc region index: group, region size 0 0
+AtlasDetectorID::initLevelsFromDict - there are no sTGC entries in the dictionary! 
+AtlasDetectorID::initLevelsFromDict - there are no MM entries in the dictionary! 
+ AtlasDetectorID::initialize_from_dictionary - OK 
+CscIdHelper          INFO MultiRange built successfully to Technology: MultiRange size is 210
+CscIdHelper          INFO MultiRange built successfully to detector element: Multilayer MultiRange size is 237
+CscIdHelper          INFO MultiRange built successfully to cscStrip: MultiRange size is 241
+CscIdHelper          INFO Initializing CSC hash indices ... 
+CscIdHelper          INFO The element hash max is 32
+CscIdHelper          INFO The detector element hash max is 64
+CscIdHelper          INFO The channel hash max is 61440
+CscIdHelper          INFO Initializing CSC hash indices for finding neighbors ... 
+MuGM:MuonFactory     INFO CSCIDHELPER retrieved from DetStore
+MuGM:MuonFactory     INFO  **************** MuonDetectorFactory001 ************************
+MuGM:MuonFactory     INFO  *** Start building the Muon Geometry Tree **********************
+MuGM:RDBReadAtlas    INFO Start retriving dbObjects with tag = <ATLAS-R2-2016-01-00-01> node <ATLAS>
+RDBAccessSvc      WARNING Could not get the tag for XtomoData node. Returning 0 pointer to IRDBQuery
+MuGM:RDBReadAtlas    INFO After getQuery XtomoData
+In DblQ00Xtomo(data)
+No XtomoData table in the MuonDD Database
+MuGM:RDBReadAtlas    INFO After new DblQ00Xtomo
+MuGM:RDBReadAtlas    INFO No Ascii aszt input found: looking for A-lines in ORACLE
+MuGM:RDBReadAtlas    INFO ASZT table found in Oracle
+MuGM:RDBReadAtlas    INFO ASZT size is 32
+MuGM:RDBReadAtlas    INFO No Ascii iacsc input found: looking for A-lines in ORACLE
+RDBAccessSvc      WARNING Could not get the tag for ISZT node. Returning 0 pointer to IRDBQuery
+MuGM:RDBReadAtlas    INFO No ISZT table in Oracle
+MuGM:RDBReadAtlas    INFO Access granted for all dbObjects needed by muon detectors
+MuonGeoModel.MYSQL   INFO LayoutName (from DBAM) set to <R.08>  -- relevant for CTB2004
+MuGM:ProcStations    INFO  Processing Stations and Components
+MuGM:ProcStations    INFO  Processing Stations and Components DONE
+MuGM:ProcTechnol.s   INFO nMDT 13 nCSC 2 nTGC 22 nRPC 25
+MuGM:ProcTechnol.s   INFO nDED 2 nSUP 4 nSPA 2
+MuGM:ProcTechnol.s   INFO nCHV 7 nCRO 7 nCMI 6 nLBI 6
+MuGM:ProcPosition    INFO  *** N. of stations positioned in the setup 234
+MuGM:ProcPosition    INFO  *** N. of stations described in mysql      234
+MuGM:ProcPosition    INFO  *** N. of types  32 size of jtypvec 32
+MuGM:ProcPosition    INFO  *** : 234 kinds of stations (type*sub_type) 
+MuGM:ProcPosition    INFO  *** : 1758 physical stations in space - according to the MuonDD DataBase
+MuGM:ProcCutouts     INFO  Processing Cutouts for geometry layout R.08
+MuGM:ProcCutouts     INFO  Processing Cutouts DONE
+MuGM:RDBReadAtlas    INFO  ProcessTGCreadout - version 7 wirespacing 1.8
+MuGM:RDBReadAtlas    INFO Intermediate Objects built from primary numbers
+MuGM:MuonFactory     INFO  theMaterialManager retrieven successfully from the DetStore
+MuGM:MuonFactory     INFO MuonSystem description from OracleTag=<ATLAS-R2-2016-01-00-01> and node=<ATLAS>
+MuGM:MuonFactory     INFO  TreeTop added to the Manager
+MuGM:MuonFactory     INFO  Muon Layout R.08.01
+MuGM:MuonFactory     INFO Fine Clash Fixing disabled: (should be ON/OFF for Simulation/Reconstruction)
+MuGM:MuonFactory     INFO  **************** MuonDetectorFactory001 ****************************
+MuGM:MuonFactory     INFO  *** The Muon Chamber Geometry Tree is built with 
+MuGM:MuonFactory     INFO  *** 1758 child volumes 
+MuGM:MuonFactory     INFO  *** 1839 independent elements and 
+MuGM:MuonFactory     INFO  *** 11473 elements cloned or shared 
+MuGM:MuonFactory     INFO  *** 234 kinds of stations
+MuGM:MuonFactory     INFO  *** 1758 stations with alignable transforms
+MuGM:MuonFactory     INFO  *** 148 stations are described as Assemblies
+MuGM:MuonFactory     INFO  *** 1758 MuonStations 
+MuGM:MuonFactory     INFO  *** 	 2324 MDT Readout Elements 	 1186 MDT Detector Elements 
+MuGM:MuonFactory     INFO  *** 	 32 CSC Readout Elements 	 32 CSC Detector Elements 
+MuGM:MuonFactory     INFO  *** 	 1122 RPC Readout Elements 	 600 RPC Detector Elements 
+MuGM:MuonFactory     INFO  *** 	 1578 TGC Readout Elements 	 1578 TGC Detector Elements 
+MuGM:MuonFactory     INFO  ********************************************************************
+MuGM:MuonFactory     INFO  *** Inert Material built according to DB switches and config. ****** 
+MuGM:MuonFactory     INFO  *** The Muon Geometry Tree has 1758 child vol.s in total ********
+MuGM:MuonFactory     INFO  ********************************************************************
+
+MGM::MuonDetect...   INFO Init A/B Line Containers - done - size is respectively 1758/0
+MGM::MuonDetect...   INFO Init of CSC I-Lines will be done via Conditions DB
+MGM::MuonDetect...   INFO Init I-Line Container - done - size is respectively 128
+MGM::MuonDetect...   INFO I-Line for CSC wire layers loaded (Csc Internal Alignment)
+MGM::MuonDetect...   INFO According to configuration they WILL be used 
+MGM::MuonDetect...   INFO Filling cache
+GeoModelSvc          INFO GeoModelSvc.MuonDetectorTool	 SZ= 228524Kb 	 Time = 0.94S
+ClassIDSvc           INFO  getRegistryEntries: read 4462 CLIDRegistry entries for module ALL
+AGDDtoGeoSvc         INFO  this is AGDDtoGeoSvc::initialize()
+AGDDtoGeoSvc.Mu...   INFO  initializing AGDD builder
+AGDDtoGeoSvc.Mu...   INFO  XML file 
+AGDDtoGeoSvc.Mu...   INFO  ---------
+AGDDtoGeoSvc.Mu...   INFO  Sections 
+AGDDtoGeoSvc.Mu...   INFO  ---------
+AGDDtoGeoSvc.Mu...   INFO  Volumes 
+AGDDtoGeoSvc.Mu...   INFO  ---------
+AGDDtoGeoSvc.Mu...   INFO MuonAGDDTool::initialize
+AGDDtoGeoSvc.Mu...   INFO AGDDtoGeoSvc.MuonSpectrometer::construct()
+AGDDtoGeoSvc.Mu...   INFO  Reading AGDD2GeoSwitches flags 
+AGDDtoGeoSvc.Mu...   INFO  ----> ECT_Toroids
+AGDDtoGeoSvc.Mu...   INFO  ----> BAR_Toroid
+AGDDtoGeoSvc.Mu...   INFO  ----> Feet
+AGDDtoGeoSvc.Mu...   INFO  ----> RailAssembly
+AGDDtoGeoSvc.Mu...   INFO  ----> JFSH_Shield
+AGDDtoGeoSvc.Mu...   INFO  ----> JDSH_Shield
+AGDDtoGeoSvc.Mu...   INFO  ----> JTSH_Shield
+AGDDtoGeoSvc.Mu...   INFO  ----> pp2
+AGDDtoGeoSvc.Mu...   INFO  ----> MBAP_AccessPlatform
+AGDDtoGeoSvc.Mu...   INFO  ----> MBWH_BigWheels
+AGDDtoGeoSvc.Mu...   INFO  ----> SADL_CalorimeterSaddle
+AGDDtoGeoSvc.Mu...   INFO  ----> TBWH_BigWheels
+AGDDtoGeoSvc.Mu...   INFO  ----> TGC3_BigWheels
+AGDDtoGeoSvc.Mu...   INFO  ----> TGC1_BigWheels
+AGDDtoGeoSvc.Mu...   INFO  ----> MDTRail
+AGDDtoGeoSvc.Mu...   INFO  ----> servicesAtZ0
+AGDDtoGeoSvc.Mu...   INFO  ----> HFTruckRail
+AGDDtoGeoSvc.Mu...   INFO  ----> RUN2_Services
+AGDDtoGeoSvc.Mu...   INFO  now reading AGDD blob 
+AGDDtoGeoSvc.Mu...   INFO  now dumping the flags 
+AGDDtoGeoSvc.Mu...   INFO 		----- ECT_Toroids ECT_Toroids
+AGDDtoGeoSvc.Mu...   INFO 		----- BAR_Toroid BAR_Toroid
+AGDDtoGeoSvc.Mu...   INFO 		----- Feet Feet
+AGDDtoGeoSvc.Mu...   INFO 		----- RailAssembly RailAssembly
+AGDDtoGeoSvc.Mu...   INFO 		----- JFSH_Shield JFSH_Shield
+AGDDtoGeoSvc.Mu...   INFO 		----- JDSH_Shield JDSH_Shield
+AGDDtoGeoSvc.Mu...   INFO 		----- JTSH_Shield JTSH_Shield
+AGDDtoGeoSvc.Mu...   INFO 		----- pp2 pp2
+AGDDtoGeoSvc.Mu...   INFO 		----- MBAP_AccessPlatform MBAP_AccessPlatform
+AGDDtoGeoSvc.Mu...   INFO 		----- MBWH_BigWheels MBWH_BigWheels
+AGDDtoGeoSvc.Mu...   INFO 		----- SADL_CalorimeterSaddle SADL_CalorimeterSaddle
+AGDDtoGeoSvc.Mu...   INFO 		----- TBWH_BigWheels TBWH_BigWheels
+AGDDtoGeoSvc.Mu...   INFO 		----- TGC3_BigWheels TGC3_BigWheels
+AGDDtoGeoSvc.Mu...   INFO 		----- TGC1_BigWheels TGC1_BigWheels
+AGDDtoGeoSvc.Mu...   INFO 		----- MDTRail MDTRail
+AGDDtoGeoSvc.Mu...   INFO 		----- servicesAtZ0 servicesAtZ0
+AGDDtoGeoSvc.Mu...   INFO 		----- HFTruckRail HFTruckRail
+AGDDtoGeoSvc.Mu...   INFO 		----- RUN2_Services RUN2_Services
+AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00
+ClassIDSvc           INFO  getRegistryEntries: read 1315 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 251 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 310 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 242 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 1064 CLIDRegistry entries for module ALL
+CondInputLoader      INFO Initializing CondInputLoader...
+CondInputLoader      INFO Adding base classes:
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/FTHOLD' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/NOISE' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/PED' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/PSLOPE' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/RMS' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/STAT' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/T0BASE' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/T0PHASE' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/EXT/DCS/MAGNETS/SENSORDATA' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/GLOBAL/BField/Maps' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/MDT/CABLING/MAP_SCHEMA' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/MDT/CABLING/MEZZANINE_SCHEMA' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/MDT/RTBLOB' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/MDT/T0BLOB' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/CSC/ILINES' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/ASBUILTPARAMS' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/BARREL' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/ENDCAP/SIDEA' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/ENDCAP/SIDEC' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/TGC/SIDEA' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/TGC/SIDEC' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/RPC/CABLING/MAP_SCHEMA' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/RPC/CABLING/MAP_SCHEMA_CORR' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/RPC/DCS/DeadRopanels' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/RPC/DCS/OffRopanels' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/RPC/DQMF/ELEMENT_STATUS' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/RPC/TRIGGER/CM_THR_ETA' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/RPC/TRIGGER/CM_THR_PHI' )   ->
+CondInputLoader      INFO Will create WriteCondHandle dependencies for the following DataObjects:
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/FTHOLD' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/NOISE' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/PED' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/PSLOPE' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/RMS' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/STAT' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/T0BASE' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/T0PHASE' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/EXT/DCS/MAGNETS/SENSORDATA' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/GLOBAL/BField/Maps' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/MDT/CABLING/MAP_SCHEMA' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/MDT/CABLING/MEZZANINE_SCHEMA' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/MDT/RTBLOB' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/MDT/T0BLOB' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/CSC/ILINES' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/ASBUILTPARAMS' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/BARREL' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/ENDCAP/SIDEA' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/ENDCAP/SIDEC' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/TGC/SIDEA' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/TGC/SIDEC' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/RPC/CABLING/MAP_SCHEMA' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/RPC/CABLING/MAP_SCHEMA_CORR' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/RPC/DCS/DeadRopanels' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/RPC/DCS/OffRopanels' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/RPC/DQMF/ELEMENT_STATUS' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/RPC/TRIGGER/CM_THR_ETA' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/RPC/TRIGGER/CM_THR_PHI' ) 
+MuonAlignmentCo...   INFO Initilalizing
+MuonAlignmentCo...   INFO In initialize ---- # of folders registered is 7
+MuonAlignmentCo...   INFO geometry version from the MuonDetectorManager = R.08.01
+MuonDetectorCon...   INFO Initializing ...
+AtlasFieldMapCo...   INFO Initialize: Key  ( 'AtlasFieldMapCondObj' , 'ConditionStore+fieldMapCondObj' )  has been succesfully registered 
+AtlasFieldMapCo...   INFO Initialize: Will update the field map from conditions
+AtlasFieldCache...   INFO Initialize: Key  ( 'AtlasFieldCacheCondObj' , 'ConditionStore+fieldCondObj' )  has been succesfully registered 
+AtlasFieldCache...   INFO Initialize: Will update current from conditions
+AtlasFieldCache...   INFO Initialize: useDCS, useSoleCurrent, useToroCurrent. 1,  'UseSoleCurrent':7730.0000,  'UseToroCurrent':20400.000 LockMapCurrents 0
+RegSelCondAlg_RPC    INFO MuonRegSelCondAlg::initialize() 'ConditionStore+RegSelLUTCondData_RPC'
+RegSelCondAlg_TGC    INFO MuonRegSelCondAlg::initialize() 'ConditionStore+RegSelLUTCondData_TGC'
+RegSelCondAlg_MDT    INFO MuonRegSelCondAlg::initialize() 'ConditionStore+RegSelLUTCondData_MDT'
+RegSelCondAlg_CSC    INFO MuonRegSelCondAlg::initialize() 'ConditionStore+RegSelLUTCondData_CSC'
+ClassIDSvc           INFO  getRegistryEntries: read 8930 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 683 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 1588 CLIDRegistry entries for module ALL
 RpcRawDataProvider   INFO RpcRawDataProvider::initialize
 RpcRawDataProvider   INFO  'DoSeededDecoding':False
+ClassIDSvc           INFO  getRegistryEntries: read 990 CLIDRegistry entries for module ALL
+ROBDataProviderSvc   INFO Initializing ROBDataProviderSvc - package version ByteStreamCnvSvcBase-00-00-00
+ROBDataProviderSvc   INFO  ---> Filter out empty ROB fragments                               =  'filterEmptyROB':False
+ROBDataProviderSvc   INFO  ---> Filter out specific ROBs by Status Code: # ROBs = 0
+ROBDataProviderSvc   INFO  ---> Filter out Sub Detector ROBs by Status Code: # Sub Detectors = 0
 RpcRawDataProvi...   INFO initialize() successful in RpcRawDataProvider.RPC_RawDataProviderToolMT
 TgcRawDataProvider   INFO TgcRawDataProvider::initialize
 TgcRawDataProvider   INFO  'DoSeededDecoding':False
+ClassIDSvc           INFO  getRegistryEntries: read 1240 CLIDRegistry entries for module ALL
 TgcRawDataProvi...   INFO initialize() successful in TgcRawDataProvider.TGC_RawDataProviderToolMT.TgcROD_Decoder
+MuonTGC_CablingSvc   INFO for 1/12 sector initialize
+MuonTGC_Cabling...   INFO initialize
+ToolSvc.TGCCabl...   INFO initialize
+ToolSvc.TGCCabl...   INFO readTGCMap from text
+ToolSvc.TGCCabl...   INFO readTGCMap found file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2020-09-16T2101/Athena/22.0.18/InstallArea/x86_64-centos7-gcc8-opt/share/ASD2PP_diff_12_ONL.db
+ToolSvc.TGCCabl...   INFO giveASD2PP_DIFF_12 (m_ASD2PP_DIFF_12 is not NULL)
 TgcRawDataProvi...   INFO initialize() successful in TgcRawDataProvider.TGC_RawDataProviderToolMT
 MdtRawDataProvider   INFO MdtRawDataProvider::initialize
 MdtRawDataProvider   INFO  'DoSeededDecoding':False
-MdtRawDataProvi...   INFO Retrieved service ServiceHandle('ROBDataProviderSvc')
+ClassIDSvc           INFO  getRegistryEntries: read 1427 CLIDRegistry entries for module ALL
+MdtRawDataProvi...   INFO Retrieved service ROBDataProviderSvc = ServiceHandle('ROBDataProviderSvc')
 MdtRawDataProvi...   INFO Processing configuration for layouts with BME chambers.
 MdtRawDataProvi...   INFO Processing configuration for layouts with BMG chambers.
 MdtRawDataProvi...   INFO Retrieved tool Decoder = PrivateToolHandle('MdtROD_Decoder/MdtROD_Decoder')
 MdtRawDataProvi...   INFO initialize() successful in MdtRawDataProvider.MDT_RawDataProviderToolMT
+ClassIDSvc           INFO  getRegistryEntries: read 1008 CLIDRegistry entries for module ALL
 CscRawDataProvi...   INFO Retrieved service ServiceHandle('ROBDataProviderSvc')
 CscRawDataProvi...   INFO Retrieved tool Decoder = PrivateToolHandle('Muon::CscROD_Decoder/CscROD_Decoder')
-CscRawDataProvi...   INFO The Muon Geometry version is R.08.01
 CscRawDataProvi...   INFO initialize() successful in CscRawDataProvider.CSC_RawDataProviderToolMT
+ClassIDSvc           INFO  getRegistryEntries: read 54 CLIDRegistry entries for module ALL
+RpcRdoToRpcPrep...   INFO package version = MuonRPC_CnvTools-00-00-00
 RpcRdoToRpcPrep...   INFO properties are 
 RpcRdoToRpcPrep...   INFO produceRpcCoinDatafromTriggerWords 1
 RpcRdoToRpcPrep...   INFO reduceCablingOverlap               1
@@ -24,15 +590,495 @@ RpcRdoToRpcPrep...   INFO timeShift                          -12.5
 RpcRdoToRpcPrep...   INFO etaphi_coincidenceTime             20
 RpcRdoToRpcPrep...   INFO overlap_timeTolerance              10
 RpcRdoToRpcPrep...   INFO Correct prd time from cool db      0
+MuonRPC_CablingSvc   INFO Initializing MuonRPC_CablingSvc - package version MuonRPC_Cabling-00-00-00
+ToolSvc.RPCCabl...   INFO Initializing - folders names are: conf /RPC/CABLING/MAP_SCHEMA / corr /RPC/CABLING/MAP_SCHEMA_CORR
+MuonRPC_CablingSvc   INFO RPCCablingDbTool retrieved with handle TheRpcCablingDbTool = PublicToolHandle('RPCCablingDbTool/RPCCablingDbTool')
+MuonRPC_CablingSvc   INFO Register call-back  against 2 folders listed below 
+MuonRPC_CablingSvc   INFO  Folder n. 1 </RPC/CABLING/MAP_SCHEMA>     found in the DetStore
+ClassIDSvc           INFO  getRegistryEntries: read 242 CLIDRegistry entries for module ALL
+MuonRPC_CablingSvc   INFO initMappingModel registered for call-back against folder </RPC/CABLING/MAP_SCHEMA>
+MuonRPC_CablingSvc   INFO  Folder n. 2 </RPC/CABLING/MAP_SCHEMA_CORR>     found in the DetStore
+MuonRPC_CablingSvc   INFO initMappingModel registered for call-back against folder </RPC/CABLING/MAP_SCHEMA_CORR>
+MuonRPC_CablingSvc   INFO RPCTriggerDbTool retrieved with statusCode = SUCCESS pointer = TheRpcTriggerDbTool = PublicToolHandle('RPCTriggerDbTool')
+MuonRPC_CablingSvc   INFO Register call-back  against 2 folders listed below 
+MuonRPC_CablingSvc   INFO  Folder n. 1 </RPC/TRIGGER/CM_THR_ETA>     found in the DetStore
+MuonRPC_CablingSvc   INFO initTrigRoadsModel registered for call-back against folder </RPC/TRIGGER/CM_THR_ETA>
+MuonRPC_CablingSvc   INFO  Folder n. 2 </RPC/TRIGGER/CM_THR_PHI>     found in the DetStore
+MuonRPC_CablingSvc   INFO initTrigRoadsModel registered for call-back against folder </RPC/TRIGGER/CM_THR_PHI>
 RpcRdoToRpcPrep...   INFO Retrieved DecodingTool = PrivateToolHandle('Muon::RpcRdoToPrepDataToolMT/RpcRdoToRpcPrepDataTool')
+ClassIDSvc           INFO  getRegistryEntries: read 169 CLIDRegistry entries for module ALL
 TgcRdoToTgcPrep...   INFO initialize() successful in TgcRdoToTgcPrepData.TgcRdoToTgcPrepDataTool
 TgcRdoToTgcPrep...   INFO Retrieved DecodingTool = PrivateToolHandle('Muon::TgcRdoToPrepDataToolMT/TgcRdoToTgcPrepDataTool')
 MdtRdoToMdtPrep...   INFO Processing configuration for layouts with BMG chambers.
 MdtRdoToMdtPrep...   INFO Processing configuration for layouts with BME chambers.
 MdtRdoToMdtPrep...   INFO Processing configuration for layouts with BMG chambers.
 MdtRdoToMdtPrep...   INFO Retrieved DecodingTool = PrivateToolHandle('Muon::MdtRdoToPrepDataToolMT/MdtRdoToMdtPrepDataTool')
+ClassIDSvc           INFO  getRegistryEntries: read 116 CLIDRegistry entries for module ALL
 CscRdoToCscPrep...   INFO Retrieved CscRdoToCscPrepDataTool = PrivateToolHandle('Muon::CscRdoToCscPrepDataToolMT/CscRdoToCscPrepDataTool')
+ByteStreamInputSvc   INFO Initializing ByteStreamInputSvc - package version ByteStreamCnvSvc-00-00-00
+ClassIDSvc           INFO  getRegistryEntries: read 452 CLIDRegistry entries for module ALL
+EventSelector        INFO reinitialization...
+AthenaEventLoopMgr   INFO Setup EventSelector service EventSelector
+ApplicationMgr       INFO Application Manager Initialized successfully
+ApplicationMgr    SUCCESS ****************************** Algorithm Sequence ****************************
+ApplicationMgr    SUCCESS AthSequencer/AthMasterSeq
+ApplicationMgr    SUCCESS      AthSequencer/AthAlgEvtSeq
+ApplicationMgr    SUCCESS           AthSequencer/AthBeginSeq
+ApplicationMgr    SUCCESS                AthIncFirerAlg/BeginIncFiringAlg
+ApplicationMgr    SUCCESS                IncidentProcAlg/IncidentProcAlg1
+ApplicationMgr    SUCCESS           AthSequencer/AthAllAlgSeq
+ApplicationMgr    SUCCESS                AthSequencer/AthCondSeq
+ApplicationMgr    SUCCESS                     CondInputLoader/CondInputLoader
+ApplicationMgr    SUCCESS                     MuonAlignmentCondAlg/MuonAlignmentCondAlg
+ApplicationMgr    SUCCESS                     MuonDetectorCondAlg/MuonDetectorCondAlg
+ApplicationMgr    SUCCESS                     RpcCablingCondAlg/RpcCablingCondAlg
+ApplicationMgr    SUCCESS                     MuonMDT_CablingAlg/MuonMDT_CablingAlg
+ApplicationMgr    SUCCESS                     MagField::AtlasFieldMapCondAlg/AtlasFieldMapCondAlg
+ApplicationMgr    SUCCESS                     MagField::AtlasFieldCacheCondAlg/AtlasFieldCacheCondAlg
+ApplicationMgr    SUCCESS                     RpcCondDbAlg/RpcCondDbAlg
+ApplicationMgr    SUCCESS                     RPC_RegSelCondAlg/RegSelCondAlg_RPC
+ApplicationMgr    SUCCESS                     TGC_RegSelCondAlg/RegSelCondAlg_TGC
+ApplicationMgr    SUCCESS                     MdtCalibDbAlg/MdtCalibDbAlg
+ApplicationMgr    SUCCESS                     MDT_RegSelCondAlg/RegSelCondAlg_MDT
+ApplicationMgr    SUCCESS                     CscCondDbAlg/CscCondDbAlg
+ApplicationMgr    SUCCESS                     CSC_RegSelCondAlg/RegSelCondAlg_CSC
+ApplicationMgr    SUCCESS                AthSequencer/AthAlgSeq
+ApplicationMgr    SUCCESS                     Muon::RpcRawDataProvider/RpcRawDataProvider
+ApplicationMgr    SUCCESS                     Muon::TgcRawDataProvider/TgcRawDataProvider
+ApplicationMgr    SUCCESS                     Muon::MdtRawDataProvider/MdtRawDataProvider
+ApplicationMgr    SUCCESS                     Muon::CscRawDataProvider/CscRawDataProvider
+ApplicationMgr    SUCCESS                     RpcRdoToRpcPrepData/RpcRdoToRpcPrepData
+ApplicationMgr    SUCCESS                     TgcRdoToTgcPrepData/TgcRdoToTgcPrepData
+ApplicationMgr    SUCCESS                     MdtRdoToMdtPrepData/MdtRdoToMdtPrepData
+ApplicationMgr    SUCCESS                     CscRdoToCscPrepData/CscRdoToCscPrepData
+ApplicationMgr    SUCCESS                     CscThresholdClusterBuilder/CscThresholdClusterBuilder
+ApplicationMgr    SUCCESS           AthSequencer/AthEndSeq
+ApplicationMgr    SUCCESS                AthIncFirerAlg/EndIncFiringAlg
+ApplicationMgr    SUCCESS                IncidentProcAlg/IncidentProcAlg2
+ApplicationMgr    SUCCESS      AthSequencer/AthOutSeq
+ApplicationMgr    SUCCESS ******************************************************************************
+ByteStreamInputSvc   INFO Picked valid file: /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/CSC/FTHOLD'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/CSC/NOISE'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/CSC/PED'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/CSC/PSLOPE'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/CSC/RMS'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/CSC/STAT'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/CSC/T0BASE'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/CSC/T0PHASE'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/EXT/DCS/MAGNETS/SENSORDATA'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/GLOBAL/BField/Maps'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MDT/CABLING/MAP_SCHEMA'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MDT/CABLING/MEZZANINE_SCHEMA'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MDT/RTBLOB'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MDT/T0BLOB'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MUONALIGN/CSC/ILINES'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MUONALIGN/MDT/ASBUILTPARAMS'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MUONALIGN/MDT/BARREL'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MUONALIGN/MDT/ENDCAP/SIDEA'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MUONALIGN/MDT/ENDCAP/SIDEC'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MUONALIGN/TGC/SIDEA'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MUONALIGN/TGC/SIDEC'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/RPC/CABLING/MAP_SCHEMA'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/RPC/CABLING/MAP_SCHEMA_CORR'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/RPC/DCS/DeadRopanels'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/RPC/DCS/OffRopanels'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/RPC/DQMF/ELEMENT_STATUS'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/RPC/TRIGGER/CM_THR_ETA'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/RPC/TRIGGER/CM_THR_PHI'
+ApplicationMgr       INFO Application Manager Started successfully
+EventInfoByteSt...   INFO IsSimulation : 0
+EventInfoByteSt...   INFO IsTestbeam : 0
+EventInfoByteSt...   INFO IsCalibration : 0
+AthenaEventLoopMgr   INFO   ===>>>  start of run 327265    <<<===
+EventPersistenc...   INFO Added successfully Conversion service:TagInfoMgr
+IOVDbSvc             INFO Opening COOL connection for COOLONL_RPC/CONDBR2
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to RPCCablingMapSchema_2016_2017_01 for folder /RPC/CABLING/MAP_SCHEMA
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to RPCCablingMapSchemaCorr_2016_2017_01 for folder /RPC/CABLING/MAP_SCHEMA_CORR
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to RPCTriggerCMThrEta_RUN1-RUN2-HI-02 for folder /RPC/TRIGGER/CM_THR_ETA
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to RPCTriggerCMThrPhi_RUN1-RUN2-HI-02 for folder /RPC/TRIGGER/CM_THR_PHI
+IOVDbSvc             INFO Disconnecting from COOLONL_RPC/CONDBR2
+EventPersistenc...   INFO Added successfully Conversion service:AthenaPoolCnvSvc
+MuonRPC_CablingSvc   INFO initMappingModel has been called
+MuonRPC_CablingSvc   INFO ToolHandle in initMappingModel - <TheRpcCablingDbTool = PublicToolHandle('RPCCablingDbTool/RPCCablingDbTool')>
+MuonRPC_CablingSvc   INFO Retrieving cabling singleton; to create an empty one or to get the existing one
+RPCcabling           INFO CablingRPC---singleton constructor ---- this must be executed just once
+RPCcabling           INFO CablingRPC---The singleton will fill the maps from the COOL streams
+RPCcabling           INFO CablingRPC---InitMaps from COOL cannot be executed NOW: empty string
+RPCcabling           INFO CablingRPC---The singleton is created here
+RPCcabling           INFO CablingRPC--- cacheCleared: s_status = 0
+MuonRPC_CablingSvc   INFO Cabling singleton cache has been cleared
+MuonRPC_CablingSvc   INFO  Trigger roads will be loaded from COOL
+ToolSvc.RPCCabl...   INFO LoadParameters /RPC/CABLING/MAP_SCHEMA I=2 
+ToolSvc.RPCCabl...   INFO loadRPCMap --- Load Map from DB
+ToolSvc.RPCCabl...   INFO Try to read from folder </RPC/CABLING/MAP_SCHEMA>
+ToolSvc.RPCCabl...   INFO  CondAttrListCollection from DB folder have been obtained with size 1
+ToolSvc.RPCCabl...   INFO After Reading folder, Configuration string size is 222202
+ToolSvc.RPCCabl...   INFO LoadParameters /RPC/CABLING/MAP_SCHEMA_CORR I=2 
+ToolSvc.RPCCabl...   INFO loadRPCCorr --- Load Corrections from DB
+ToolSvc.RPCCabl...   INFO Try to read from folder </RPC/CABLING/MAP_SCHEMA_CORR>
+ToolSvc.RPCCabl...   INFO  CondAttrListCollection from DB folder have been obtained with size 1
+ToolSvc.RPCCabl...   INFO After Reading folder, Correction string size is 29369
+MuonRPC_CablingSvc   INFO  InitMappingModel: Trigger roads not yet loaded from COOL - postpone cabling initialization 
+MuonRPC_CablingSvc   INFO initTrigRoadsModel has been called
+MuonRPC_CablingSvc   INFO  Trigger roads will be loaded from COOL
+MuonRPC_CablingSvc   INFO Retrieve the pointer to the cabling singleton 
+RPCcabling           INFO CablingRPC--- cacheCleared: s_status = 0
+MuonRPC_CablingSvc   INFO Cabling singleton cache has been cleared
+ToolSvc.RPCTrig...   INFO LoadParameters /RPC/TRIGGER/CM_THR_ETA I=2 
+ToolSvc.RPCTrig...   INFO LoadParameters /RPC/TRIGGER/CM_THR_PHI I=2 
+MuonRPC_CablingSvc   INFO ======== RPC Trigger Roads from COOL - Header infos ========
+MuonRPC_CablingSvc   INFO 
+RPC LVL1 Configuration 10.6 with roads from Feb 2012
+L1 THRESHOLDS:   MU4 MU6 MU10 MU11 MU15 MU20
+Road version: "road_files_120209"
+CMA            th0    th1   th2
+eta low-pt     mu4    mu6   mu10
+phi low-pt     mu4    mu6   mu10
+eta high-pt    mu11  mu15   mu20
+phi high-pt    mu11  mu15   mu15
+
+
+RPCcabling           INFO CablingRPC---InitMaps from COOL: going to read configuration
+RPCcabling           INFO CablingRPC--->> RPC cabling map from COOL <<
+RPCcabling           INFO CablingRPC--- ReadConf: map has size 222202
+RPCcabling           INFO CablingRPC--- ReadConf: map n. of lines read is 924
+RPCcabling           INFO CablingRPC--- ReadConf: version is 5.0 Atlas R_07_03_RUN2ver104
+RPCcabling           INFO CablingRPC--- buildRDOmap
+RPCcabling           INFO CablingRPC---InitMaps from COOL: going to read corrections to configuration
+RPCcabling           INFO CablingRPC--->> RPC cabling corrections from COOL <<
+RPCcabling           INFO CablingRPC--- ReadCorr: CorrMap has size 29369
+RPCcabling           INFO CablingRPC--- ReadConf: CorrMap n. of lines read is 743
+RPCcabling           INFO CablingRPC---InitMaps from COOL - maps have been parsed
+MuonRPC_CablingSvc   INFO InitTrigRoadsModel: RPC cabling model is loaded!
+Level-1 configuration database version 5.0 Atlas R_07_03_RUN2ver104 read.
+Contains 26 Trigger Sector Types:
+negative sectors  0 - 15 ==> 18  2 24  3 19  2 24  4 20  2 24  1 18  5 25  6 
+negative sectors 16 - 31 ==> 21 13 26  6 21  7 16  8 14  7 16  6 21 13 26  1 
+positive sectors 32 - 47 ==>  9 24  2 22  9 24  2 23 10 24  2 18  1 25  5 18 
+positive sectors 48 - 63 ==>  1 26 13 21  6 17 12 15 11 17 12 21  6 26 13 22 
+
+MuonRPC_CablingSvc   INFO buildOfflineOnlineMap
+MuonRPC_CablingSvc   INFO Applying FeetPadThresholds : 0,2,5
+MuonRPC_CablingSvc   INFO MuonRPC_CablingSvc initialized succesfully
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186525031, run #327265 0 events processed so far  <<<===
+IOVDbSvc             INFO Opening COOL connection for COOLOFL_CSC/CONDBR2
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to CscFthold-RUN2-BLK-UPD1-007-00 for folder /CSC/FTHOLD
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to CscNoise-RUN2-BLK-UPD1-007-00 for folder /CSC/NOISE
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to CscPed-RUN2-BLK-UPD1-007-00 for folder /CSC/PED
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to CscPslope-RUN2-BLK-UPD1-000-00 for folder /CSC/PSLOPE
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to CscRms-RUN2-BLK-UPD1-003-00 for folder /CSC/RMS
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to CscStat-RUN2-BLK-UPD1-008-00 for folder /CSC/STAT
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to CscT0base-RUN2-BLK-UPD1-001-00 for folder /CSC/T0BASE
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to CscT0phase-RUN2-BLK-UPD2-001-00 for folder /CSC/T0PHASE
+IOVDbSvc             INFO Disconnecting from COOLOFL_CSC/CONDBR2
+IOVDbSvc             INFO Opening COOL connection for COOLOFL_DCS/CONDBR2
+IOVDbSvc             INFO Disconnecting from COOLOFL_DCS/CONDBR2
+IOVDbSvc             INFO Opening COOL connection for COOLONL_GLOBAL/CONDBR2
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to BFieldMap-Run1-14m-v01 for folder /GLOBAL/BField/Maps
+IOVDbSvc             INFO Disconnecting from COOLONL_GLOBAL/CONDBR2
+IOVDbSvc             INFO Opening COOL connection for COOLONL_MDT/CONDBR2
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MDTCablingMapSchema_BMG_01 for folder /MDT/CABLING/MAP_SCHEMA
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MDTCablingMezzanineSchema_M5-RUN2 for folder /MDT/CABLING/MEZZANINE_SCHEMA
+IOVDbSvc             INFO Disconnecting from COOLONL_MDT/CONDBR2
+IOVDbSvc             INFO Opening COOL connection for COOLOFL_MDT/CONDBR2
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MDTRT-RUN2-UPD4-21 for folder /MDT/RTBLOB
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MDTT0-RUN2-UPD4-21 for folder /MDT/T0BLOB
+IOVDbSvc             INFO Disconnecting from COOLOFL_MDT/CONDBR2
+IOVDbSvc             INFO Opening COOL connection for COOLOFL_MUONALIGN/CONDBR2
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MuonAlignCscIlines-UPD1-02 for folder /MUONALIGN/CSC/ILINES
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MuonAlignMdtAsbuiltparams-RUN2-BA_ONLY-UPD4-00 for folder /MUONALIGN/MDT/ASBUILTPARAMS
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MuonAlignMDTBarrelAlign-RUN2-BA_ROLLING_11-BLKP-UPD4-00 for folder /MUONALIGN/MDT/BARREL
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MuonAlignMDTEndCapAAlign-RUN2-ECA_ROLLING_2015_03_01-UPD4-02 for folder /MUONALIGN/MDT/ENDCAP/SIDEA
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MuonAlignMDTEndCapCAlign-RUN2-ECC_ROLLING_2015_03_01-UPD4-02 for folder /MUONALIGN/MDT/ENDCAP/SIDEC
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MuonAlignTGCEndCapAAlign-RUN2-TGCA_ROLLING_2011_01-ES1-UPD1-03 for folder /MUONALIGN/TGC/SIDEA
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MuonAlignTGCEndCapCAlign-RUN2-TGCC_ROLLING_2011_01-ES1-UPD1-03 for folder /MUONALIGN/TGC/SIDEC
+IOVDbSvc             INFO Disconnecting from COOLOFL_MUONALIGN/CONDBR2
+IOVDbSvc             INFO Opening COOL connection for COOLOFL_RPC/CONDBR2
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to RPCDQMFElementStatus_Run1_UPD4-RUN2-01 for folder /RPC/DQMF/ELEMENT_STATUS
+IOVDbSvc             INFO Disconnecting from COOLOFL_RPC/CONDBR2
+MuonAlignmentCo...   INFO Load alignment parameters from DB folder </MUONALIGN/CSC/ILINES>
+MuonAlignmentCo...   INFO Size of CSC/ILINES CondAttrListCollection  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/CSC/ILINES' )  readCscILinesCdo->size()= 1
+MuonAlignmentCo...   INFO Range of CSC/ILINES input is {[0,0,t:1425168000] - [t:4294967294.854775807]}
+MuonAlignmentCo...   INFO recorded new CscInternalAlignmentMapContainer with range {[0,0,t:1425168000] - [t:4294967294.854775807]} into Conditions Store
+MuonAlignmentCo...   INFO Load alignment parameters from DB folder </MUONALIGN/MDT/ASBUILTPARAMS>
+MuonAlignmentCo...   INFO Size of MDT/ASBUILTPARAMS CondAttrListCollection  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/ASBUILTPARAMS' )  ->size()= 1
+MuonAlignmentCo...   INFO Range of MDT/ASBUILTPARAMS input is {[0,0,t:0] - [t:4294967294.854775807]}
+MuonAlignmentCo...   INFO recorded new MdtAsBuiltMapContainer with range {[0,0,t:0] - [t:4294967294.854775807]} into Conditions Store
+MuonAlignmentCo...   INFO Load alignment parameters from DB folder </MUONALIGN/MDT/BARREL>
+MuonAlignmentCo...   INFO Size of /MUONALIGN/MDT/BARREL CondAttrListCollection  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/BARREL' )  readCdo->size()= 1
+MuonAlignmentCo...   INFO Range of /MUONALIGN/MDT/BARREL input is, ALines: {[0,0,t:1497851700] - [t:1498737300]} BLines: {[0,0,t:1497851700] - [t:1498737300]}
+MuonAlignmentCo...   INFO Data read from folder /MUONALIGN/MDT/BARREL have IoV = 195569
+MuonAlignmentCo...   INFO A- and B-Lines parameters from DB folder </MUONALIGN/MDT/BARREL> loaded
+MuonAlignmentCo...   INFO Load alignment parameters from DB folder </MUONALIGN/MDT/ENDCAP/SIDEA>
+MuonAlignmentCo...   INFO Size of /MUONALIGN/MDT/ENDCAP/SIDEA CondAttrListCollection  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/ENDCAP/SIDEA' )  readCdo->size()= 1
+MuonAlignmentCo...   INFO Range of /MUONALIGN/MDT/ENDCAP/SIDEA input is, ALines: {[0,0,t:1497891240] - [t:1497898380]} BLines: {[0,0,t:1497891240] - [t:1497898380]}
+MuonAlignmentCo...   INFO Data read from folder /MUONALIGN/MDT/ENDCAP/SIDEA have IoV = 195588
+MuonAlignmentCo...   INFO A- and B-Lines parameters from DB folder </MUONALIGN/MDT/ENDCAP/SIDEA> loaded
+MuonAlignmentCo...   INFO Load alignment parameters from DB folder </MUONALIGN/MDT/ENDCAP/SIDEC>
+MuonAlignmentCo...   INFO Size of /MUONALIGN/MDT/ENDCAP/SIDEC CondAttrListCollection  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/ENDCAP/SIDEC' )  readCdo->size()= 1
+MuonAlignmentCo...   INFO Range of /MUONALIGN/MDT/ENDCAP/SIDEC input is, ALines: {[0,0,t:1497892260] - [t:1497899460]} BLines: {[0,0,t:1497892260] - [t:1497899460]}
+MuonAlignmentCo...   INFO Data read from folder /MUONALIGN/MDT/ENDCAP/SIDEC have IoV = 195599
+MuonAlignmentCo...   INFO A- and B-Lines parameters from DB folder </MUONALIGN/MDT/ENDCAP/SIDEC> loaded
+MuonAlignmentCo...   INFO Load alignment parameters from DB folder </MUONALIGN/TGC/SIDEA>
+MuonAlignmentCo...   INFO No BLines decoding will be attempted for folder named /MUONALIGN/TGC/SIDEA
+MuonAlignmentCo...   INFO Size of /MUONALIGN/TGC/SIDEA CondAttrListCollection  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/TGC/SIDEA' )  readCdo->size()= 1
+MuonAlignmentCo...   INFO Range of /MUONALIGN/TGC/SIDEA input is, ALines: {[0,0,t:0] - [t:4294967294.854775807]}
+MuonAlignmentCo...   INFO Data read from folder /MUONALIGN/TGC/SIDEA have IoV = 82360
+MuonAlignmentCo...   INFO A- and B-Lines parameters from DB folder </MUONALIGN/TGC/SIDEA> loaded
+MuonAlignmentCo...   INFO Load alignment parameters from DB folder </MUONALIGN/TGC/SIDEC>
+MuonAlignmentCo...   INFO No BLines decoding will be attempted for folder named /MUONALIGN/TGC/SIDEC
+MuonAlignmentCo...   INFO Size of /MUONALIGN/TGC/SIDEC CondAttrListCollection  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/TGC/SIDEC' )  readCdo->size()= 1
+MuonAlignmentCo...   INFO Range of /MUONALIGN/TGC/SIDEC input is, ALines: {[0,0,t:0] - [t:4294967294.854775807]}
+MuonAlignmentCo...   INFO Data read from folder /MUONALIGN/TGC/SIDEC have IoV = 82359
+MuonAlignmentCo...   INFO A- and B-Lines parameters from DB folder </MUONALIGN/TGC/SIDEC> loaded
+MuonAlignmentCo...   INFO recorded new ALineMapContainer with range {[0,0,t:1497892260,l:0] - [t:1497898380]} into Conditions Store
+MuonAlignmentCo...   INFO recorded new BLineMapContainer with range {[0,0,t:1497892260,l:0] - [t:1497898380]} into Conditions Store
+MuonGeoModel         INFO MuonDetectorFactory - constructor  MuonSystem OuterRadius 13000 Length 22030
+MuonDetectorCon...   INFO create MuonDetectorTool - package version = MuonGeoModel-00-00-00
+MuonDetectorCon...   INFO (from GeoModelSvc)    AtlasVersion = <ATLAS-R2-2016-01-00-01>  MuonVersion = <>
+MuonDetectorCon...   INFO Keys for Muon Switches are  (key) ATLAS-R2-2016-01-00-01 (node) ATLAS
+MuonDetectorCon...   INFO (from GeoModelSvc) in AtlasVersion = <ATLAS-R2-2016-01-00-01>  default MuonVersion is <MuonSpectrometer-R.08.01>
+MuonDetectorCon...   INFO Properties have been set as follows: 
+MuonDetectorCon...   INFO     LayoutName                     R
+MuonDetectorCon...   INFO     IncludeCutouts                 0
+MuonDetectorCon...   INFO     IncludeCutoutsBog              0
+MuonDetectorCon...   INFO     IncludeCtbBis                  0
+MuonDetectorCon...   INFO     ControlAlines                  111111
+MuonDetectorCon...   INFO     MinimalGeoFlag                 0
+MuonDetectorCon...   INFO     EnableCscIntAlignment          1
+MuonDetectorCon...   INFO     EnableCscIntAlignmentFromGM    0
+MuonDetectorCon...   INFO     ControlCscIntAlines            111111
+MuonDetectorCon...   INFO     EnableMdtDeformations          1
+MuonDetectorCon...   INFO     EnableMdtAsBuiltParameters     1
+MuGM:MuonFactory     INFO MuonLayout set to <R.08.01> = Development version for DC3 - infrastructures 
+MuGM:MuonFactory     INFO                    BOG cutouts are activated 1 , all other cutouts are disabled 1
+MuGM:MuonFactory     INFO Manager created for geometry version R.08.01 from DB MuonVersion <MuonSpectrometer-R.08.01>
+MuonGeoModel.MYSQL   INFO GeometryVersion set to <R.08.01>
+MuGM:MuonFactory     INFO Mysql helper class created here for geometry version R.08.01 from DB MuonVersion <MuonSpectrometer-R.08.01>
+MuGM:MuonFactory     INFO MDTIDHELPER retrieved from DetStore
+MuGM:MuonFactory     INFO RPCIDHELPER retrieved from DetStore
+MuGM:MuonFactory     INFO TGCIDHELPER retrieved from DetStore
+MuGM:MuonFactory     INFO CSCIDHELPER retrieved from DetStore
+MuGM:MuonFactory     INFO  **************** MuonDetectorFactory001 ************************
+MuGM:MuonFactory     INFO  *** Start building the Muon Geometry Tree **********************
+MuGM:RDBReadAtlas    INFO Start retriving dbObjects with tag = <ATLAS-R2-2016-01-00-01> node <ATLAS>
+RDBAccessSvc      WARNING Could not get the tag for XtomoData node. Returning 0 pointer to IRDBQuery
+MuGM:RDBReadAtlas    INFO After getQuery XtomoData
+In DblQ00Xtomo(data)
+No XtomoData table in the MuonDD Database
+MuGM:RDBReadAtlas    INFO After new DblQ00Xtomo
+MuGM:RDBReadAtlas    INFO No Ascii aszt input found: looking for A-lines in ORACLE
+MuGM:RDBReadAtlas    INFO ASZT table found in Oracle
+MuGM:RDBReadAtlas    INFO ASZT size is 32
+MuGM:RDBReadAtlas    INFO No Ascii iacsc input found: looking for A-lines in ORACLE
+RDBAccessSvc      WARNING Could not get the tag for ISZT node. Returning 0 pointer to IRDBQuery
+MuGM:RDBReadAtlas    INFO No ISZT table in Oracle
+MuGM:RDBReadAtlas    INFO Access granted for all dbObjects needed by muon detectors
+MuonGeoModel.MYSQL   INFO LayoutName (from DBAM) set to <R.08>  -- relevant for CTB2004
+MuGM:ProcStations    INFO  Processing Stations and Components
+MuGM:ProcStations    INFO  Processing Stations and Components DONE
+MuGM:ProcTechnol.s   INFO nMDT 26 nCSC 4 nTGC 44 nRPC 50
+MuGM:ProcTechnol.s   INFO nDED 4 nSUP 8 nSPA 4
+MuGM:ProcTechnol.s   INFO nCHV 14 nCRO 14 nCMI 12 nLBI 12
+MuGM:ProcPosition    INFO  *** N. of stations positioned in the setup 234
+MuGM:ProcPosition    INFO  *** N. of stations described in mysql      234
+MuGM:ProcPosition    INFO  *** N. of types  32 size of jtypvec 32
+MuGM:ProcPosition    INFO  *** : 234 kinds of stations (type*sub_type) 
+MuGM:ProcPosition    INFO  *** : 1758 physical stations in space - according to the MuonDD DataBase
+MuGM:ProcCutouts     INFO  Processing Cutouts for geometry layout R.08
+MuGM:ProcCutouts     INFO  Processing Cutouts DONE
+MuGM:RDBReadAtlas    INFO  ProcessTGCreadout - version 7 wirespacing 1.8
+MuGM:RDBReadAtlas    INFO Intermediate Objects built from primary numbers
+MuGM:MuonFactory     INFO  theMaterialManager retrieven successfully from the DetStore
+MuGM:MuonFactory     INFO MuonSystem description from OracleTag=<ATLAS-R2-2016-01-00-01> and node=<ATLAS>
+MuGM:MuonFactory     INFO  TreeTop added to the Manager
+MuGM:MuonFactory     INFO  Muon Layout R.08.01
+MuGM:MuonFactory     INFO Fine Clash Fixing disabled: (should be ON/OFF for Simulation/Reconstruction)
+MuGM:MuonFactory     INFO  **************** MuonDetectorFactory001 ****************************
+MuGM:MuonFactory     INFO  *** The Muon Chamber Geometry Tree is built with 
+MuGM:MuonFactory     INFO  *** 1758 child volumes 
+MuGM:MuonFactory     INFO  *** 1839 independent elements and 
+MuGM:MuonFactory     INFO  *** 11473 elements cloned or shared 
+MuGM:MuonFactory     INFO  *** 234 kinds of stations
+MuGM:MuonFactory     INFO  *** 1758 stations with alignable transforms
+MuGM:MuonFactory     INFO  *** 148 stations are described as Assemblies
+MuGM:MuonFactory     INFO  *** 1758 MuonStations 
+MuGM:MuonFactory     INFO  *** 	 2324 MDT Readout Elements 	 1186 MDT Detector Elements 
+MuGM:MuonFactory     INFO  *** 	 32 CSC Readout Elements 	 32 CSC Detector Elements 
+MuGM:MuonFactory     INFO  *** 	 1122 RPC Readout Elements 	 600 RPC Detector Elements 
+MuGM:MuonFactory     INFO  *** 	 1578 TGC Readout Elements 	 1578 TGC Detector Elements 
+MuGM:MuonFactory     INFO  ********************************************************************
+MuGM:MuonFactory     INFO  *** Inert Material built according to DB switches and config. ****** 
+MuGM:MuonFactory     INFO  *** The Muon Geometry Tree has 1758 child vol.s in total ********
+MuGM:MuonFactory     INFO  ********************************************************************
+
+MGM::MuonDetect...   INFO Init A/B Line Containers - done - size is respectively 1758/0
+MGM::MuonDetect...   INFO Init of CSC I-Lines will be done via Conditions DB
+MGM::MuonDetect...   INFO Init I-Line Container - done - size is respectively 128
+MGM::MuonDetect...   INFO I-Line for CSC wire layers loaded (Csc Internal Alignment)
+MGM::MuonDetect...   INFO According to configuration they WILL be used 
+MGM::MuonDetect...   INFO Filling cache
+MGM::MuonDetect...   INFO temporary CSC I-line container with size = 128
+MGM::MuonDetect...   INFO # of CSC I-lines read from the ILineMapContainer in StoreGate is 128
+MGM::MuonDetect...   INFO # of deltaTransforms updated according to A-lines             is 128
+MGM::MuonDetect...   INFO # of entries in the CSC I-lines historical container          is 128
+MGM::MuonDetect...   INFO temporary As-Built container with size = 628
+MGM::MuonDetect...   INFO # of MDT As-Built read from the MdtAsBuiltMapContainer in StoreGate is 628
+MGM::MuonDetect...   INFO # of deltaTransforms updated according to As-Built                  is 628
+MGM::MuonDetect...   INFO # of entries in the MdtAsBuilt historical container                 is 628
+MGM::MuonDetect...   INFO temporary A-line container with size = 2694
+MGM::MuonDetect...   INFO # of A-lines read from the ALineMapContainer in StoreGate is 2694
+MGM::MuonDetect...   INFO # of deltaTransforms updated according to A-lines         is 2694
+MGM::MuonDetect...   INFO # of entries in the A-lines historical container          is 2814
+MGM::MuonDetect...   INFO In updateDeformations()
+MGM::MuonDetect...   INFO temporary B-line container with size = 1206
+MGM::MuonDetect...   INFO # of B-lines read from the ALineMapContainer in StoreGate   is 1206
+MGM::MuonDetect...   INFO # of deform-Transforms updated according to B-lines         is 1174
+MGM::MuonDetect...   INFO # of entries in the B-lines historical container            is 1174
+MuonDetectorCon...   INFO recorded new MuonDetectorManager with range {[0,0,t:1497892260,l:0] - [t:1497898380]} into Conditions Store
+RpcCablingCondAlg    INFO maps configuration have been parsed
+RpcCablingCondAlg    INFO recorded new RpcCablingCondData with range {[315000,l:0] - [999999,l:0]}
+MuonMDT_CablingAlg   INFO Size of CondAttrListCollection  ( 'CondAttrListCollection' , 'ConditionStore+/MDT/CABLING/MEZZANINE_SCHEMA' )  readCdoMez->size()= 24
+MuonMDT_CablingAlg   INFO Range of input is {[0,l:0] - [INVALID]}
+MuonMDT_CablingAlg   INFO Size of CondAttrListCollection  ( 'CondAttrListCollection' , 'ConditionStore+/MDT/CABLING/MAP_SCHEMA' )  readCdoMap->size()= 2312
+MuonMDT_CablingAlg   INFO Range of input is {[327264,l:4294640031] - [327265,l:4294640030]}
+MuonMDT_CablingAlg   INFO recorded new MuonMDT_CablingMap with range {[327264,t:0,l:4294640031] - [327265,l:4294640030]} into Conditions Store
+AtlasFieldMapCo...   INFO updateFieldMap: Update map from conditions
+AtlasFieldMapCo...   INFO updateFieldMap: Update map from conditions: Range of input/output is {[0,l:0] - [INVALID]}
+AtlasFieldMapCo...   INFO updateFieldMap: reading magnetic field map filenames from COOL
+AtlasFieldMapCo...   INFO updateFieldMap: found map of type GlobalMap with soleCur=7730 toroCur=20400 (path file:MagneticFieldMaps/bfieldmap_7730_20400_14m.root)
+AtlasFieldMapCo...   INFO updateFieldMap: found map of type SolenoidMap with soleCur=7730 toroCur=0 (path file:MagneticFieldMaps/bfieldmap_7730_0_14m.root)
+AtlasFieldMapCo...   INFO updateFieldMap: found map of type ToroidMap with soleCur=0 toroCur=20400 (path file:MagneticFieldMaps/bfieldmap_0_20400_14m.root)
+AtlasFieldMapCo...   INFO checkCurrentFromConditions: Range of input currents is {[0,0,t:1497895317.371000000] - [t:1497898549.609000000]}
+AtlasFieldMapCo...   INFO checkCurrentFromConditions: Attempt 1 at reading currents from DCS (using channel name)
+AtlasFieldMapCo...   INFO checkCurrentFromConditions: Trying to read from DCS: [channel name, index, value] CentralSol_Current , 1 , 7729.99
+AtlasFieldMapCo...   INFO checkCurrentFromConditions: Trying to read from DCS: [channel name, index, value] CentralSol_SCurrent , 2 , 7730
+AtlasFieldMapCo...   INFO checkCurrentFromConditions: Trying to read from DCS: [channel name, index, value] Toroids_Current , 3 , 20399.9
+AtlasFieldMapCo...   INFO checkCurrentFromConditions: Trying to read from DCS: [channel name, index, value] Toroids_SCurrent , 4 , 20397.7
+AtlasFieldMapCo...   INFO checkCurrentFromConditions: Currents read from DCS - solenoid 7729.99 toroid 20399.9
+AtlasFieldMapCo...   INFO updateFieldMap: currents are OK, will use nominal maps
+AtlasFieldMapCo...   INFO updateFieldMap: tagInfoH  ( 'TagInfo' , 'DetectorStore+ProcessingTags' )  is valid. 
+AtlasFieldMapCo...   INFO updateFieldMap: DID NOT reset currents from TagInfo
+AtlasFieldMapCo...   INFO updateFieldMap: Set map currents from FieldSvc: solenoid/toroid 7730,20400
+AtlasFieldMapCo...   INFO updateFieldMap: Use map file MagneticFieldMaps/bfieldmap_7730_20400_14m.root
+AtlasFieldMapCo...   INFO updateFieldMap: Initialized the field map from /cvmfs/atlas.cern.ch/repo/sw/database/GroupData/MagneticFieldMaps/bfieldmap_7730_20400_14m.root
+AtlasFieldMapCo...   INFO execute: solenoid zone id  7000
+AtlasFieldMapCo...   INFO execute: recorded AtlasFieldMapCondObj with EventRange {[0,l:0] - [INVALID]}
+AtlasFieldCache...   INFO UpdateCurrentFromConditions: Range of input/output is {[0,0,t:1497895317.371000000] - [t:1497898549.609000000]}
+AtlasFieldCache...   INFO UpdateCurrentFromConditions: Attempt 1 at reading currents from DCS (using channel name)
+AtlasFieldCache...   INFO UpdateCurrentFromConditions: Trying to read from DCS: [channel name, index, value] CentralSol_Current , 1 , 7729.99
+AtlasFieldCache...   INFO UpdateCurrentFromConditions: Trying to read from DCS: [channel name, index, value] CentralSol_SCurrent , 2 , 7730
+AtlasFieldCache...   INFO UpdateCurrentFromConditions: Trying to read from DCS: [channel name, index, value] Toroids_Current , 3 , 20399.9
+AtlasFieldCache...   INFO UpdateCurrentFromConditions: Trying to read from DCS: [channel name, index, value] Toroids_SCurrent , 4 , 20397.7
+AtlasFieldCache...   INFO UpdateCurrentFromConditions: Currents read from DCS - solenoid 7729.99 toroid 20399.9
+AtlasFieldCache...   INFO scaleField: Solenoid field scale factor 1. Desired current and map current: 7729.99,7730
+AtlasFieldCache...   INFO scaleField: Toroid field scale factor 1. Desired current and map current: 20399.9,20400
+AtlasFieldCache...   INFO execute: initialized AtlasFieldCacheCondObj and cache with SFs - sol/tor 1/1, EventRange {[0,0,t:1497895317.371000000] - [t:1497898549.609000000]}
+AtlasFieldCache...   INFO execute: solenoid zone id  7000
+RegSelCondAlg_RPC    INFO RegSelCondAlg LUT recorded: 'ConditionStore+RegSelLUTCondData_RPC'
+RegSelCondAlg_TGC    INFO RegSelCondAlg LUT recorded: 'ConditionStore+RegSelLUTCondData_TGC'
+MdtCalibDbAlg        INFO Size of CondAttrListCollection  ( 'CondAttrListCollection' , 'ConditionStore+/MDT/RTBLOB' )  readCdoRt->size()= 1186
+MdtCalibDbAlg        INFO Range of input is {[327265,l:0] - [327342,l:0]}
+MdtCalibDbAlg        INFO MdtCalibDbAlg::loadRt Read 1188RTs from COOL
+MdtCalibDbAlg        INFO recorded new MdtRtRelationCollection with range {[327265,l:0] - [327342,l:0]} into Conditions Store
+MdtCalibDbAlg        INFO recorded new MdtCorFuncSetCollection with range {[327265,l:0] - [327342,l:0]} into Conditions Store
+MdtCalibDbAlg        INFO Ignoring nonexistant station in calibration DB: MuonSpectrometer BML -6 stationPhi 7 MDT multiLayer 1 tubeLayer 1 tube 1
+MdtCalibDbAlg        INFO Ignoring nonexistant station in calibration DB: MuonSpectrometer BML stationEta 6 stationPhi 7 MDT multiLayer 1 tubeLayer 1 tube 1
+MdtCalibDbAlg        INFO Size of CondAttrListCollection  ( 'CondAttrListCollection' , 'ConditionStore+/MDT/T0BLOB' )  readCdoTube->size()= 1186
+MdtCalibDbAlg        INFO Range of input is {[319000,l:0] - [INVALID]}
+MdtCalibDbAlg        INFO recorded new MdtTubeCalibContainerCollection with range {[319000,l:0] - [INVALID]} into Conditions Store
+RegSelCondAlg_MDT    INFO RegSelCondAlg LUT recorded: 'ConditionStore+RegSelLUTCondData_MDT'
+RegSelCondAlg_CSC    INFO RegSelCondAlg LUT recorded: 'ConditionStore+RegSelLUTCondData_CSC'
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186525031, run #327265 1 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186524665, run #327265 1 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186524665, run #327265 2 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186542447, run #327265 2 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186542447, run #327265 3 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186543405, run #327265 3 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186543405, run #327265 4 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186548387, run #327265 4 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186548387, run #327265 5 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186515186, run #327265 5 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186515186, run #327265 6 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186556019, run #327265 6 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186556019, run #327265 7 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186542866, run #327265 7 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186542866, run #327265 8 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186537901, run #327265 8 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186537901, run #327265 9 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186517811, run #327265 9 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186517811, run #327265 10 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186534221, run #327265 10 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186534221, run #327265 11 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186540986, run #327265 11 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186540986, run #327265 12 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186535104, run #327265 12 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186535104, run #327265 13 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186539903, run #327265 13 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186539903, run #327265 14 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186552713, run #327265 14 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186552713, run #327265 15 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186524730, run #327265 15 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186524730, run #327265 16 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186547632, run #327265 16 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186547632, run #327265 17 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186555621, run #327265 17 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186555621, run #327265 18 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186568452, run #327265 18 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186568452, run #327265 19 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186580451, run #327265 19 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186580451, run #327265 20 events processed so far  <<<===
+Domain[ROOT_All]     INFO >   Deaccess DbDomain     READ      [ROOT_All] 
+ApplicationMgr       INFO Application Manager Stopped successfully
+IncidentProcAlg1     INFO Finalize
+CondInputLoader      INFO Finalizing CondInputLoader...
+IncidentProcAlg2     INFO Finalize
+IOVDbFolder          INFO Folder /CSC/FTHOLD (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/322656 ((     0.06 ))s
+IOVDbFolder          INFO Folder /CSC/NOISE (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/350062 ((     0.06 ))s
+IOVDbFolder          INFO Folder /CSC/PED (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/411187 ((     0.07 ))s
+IOVDbFolder          INFO Folder /CSC/PSLOPE (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/353376 ((     0.03 ))s
+IOVDbFolder          INFO Folder /CSC/RMS (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/411395 ((     0.04 ))s
+IOVDbFolder          INFO Folder /CSC/STAT (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/230496 ((     0.04 ))s
+IOVDbFolder          INFO Folder /CSC/T0BASE (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/314380 ((     0.02 ))s
+IOVDbFolder          INFO Folder /CSC/T0PHASE (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/3136 ((     0.03 ))s
+IOVDbFolder          INFO Folder /EXT/DCS/MAGNETS/SENSORDATA (AttrListColl) db-read 1/1 objs/chan/bytes 4/4/20 ((     0.04 ))s
+IOVDbFolder          INFO Folder /GLOBAL/BField/Maps (AttrListColl) db-read 1/1 objs/chan/bytes 3/3/202 ((     0.03 ))s
+IOVDbFolder          INFO Folder /MDT/CABLING/MAP_SCHEMA (AttrListColl) db-read 1/1 objs/chan/bytes 2312/2437/216520 ((     0.13 ))s
+IOVDbFolder          INFO Folder /MDT/CABLING/MEZZANINE_SCHEMA (AttrListColl) db-read 1/1 objs/chan/bytes 24/24/288 ((     0.02 ))s
+IOVDbFolder          INFO Folder /MDT/RTBLOB (AttrListColl) db-read 1/1 objs/chan/bytes 2372/1186/2251209 ((     0.13 ))s
+IOVDbFolder          INFO Folder /MDT/T0BLOB (AttrListColl) db-read 1/1 objs/chan/bytes 1186/1186/1374284 ((     0.12 ))s
+IOVDbFolder          INFO Folder /MUONALIGN/CSC/ILINES (AttrListColl) db-read 1/1 objs/chan/bytes 1/1/10814 ((     0.03 ))s
+IOVDbFolder          INFO Folder /MUONALIGN/MDT/ASBUILTPARAMS (AttrListColl) db-read 1/1 objs/chan/bytes 1/1/128992 ((     0.02 ))s
+IOVDbFolder          INFO Folder /MUONALIGN/MDT/BARREL (AttrListColl) db-read 1/1 objs/chan/bytes 1/1/140293 ((     0.04 ))s
+IOVDbFolder          INFO Folder /MUONALIGN/MDT/ENDCAP/SIDEA (AttrListColl) db-read 1/1 objs/chan/bytes 1/1/65494 ((     0.04 ))s
+IOVDbFolder          INFO Folder /MUONALIGN/MDT/ENDCAP/SIDEC (AttrListColl) db-read 1/1 objs/chan/bytes 1/1/65497 ((     0.04 ))s
+IOVDbFolder          INFO Folder /MUONALIGN/TGC/SIDEA (AttrListColl) db-read 1/1 objs/chan/bytes 1/1/165643 ((     0.03 ))s
+IOVDbFolder          INFO Folder /MUONALIGN/TGC/SIDEC (AttrListColl) db-read 1/1 objs/chan/bytes 1/1/165643 ((     0.03 ))s
+IOVDbFolder          INFO Folder /RPC/CABLING/MAP_SCHEMA (AttrListColl) db-read 1/2 objs/chan/bytes 1/1/222235 ((     0.06 ))s
+IOVDbFolder          INFO Folder /RPC/CABLING/MAP_SCHEMA_CORR (AttrListColl) db-read 1/2 objs/chan/bytes 1/1/29402 ((     0.04 ))s
+IOVDbFolder          INFO Folder /RPC/DCS/DeadRopanels (AttrListColl) db-read 1/1 objs/chan/bytes 32/48/6200 ((     0.00 ))s
+IOVDbFolder          INFO Folder /RPC/DCS/OffRopanels (AttrListColl) db-read 1/1 objs/chan/bytes 4/48/16 ((     0.00 ))s
+IOVDbFolder          INFO Folder /RPC/DQMF/ELEMENT_STATUS (AttrListColl) db-read 1/1 objs/chan/bytes 8320/8320/6180700 ((     0.18 ))s
+IOVDbFolder          INFO Folder /RPC/TRIGGER/CM_THR_ETA (AttrListColl) db-read 1/2 objs/chan/bytes 1613/1613/7562651 ((     0.10 ))s
+IOVDbFolder          INFO Folder /RPC/TRIGGER/CM_THR_PHI (AttrListColl) db-read 1/2 objs/chan/bytes 1612/1612/8096306 ((     0.07 ))s
+IOVDbFolder          INFO Folder /TGC/CABLING/MAP_SCHEMA (AttrListColl) db-read 0/0 objs/chan/bytes 0/1/0 ((     0.00 ))s
+IOVDbSvc             INFO  bytes in ((      1.49 ))s
+IOVDbSvc             INFO Connection sqlite://;schema=mycool.db;dbname=CONDBR2 : nConnect: 0 nFolders: 0 ReadTime: ((     0.00 ))s
+IOVDbSvc             INFO Connection COOLOFL_MUONALIGN/CONDBR2 : nConnect: 2 nFolders: 7 ReadTime: ((     0.23 ))s
+IOVDbSvc             INFO Connection COOLONL_RPC/CONDBR2 : nConnect: 2 nFolders: 4 ReadTime: ((     0.27 ))s
+IOVDbSvc             INFO Connection COOLONL_TGC/CONDBR2 : nConnect: 1 nFolders: 1 ReadTime: ((     0.00 ))s
+IOVDbSvc             INFO Connection COOLONL_MDT/CONDBR2 : nConnect: 2 nFolders: 2 ReadTime: ((     0.15 ))s
+IOVDbSvc             INFO Connection COOLONL_GLOBAL/CONDBR2 : nConnect: 2 nFolders: 1 ReadTime: ((     0.03 ))s
+IOVDbSvc             INFO Connection COOLOFL_DCS/CONDBR2 : nConnect: 2 nFolders: 3 ReadTime: ((     0.04 ))s
+IOVDbSvc             INFO Connection COOLOFL_RPC/CONDBR2 : nConnect: 2 nFolders: 1 ReadTime: ((     0.18 ))s
+IOVDbSvc             INFO Connection COOLOFL_MDT/CONDBR2 : nConnect: 2 nFolders: 2 ReadTime: ((     0.25 ))s
+IOVDbSvc             INFO Connection COOLOFL_CSC/CONDBR2 : nConnect: 2 nFolders: 8 ReadTime: ((     0.34 ))s
+ToolSvc              INFO Removing all tools created by ToolSvc
+TgcRdoToTgcPrep...   INFO finalize(): input RDOs->output PRDs [Hit: 6807->6807, Tracklet: 28->28, TrackletEIFI: 692->692, HiPt: 4031->4031, SL: 3->3]
 MdtRawDataProvi...   INFO Fraction of fills that use the cache = 0
+ToolSvc.TGCCabl...   INFO finalize
+MuonTGC_Cabling...   INFO finalize
 TgcRawDataProvi...   INFO Fraction of fills that use the cache = 0
 RpcROD_Decoder:...   INFO  ============ FINAL RPC DATA FORMAT STAT. =========== 
 RpcROD_Decoder:...   INFO  RX Header Errors.............0
@@ -49,3 +1095,14 @@ RpcROD_Decoder:...   INFO  SL Footer Errors.............0
 RpcROD_Decoder:...   INFO  RX Footer Errors.............0
 RpcROD_Decoder:...   INFO  CRC8 check Failures..........0
 RpcROD_Decoder:...   INFO  ==================================================== 
+ToolSvc.ByteStr...   INFO in finalize()
+IdDictDetDescrCnv    INFO in finalize
+*****Chrono*****     INFO ****************************************************************************************************
+*****Chrono*****     INFO  The Final CPU consumption ( Chrono ) Table (ordered)
+*****Chrono*****     INFO ****************************************************************************************************
+cObj_ALL             INFO Time User   : Tot=    0 [us] Ave/Min/Max=       0(+-       0)/       0/       0 [us] #= 32
+ChronoStatSvc        INFO Time User   : Tot= 15.1  [s]  #=  1
+*****Chrono*****     INFO ****************************************************************************************************
+ChronoStatSvc.f...   INFO  Service finalized successfully 
+ApplicationMgr       INFO Application Manager Finalized successfully
+ApplicationMgr       INFO Application Manager Terminated successfully
diff --git a/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest_Cache.ref b/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest_Cache.ref
index dcb83378af3ee53e17f8a6e06dd0eec8d0cb80b4..9f298ca189847decc06d0c495534d99facff13fd 100644
--- a/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest_Cache.ref
+++ b/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest_Cache.ref
@@ -1,21 +1,587 @@
+Flag Name                                : Value
+Beam.BunchSpacing                        : 25
+Beam.Energy                              : [function]
+Beam.NumberOfCollisions                  : [function]
+Beam.Type                                : [function]
+Beam.estimatedLuminosity                 : [function]
+Common.Project                           : 'Athena'
+Common.bunchCrossingSource               : [function]
+Common.doExpressProcessing               : False
+Common.isOnline                          : False
+Common.useOnlineLumi                     : [function]
+Concurrency.NumConcurrentEvents          : 0
+Concurrency.NumProcs                     : 0
+Concurrency.NumThreads                   : 0
+Exec.DebugStage                          : ''
+Exec.MaxEvents                           : -1
+Exec.OutputLevel                         : 3
+Exec.SkipEvents                          : 0
+GeoModel.Align.Dynamic                   : [function]
+GeoModel.AtlasVersion                    : 'ATLAS-R2-2016-01-00-01'
+GeoModel.IBLLayout                       : [function]
+GeoModel.Layout                          : 'atlas'
+GeoModel.Run                             : [function]
+GeoModel.StripGeoType                    : [function]
+GeoModel.Type                            : [function]
+IOVDb.DatabaseInstance                   : [function]
+IOVDb.GlobalTag                          : 'CONDBR2-BLKPA-2018-13'
+Input.Collections                        : [function]
+Input.Files                              : ['/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1']
+Input.Format                             : [function]
+Input.ProjectName                        : [function]
+Input.RunNumber                          : [function]
+Input.SecondaryCollections               : [function]
+Input.SecondaryFiles                     : []
+Input.isMC                               : [function]
+Output.AODFileName                       : ''
+Output.ESDFileName                       : ''
+Output.EVNTFileName                      : ''
+Output.HISTFileName                      : ''
+Output.HITSFileName                      : ''
+Output.RDOFileName                       : ''
+Output.RDO_SGNLFileName                  : ''
+Output.doESD                             : [function]
+Output.doWriteAOD                        : [function]
+Output.doWriteBS                         : False
+Output.doWriteESD                        : [function]
+Output.doWriteRDO                        : [function]
+Output.doWriteRDO_SGNL                   : [function]
+Random.Engine                            : 'dSFMT'
+Scheduler.CheckDependencies              : True
+Scheduler.ShowControlFlow                : True
+Scheduler.ShowDataDeps                   : True
+Scheduler.ShowDataFlow                   : True
+TrackingGeometry.MagneticFileMode        : 6
+TrackingGeometry.MaterialSource          : 'COOL'
+Flag categories that can be loaded dynamically
+Category                  :                 Generator name : Defined in
+BField                    :                       __bfield : AthenaConfiguration/AllConfigFlags.py
+BTagging                  :                     __btagging : AthenaConfiguration/AllConfigFlags.py
+Calo                      :                         __calo : AthenaConfiguration/AllConfigFlags.py
+DQ                        :                           __dq : AthenaConfiguration/AllConfigFlags.py
+Detector                  :                     __detector : AthenaConfiguration/AllConfigFlags.py
+Digitization              :                 __digitization : AthenaConfiguration/AllConfigFlags.py
+Egamma                    :                       __egamma : AthenaConfiguration/AllConfigFlags.py
+InDet                     :                        __indet : AthenaConfiguration/AllConfigFlags.py
+LAr                       :                          __lar : AthenaConfiguration/AllConfigFlags.py
+MET                       :                          __met : AthenaConfiguration/AllConfigFlags.py
+Muon                      :                         __muon : AthenaConfiguration/AllConfigFlags.py
+MuonCombined              :                 __muoncombined : AthenaConfiguration/AllConfigFlags.py
+Overlay                   :                      __overlay : AthenaConfiguration/AllConfigFlags.py
+PF                        :                        __pflow : AthenaConfiguration/AllConfigFlags.py
+PerfMon                   :                      __perfmon : AthenaConfiguration/AllConfigFlags.py
+Sim                       :                   __simulation : AthenaConfiguration/AllConfigFlags.py
+Tile                      :                         __tile : AthenaConfiguration/AllConfigFlags.py
+Trigger                   :                      __trigger : AthenaConfiguration/AllConfigFlags.py
+Py:Athena            INFO About to setup Raw data decoding
+Py:Athena            INFO using release [WorkDir-22.0.18] [x86_64-centos7-gcc8-opt] [removeDuplicateProp/12d6dd5] -- built on [2020-09-17T1141]
+Py:AutoConfigFlags    INFO Obtaining metadata of auto-configuration by peeking into /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1
+Py:MetaReader        INFO Current mode used: peeker
+Py:MetaReader        INFO Current filenames: ['/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1']
+Py:ConfigurableDb    INFO Read module info for 5566 configurables from 4 genConfDb files
+Py:ConfigurableDb    INFO No duplicates have been found: that's good !
+EventInfoMgtInit: Got release version  Athena-22.0.18
+Py:IOVDbSvc.CondDB    INFO Setting up conditions DB access to instance OFLP200
+Py:Athena            INFO Print Config
+Py:ComponentAccumulator    INFO Event Inputs
+Py:ComponentAccumulator    INFO Event Algorithm Sequences
+Py:ComponentAccumulator    INFO AthSequencer('AthAlgSeq', Sequential=True, Members=[MuonCacheCreator('MuonCacheCreator', MdtCsmCacheKey='MdtCsmRdoCache', CscCacheKey='CscRdoCache', RpcCacheKey='RpcRdoCache', TgcCacheKey='TgcRdoCache'), RpcRawDataProvider('RpcRawDataProvider', ProviderTool=RPC_RawDataProviderToolMT('RPC_RawDataProviderToolMT', Decoder=RpcROD_Decoder('RpcROD_Decoder'), RdoLocation='RPCPAD', RpcContainerCacheKey='RpcRdoCache', WriteOutRpcSectorLogic=False), RoIs='HLT_MURoIs'), TgcRawDataProvider('TgcRawDataProvider', ProviderTool=TGC_RawDataProviderToolMT('TGC_RawDataProviderToolMT', Decoder=TGC_RodDecoderReadout('TgcROD_Decoder'), RdoLocation='TGCRDO', TgcContainerCacheKey='TgcRdoCache')), MdtRawDataProvider('MdtRawDataProvider', ProviderTool=MDT_RawDataProviderToolMT('MDT_RawDataProviderToolMT', Decoder=MdtROD_Decoder('MdtROD_Decoder'), RdoLocation='MDTCSM', CsmContainerCacheKey='MdtCsmRdoCache')), CscRawDataProvider('CscRawDataProvider', ProviderTool=CSC_RawDataProviderToolMT('CSC_RawDataProviderToolMT', Decoder=CscROD_Decoder('CscROD_Decoder'), RdoLocation='CSCRDO', CscContainerCacheKey='CscRdoCache')), RpcRdoToRpcPrepData('RpcRdoToRpcPrepData', DecodingTool=RpcRdoToPrepDataToolMT('RpcRdoToRpcPrepDataTool'), PrintPrepData=False, RegSel_RPC=RegSelTool('RegSelTool_RPC', RegSelLUT='RegSelLUTCondData_RPC', Initialised=True)), TgcRdoToTgcPrepData('TgcRdoToTgcPrepData', DecodingTool=TgcRdoToPrepDataToolMT('TgcRdoToTgcPrepDataTool'), PrintPrepData=False, RegSel_TGC=RegSelTool('RegSelTool_TGC', RegSelLUT='RegSelLUTCondData_TGC', Initialised=True)), MdtRdoToMdtPrepData('MdtRdoToMdtPrepData', DecodingTool=MdtRdoToPrepDataToolMT('MdtRdoToMdtPrepDataTool'), PrintPrepData=False, RegSel_MDT=RegSelTool('RegSelTool_MDT', RegSelLUT='RegSelLUTCondData_MDT', Initialised=True)), CscRdoToCscPrepData('CscRdoToCscPrepData', CscRdoToCscPrepDataTool=CscRdoToCscPrepDataToolMT('CscRdoToCscPrepDataTool'), PrintPrepData=False, RegSel_CSC=RegSelTool('RegSelTool_CSC', RegSelLUT='RegSelLUTCondData_CSC', Initialised=True)), CscThresholdClusterBuilder('CscThresholdClusterBuilder', cluster_builder=CscThresholdClusterBuilderTool('CscThresholdClusterBuilderTool'))])
+Py:ComponentAccumulator    INFO Condition Algorithms
+Py:ComponentAccumulator    INFO  \__ CondInputLoader (cond alg)
+Py:ComponentAccumulator    INFO  \__ MuonAlignmentCondAlg (cond alg)
+Py:ComponentAccumulator    INFO  \__ MuonDetectorCondAlg (cond alg)
+Py:ComponentAccumulator    INFO  \__ RpcCablingCondAlg (cond alg)
+Py:ComponentAccumulator    INFO  \__ MuonMDT_CablingAlg (cond alg)
+Py:ComponentAccumulator    INFO  \__ AtlasFieldMapCondAlg (cond alg)
+Py:ComponentAccumulator    INFO  \__ AtlasFieldCacheCondAlg (cond alg)
+Py:ComponentAccumulator    INFO  \__ RpcCondDbAlg (cond alg)
+Py:ComponentAccumulator    INFO  \__ RegSelCondAlg_RPC (cond alg)
+Py:ComponentAccumulator    INFO  \__ RegSelCondAlg_TGC (cond alg)
+Py:ComponentAccumulator    INFO  \__ MdtCalibDbAlg (cond alg)
+Py:ComponentAccumulator    INFO  \__ RegSelCondAlg_MDT (cond alg)
+Py:ComponentAccumulator    INFO  \__ CscCondDbAlg (cond alg)
+Py:ComponentAccumulator    INFO  \__ RegSelCondAlg_CSC (cond alg)
+Py:ComponentAccumulator    INFO Services
+Py:ComponentAccumulator    INFO ['ByteStreamCnvSvc', 'ByteStreamInputSvc', 'EventSelector', 'EventPersistencySvc', 'ROBDataProviderSvc', 'ByteStreamAddressProviderSvc', 'MetaDataStore', 'InputMetaDataStore', 'MetaDataSvc', 'ProxyProviderSvc', 'GeoModelSvc', 'DetDescrCnvSvc', 'TagInfoMgr', 'AGDDtoGeoSvc', 'MuonIdHelperSvc', 'IOVDbSvc', 'PoolSvc', 'CondSvc', 'DBReplicaSvc', 'AthenaPoolCnvSvc', 'RPCcablingServerSvc', 'MuonRPC_CablingSvc', 'LVL1TGC::TGCRecRoiSvc', 'TGCcablingServerSvc', 'MuonMDT_CablingSvc', 'CSCcablingSvc']
+Py:ComponentAccumulator    INFO Public Tools
+Py:ComponentAccumulator    INFO [
+Py:ComponentAccumulator    INFO   IOVDbMetaDataTool/IOVDbMetaDataTool,
+Py:ComponentAccumulator    INFO   ByteStreamMetadataTool/ByteStreamMetadataTool,
+Py:ComponentAccumulator    INFO   RPCCablingDbTool/RPCCablingDbTool,
+Py:ComponentAccumulator    INFO   Muon::RPC_RawDataProviderToolMT/RPC_RawDataProviderToolMT,
+Py:ComponentAccumulator    INFO   Muon::TGC_RawDataProviderToolMT/TGC_RawDataProviderToolMT,
+Py:ComponentAccumulator    INFO   MDTCablingDbTool/MDTCablingDbTool,
+Py:ComponentAccumulator    INFO   Muon::MDT_RawDataProviderToolMT/MDT_RawDataProviderToolMT,
+Py:ComponentAccumulator    INFO   Muon::CSC_RawDataProviderToolMT/CSC_RawDataProviderToolMT,
+Py:ComponentAccumulator    INFO ]
+Py:ComponentAccumulator    INFO Private Tools
+Py:ComponentAccumulator    INFO [
+Py:ComponentAccumulator    INFO ]
+Py:ComponentAccumulator    INFO TheApp properties
+Py:ComponentAccumulator    INFO   EvtSel : EventSelector
+Py:Athena            INFO Save Config
+
+JOs reading stage finished, launching CARunner from pickle file
+
+ApplicationMgr    SUCCESS 
+====================================================================================================================================
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v34r0)
+                                          running on pcaz004 on Thu Sep 17 11:43:58 2020
+====================================================================================================================================
+ApplicationMgr       INFO Application Manager Configured successfully
+CoreDumpSvc          INFO Handling signals: 11(Segmentation fault) 7(Bus error) 4(Illegal instruction) 8(Floating point exception) 
+ClassIDSvc           INFO  getRegistryEntries: read 4008 CLIDRegistry entries for module ALL
+MetaDataSvc          INFO Initializing MetaDataSvc - package version AthenaServices-00-00-00
+PoolSvc              INFO io_register[PoolSvc](xmlcatalog_file:PoolFileCatalog.xml) [ok]
+PoolSvc              INFO Set connectionsvc retry/timeout/IDLE timeout to  'ConnectionRetrialPeriod':300/ 'ConnectionRetrialTimeOut':3600/ 'ConnectionTimeOut':5 seconds with connection cleanup disabled
+PoolSvc              INFO Frontier compression level set to 5
+DBReplicaSvc         INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy-atlas.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://atlasbpfrontier.cern.ch:3127)(proxyurl=http://atlasbpfrontier.fnal.gov:3127) will be considered for COOL data
+DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2020-09-16T2101/Athena/22.0.18/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 10 servers found for host pcaz004.dyndns.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
+DBReplicaSvc         INFO COOL SQLite replicas will be excluded if matching pattern /DBRelease/
+PoolSvc              INFO Successfully setup replica sorting algorithm
+PoolSvc              INFO Setting up APR FileCatalog and Streams
+PoolSvc              INFO Resolved path (via ATLAS_POOLCOND_PATH) is /cvmfs/atlas-condb.cern.ch/repo/conditions/poolcond/PoolFileCatalog.xml
+PoolSvc           WARNING Unable to locate catalog for prfile:poolcond/PoolCat_oflcond.xml check your ATLAS_POOLCOND_PATH and DATAPATH variables
+PoolSvc           WARNING Unable to locate catalog for apcfile:poolcond/PoolCat_oflcond.xml check your ATLAS_POOLCOND_PATH and DATAPATH variables
+PoolSvc           WARNING Unable to locate catalog for prfile:poolcond/PoolCat_comcond.xml check your ATLAS_POOLCOND_PATH and DATAPATH variables
+PoolSvc           WARNING Unable to locate catalog for apcfile:poolcond/PoolCat_comcond.xml check your ATLAS_POOLCOND_PATH and DATAPATH variables
+PoolSvc              INFO POOL WriteCatalog is xmlcatalog_file:PoolFileCatalog.xml
+DbSession            INFO     Open     DbSession    
+Domain[ROOT_All]     INFO >   Access   DbDomain     READ      [ROOT_All] 
+ToolSvc.ByteStr...   INFO Initializing ToolSvc.ByteStreamMetadataTool - package version ByteStreamCnvSvc-00-00-00
+MetaDataSvc          INFO Found MetaDataTools = PublicToolHandleArray(['IOVDbMetaDataTool/IOVDbMetaDataTool','ByteStreamMetadataTool/ByteStreamMetadataTool'])
+OutputStreamSeq...   INFO Initializing OutputStreamSequencerSvc - package version AthenaServices-00-00-00
+ByteStreamAddre...   INFO Initializing ByteStreamAddressProviderSvc - package version ByteStreamCnvSvcBase-00-00-00
+ByteStreamAddre...   INFO initialized 
+ByteStreamAddre...   INFO -- Will fill Store with id =  0
+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
+IOVDbSvc             INFO Global tag: CONDBR2-BLKPA-2018-13 set from joboptions
+IOVDbFolder          INFO Inputfile tag override disabled for /GLOBAL/BField/Maps
+IOVDbSvc             INFO Initialised with 10 connections and 29 folders
+IOVDbSvc             INFO Service IOVDbSvc initialised successfully
+ClassIDSvc           INFO  getRegistryEntries: read 2789 CLIDRegistry entries for module ALL
+IOVDbSvc             INFO Opening COOL connection for COOLOFL_MUONALIGN/CONDBR2
+IOVSvc               INFO No IOVSvcTool associated with store "StoreGateSvc"
+IOVSvc.IOVSvcTool    INFO IOVRanges will be checked at every Event
+IOVDbSvc             INFO Opening COOL connection for COOLONL_RPC/CONDBR2
+IOVDbSvc             INFO Disconnecting from COOLOFL_MUONALIGN/CONDBR2
+IOVDbSvc             INFO Opening COOL connection for COOLONL_TGC/CONDBR2
+IOVDbSvc             INFO Disconnecting from COOLONL_RPC/CONDBR2
+IOVDbSvc             INFO Opening COOL connection for COOLONL_MDT/CONDBR2
+IOVDbSvc             INFO Disconnecting from COOLONL_TGC/CONDBR2
+IOVDbSvc             INFO Opening COOL connection for COOLONL_GLOBAL/CONDBR2
+IOVDbSvc             INFO Disconnecting from COOLONL_MDT/CONDBR2
+IOVDbSvc             INFO Opening COOL connection for COOLOFL_DCS/CONDBR2
+IOVDbSvc             INFO Disconnecting from COOLONL_GLOBAL/CONDBR2
+IOVDbSvc             INFO Opening COOL connection for COOLOFL_RPC/CONDBR2
+IOVDbSvc             INFO Disconnecting from COOLOFL_DCS/CONDBR2
+IOVDbSvc             INFO Opening COOL connection for COOLOFL_MDT/CONDBR2
+IOVDbSvc             INFO Disconnecting from COOLOFL_RPC/CONDBR2
+IOVDbSvc             INFO Opening COOL connection for COOLOFL_CSC/CONDBR2
+IOVDbSvc             INFO Disconnecting from COOLOFL_MDT/CONDBR2
+IOVDbSvc             INFO Disconnecting from COOLOFL_CSC/CONDBR2
+IOVDbSvc             INFO Added taginfo remove for /CSC/FTHOLD
+IOVDbSvc             INFO Added taginfo remove for /CSC/NOISE
+IOVDbSvc             INFO Added taginfo remove for /CSC/PED
+IOVDbSvc             INFO Added taginfo remove for /CSC/PSLOPE
+IOVDbSvc             INFO Added taginfo remove for /CSC/RMS
+IOVDbSvc             INFO Added taginfo remove for /CSC/STAT
+IOVDbSvc             INFO Added taginfo remove for /CSC/T0BASE
+IOVDbSvc             INFO Added taginfo remove for /CSC/T0PHASE
+IOVDbSvc             INFO Added taginfo remove for /EXT/DCS/MAGNETS/SENSORDATA
+IOVDbSvc             INFO Added taginfo remove for /GLOBAL/BField/Maps
+IOVDbSvc             INFO Added taginfo remove for /MDT/CABLING/MAP_SCHEMA
+IOVDbSvc             INFO Added taginfo remove for /MDT/CABLING/MEZZANINE_SCHEMA
+IOVDbSvc             INFO Added taginfo remove for /MDT/RTBLOB
+IOVDbSvc             INFO Added taginfo remove for /MDT/T0BLOB
+IOVDbSvc             INFO Added taginfo remove for /MUONALIGN/CSC/ILINES
+IOVDbSvc             INFO Added taginfo remove for /MUONALIGN/MDT/ASBUILTPARAMS
+IOVDbSvc             INFO Added taginfo remove for /MUONALIGN/MDT/BARREL
+IOVDbSvc             INFO Added taginfo remove for /MUONALIGN/MDT/ENDCAP/SIDEA
+IOVDbSvc             INFO Added taginfo remove for /MUONALIGN/MDT/ENDCAP/SIDEC
+IOVDbSvc             INFO Added taginfo remove for /MUONALIGN/TGC/SIDEA
+IOVDbSvc             INFO Added taginfo remove for /MUONALIGN/TGC/SIDEC
+IOVDbSvc             INFO Added taginfo remove for /RPC/CABLING/MAP_SCHEMA
+IOVDbSvc             INFO Added taginfo remove for /RPC/CABLING/MAP_SCHEMA_CORR
+IOVDbSvc             INFO Added taginfo remove for /RPC/DCS/DeadRopanels
+IOVDbSvc             INFO Added taginfo remove for /RPC/DCS/OffRopanels
+IOVDbSvc             INFO Added taginfo remove for /RPC/DQMF/ELEMENT_STATUS
+IOVDbSvc             INFO Added taginfo remove for /RPC/TRIGGER/CM_THR_ETA
+IOVDbSvc             INFO Added taginfo remove for /RPC/TRIGGER/CM_THR_PHI
+IOVDbSvc             INFO Added taginfo remove for /TGC/CABLING/MAP_SCHEMA
+GeoModelSvc          INFO Explicitly initializing DetDescrCnvSvc
+DetDescrCnvSvc       INFO  initializing 
+DetDescrCnvSvc       INFO Found DetectorStore service
+DetDescrCnvSvc       INFO  filling proxies for detector managers 
+DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for SCT_ID with CLID 2517 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for TRT_ID with CLID 2518 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for SiliconID with CLID 129452393 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArEM_ID with CLID 163583365 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArEM_SuperCell_ID with CLID 99488227 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArHEC_ID with CLID 3870484 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArHEC_SuperCell_ID with CLID 254277678 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArFCAL_ID with CLID 45738051 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArFCAL_SuperCell_ID with CLID 12829437 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArMiniFCAL_ID with CLID 79264204 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArOnlineID with CLID 158698068 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for TTOnlineID with CLID 38321944 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArOnline_SuperCellID with CLID 115600394 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArHVLineID with CLID 27863673 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArElectrodeID with CLID 80757351 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for TileID with CLID 2901 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for Tile_SuperCell_ID with CLID 49557789 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for TileHWID with CLID 2902 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for TileTBID with CLID 2903 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for MDTIDHELPER with CLID 4170 and storage type 68 to detector store 
+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 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 
+DetDescrCnvSvc       INFO  filling address for CaloDM_ID with CLID 167756483 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for ZdcID with CLID 190591643 and storage type 68 to detector store 
+GeoModelSvc.Muo...   INFO Initializing ...
+GeoModelSvc::RD...WARNING  Getting PixTBMatComponents with default tag
+GeoModelSvc::RD...WARNING  Getting PixTBMaterials with default tag
+GeoModelSvc::RD...WARNING  Getting InDetMatComponents with default tag
+GeoModelSvc::RD...WARNING  Getting InDetMaterials with default tag
+MuonGeoModel         INFO MuonDetectorFactory - constructor  MuonSystem OuterRadius 13000 Length 22030
+GeoModelSvc.Muo...   INFO create MuonDetectorTool - package version = MuonGeoModel-00-00-00
+GeoModelSvc.Muo...   INFO (from GeoModelSvc)    AtlasVersion = <ATLAS-R2-2016-01-00-01>  MuonVersion = <>
+GeoModelSvc.Muo...   INFO Keys for Muon Switches are  (key) ATLAS-R2-2016-01-00-01 (node) ATLAS
+GeoModelSvc.Muo...   INFO (from GeoModelSvc) in AtlasVersion = <ATLAS-R2-2016-01-00-01>  default MuonVersion is <MuonSpectrometer-R.08.01>
+GeoModelSvc.Muo...   INFO Properties have been set as follows: 
+GeoModelSvc.Muo...   INFO     LayoutName                     R
+GeoModelSvc.Muo...   INFO     IncludeCutouts                 0
+GeoModelSvc.Muo...   INFO     IncludeCutoutsBog              0
+GeoModelSvc.Muo...   INFO     IncludeCtbBis                  0
+GeoModelSvc.Muo...   INFO     ControlAlines                  111111
+GeoModelSvc.Muo...   INFO     MinimalGeoFlag                 0
+GeoModelSvc.Muo...   INFO     EnableCscIntAlignment          1
+GeoModelSvc.Muo...   INFO     EnableCscIntAlignmentFromGM    0
+GeoModelSvc.Muo...   INFO     ControlCscIntAlines            111111
+GeoModelSvc.Muo...   INFO     EnableMdtDeformations          1
+GeoModelSvc.Muo...   INFO     EnableMdtAsBuiltParameters     1
+MuGM:MuonFactory     INFO MuonLayout set to <R.08.01> = Development version for DC3 - infrastructures 
+MuGM:MuonFactory     INFO                    BOG cutouts are activated 1 , all other cutouts are disabled 1
+MuGM:MuonFactory     INFO Manager created for geometry version R.08.01 from DB MuonVersion <MuonSpectrometer-R.08.01>
+MuonGeoModel.MYSQL   INFO GeometryVersion set to <R.08.01>
+MuGM:MuonFactory     INFO Mysql helper class created here for geometry version R.08.01 from DB MuonVersion <MuonSpectrometer-R.08.01>
+EventPersistenc...   INFO Added successfully Conversion service:ByteStreamCnvSvc
+EventPersistenc...   INFO Added successfully Conversion service:DetDescrCnvSvc
+MDT_IDDetDescrCnv    INFO in createObj: creating a MdtIdHelper object in the detector store
+IdDictDetDescrCnv    INFO in initialize
+IdDictDetDescrCnv    INFO in createObj: creating a IdDictManager object in the detector store
+IdDictDetDescrCnv    INFO IdDictName:  IdDictParser/ATLAS_IDS.xml
+IdDictDetDescrCnv    INFO Reading InnerDetector    IdDict file InDetIdDictFiles/IdDictInnerDetector_IBL3D25-03.xml
+IdDictDetDescrCnv    INFO Reading LArCalorimeter   IdDict file IdDictParser/IdDictLArCalorimeter_DC3-05-Comm-01.xml
+IdDictDetDescrCnv    INFO Reading TileCalorimeter  IdDict file IdDictParser/IdDictTileCalorimeter.xml
+IdDictDetDescrCnv    INFO Reading Calorimeter      IdDict file IdDictParser/IdDictCalorimeter_L1Onl.xml
+IdDictDetDescrCnv    INFO Reading MuonSpectrometer IdDict file IdDictParser/IdDictMuonSpectrometer_R.03.xml
+IdDictDetDescrCnv    INFO Reading ForwardDetectors IdDict file IdDictParser/IdDictForwardDetectors_2010.xml
+IdDictDetDescrCnv    INFO Found id dicts:
+IdDictDetDescrCnv    INFO Using dictionary tag: null
+IdDictDetDescrCnv    INFO Dictionary ATLAS                version default              DetDescr tag (using default) file 
+IdDictDetDescrCnv    INFO Dictionary Calorimeter          version default              DetDescr tag CaloIdentifier-LVL1-02 file IdDictParser/IdDictCalorimeter_L1Onl.xml
+IdDictDetDescrCnv    INFO Dictionary ForwardDetectors     version default              DetDescr tag ForDetIdentifier-01       file IdDictParser/IdDictForwardDetectors_2010.xml
+IdDictDetDescrCnv    INFO Dictionary InnerDetector        version IBL-DBM              DetDescr tag InDetIdentifier-IBL3D25-02 file InDetIdDictFiles/IdDictInnerDetector_IBL3D25-03.xml
+IdDictDetDescrCnv    INFO Dictionary LArCalorimeter       version fullAtlas            DetDescr tag LArIdentifier-DC3-05-Comm file IdDictParser/IdDictLArCalorimeter_DC3-05-Comm-01.xml
+IdDictDetDescrCnv    INFO Dictionary LArElectrode         version fullAtlas            DetDescr tag (using default) file 
+IdDictDetDescrCnv    INFO Dictionary LArHighVoltage       version fullAtlas            DetDescr tag (using default) file 
+IdDictDetDescrCnv    INFO Dictionary MuonSpectrometer     version R.03                 DetDescr tag MuonIdentifier-08         file IdDictParser/IdDictMuonSpectrometer_R.03.xml
+IdDictDetDescrCnv    INFO Dictionary TileCalorimeter      version fullAtlasAndTestBeam DetDescr tag TileIdentifier-00         file IdDictParser/IdDictTileCalorimeter.xml
+AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find mm region index: group, region size 0 0
+AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find stgc region index: group, region size 0 0
+AtlasDetectorID::initLevelsFromDict - there are no sTGC entries in the dictionary! 
+AtlasDetectorID::initLevelsFromDict - there are no MM entries in the dictionary! 
+ AtlasDetectorID::initialize_from_dictionary - OK 
+MdtIdHelper          INFO MultiRange built successfully to Technology: MultiRange size is 210
+MdtIdHelper          INFO MultiRange built successfully to detector element: Multilayer MultiRange size is 241
+MdtIdHelper          INFO MultiRange built successfully to tube: MultiRange size is 241
+MdtIdHelper          INFO Initializing MDT hash indices ... 
+MdtIdHelper          INFO The element hash max is 1188
+MdtIdHelper          INFO The detector element hash max is 2328
+MdtIdHelper          INFO Initializing MDT hash indices for finding neighbors ... 
+MuGM:MuonFactory     INFO MDTIDHELPER retrieved from DetStore
+RPC_IDDetDescrCnv    INFO in createObj: creating a RpcIdHelper object in the detector store
+AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find mm region index: group, region size 0 0
+AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find stgc region index: group, region size 0 0
+AtlasDetectorID::initLevelsFromDict - there are no sTGC entries in the dictionary! 
+AtlasDetectorID::initLevelsFromDict - there are no MM entries in the dictionary! 
+ AtlasDetectorID::initialize_from_dictionary - OK 
+RpcIdHelper          INFO MultiRange built successfully to doubletR: MultiRange size is 241
+RpcIdHelper          INFO MultiRange built successfully to detectorElement: DetectorElement MultiRange size is 241
+RpcIdHelper          INFO MultiRange built successfully to rpcStrip: MultiRange size is 241
+RpcIdHelper          INFO Initializing RPC hash indices ... 
+RpcIdHelper          INFO The element hash max is 600
+RpcIdHelper          INFO The detector element hash max is 1122
+RpcIdHelper          INFO Initializing RPC hash indices for finding neighbors ... 
+MuGM:MuonFactory     INFO RPCIDHELPER retrieved from DetStore
+TGC_IDDetDescrCnv    INFO in createObj: creating a TgcIdHelper object in the detector store
+AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find mm region index: group, region size 0 0
+AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find stgc region index: group, region size 0 0
+AtlasDetectorID::initLevelsFromDict - there are no sTGC entries in the dictionary! 
+AtlasDetectorID::initLevelsFromDict - there are no MM entries in the dictionary! 
+ AtlasDetectorID::initialize_from_dictionary - OK 
+TgcIdHelper          INFO MultiRange built successfully to Technology: MultiRange size is 210
+TgcIdHelper          INFO MultiRange built successfully to detector element: Multilayer MultiRange size is 210
+TgcIdHelper          INFO MultiRange built successfully to channel: MultiRange size is 241
+TgcIdHelper          INFO Initializing TGC hash indices ... 
+TgcIdHelper          INFO The element hash max is 1578
+TgcIdHelper          INFO The detector element hash max is 1578
+TgcIdHelper          INFO Initializing TGC hash indices for finding neighbors ... 
+MuGM:MuonFactory     INFO TGCIDHELPER retrieved from DetStore
+CSC_IDDetDescrCnv    INFO in createObj: creating a CcscIdHelper object in the detector store
+AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find mm region index: group, region size 0 0
+AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find stgc region index: group, region size 0 0
+AtlasDetectorID::initLevelsFromDict - there are no sTGC entries in the dictionary! 
+AtlasDetectorID::initLevelsFromDict - there are no MM entries in the dictionary! 
+ AtlasDetectorID::initialize_from_dictionary - OK 
+CscIdHelper          INFO MultiRange built successfully to Technology: MultiRange size is 210
+CscIdHelper          INFO MultiRange built successfully to detector element: Multilayer MultiRange size is 237
+CscIdHelper          INFO MultiRange built successfully to cscStrip: MultiRange size is 241
+CscIdHelper          INFO Initializing CSC hash indices ... 
+CscIdHelper          INFO The element hash max is 32
+CscIdHelper          INFO The detector element hash max is 64
+CscIdHelper          INFO The channel hash max is 61440
+CscIdHelper          INFO Initializing CSC hash indices for finding neighbors ... 
+MuGM:MuonFactory     INFO CSCIDHELPER retrieved from DetStore
+MuGM:MuonFactory     INFO  **************** MuonDetectorFactory001 ************************
+MuGM:MuonFactory     INFO  *** Start building the Muon Geometry Tree **********************
+MuGM:RDBReadAtlas    INFO Start retriving dbObjects with tag = <ATLAS-R2-2016-01-00-01> node <ATLAS>
+RDBAccessSvc      WARNING Could not get the tag for XtomoData node. Returning 0 pointer to IRDBQuery
+MuGM:RDBReadAtlas    INFO After getQuery XtomoData
+In DblQ00Xtomo(data)
+No XtomoData table in the MuonDD Database
+MuGM:RDBReadAtlas    INFO After new DblQ00Xtomo
+MuGM:RDBReadAtlas    INFO No Ascii aszt input found: looking for A-lines in ORACLE
+MuGM:RDBReadAtlas    INFO ASZT table found in Oracle
+MuGM:RDBReadAtlas    INFO ASZT size is 32
+MuGM:RDBReadAtlas    INFO No Ascii iacsc input found: looking for A-lines in ORACLE
+RDBAccessSvc      WARNING Could not get the tag for ISZT node. Returning 0 pointer to IRDBQuery
+MuGM:RDBReadAtlas    INFO No ISZT table in Oracle
+MuGM:RDBReadAtlas    INFO Access granted for all dbObjects needed by muon detectors
+MuonGeoModel.MYSQL   INFO LayoutName (from DBAM) set to <R.08>  -- relevant for CTB2004
+MuGM:ProcStations    INFO  Processing Stations and Components
+MuGM:ProcStations    INFO  Processing Stations and Components DONE
+MuGM:ProcTechnol.s   INFO nMDT 13 nCSC 2 nTGC 22 nRPC 25
+MuGM:ProcTechnol.s   INFO nDED 2 nSUP 4 nSPA 2
+MuGM:ProcTechnol.s   INFO nCHV 7 nCRO 7 nCMI 6 nLBI 6
+MuGM:ProcPosition    INFO  *** N. of stations positioned in the setup 234
+MuGM:ProcPosition    INFO  *** N. of stations described in mysql      234
+MuGM:ProcPosition    INFO  *** N. of types  32 size of jtypvec 32
+MuGM:ProcPosition    INFO  *** : 234 kinds of stations (type*sub_type) 
+MuGM:ProcPosition    INFO  *** : 1758 physical stations in space - according to the MuonDD DataBase
+MuGM:ProcCutouts     INFO  Processing Cutouts for geometry layout R.08
+MuGM:ProcCutouts     INFO  Processing Cutouts DONE
+MuGM:RDBReadAtlas    INFO  ProcessTGCreadout - version 7 wirespacing 1.8
+MuGM:RDBReadAtlas    INFO Intermediate Objects built from primary numbers
+MuGM:MuonFactory     INFO  theMaterialManager retrieven successfully from the DetStore
+MuGM:MuonFactory     INFO MuonSystem description from OracleTag=<ATLAS-R2-2016-01-00-01> and node=<ATLAS>
+MuGM:MuonFactory     INFO  TreeTop added to the Manager
+MuGM:MuonFactory     INFO  Muon Layout R.08.01
+MuGM:MuonFactory     INFO Fine Clash Fixing disabled: (should be ON/OFF for Simulation/Reconstruction)
+MuGM:MuonFactory     INFO  **************** MuonDetectorFactory001 ****************************
+MuGM:MuonFactory     INFO  *** The Muon Chamber Geometry Tree is built with 
+MuGM:MuonFactory     INFO  *** 1758 child volumes 
+MuGM:MuonFactory     INFO  *** 1839 independent elements and 
+MuGM:MuonFactory     INFO  *** 11473 elements cloned or shared 
+MuGM:MuonFactory     INFO  *** 234 kinds of stations
+MuGM:MuonFactory     INFO  *** 1758 stations with alignable transforms
+MuGM:MuonFactory     INFO  *** 148 stations are described as Assemblies
+MuGM:MuonFactory     INFO  *** 1758 MuonStations 
+MuGM:MuonFactory     INFO  *** 	 2324 MDT Readout Elements 	 1186 MDT Detector Elements 
+MuGM:MuonFactory     INFO  *** 	 32 CSC Readout Elements 	 32 CSC Detector Elements 
+MuGM:MuonFactory     INFO  *** 	 1122 RPC Readout Elements 	 600 RPC Detector Elements 
+MuGM:MuonFactory     INFO  *** 	 1578 TGC Readout Elements 	 1578 TGC Detector Elements 
+MuGM:MuonFactory     INFO  ********************************************************************
+MuGM:MuonFactory     INFO  *** Inert Material built according to DB switches and config. ****** 
+MuGM:MuonFactory     INFO  *** The Muon Geometry Tree has 1758 child vol.s in total ********
+MuGM:MuonFactory     INFO  ********************************************************************
+
+MGM::MuonDetect...   INFO Init A/B Line Containers - done - size is respectively 1758/0
+MGM::MuonDetect...   INFO Init of CSC I-Lines will be done via Conditions DB
+MGM::MuonDetect...   INFO Init I-Line Container - done - size is respectively 128
+MGM::MuonDetect...   INFO I-Line for CSC wire layers loaded (Csc Internal Alignment)
+MGM::MuonDetect...   INFO According to configuration they WILL be used 
+MGM::MuonDetect...   INFO Filling cache
+GeoModelSvc          INFO GeoModelSvc.MuonDetectorTool	 SZ= 228460Kb 	 Time = 0.92S
+ClassIDSvc           INFO  getRegistryEntries: read 4462 CLIDRegistry entries for module ALL
+AGDDtoGeoSvc         INFO  this is AGDDtoGeoSvc::initialize()
+AGDDtoGeoSvc.Mu...   INFO  initializing AGDD builder
+AGDDtoGeoSvc.Mu...   INFO  XML file 
+AGDDtoGeoSvc.Mu...   INFO  ---------
+AGDDtoGeoSvc.Mu...   INFO  Sections 
+AGDDtoGeoSvc.Mu...   INFO  ---------
+AGDDtoGeoSvc.Mu...   INFO  Volumes 
+AGDDtoGeoSvc.Mu...   INFO  ---------
+AGDDtoGeoSvc.Mu...   INFO MuonAGDDTool::initialize
+AGDDtoGeoSvc.Mu...   INFO AGDDtoGeoSvc.MuonSpectrometer::construct()
+AGDDtoGeoSvc.Mu...   INFO  Reading AGDD2GeoSwitches flags 
+AGDDtoGeoSvc.Mu...   INFO  ----> ECT_Toroids
+AGDDtoGeoSvc.Mu...   INFO  ----> BAR_Toroid
+AGDDtoGeoSvc.Mu...   INFO  ----> Feet
+AGDDtoGeoSvc.Mu...   INFO  ----> RailAssembly
+AGDDtoGeoSvc.Mu...   INFO  ----> JFSH_Shield
+AGDDtoGeoSvc.Mu...   INFO  ----> JDSH_Shield
+AGDDtoGeoSvc.Mu...   INFO  ----> JTSH_Shield
+AGDDtoGeoSvc.Mu...   INFO  ----> pp2
+AGDDtoGeoSvc.Mu...   INFO  ----> MBAP_AccessPlatform
+AGDDtoGeoSvc.Mu...   INFO  ----> MBWH_BigWheels
+AGDDtoGeoSvc.Mu...   INFO  ----> SADL_CalorimeterSaddle
+AGDDtoGeoSvc.Mu...   INFO  ----> TBWH_BigWheels
+AGDDtoGeoSvc.Mu...   INFO  ----> TGC3_BigWheels
+AGDDtoGeoSvc.Mu...   INFO  ----> TGC1_BigWheels
+AGDDtoGeoSvc.Mu...   INFO  ----> MDTRail
+AGDDtoGeoSvc.Mu...   INFO  ----> servicesAtZ0
+AGDDtoGeoSvc.Mu...   INFO  ----> HFTruckRail
+AGDDtoGeoSvc.Mu...   INFO  ----> RUN2_Services
+AGDDtoGeoSvc.Mu...   INFO  now reading AGDD blob 
+AGDDtoGeoSvc.Mu...   INFO  now dumping the flags 
+AGDDtoGeoSvc.Mu...   INFO 		----- ECT_Toroids ECT_Toroids
+AGDDtoGeoSvc.Mu...   INFO 		----- BAR_Toroid BAR_Toroid
+AGDDtoGeoSvc.Mu...   INFO 		----- Feet Feet
+AGDDtoGeoSvc.Mu...   INFO 		----- RailAssembly RailAssembly
+AGDDtoGeoSvc.Mu...   INFO 		----- JFSH_Shield JFSH_Shield
+AGDDtoGeoSvc.Mu...   INFO 		----- JDSH_Shield JDSH_Shield
+AGDDtoGeoSvc.Mu...   INFO 		----- JTSH_Shield JTSH_Shield
+AGDDtoGeoSvc.Mu...   INFO 		----- pp2 pp2
+AGDDtoGeoSvc.Mu...   INFO 		----- MBAP_AccessPlatform MBAP_AccessPlatform
+AGDDtoGeoSvc.Mu...   INFO 		----- MBWH_BigWheels MBWH_BigWheels
+AGDDtoGeoSvc.Mu...   INFO 		----- SADL_CalorimeterSaddle SADL_CalorimeterSaddle
+AGDDtoGeoSvc.Mu...   INFO 		----- TBWH_BigWheels TBWH_BigWheels
+AGDDtoGeoSvc.Mu...   INFO 		----- TGC3_BigWheels TGC3_BigWheels
+AGDDtoGeoSvc.Mu...   INFO 		----- TGC1_BigWheels TGC1_BigWheels
+AGDDtoGeoSvc.Mu...   INFO 		----- MDTRail MDTRail
+AGDDtoGeoSvc.Mu...   INFO 		----- servicesAtZ0 servicesAtZ0
+AGDDtoGeoSvc.Mu...   INFO 		----- HFTruckRail HFTruckRail
+AGDDtoGeoSvc.Mu...   INFO 		----- RUN2_Services RUN2_Services
+AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00
+ClassIDSvc           INFO  getRegistryEntries: read 1315 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 251 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 310 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 242 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 1064 CLIDRegistry entries for module ALL
+CondInputLoader      INFO Initializing CondInputLoader...
+CondInputLoader      INFO Adding base classes:
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/FTHOLD' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/NOISE' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/PED' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/PSLOPE' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/RMS' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/STAT' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/T0BASE' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/T0PHASE' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/EXT/DCS/MAGNETS/SENSORDATA' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/GLOBAL/BField/Maps' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/MDT/CABLING/MAP_SCHEMA' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/MDT/CABLING/MEZZANINE_SCHEMA' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/MDT/RTBLOB' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/MDT/T0BLOB' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/CSC/ILINES' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/ASBUILTPARAMS' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/BARREL' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/ENDCAP/SIDEA' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/ENDCAP/SIDEC' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/TGC/SIDEA' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/TGC/SIDEC' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/RPC/CABLING/MAP_SCHEMA' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/RPC/CABLING/MAP_SCHEMA_CORR' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/RPC/DCS/DeadRopanels' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/RPC/DCS/OffRopanels' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/RPC/DQMF/ELEMENT_STATUS' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/RPC/TRIGGER/CM_THR_ETA' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/RPC/TRIGGER/CM_THR_PHI' )   ->
+CondInputLoader      INFO Will create WriteCondHandle dependencies for the following DataObjects:
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/FTHOLD' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/NOISE' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/PED' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/PSLOPE' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/RMS' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/STAT' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/T0BASE' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/CSC/T0PHASE' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/EXT/DCS/MAGNETS/SENSORDATA' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/GLOBAL/BField/Maps' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/MDT/CABLING/MAP_SCHEMA' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/MDT/CABLING/MEZZANINE_SCHEMA' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/MDT/RTBLOB' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/MDT/T0BLOB' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/CSC/ILINES' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/ASBUILTPARAMS' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/BARREL' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/ENDCAP/SIDEA' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/ENDCAP/SIDEC' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/TGC/SIDEA' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/TGC/SIDEC' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/RPC/CABLING/MAP_SCHEMA' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/RPC/CABLING/MAP_SCHEMA_CORR' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/RPC/DCS/DeadRopanels' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/RPC/DCS/OffRopanels' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/RPC/DQMF/ELEMENT_STATUS' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/RPC/TRIGGER/CM_THR_ETA' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/RPC/TRIGGER/CM_THR_PHI' ) 
+MuonAlignmentCo...   INFO Initilalizing
+MuonAlignmentCo...   INFO In initialize ---- # of folders registered is 7
+MuonAlignmentCo...   INFO geometry version from the MuonDetectorManager = R.08.01
+MuonDetectorCon...   INFO Initializing ...
+AtlasFieldMapCo...   INFO Initialize: Key  ( 'AtlasFieldMapCondObj' , 'ConditionStore+fieldMapCondObj' )  has been succesfully registered 
+AtlasFieldMapCo...   INFO Initialize: Will update the field map from conditions
+AtlasFieldCache...   INFO Initialize: Key  ( 'AtlasFieldCacheCondObj' , 'ConditionStore+fieldCondObj' )  has been succesfully registered 
+AtlasFieldCache...   INFO Initialize: Will update current from conditions
+AtlasFieldCache...   INFO Initialize: useDCS, useSoleCurrent, useToroCurrent. 1,  'UseSoleCurrent':7730.0000,  'UseToroCurrent':20400.000 LockMapCurrents 0
+RegSelCondAlg_RPC    INFO MuonRegSelCondAlg::initialize() 'ConditionStore+RegSelLUTCondData_RPC'
+RegSelCondAlg_TGC    INFO MuonRegSelCondAlg::initialize() 'ConditionStore+RegSelLUTCondData_TGC'
+RegSelCondAlg_MDT    INFO MuonRegSelCondAlg::initialize() 'ConditionStore+RegSelLUTCondData_MDT'
+RegSelCondAlg_CSC    INFO MuonRegSelCondAlg::initialize() 'ConditionStore+RegSelLUTCondData_CSC'
+ClassIDSvc           INFO  getRegistryEntries: read 8930 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 683 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 1588 CLIDRegistry entries for module ALL
 RpcRawDataProvider   INFO RpcRawDataProvider::initialize
 RpcRawDataProvider   INFO  'DoSeededDecoding':False
+ClassIDSvc           INFO  getRegistryEntries: read 990 CLIDRegistry entries for module ALL
+ROBDataProviderSvc   INFO Initializing ROBDataProviderSvc - package version ByteStreamCnvSvcBase-00-00-00
+ROBDataProviderSvc   INFO  ---> Filter out empty ROB fragments                               =  'filterEmptyROB':False
+ROBDataProviderSvc   INFO  ---> Filter out specific ROBs by Status Code: # ROBs = 0
+ROBDataProviderSvc   INFO  ---> Filter out Sub Detector ROBs by Status Code: # Sub Detectors = 0
 RpcRawDataProvi...   INFO initialize() successful in RpcRawDataProvider.RPC_RawDataProviderToolMT
 TgcRawDataProvider   INFO TgcRawDataProvider::initialize
 TgcRawDataProvider   INFO  'DoSeededDecoding':False
+ClassIDSvc           INFO  getRegistryEntries: read 1240 CLIDRegistry entries for module ALL
 TgcRawDataProvi...   INFO initialize() successful in TgcRawDataProvider.TGC_RawDataProviderToolMT.TgcROD_Decoder
+MuonTGC_CablingSvc   INFO for 1/12 sector initialize
+MuonTGC_Cabling...   INFO initialize
+ToolSvc.TGCCabl...   INFO initialize
+ToolSvc.TGCCabl...   INFO readTGCMap from text
+ToolSvc.TGCCabl...   INFO readTGCMap found file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2020-09-16T2101/Athena/22.0.18/InstallArea/x86_64-centos7-gcc8-opt/share/ASD2PP_diff_12_ONL.db
+ToolSvc.TGCCabl...   INFO giveASD2PP_DIFF_12 (m_ASD2PP_DIFF_12 is not NULL)
 TgcRawDataProvi...   INFO initialize() successful in TgcRawDataProvider.TGC_RawDataProviderToolMT
 MdtRawDataProvider   INFO MdtRawDataProvider::initialize
 MdtRawDataProvider   INFO  'DoSeededDecoding':False
-MdtRawDataProvi...   INFO Retrieved service ServiceHandle('ROBDataProviderSvc')
+ClassIDSvc           INFO  getRegistryEntries: read 1427 CLIDRegistry entries for module ALL
+MdtRawDataProvi...   INFO Retrieved service ROBDataProviderSvc = ServiceHandle('ROBDataProviderSvc')
 MdtRawDataProvi...   INFO Processing configuration for layouts with BME chambers.
 MdtRawDataProvi...   INFO Processing configuration for layouts with BMG chambers.
 MdtRawDataProvi...   INFO Retrieved tool Decoder = PrivateToolHandle('MdtROD_Decoder/MdtROD_Decoder')
 MdtRawDataProvi...   INFO initialize() successful in MdtRawDataProvider.MDT_RawDataProviderToolMT
+ClassIDSvc           INFO  getRegistryEntries: read 1008 CLIDRegistry entries for module ALL
 CscRawDataProvi...   INFO Retrieved service ServiceHandle('ROBDataProviderSvc')
 CscRawDataProvi...   INFO Retrieved tool Decoder = PrivateToolHandle('Muon::CscROD_Decoder/CscROD_Decoder')
-CscRawDataProvi...   INFO The Muon Geometry version is R.08.01
 CscRawDataProvi...   INFO initialize() successful in CscRawDataProvider.CSC_RawDataProviderToolMT
+ClassIDSvc           INFO  getRegistryEntries: read 54 CLIDRegistry entries for module ALL
+RpcRdoToRpcPrep...   INFO package version = MuonRPC_CnvTools-00-00-00
 RpcRdoToRpcPrep...   INFO properties are 
 RpcRdoToRpcPrep...   INFO produceRpcCoinDatafromTriggerWords 1
 RpcRdoToRpcPrep...   INFO reduceCablingOverlap               1
@@ -24,15 +590,496 @@ RpcRdoToRpcPrep...   INFO timeShift                          -12.5
 RpcRdoToRpcPrep...   INFO etaphi_coincidenceTime             20
 RpcRdoToRpcPrep...   INFO overlap_timeTolerance              10
 RpcRdoToRpcPrep...   INFO Correct prd time from cool db      0
+MuonRPC_CablingSvc   INFO Initializing MuonRPC_CablingSvc - package version MuonRPC_Cabling-00-00-00
+ToolSvc.RPCCabl...   INFO Initializing - folders names are: conf /RPC/CABLING/MAP_SCHEMA / corr /RPC/CABLING/MAP_SCHEMA_CORR
+MuonRPC_CablingSvc   INFO RPCCablingDbTool retrieved with handle TheRpcCablingDbTool = PublicToolHandle('RPCCablingDbTool/RPCCablingDbTool')
+MuonRPC_CablingSvc   INFO Register call-back  against 2 folders listed below 
+MuonRPC_CablingSvc   INFO  Folder n. 1 </RPC/CABLING/MAP_SCHEMA>     found in the DetStore
+ClassIDSvc           INFO  getRegistryEntries: read 242 CLIDRegistry entries for module ALL
+MuonRPC_CablingSvc   INFO initMappingModel registered for call-back against folder </RPC/CABLING/MAP_SCHEMA>
+MuonRPC_CablingSvc   INFO  Folder n. 2 </RPC/CABLING/MAP_SCHEMA_CORR>     found in the DetStore
+MuonRPC_CablingSvc   INFO initMappingModel registered for call-back against folder </RPC/CABLING/MAP_SCHEMA_CORR>
+MuonRPC_CablingSvc   INFO RPCTriggerDbTool retrieved with statusCode = SUCCESS pointer = TheRpcTriggerDbTool = PublicToolHandle('RPCTriggerDbTool')
+MuonRPC_CablingSvc   INFO Register call-back  against 2 folders listed below 
+MuonRPC_CablingSvc   INFO  Folder n. 1 </RPC/TRIGGER/CM_THR_ETA>     found in the DetStore
+MuonRPC_CablingSvc   INFO initTrigRoadsModel registered for call-back against folder </RPC/TRIGGER/CM_THR_ETA>
+MuonRPC_CablingSvc   INFO  Folder n. 2 </RPC/TRIGGER/CM_THR_PHI>     found in the DetStore
+MuonRPC_CablingSvc   INFO initTrigRoadsModel registered for call-back against folder </RPC/TRIGGER/CM_THR_PHI>
 RpcRdoToRpcPrep...   INFO Retrieved DecodingTool = PrivateToolHandle('Muon::RpcRdoToPrepDataToolMT/RpcRdoToRpcPrepDataTool')
+ClassIDSvc           INFO  getRegistryEntries: read 169 CLIDRegistry entries for module ALL
 TgcRdoToTgcPrep...   INFO initialize() successful in TgcRdoToTgcPrepData.TgcRdoToTgcPrepDataTool
 TgcRdoToTgcPrep...   INFO Retrieved DecodingTool = PrivateToolHandle('Muon::TgcRdoToPrepDataToolMT/TgcRdoToTgcPrepDataTool')
 MdtRdoToMdtPrep...   INFO Processing configuration for layouts with BMG chambers.
 MdtRdoToMdtPrep...   INFO Processing configuration for layouts with BME chambers.
 MdtRdoToMdtPrep...   INFO Processing configuration for layouts with BMG chambers.
 MdtRdoToMdtPrep...   INFO Retrieved DecodingTool = PrivateToolHandle('Muon::MdtRdoToPrepDataToolMT/MdtRdoToMdtPrepDataTool')
+ClassIDSvc           INFO  getRegistryEntries: read 116 CLIDRegistry entries for module ALL
 CscRdoToCscPrep...   INFO Retrieved CscRdoToCscPrepDataTool = PrivateToolHandle('Muon::CscRdoToCscPrepDataToolMT/CscRdoToCscPrepDataTool')
+ByteStreamInputSvc   INFO Initializing ByteStreamInputSvc - package version ByteStreamCnvSvc-00-00-00
+ClassIDSvc           INFO  getRegistryEntries: read 452 CLIDRegistry entries for module ALL
+EventSelector        INFO reinitialization...
+AthenaEventLoopMgr   INFO Setup EventSelector service EventSelector
+ApplicationMgr       INFO Application Manager Initialized successfully
+ApplicationMgr    SUCCESS ****************************** Algorithm Sequence ****************************
+ApplicationMgr    SUCCESS AthSequencer/AthMasterSeq
+ApplicationMgr    SUCCESS      AthSequencer/AthAlgEvtSeq
+ApplicationMgr    SUCCESS           AthSequencer/AthBeginSeq
+ApplicationMgr    SUCCESS                AthIncFirerAlg/BeginIncFiringAlg
+ApplicationMgr    SUCCESS                IncidentProcAlg/IncidentProcAlg1
+ApplicationMgr    SUCCESS           AthSequencer/AthAllAlgSeq
+ApplicationMgr    SUCCESS                AthSequencer/AthCondSeq
+ApplicationMgr    SUCCESS                     CondInputLoader/CondInputLoader
+ApplicationMgr    SUCCESS                     MuonAlignmentCondAlg/MuonAlignmentCondAlg
+ApplicationMgr    SUCCESS                     MuonDetectorCondAlg/MuonDetectorCondAlg
+ApplicationMgr    SUCCESS                     RpcCablingCondAlg/RpcCablingCondAlg
+ApplicationMgr    SUCCESS                     MuonMDT_CablingAlg/MuonMDT_CablingAlg
+ApplicationMgr    SUCCESS                     MagField::AtlasFieldMapCondAlg/AtlasFieldMapCondAlg
+ApplicationMgr    SUCCESS                     MagField::AtlasFieldCacheCondAlg/AtlasFieldCacheCondAlg
+ApplicationMgr    SUCCESS                     RpcCondDbAlg/RpcCondDbAlg
+ApplicationMgr    SUCCESS                     RPC_RegSelCondAlg/RegSelCondAlg_RPC
+ApplicationMgr    SUCCESS                     TGC_RegSelCondAlg/RegSelCondAlg_TGC
+ApplicationMgr    SUCCESS                     MdtCalibDbAlg/MdtCalibDbAlg
+ApplicationMgr    SUCCESS                     MDT_RegSelCondAlg/RegSelCondAlg_MDT
+ApplicationMgr    SUCCESS                     CscCondDbAlg/CscCondDbAlg
+ApplicationMgr    SUCCESS                     CSC_RegSelCondAlg/RegSelCondAlg_CSC
+ApplicationMgr    SUCCESS                AthSequencer/AthAlgSeq
+ApplicationMgr    SUCCESS                     MuonCacheCreator/MuonCacheCreator
+ApplicationMgr    SUCCESS                     Muon::RpcRawDataProvider/RpcRawDataProvider
+ApplicationMgr    SUCCESS                     Muon::TgcRawDataProvider/TgcRawDataProvider
+ApplicationMgr    SUCCESS                     Muon::MdtRawDataProvider/MdtRawDataProvider
+ApplicationMgr    SUCCESS                     Muon::CscRawDataProvider/CscRawDataProvider
+ApplicationMgr    SUCCESS                     RpcRdoToRpcPrepData/RpcRdoToRpcPrepData
+ApplicationMgr    SUCCESS                     TgcRdoToTgcPrepData/TgcRdoToTgcPrepData
+ApplicationMgr    SUCCESS                     MdtRdoToMdtPrepData/MdtRdoToMdtPrepData
+ApplicationMgr    SUCCESS                     CscRdoToCscPrepData/CscRdoToCscPrepData
+ApplicationMgr    SUCCESS                     CscThresholdClusterBuilder/CscThresholdClusterBuilder
+ApplicationMgr    SUCCESS           AthSequencer/AthEndSeq
+ApplicationMgr    SUCCESS                AthIncFirerAlg/EndIncFiringAlg
+ApplicationMgr    SUCCESS                IncidentProcAlg/IncidentProcAlg2
+ApplicationMgr    SUCCESS      AthSequencer/AthOutSeq
+ApplicationMgr    SUCCESS ******************************************************************************
+ByteStreamInputSvc   INFO Picked valid file: /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/CSC/FTHOLD'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/CSC/NOISE'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/CSC/PED'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/CSC/PSLOPE'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/CSC/RMS'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/CSC/STAT'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/CSC/T0BASE'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/CSC/T0PHASE'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/EXT/DCS/MAGNETS/SENSORDATA'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/GLOBAL/BField/Maps'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MDT/CABLING/MAP_SCHEMA'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MDT/CABLING/MEZZANINE_SCHEMA'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MDT/RTBLOB'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MDT/T0BLOB'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MUONALIGN/CSC/ILINES'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MUONALIGN/MDT/ASBUILTPARAMS'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MUONALIGN/MDT/BARREL'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MUONALIGN/MDT/ENDCAP/SIDEA'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MUONALIGN/MDT/ENDCAP/SIDEC'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MUONALIGN/TGC/SIDEA'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MUONALIGN/TGC/SIDEC'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/RPC/CABLING/MAP_SCHEMA'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/RPC/CABLING/MAP_SCHEMA_CORR'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/RPC/DCS/DeadRopanels'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/RPC/DCS/OffRopanels'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/RPC/DQMF/ELEMENT_STATUS'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/RPC/TRIGGER/CM_THR_ETA'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/RPC/TRIGGER/CM_THR_PHI'
+ApplicationMgr       INFO Application Manager Started successfully
+EventInfoByteSt...   INFO IsSimulation : 0
+EventInfoByteSt...   INFO IsTestbeam : 0
+EventInfoByteSt...   INFO IsCalibration : 0
+AthenaEventLoopMgr   INFO   ===>>>  start of run 327265    <<<===
+EventPersistenc...   INFO Added successfully Conversion service:TagInfoMgr
+IOVDbSvc             INFO Opening COOL connection for COOLONL_RPC/CONDBR2
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to RPCCablingMapSchema_2016_2017_01 for folder /RPC/CABLING/MAP_SCHEMA
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to RPCCablingMapSchemaCorr_2016_2017_01 for folder /RPC/CABLING/MAP_SCHEMA_CORR
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to RPCTriggerCMThrEta_RUN1-RUN2-HI-02 for folder /RPC/TRIGGER/CM_THR_ETA
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to RPCTriggerCMThrPhi_RUN1-RUN2-HI-02 for folder /RPC/TRIGGER/CM_THR_PHI
+IOVDbSvc             INFO Disconnecting from COOLONL_RPC/CONDBR2
+EventPersistenc...   INFO Added successfully Conversion service:AthenaPoolCnvSvc
+MuonRPC_CablingSvc   INFO initMappingModel has been called
+MuonRPC_CablingSvc   INFO ToolHandle in initMappingModel - <TheRpcCablingDbTool = PublicToolHandle('RPCCablingDbTool/RPCCablingDbTool')>
+MuonRPC_CablingSvc   INFO Retrieving cabling singleton; to create an empty one or to get the existing one
+RPCcabling           INFO CablingRPC---singleton constructor ---- this must be executed just once
+RPCcabling           INFO CablingRPC---The singleton will fill the maps from the COOL streams
+RPCcabling           INFO CablingRPC---InitMaps from COOL cannot be executed NOW: empty string
+RPCcabling           INFO CablingRPC---The singleton is created here
+RPCcabling           INFO CablingRPC--- cacheCleared: s_status = 0
+MuonRPC_CablingSvc   INFO Cabling singleton cache has been cleared
+MuonRPC_CablingSvc   INFO  Trigger roads will be loaded from COOL
+ToolSvc.RPCCabl...   INFO LoadParameters /RPC/CABLING/MAP_SCHEMA I=2 
+ToolSvc.RPCCabl...   INFO loadRPCMap --- Load Map from DB
+ToolSvc.RPCCabl...   INFO Try to read from folder </RPC/CABLING/MAP_SCHEMA>
+ToolSvc.RPCCabl...   INFO  CondAttrListCollection from DB folder have been obtained with size 1
+ToolSvc.RPCCabl...   INFO After Reading folder, Configuration string size is 222202
+ToolSvc.RPCCabl...   INFO LoadParameters /RPC/CABLING/MAP_SCHEMA_CORR I=2 
+ToolSvc.RPCCabl...   INFO loadRPCCorr --- Load Corrections from DB
+ToolSvc.RPCCabl...   INFO Try to read from folder </RPC/CABLING/MAP_SCHEMA_CORR>
+ToolSvc.RPCCabl...   INFO  CondAttrListCollection from DB folder have been obtained with size 1
+ToolSvc.RPCCabl...   INFO After Reading folder, Correction string size is 29369
+MuonRPC_CablingSvc   INFO  InitMappingModel: Trigger roads not yet loaded from COOL - postpone cabling initialization 
+MuonRPC_CablingSvc   INFO initTrigRoadsModel has been called
+MuonRPC_CablingSvc   INFO  Trigger roads will be loaded from COOL
+MuonRPC_CablingSvc   INFO Retrieve the pointer to the cabling singleton 
+RPCcabling           INFO CablingRPC--- cacheCleared: s_status = 0
+MuonRPC_CablingSvc   INFO Cabling singleton cache has been cleared
+ToolSvc.RPCTrig...   INFO LoadParameters /RPC/TRIGGER/CM_THR_ETA I=2 
+ToolSvc.RPCTrig...   INFO LoadParameters /RPC/TRIGGER/CM_THR_PHI I=2 
+MuonRPC_CablingSvc   INFO ======== RPC Trigger Roads from COOL - Header infos ========
+MuonRPC_CablingSvc   INFO 
+RPC LVL1 Configuration 10.6 with roads from Feb 2012
+L1 THRESHOLDS:   MU4 MU6 MU10 MU11 MU15 MU20
+Road version: "road_files_120209"
+CMA            th0    th1   th2
+eta low-pt     mu4    mu6   mu10
+phi low-pt     mu4    mu6   mu10
+eta high-pt    mu11  mu15   mu20
+phi high-pt    mu11  mu15   mu15
+
+
+RPCcabling           INFO CablingRPC---InitMaps from COOL: going to read configuration
+RPCcabling           INFO CablingRPC--->> RPC cabling map from COOL <<
+RPCcabling           INFO CablingRPC--- ReadConf: map has size 222202
+RPCcabling           INFO CablingRPC--- ReadConf: map n. of lines read is 924
+RPCcabling           INFO CablingRPC--- ReadConf: version is 5.0 Atlas R_07_03_RUN2ver104
+RPCcabling           INFO CablingRPC--- buildRDOmap
+RPCcabling           INFO CablingRPC---InitMaps from COOL: going to read corrections to configuration
+RPCcabling           INFO CablingRPC--->> RPC cabling corrections from COOL <<
+RPCcabling           INFO CablingRPC--- ReadCorr: CorrMap has size 29369
+RPCcabling           INFO CablingRPC--- ReadConf: CorrMap n. of lines read is 743
+RPCcabling           INFO CablingRPC---InitMaps from COOL - maps have been parsed
+MuonRPC_CablingSvc   INFO InitTrigRoadsModel: RPC cabling model is loaded!
+Level-1 configuration database version 5.0 Atlas R_07_03_RUN2ver104 read.
+Contains 26 Trigger Sector Types:
+negative sectors  0 - 15 ==> 18  2 24  3 19  2 24  4 20  2 24  1 18  5 25  6 
+negative sectors 16 - 31 ==> 21 13 26  6 21  7 16  8 14  7 16  6 21 13 26  1 
+positive sectors 32 - 47 ==>  9 24  2 22  9 24  2 23 10 24  2 18  1 25  5 18 
+positive sectors 48 - 63 ==>  1 26 13 21  6 17 12 15 11 17 12 21  6 26 13 22 
+
+MuonRPC_CablingSvc   INFO buildOfflineOnlineMap
+MuonRPC_CablingSvc   INFO Applying FeetPadThresholds : 0,2,5
+MuonRPC_CablingSvc   INFO MuonRPC_CablingSvc initialized succesfully
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186525031, run #327265 0 events processed so far  <<<===
+IOVDbSvc             INFO Opening COOL connection for COOLOFL_CSC/CONDBR2
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to CscFthold-RUN2-BLK-UPD1-007-00 for folder /CSC/FTHOLD
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to CscNoise-RUN2-BLK-UPD1-007-00 for folder /CSC/NOISE
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to CscPed-RUN2-BLK-UPD1-007-00 for folder /CSC/PED
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to CscPslope-RUN2-BLK-UPD1-000-00 for folder /CSC/PSLOPE
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to CscRms-RUN2-BLK-UPD1-003-00 for folder /CSC/RMS
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to CscStat-RUN2-BLK-UPD1-008-00 for folder /CSC/STAT
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to CscT0base-RUN2-BLK-UPD1-001-00 for folder /CSC/T0BASE
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to CscT0phase-RUN2-BLK-UPD2-001-00 for folder /CSC/T0PHASE
+IOVDbSvc             INFO Disconnecting from COOLOFL_CSC/CONDBR2
+IOVDbSvc             INFO Opening COOL connection for COOLOFL_DCS/CONDBR2
+IOVDbSvc             INFO Disconnecting from COOLOFL_DCS/CONDBR2
+IOVDbSvc             INFO Opening COOL connection for COOLONL_GLOBAL/CONDBR2
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to BFieldMap-Run1-14m-v01 for folder /GLOBAL/BField/Maps
+IOVDbSvc             INFO Disconnecting from COOLONL_GLOBAL/CONDBR2
+IOVDbSvc             INFO Opening COOL connection for COOLONL_MDT/CONDBR2
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MDTCablingMapSchema_BMG_01 for folder /MDT/CABLING/MAP_SCHEMA
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MDTCablingMezzanineSchema_M5-RUN2 for folder /MDT/CABLING/MEZZANINE_SCHEMA
+IOVDbSvc             INFO Disconnecting from COOLONL_MDT/CONDBR2
+IOVDbSvc             INFO Opening COOL connection for COOLOFL_MDT/CONDBR2
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MDTRT-RUN2-UPD4-21 for folder /MDT/RTBLOB
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MDTT0-RUN2-UPD4-21 for folder /MDT/T0BLOB
+IOVDbSvc             INFO Disconnecting from COOLOFL_MDT/CONDBR2
+IOVDbSvc             INFO Opening COOL connection for COOLOFL_MUONALIGN/CONDBR2
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MuonAlignCscIlines-UPD1-02 for folder /MUONALIGN/CSC/ILINES
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MuonAlignMdtAsbuiltparams-RUN2-BA_ONLY-UPD4-00 for folder /MUONALIGN/MDT/ASBUILTPARAMS
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MuonAlignMDTBarrelAlign-RUN2-BA_ROLLING_11-BLKP-UPD4-00 for folder /MUONALIGN/MDT/BARREL
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MuonAlignMDTEndCapAAlign-RUN2-ECA_ROLLING_2015_03_01-UPD4-02 for folder /MUONALIGN/MDT/ENDCAP/SIDEA
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MuonAlignMDTEndCapCAlign-RUN2-ECC_ROLLING_2015_03_01-UPD4-02 for folder /MUONALIGN/MDT/ENDCAP/SIDEC
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MuonAlignTGCEndCapAAlign-RUN2-TGCA_ROLLING_2011_01-ES1-UPD1-03 for folder /MUONALIGN/TGC/SIDEA
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MuonAlignTGCEndCapCAlign-RUN2-TGCC_ROLLING_2011_01-ES1-UPD1-03 for folder /MUONALIGN/TGC/SIDEC
+IOVDbSvc             INFO Disconnecting from COOLOFL_MUONALIGN/CONDBR2
+IOVDbSvc             INFO Opening COOL connection for COOLOFL_RPC/CONDBR2
+IOVDbFolder          INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to RPCDQMFElementStatus_Run1_UPD4-RUN2-01 for folder /RPC/DQMF/ELEMENT_STATUS
+IOVDbSvc             INFO Disconnecting from COOLOFL_RPC/CONDBR2
+MuonAlignmentCo...   INFO Load alignment parameters from DB folder </MUONALIGN/CSC/ILINES>
+MuonAlignmentCo...   INFO Size of CSC/ILINES CondAttrListCollection  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/CSC/ILINES' )  readCscILinesCdo->size()= 1
+MuonAlignmentCo...   INFO Range of CSC/ILINES input is {[0,0,t:1425168000] - [t:4294967294.854775807]}
+MuonAlignmentCo...   INFO recorded new CscInternalAlignmentMapContainer with range {[0,0,t:1425168000] - [t:4294967294.854775807]} into Conditions Store
+MuonAlignmentCo...   INFO Load alignment parameters from DB folder </MUONALIGN/MDT/ASBUILTPARAMS>
+MuonAlignmentCo...   INFO Size of MDT/ASBUILTPARAMS CondAttrListCollection  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/ASBUILTPARAMS' )  ->size()= 1
+MuonAlignmentCo...   INFO Range of MDT/ASBUILTPARAMS input is {[0,0,t:0] - [t:4294967294.854775807]}
+MuonAlignmentCo...   INFO recorded new MdtAsBuiltMapContainer with range {[0,0,t:0] - [t:4294967294.854775807]} into Conditions Store
+MuonAlignmentCo...   INFO Load alignment parameters from DB folder </MUONALIGN/MDT/BARREL>
+MuonAlignmentCo...   INFO Size of /MUONALIGN/MDT/BARREL CondAttrListCollection  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/BARREL' )  readCdo->size()= 1
+MuonAlignmentCo...   INFO Range of /MUONALIGN/MDT/BARREL input is, ALines: {[0,0,t:1497851700] - [t:1498737300]} BLines: {[0,0,t:1497851700] - [t:1498737300]}
+MuonAlignmentCo...   INFO Data read from folder /MUONALIGN/MDT/BARREL have IoV = 195569
+MuonAlignmentCo...   INFO A- and B-Lines parameters from DB folder </MUONALIGN/MDT/BARREL> loaded
+MuonAlignmentCo...   INFO Load alignment parameters from DB folder </MUONALIGN/MDT/ENDCAP/SIDEA>
+MuonAlignmentCo...   INFO Size of /MUONALIGN/MDT/ENDCAP/SIDEA CondAttrListCollection  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/ENDCAP/SIDEA' )  readCdo->size()= 1
+MuonAlignmentCo...   INFO Range of /MUONALIGN/MDT/ENDCAP/SIDEA input is, ALines: {[0,0,t:1497891240] - [t:1497898380]} BLines: {[0,0,t:1497891240] - [t:1497898380]}
+MuonAlignmentCo...   INFO Data read from folder /MUONALIGN/MDT/ENDCAP/SIDEA have IoV = 195588
+MuonAlignmentCo...   INFO A- and B-Lines parameters from DB folder </MUONALIGN/MDT/ENDCAP/SIDEA> loaded
+MuonAlignmentCo...   INFO Load alignment parameters from DB folder </MUONALIGN/MDT/ENDCAP/SIDEC>
+MuonAlignmentCo...   INFO Size of /MUONALIGN/MDT/ENDCAP/SIDEC CondAttrListCollection  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/ENDCAP/SIDEC' )  readCdo->size()= 1
+MuonAlignmentCo...   INFO Range of /MUONALIGN/MDT/ENDCAP/SIDEC input is, ALines: {[0,0,t:1497892260] - [t:1497899460]} BLines: {[0,0,t:1497892260] - [t:1497899460]}
+MuonAlignmentCo...   INFO Data read from folder /MUONALIGN/MDT/ENDCAP/SIDEC have IoV = 195599
+MuonAlignmentCo...   INFO A- and B-Lines parameters from DB folder </MUONALIGN/MDT/ENDCAP/SIDEC> loaded
+MuonAlignmentCo...   INFO Load alignment parameters from DB folder </MUONALIGN/TGC/SIDEA>
+MuonAlignmentCo...   INFO No BLines decoding will be attempted for folder named /MUONALIGN/TGC/SIDEA
+MuonAlignmentCo...   INFO Size of /MUONALIGN/TGC/SIDEA CondAttrListCollection  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/TGC/SIDEA' )  readCdo->size()= 1
+MuonAlignmentCo...   INFO Range of /MUONALIGN/TGC/SIDEA input is, ALines: {[0,0,t:0] - [t:4294967294.854775807]}
+MuonAlignmentCo...   INFO Data read from folder /MUONALIGN/TGC/SIDEA have IoV = 82360
+MuonAlignmentCo...   INFO A- and B-Lines parameters from DB folder </MUONALIGN/TGC/SIDEA> loaded
+MuonAlignmentCo...   INFO Load alignment parameters from DB folder </MUONALIGN/TGC/SIDEC>
+MuonAlignmentCo...   INFO No BLines decoding will be attempted for folder named /MUONALIGN/TGC/SIDEC
+MuonAlignmentCo...   INFO Size of /MUONALIGN/TGC/SIDEC CondAttrListCollection  ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/TGC/SIDEC' )  readCdo->size()= 1
+MuonAlignmentCo...   INFO Range of /MUONALIGN/TGC/SIDEC input is, ALines: {[0,0,t:0] - [t:4294967294.854775807]}
+MuonAlignmentCo...   INFO Data read from folder /MUONALIGN/TGC/SIDEC have IoV = 82359
+MuonAlignmentCo...   INFO A- and B-Lines parameters from DB folder </MUONALIGN/TGC/SIDEC> loaded
+MuonAlignmentCo...   INFO recorded new ALineMapContainer with range {[0,0,t:1497892260,l:0] - [t:1497898380]} into Conditions Store
+MuonAlignmentCo...   INFO recorded new BLineMapContainer with range {[0,0,t:1497892260,l:0] - [t:1497898380]} into Conditions Store
+MuonGeoModel         INFO MuonDetectorFactory - constructor  MuonSystem OuterRadius 13000 Length 22030
+MuonDetectorCon...   INFO create MuonDetectorTool - package version = MuonGeoModel-00-00-00
+MuonDetectorCon...   INFO (from GeoModelSvc)    AtlasVersion = <ATLAS-R2-2016-01-00-01>  MuonVersion = <>
+MuonDetectorCon...   INFO Keys for Muon Switches are  (key) ATLAS-R2-2016-01-00-01 (node) ATLAS
+MuonDetectorCon...   INFO (from GeoModelSvc) in AtlasVersion = <ATLAS-R2-2016-01-00-01>  default MuonVersion is <MuonSpectrometer-R.08.01>
+MuonDetectorCon...   INFO Properties have been set as follows: 
+MuonDetectorCon...   INFO     LayoutName                     R
+MuonDetectorCon...   INFO     IncludeCutouts                 0
+MuonDetectorCon...   INFO     IncludeCutoutsBog              0
+MuonDetectorCon...   INFO     IncludeCtbBis                  0
+MuonDetectorCon...   INFO     ControlAlines                  111111
+MuonDetectorCon...   INFO     MinimalGeoFlag                 0
+MuonDetectorCon...   INFO     EnableCscIntAlignment          1
+MuonDetectorCon...   INFO     EnableCscIntAlignmentFromGM    0
+MuonDetectorCon...   INFO     ControlCscIntAlines            111111
+MuonDetectorCon...   INFO     EnableMdtDeformations          1
+MuonDetectorCon...   INFO     EnableMdtAsBuiltParameters     1
+MuGM:MuonFactory     INFO MuonLayout set to <R.08.01> = Development version for DC3 - infrastructures 
+MuGM:MuonFactory     INFO                    BOG cutouts are activated 1 , all other cutouts are disabled 1
+MuGM:MuonFactory     INFO Manager created for geometry version R.08.01 from DB MuonVersion <MuonSpectrometer-R.08.01>
+MuonGeoModel.MYSQL   INFO GeometryVersion set to <R.08.01>
+MuGM:MuonFactory     INFO Mysql helper class created here for geometry version R.08.01 from DB MuonVersion <MuonSpectrometer-R.08.01>
+MuGM:MuonFactory     INFO MDTIDHELPER retrieved from DetStore
+MuGM:MuonFactory     INFO RPCIDHELPER retrieved from DetStore
+MuGM:MuonFactory     INFO TGCIDHELPER retrieved from DetStore
+MuGM:MuonFactory     INFO CSCIDHELPER retrieved from DetStore
+MuGM:MuonFactory     INFO  **************** MuonDetectorFactory001 ************************
+MuGM:MuonFactory     INFO  *** Start building the Muon Geometry Tree **********************
+MuGM:RDBReadAtlas    INFO Start retriving dbObjects with tag = <ATLAS-R2-2016-01-00-01> node <ATLAS>
+RDBAccessSvc      WARNING Could not get the tag for XtomoData node. Returning 0 pointer to IRDBQuery
+MuGM:RDBReadAtlas    INFO After getQuery XtomoData
+In DblQ00Xtomo(data)
+No XtomoData table in the MuonDD Database
+MuGM:RDBReadAtlas    INFO After new DblQ00Xtomo
+MuGM:RDBReadAtlas    INFO No Ascii aszt input found: looking for A-lines in ORACLE
+MuGM:RDBReadAtlas    INFO ASZT table found in Oracle
+MuGM:RDBReadAtlas    INFO ASZT size is 32
+MuGM:RDBReadAtlas    INFO No Ascii iacsc input found: looking for A-lines in ORACLE
+RDBAccessSvc      WARNING Could not get the tag for ISZT node. Returning 0 pointer to IRDBQuery
+MuGM:RDBReadAtlas    INFO No ISZT table in Oracle
+MuGM:RDBReadAtlas    INFO Access granted for all dbObjects needed by muon detectors
+MuonGeoModel.MYSQL   INFO LayoutName (from DBAM) set to <R.08>  -- relevant for CTB2004
+MuGM:ProcStations    INFO  Processing Stations and Components
+MuGM:ProcStations    INFO  Processing Stations and Components DONE
+MuGM:ProcTechnol.s   INFO nMDT 26 nCSC 4 nTGC 44 nRPC 50
+MuGM:ProcTechnol.s   INFO nDED 4 nSUP 8 nSPA 4
+MuGM:ProcTechnol.s   INFO nCHV 14 nCRO 14 nCMI 12 nLBI 12
+MuGM:ProcPosition    INFO  *** N. of stations positioned in the setup 234
+MuGM:ProcPosition    INFO  *** N. of stations described in mysql      234
+MuGM:ProcPosition    INFO  *** N. of types  32 size of jtypvec 32
+MuGM:ProcPosition    INFO  *** : 234 kinds of stations (type*sub_type) 
+MuGM:ProcPosition    INFO  *** : 1758 physical stations in space - according to the MuonDD DataBase
+MuGM:ProcCutouts     INFO  Processing Cutouts for geometry layout R.08
+MuGM:ProcCutouts     INFO  Processing Cutouts DONE
+MuGM:RDBReadAtlas    INFO  ProcessTGCreadout - version 7 wirespacing 1.8
+MuGM:RDBReadAtlas    INFO Intermediate Objects built from primary numbers
+MuGM:MuonFactory     INFO  theMaterialManager retrieven successfully from the DetStore
+MuGM:MuonFactory     INFO MuonSystem description from OracleTag=<ATLAS-R2-2016-01-00-01> and node=<ATLAS>
+MuGM:MuonFactory     INFO  TreeTop added to the Manager
+MuGM:MuonFactory     INFO  Muon Layout R.08.01
+MuGM:MuonFactory     INFO Fine Clash Fixing disabled: (should be ON/OFF for Simulation/Reconstruction)
+MuGM:MuonFactory     INFO  **************** MuonDetectorFactory001 ****************************
+MuGM:MuonFactory     INFO  *** The Muon Chamber Geometry Tree is built with 
+MuGM:MuonFactory     INFO  *** 1758 child volumes 
+MuGM:MuonFactory     INFO  *** 1839 independent elements and 
+MuGM:MuonFactory     INFO  *** 11473 elements cloned or shared 
+MuGM:MuonFactory     INFO  *** 234 kinds of stations
+MuGM:MuonFactory     INFO  *** 1758 stations with alignable transforms
+MuGM:MuonFactory     INFO  *** 148 stations are described as Assemblies
+MuGM:MuonFactory     INFO  *** 1758 MuonStations 
+MuGM:MuonFactory     INFO  *** 	 2324 MDT Readout Elements 	 1186 MDT Detector Elements 
+MuGM:MuonFactory     INFO  *** 	 32 CSC Readout Elements 	 32 CSC Detector Elements 
+MuGM:MuonFactory     INFO  *** 	 1122 RPC Readout Elements 	 600 RPC Detector Elements 
+MuGM:MuonFactory     INFO  *** 	 1578 TGC Readout Elements 	 1578 TGC Detector Elements 
+MuGM:MuonFactory     INFO  ********************************************************************
+MuGM:MuonFactory     INFO  *** Inert Material built according to DB switches and config. ****** 
+MuGM:MuonFactory     INFO  *** The Muon Geometry Tree has 1758 child vol.s in total ********
+MuGM:MuonFactory     INFO  ********************************************************************
+
+MGM::MuonDetect...   INFO Init A/B Line Containers - done - size is respectively 1758/0
+MGM::MuonDetect...   INFO Init of CSC I-Lines will be done via Conditions DB
+MGM::MuonDetect...   INFO Init I-Line Container - done - size is respectively 128
+MGM::MuonDetect...   INFO I-Line for CSC wire layers loaded (Csc Internal Alignment)
+MGM::MuonDetect...   INFO According to configuration they WILL be used 
+MGM::MuonDetect...   INFO Filling cache
+MGM::MuonDetect...   INFO temporary CSC I-line container with size = 128
+MGM::MuonDetect...   INFO # of CSC I-lines read from the ILineMapContainer in StoreGate is 128
+MGM::MuonDetect...   INFO # of deltaTransforms updated according to A-lines             is 128
+MGM::MuonDetect...   INFO # of entries in the CSC I-lines historical container          is 128
+MGM::MuonDetect...   INFO temporary As-Built container with size = 628
+MGM::MuonDetect...   INFO # of MDT As-Built read from the MdtAsBuiltMapContainer in StoreGate is 628
+MGM::MuonDetect...   INFO # of deltaTransforms updated according to As-Built                  is 628
+MGM::MuonDetect...   INFO # of entries in the MdtAsBuilt historical container                 is 628
+MGM::MuonDetect...   INFO temporary A-line container with size = 2694
+MGM::MuonDetect...   INFO # of A-lines read from the ALineMapContainer in StoreGate is 2694
+MGM::MuonDetect...   INFO # of deltaTransforms updated according to A-lines         is 2694
+MGM::MuonDetect...   INFO # of entries in the A-lines historical container          is 2814
+MGM::MuonDetect...   INFO In updateDeformations()
+MGM::MuonDetect...   INFO temporary B-line container with size = 1206
+MGM::MuonDetect...   INFO # of B-lines read from the ALineMapContainer in StoreGate   is 1206
+MGM::MuonDetect...   INFO # of deform-Transforms updated according to B-lines         is 1174
+MGM::MuonDetect...   INFO # of entries in the B-lines historical container            is 1174
+MuonDetectorCon...   INFO recorded new MuonDetectorManager with range {[0,0,t:1497892260,l:0] - [t:1497898380]} into Conditions Store
+RpcCablingCondAlg    INFO maps configuration have been parsed
+RpcCablingCondAlg    INFO recorded new RpcCablingCondData with range {[315000,l:0] - [999999,l:0]}
+MuonMDT_CablingAlg   INFO Size of CondAttrListCollection  ( 'CondAttrListCollection' , 'ConditionStore+/MDT/CABLING/MEZZANINE_SCHEMA' )  readCdoMez->size()= 24
+MuonMDT_CablingAlg   INFO Range of input is {[0,l:0] - [INVALID]}
+MuonMDT_CablingAlg   INFO Size of CondAttrListCollection  ( 'CondAttrListCollection' , 'ConditionStore+/MDT/CABLING/MAP_SCHEMA' )  readCdoMap->size()= 2312
+MuonMDT_CablingAlg   INFO Range of input is {[327264,l:4294640031] - [327265,l:4294640030]}
+MuonMDT_CablingAlg   INFO recorded new MuonMDT_CablingMap with range {[327264,t:0,l:4294640031] - [327265,l:4294640030]} into Conditions Store
+AtlasFieldMapCo...   INFO updateFieldMap: Update map from conditions
+AtlasFieldMapCo...   INFO updateFieldMap: Update map from conditions: Range of input/output is {[0,l:0] - [INVALID]}
+AtlasFieldMapCo...   INFO updateFieldMap: reading magnetic field map filenames from COOL
+AtlasFieldMapCo...   INFO updateFieldMap: found map of type GlobalMap with soleCur=7730 toroCur=20400 (path file:MagneticFieldMaps/bfieldmap_7730_20400_14m.root)
+AtlasFieldMapCo...   INFO updateFieldMap: found map of type SolenoidMap with soleCur=7730 toroCur=0 (path file:MagneticFieldMaps/bfieldmap_7730_0_14m.root)
+AtlasFieldMapCo...   INFO updateFieldMap: found map of type ToroidMap with soleCur=0 toroCur=20400 (path file:MagneticFieldMaps/bfieldmap_0_20400_14m.root)
+AtlasFieldMapCo...   INFO checkCurrentFromConditions: Range of input currents is {[0,0,t:1497895317.371000000] - [t:1497898549.609000000]}
+AtlasFieldMapCo...   INFO checkCurrentFromConditions: Attempt 1 at reading currents from DCS (using channel name)
+AtlasFieldMapCo...   INFO checkCurrentFromConditions: Trying to read from DCS: [channel name, index, value] CentralSol_Current , 1 , 7729.99
+AtlasFieldMapCo...   INFO checkCurrentFromConditions: Trying to read from DCS: [channel name, index, value] CentralSol_SCurrent , 2 , 7730
+AtlasFieldMapCo...   INFO checkCurrentFromConditions: Trying to read from DCS: [channel name, index, value] Toroids_Current , 3 , 20399.9
+AtlasFieldMapCo...   INFO checkCurrentFromConditions: Trying to read from DCS: [channel name, index, value] Toroids_SCurrent , 4 , 20397.7
+AtlasFieldMapCo...   INFO checkCurrentFromConditions: Currents read from DCS - solenoid 7729.99 toroid 20399.9
+AtlasFieldMapCo...   INFO updateFieldMap: currents are OK, will use nominal maps
+AtlasFieldMapCo...   INFO updateFieldMap: tagInfoH  ( 'TagInfo' , 'DetectorStore+ProcessingTags' )  is valid. 
+AtlasFieldMapCo...   INFO updateFieldMap: DID NOT reset currents from TagInfo
+AtlasFieldMapCo...   INFO updateFieldMap: Set map currents from FieldSvc: solenoid/toroid 7730,20400
+AtlasFieldMapCo...   INFO updateFieldMap: Use map file MagneticFieldMaps/bfieldmap_7730_20400_14m.root
+AtlasFieldMapCo...   INFO updateFieldMap: Initialized the field map from /cvmfs/atlas.cern.ch/repo/sw/database/GroupData/MagneticFieldMaps/bfieldmap_7730_20400_14m.root
+AtlasFieldMapCo...   INFO execute: solenoid zone id  7000
+AtlasFieldMapCo...   INFO execute: recorded AtlasFieldMapCondObj with EventRange {[0,l:0] - [INVALID]}
+AtlasFieldCache...   INFO UpdateCurrentFromConditions: Range of input/output is {[0,0,t:1497895317.371000000] - [t:1497898549.609000000]}
+AtlasFieldCache...   INFO UpdateCurrentFromConditions: Attempt 1 at reading currents from DCS (using channel name)
+AtlasFieldCache...   INFO UpdateCurrentFromConditions: Trying to read from DCS: [channel name, index, value] CentralSol_Current , 1 , 7729.99
+AtlasFieldCache...   INFO UpdateCurrentFromConditions: Trying to read from DCS: [channel name, index, value] CentralSol_SCurrent , 2 , 7730
+AtlasFieldCache...   INFO UpdateCurrentFromConditions: Trying to read from DCS: [channel name, index, value] Toroids_Current , 3 , 20399.9
+AtlasFieldCache...   INFO UpdateCurrentFromConditions: Trying to read from DCS: [channel name, index, value] Toroids_SCurrent , 4 , 20397.7
+AtlasFieldCache...   INFO UpdateCurrentFromConditions: Currents read from DCS - solenoid 7729.99 toroid 20399.9
+AtlasFieldCache...   INFO scaleField: Solenoid field scale factor 1. Desired current and map current: 7729.99,7730
+AtlasFieldCache...   INFO scaleField: Toroid field scale factor 1. Desired current and map current: 20399.9,20400
+AtlasFieldCache...   INFO execute: initialized AtlasFieldCacheCondObj and cache with SFs - sol/tor 1/1, EventRange {[0,0,t:1497895317.371000000] - [t:1497898549.609000000]}
+AtlasFieldCache...   INFO execute: solenoid zone id  7000
+RegSelCondAlg_RPC    INFO RegSelCondAlg LUT recorded: 'ConditionStore+RegSelLUTCondData_RPC'
+RegSelCondAlg_TGC    INFO RegSelCondAlg LUT recorded: 'ConditionStore+RegSelLUTCondData_TGC'
+MdtCalibDbAlg        INFO Size of CondAttrListCollection  ( 'CondAttrListCollection' , 'ConditionStore+/MDT/RTBLOB' )  readCdoRt->size()= 1186
+MdtCalibDbAlg        INFO Range of input is {[327265,l:0] - [327342,l:0]}
+MdtCalibDbAlg        INFO MdtCalibDbAlg::loadRt Read 1188RTs from COOL
+MdtCalibDbAlg        INFO recorded new MdtRtRelationCollection with range {[327265,l:0] - [327342,l:0]} into Conditions Store
+MdtCalibDbAlg        INFO recorded new MdtCorFuncSetCollection with range {[327265,l:0] - [327342,l:0]} into Conditions Store
+MdtCalibDbAlg        INFO Ignoring nonexistant station in calibration DB: MuonSpectrometer BML -6 stationPhi 7 MDT multiLayer 1 tubeLayer 1 tube 1
+MdtCalibDbAlg        INFO Ignoring nonexistant station in calibration DB: MuonSpectrometer BML stationEta 6 stationPhi 7 MDT multiLayer 1 tubeLayer 1 tube 1
+MdtCalibDbAlg        INFO Size of CondAttrListCollection  ( 'CondAttrListCollection' , 'ConditionStore+/MDT/T0BLOB' )  readCdoTube->size()= 1186
+MdtCalibDbAlg        INFO Range of input is {[319000,l:0] - [INVALID]}
+MdtCalibDbAlg        INFO recorded new MdtTubeCalibContainerCollection with range {[319000,l:0] - [INVALID]} into Conditions Store
+RegSelCondAlg_MDT    INFO RegSelCondAlg LUT recorded: 'ConditionStore+RegSelLUTCondData_MDT'
+RegSelCondAlg_CSC    INFO RegSelCondAlg LUT recorded: 'ConditionStore+RegSelLUTCondData_CSC'
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186525031, run #327265 1 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186524665, run #327265 1 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186524665, run #327265 2 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186542447, run #327265 2 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186542447, run #327265 3 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186543405, run #327265 3 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186543405, run #327265 4 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186548387, run #327265 4 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186548387, run #327265 5 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186515186, run #327265 5 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186515186, run #327265 6 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186556019, run #327265 6 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186556019, run #327265 7 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186542866, run #327265 7 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186542866, run #327265 8 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186537901, run #327265 8 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186537901, run #327265 9 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186517811, run #327265 9 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186517811, run #327265 10 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186534221, run #327265 10 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186534221, run #327265 11 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186540986, run #327265 11 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186540986, run #327265 12 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186535104, run #327265 12 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186535104, run #327265 13 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186539903, run #327265 13 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186539903, run #327265 14 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186552713, run #327265 14 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186552713, run #327265 15 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186524730, run #327265 15 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186524730, run #327265 16 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186547632, run #327265 16 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186547632, run #327265 17 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186555621, run #327265 17 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186555621, run #327265 18 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186568452, run #327265 18 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186568452, run #327265 19 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #186580451, run #327265 19 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #186580451, run #327265 20 events processed so far  <<<===
+Domain[ROOT_All]     INFO >   Deaccess DbDomain     READ      [ROOT_All] 
+ApplicationMgr       INFO Application Manager Stopped successfully
+IncidentProcAlg1     INFO Finalize
+CondInputLoader      INFO Finalizing CondInputLoader...
+IncidentProcAlg2     INFO Finalize
+IOVDbFolder          INFO Folder /CSC/FTHOLD (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/322656 ((     0.03 ))s
+IOVDbFolder          INFO Folder /CSC/NOISE (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/350062 ((     0.02 ))s
+IOVDbFolder          INFO Folder /CSC/PED (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/411187 ((     0.03 ))s
+IOVDbFolder          INFO Folder /CSC/PSLOPE (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/353376 ((     0.02 ))s
+IOVDbFolder          INFO Folder /CSC/RMS (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/411395 ((     0.03 ))s
+IOVDbFolder          INFO Folder /CSC/STAT (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/230496 ((     0.02 ))s
+IOVDbFolder          INFO Folder /CSC/T0BASE (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/314380 ((     0.02 ))s
+IOVDbFolder          INFO Folder /CSC/T0PHASE (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/3136 ((     0.02 ))s
+IOVDbFolder          INFO Folder /EXT/DCS/MAGNETS/SENSORDATA (AttrListColl) db-read 1/1 objs/chan/bytes 4/4/20 ((     0.02 ))s
+IOVDbFolder          INFO Folder /GLOBAL/BField/Maps (AttrListColl) db-read 1/1 objs/chan/bytes 3/3/202 ((     0.05 ))s
+IOVDbFolder          INFO Folder /MDT/CABLING/MAP_SCHEMA (AttrListColl) db-read 1/1 objs/chan/bytes 2312/2437/216520 ((     0.13 ))s
+IOVDbFolder          INFO Folder /MDT/CABLING/MEZZANINE_SCHEMA (AttrListColl) db-read 1/1 objs/chan/bytes 24/24/288 ((     0.01 ))s
+IOVDbFolder          INFO Folder /MDT/RTBLOB (AttrListColl) db-read 1/1 objs/chan/bytes 2372/1186/2251209 ((     0.12 ))s
+IOVDbFolder          INFO Folder /MDT/T0BLOB (AttrListColl) db-read 1/1 objs/chan/bytes 1186/1186/1374284 ((     0.06 ))s
+IOVDbFolder          INFO Folder /MUONALIGN/CSC/ILINES (AttrListColl) db-read 1/1 objs/chan/bytes 1/1/10814 ((     0.02 ))s
+IOVDbFolder          INFO Folder /MUONALIGN/MDT/ASBUILTPARAMS (AttrListColl) db-read 1/1 objs/chan/bytes 1/1/128992 ((     0.02 ))s
+IOVDbFolder          INFO Folder /MUONALIGN/MDT/BARREL (AttrListColl) db-read 1/1 objs/chan/bytes 1/1/140293 ((     0.02 ))s
+IOVDbFolder          INFO Folder /MUONALIGN/MDT/ENDCAP/SIDEA (AttrListColl) db-read 1/1 objs/chan/bytes 1/1/65494 ((     0.02 ))s
+IOVDbFolder          INFO Folder /MUONALIGN/MDT/ENDCAP/SIDEC (AttrListColl) db-read 1/1 objs/chan/bytes 1/1/65497 ((     0.04 ))s
+IOVDbFolder          INFO Folder /MUONALIGN/TGC/SIDEA (AttrListColl) db-read 1/1 objs/chan/bytes 1/1/165643 ((     0.03 ))s
+IOVDbFolder          INFO Folder /MUONALIGN/TGC/SIDEC (AttrListColl) db-read 1/1 objs/chan/bytes 1/1/165643 ((     0.03 ))s
+IOVDbFolder          INFO Folder /RPC/CABLING/MAP_SCHEMA (AttrListColl) db-read 1/2 objs/chan/bytes 1/1/222235 ((     0.03 ))s
+IOVDbFolder          INFO Folder /RPC/CABLING/MAP_SCHEMA_CORR (AttrListColl) db-read 1/2 objs/chan/bytes 1/1/29402 ((     0.02 ))s
+IOVDbFolder          INFO Folder /RPC/DCS/DeadRopanels (AttrListColl) db-read 1/1 objs/chan/bytes 32/48/6200 ((     0.01 ))s
+IOVDbFolder          INFO Folder /RPC/DCS/OffRopanels (AttrListColl) db-read 1/1 objs/chan/bytes 4/48/16 ((     0.01 ))s
+IOVDbFolder          INFO Folder /RPC/DQMF/ELEMENT_STATUS (AttrListColl) db-read 1/1 objs/chan/bytes 8320/8320/6180700 ((     0.15 ))s
+IOVDbFolder          INFO Folder /RPC/TRIGGER/CM_THR_ETA (AttrListColl) db-read 1/2 objs/chan/bytes 1613/1613/7562651 ((     0.09 ))s
+IOVDbFolder          INFO Folder /RPC/TRIGGER/CM_THR_PHI (AttrListColl) db-read 1/2 objs/chan/bytes 1612/1612/8096306 ((     0.06 ))s
+IOVDbFolder          INFO Folder /TGC/CABLING/MAP_SCHEMA (AttrListColl) db-read 0/0 objs/chan/bytes 0/1/0 ((     0.00 ))s
+IOVDbSvc             INFO  bytes in ((      1.13 ))s
+IOVDbSvc             INFO Connection sqlite://;schema=mycool.db;dbname=CONDBR2 : nConnect: 0 nFolders: 0 ReadTime: ((     0.00 ))s
+IOVDbSvc             INFO Connection COOLOFL_MUONALIGN/CONDBR2 : nConnect: 2 nFolders: 7 ReadTime: ((     0.17 ))s
+IOVDbSvc             INFO Connection COOLONL_RPC/CONDBR2 : nConnect: 2 nFolders: 4 ReadTime: ((     0.21 ))s
+IOVDbSvc             INFO Connection COOLONL_TGC/CONDBR2 : nConnect: 1 nFolders: 1 ReadTime: ((     0.00 ))s
+IOVDbSvc             INFO Connection COOLONL_MDT/CONDBR2 : nConnect: 2 nFolders: 2 ReadTime: ((     0.15 ))s
+IOVDbSvc             INFO Connection COOLONL_GLOBAL/CONDBR2 : nConnect: 2 nFolders: 1 ReadTime: ((     0.05 ))s
+IOVDbSvc             INFO Connection COOLOFL_DCS/CONDBR2 : nConnect: 2 nFolders: 3 ReadTime: ((     0.04 ))s
+IOVDbSvc             INFO Connection COOLOFL_RPC/CONDBR2 : nConnect: 2 nFolders: 1 ReadTime: ((     0.15 ))s
+IOVDbSvc             INFO Connection COOLOFL_MDT/CONDBR2 : nConnect: 2 nFolders: 2 ReadTime: ((     0.18 ))s
+IOVDbSvc             INFO Connection COOLOFL_CSC/CONDBR2 : nConnect: 2 nFolders: 8 ReadTime: ((     0.19 ))s
+ToolSvc              INFO Removing all tools created by ToolSvc
+TgcRdoToTgcPrep...   INFO finalize(): input RDOs->output PRDs [Hit: 6807->6807, Tracklet: 28->28, TrackletEIFI: 692->692, HiPt: 4031->4031, SL: 3->3]
 MdtRawDataProvi...   INFO Fraction of fills that use the cache = 0
+ToolSvc.TGCCabl...   INFO finalize
+MuonTGC_Cabling...   INFO finalize
 TgcRawDataProvi...   INFO Fraction of fills that use the cache = 0
 RpcROD_Decoder:...   INFO  ============ FINAL RPC DATA FORMAT STAT. =========== 
 RpcROD_Decoder:...   INFO  RX Header Errors.............0
@@ -49,3 +1096,14 @@ RpcROD_Decoder:...   INFO  SL Footer Errors.............0
 RpcROD_Decoder:...   INFO  RX Footer Errors.............0
 RpcROD_Decoder:...   INFO  CRC8 check Failures..........0
 RpcROD_Decoder:...   INFO  ==================================================== 
+ToolSvc.ByteStr...   INFO in finalize()
+IdDictDetDescrCnv    INFO in finalize
+*****Chrono*****     INFO ****************************************************************************************************
+*****Chrono*****     INFO  The Final CPU consumption ( Chrono ) Table (ordered)
+*****Chrono*****     INFO ****************************************************************************************************
+cObj_ALL             INFO Time User   : Tot=    0 [us] Ave/Min/Max=       0(+-       0)/       0/       0 [us] #= 32
+ChronoStatSvc        INFO Time User   : Tot= 14.9  [s]  #=  1
+*****Chrono*****     INFO ****************************************************************************************************
+ChronoStatSvc.f...   INFO  Service finalized successfully 
+ApplicationMgr       INFO Application Manager Finalized successfully
+ApplicationMgr       INFO Application Manager Terminated successfully
diff --git a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h
index f1ca79d974de86aa85f68a04c2425eeee1aa7ba8..869cff1fa435804f25c804899659535d352b1c70 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h
+++ b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h
@@ -106,15 +106,21 @@ namespace MuonGM {
 
     const MuonClusterReadoutElement* getMuonClusterReadoutElement(Identifier) const;//!< access via extended identifier (requires unpacking)
 
+    /// Returns the const detector readout elements
     const MdtReadoutElement* getMdtReadoutElement(int i1, int i2, int i3, int i4) const;
-    MdtReadoutElement* getMdtReadoutElement(int i1, int i2, int i3, int i4);
     const sTgcReadoutElement* getsTgcReadoutElement(int i1, int i2, int i3, int i4) const;
     const MMReadoutElement* getMMReadoutElement(int i1, int i2, int i3, int i4) const;
     const TgcReadoutElement* getTgcReadoutElement(int i1, int i2, int i3) const;
-    TgcReadoutElement* getTgcReadoutElement(int i1, int i2, int i3);
     const CscReadoutElement* getCscReadoutElement(int i1, int i2, int i3, int i4) const;
+
+    //// Non const version
+    MdtReadoutElement* getMdtReadoutElement(int i1, int i2, int i3, int i4);
+    sTgcReadoutElement* getsTgcReadoutElement(int i1, int i2, int i3, int i4);
+    MMReadoutElement* getMMReadoutElement(int i1, int i2, int i3, int i4);
+    TgcReadoutElement* getTgcReadoutElement(int i1, int i2, int i3);
     CscReadoutElement* getCscReadoutElement(int i1, int i2, int i3, int i4);
 
+
     const MdtReadoutElement* getMdtRElement_fromIdFields(int i1, int i2, int i3, int i4) const;
     //!< access via extended identifier field (no unpacking)
 
@@ -397,19 +403,19 @@ namespace MuonGM {
     const MmIdHelper* m_mmIdHelper;
 
     // 115.6 kBytes.
-    MdtReadoutElement*   m_mdtArray[NMdtStatType][NMdtStatEta][NMdtStatPhi][NMdtMultilayer];
-    CscReadoutElement*   m_cscArray[NCscStatType][NCscStatEta][NCscStatPhi][NCscChamberLayer];
-    RpcReadoutElement*   m_rpcArray[NRpcStatType][NRpcStatEta][NRpcStatPhi][NDoubletR][NDoubletZ];
-    TgcReadoutElement*   m_tgcArray[NTgcStatType][NTgcStatEta][NTgcStatPhi];
-    sTgcReadoutElement*  m_stgArray[NsTgStatEta][NsTgStatPhi][NsTgChamberLayer];
-    MMReadoutElement*    m_mmcArray[NMMcStatEta][NMMcStatPhi][NMMcChamberLayer];
+    std::unique_ptr<MdtReadoutElement>   m_mdtArray[NMdtStatType][NMdtStatEta][NMdtStatPhi][NMdtMultilayer];
+    std::unique_ptr<CscReadoutElement>   m_cscArray[NCscStatType][NCscStatEta][NCscStatPhi][NCscChamberLayer];
+    std::unique_ptr<RpcReadoutElement>   m_rpcArray[NRpcStatType][NRpcStatEta][NRpcStatPhi][NDoubletR][NDoubletZ];
+    std::unique_ptr<TgcReadoutElement>   m_tgcArray[NTgcStatType][NTgcStatEta][NTgcStatPhi];
+    std::unique_ptr<sTgcReadoutElement>  m_stgArray[NsTgStatEta][NsTgStatPhi][NsTgChamberLayer];
+    std::unique_ptr<MMReadoutElement>    m_mmcArray[NMMcStatEta][NMMcStatPhi][NMMcChamberLayer];
     //
     const MdtReadoutElement *m_mdtArrayByHash[MdtRElMaxHash];
     const CscReadoutElement *m_cscArrayByHash[CscRElMaxHash];
     const RpcReadoutElement *m_rpcArrayByHash[RpcRElMaxHash];
     const TgcReadoutElement *m_tgcArrayByHash[TgcRElMaxHash];
 
-    std::map< std::string, MuonStation * > m_MuonStationMap;
+    std::map< std::string, std::unique_ptr<MuonStation> > m_MuonStationMap;
 
     unsigned int m_n_mdtRE;
     unsigned int m_n_cscRE;
@@ -426,10 +432,10 @@ namespace MuonGM {
     // pointers to the XxxDetectorElements (with granularity a la EDM)
     std::vector<std::unique_ptr<const TgcReadoutParams> > m_TgcReadoutParamsVec;
 
-    MdtDetectorElement* m_mdtDEArray[MdtDetElMaxHash];
-    RpcDetectorElement* m_rpcDEArray[RpcDetElMaxHash];
-    TgcDetectorElement* m_tgcDEArray[TgcDetElMaxHash];
-    CscDetectorElement* m_cscDEArray[CscDetElMaxHash];
+    std::unique_ptr<MdtDetectorElement> m_mdtDEArray[MdtDetElMaxHash];
+    std::unique_ptr<RpcDetectorElement> m_rpcDEArray[RpcDetElMaxHash];
+    std::unique_ptr<TgcDetectorElement> m_tgcDEArray[TgcDetElMaxHash];
+    std::unique_ptr<CscDetectorElement> m_cscDEArray[CscDetElMaxHash];
 
     ALineMapContainer m_aLineContainer;
     BLineMapContainer m_bLineContainer;
@@ -438,7 +444,7 @@ namespace MuonGM {
     /// RPC name caches
     std::map<int,int> m_rpcStatToIdx;
     std::map<int,int> m_rpcIdxToStat;
-    
+
 
   };
 
diff --git a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx
index 544385e8932803ccecd103401e34d5279f082b04..2c7a31795e3f40d996cbd663f1b01e376bacb227 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx
@@ -32,38 +32,6 @@ namespace MuonGM {
 
 MuonDetectorManager::MuonDetectorManager() {
 
-  for (unsigned int i=0; i<NRpcStatType; i++)
-    for (unsigned int j=0; j<NRpcStatEta; j++)
-      for (unsigned int k=0; k<NRpcStatPhi; k++)
-        for (unsigned int l=0; l<NDoubletR; l++)
-          for (unsigned int h=0; h<NDoubletZ; h++)
-              m_rpcArray[i][j][k][l][h] = nullptr;
-  for (unsigned int i=0; i<NMdtStatType; i++)
-    for (unsigned int j=0; j<NMdtStatEta; j++)
-      for (unsigned int k=0; k<NMdtStatPhi; k++)
-        for (unsigned int l=0; l<NMdtMultilayer; l++)
-                   m_mdtArray[i][j][k][l] = nullptr;
-  for (unsigned int i=0; i<NCscStatType; i++)
-    for (unsigned int j=0; j<NCscStatEta; j++)
-      for (unsigned int k=0; k<NCscStatPhi; k++)
-        for (unsigned int l=0; l<NCscChamberLayer; l++)
-                   m_cscArray[i][j][k][l] = nullptr;
-  for (unsigned int i=0; i<NTgcStatType; i++)
-    for (unsigned int j=0; j<NTgcStatEta; j++)
-      for (unsigned int k=0; k<NTgcStatPhi; k++)
-                 m_tgcArray[i][j][k] = nullptr;
-
-  for (unsigned int j=0; j<NsTgStatEta; j++)
-    for (unsigned int k=0; k<NsTgStatPhi; k++)
-      for (unsigned int l=0; l<NsTgChamberLayer; l++)
-    m_stgArray[j][k][l] = nullptr;
-
-  for (unsigned int j=0; j<NMMcStatEta; j++)
-    for (unsigned int k=0; k<NMMcStatPhi; k++)
-      for (unsigned int l=0; l<NMMcChamberLayer; l++)
-    m_mmcArray[j][k][l] = nullptr;
-
-
   for (unsigned int i=0; i<MdtRElMaxHash; ++i)
       m_mdtArrayByHash[i] = nullptr;
   for (unsigned int i=0; i<CscRElMaxHash; ++i)
@@ -73,14 +41,7 @@ MuonDetectorManager::MuonDetectorManager() {
   for (unsigned int i=0; i<TgcRElMaxHash; ++i)
       m_tgcArrayByHash[i] = nullptr;
 
-     for (unsigned int i=0; i<TgcDetElMaxHash; ++i)
-         m_tgcDEArray[i] = nullptr;
-  for (unsigned int i=0; i<MdtDetElMaxHash; ++i)
-      m_mdtDEArray[i] = nullptr;
-   for (unsigned int i=0; i<CscDetElMaxHash; ++i)
-        m_cscDEArray[i] = nullptr;
-     for (unsigned int i=0; i<RpcDetElMaxHash; ++i)
-        m_rpcDEArray[i] = nullptr;
+
 
   m_n_mdtDE = m_n_cscDE = m_n_tgcDE = m_n_rpcDE = 0;
   m_n_mdtRE = m_n_cscRE = m_n_tgcRE = m_n_rpcRE = m_n_mmcRE = m_n_stgRE = 0;
@@ -108,65 +69,9 @@ MuonDetectorManager::MuonDetectorManager() {
 }
 
 MuonDetectorManager::~MuonDetectorManager() {
-
-
   for (unsigned int p=0;p<m_envelope.size();++p) {
       m_envelope[p]->unref();
   }
-
-
-  for (unsigned int i=0; i<NRpcStatType; ++i)
-    for (unsigned int j=0; j<NRpcStatEta; ++j)
-      for (unsigned int k=0; k<NRpcStatPhi; ++k)
-        for (unsigned int l=0; l<NDoubletR; ++l)
-          for (unsigned int h=0; h<NDoubletZ; ++h) {
-            delete m_rpcArray[i][j][k][l][h]; m_rpcArray[i][j][k][l][h] = nullptr;
-          }
-  for (unsigned int i=0; i<NMdtStatType; ++i)
-    for (unsigned int j=0; j<NMdtStatEta; ++j)
-      for (unsigned int k=0; k<NMdtStatPhi; ++k)
-        for (unsigned int l=0; l<NMdtMultilayer; ++l) {
-          delete m_mdtArray[i][j][k][l]; m_mdtArray[i][j][k][l] = nullptr;
-        }
-  for (unsigned int i=0; i<NTgcStatType; ++i)
-    for (unsigned int j=0; j<NTgcStatEta; ++j)
-      for (unsigned int k=0; k<NTgcStatPhi; ++k) {
-        delete m_tgcArray[i][j][k]; m_tgcArray[i][j][k] = nullptr;
-      }
-  for (unsigned int i=0; i<NCscStatType; ++i)
-    for (unsigned int j=0; j<NCscStatEta; ++j)
-      for (unsigned int k=0; k<NCscStatPhi; ++k)
-        for (unsigned int l=0; l<NCscChamberLayer; ++l) {
-          delete m_cscArray[i][j][k][l]; m_cscArray[i][j][k][l] = nullptr;
-        }
-  for (unsigned int j=0; j<NsTgStatEta; j++)
-    for (unsigned int k=0; k<NsTgStatPhi; k++)
-      for (unsigned int l=0; l<NsTgChamberLayer; l++){
-          delete m_stgArray[j][k][l]; m_stgArray[j][k][l] = nullptr;
-      }
-  for (unsigned int j=0; j<NMMcStatEta; j++)
-    for (unsigned int k=0; k<NMMcStatPhi; k++)
-      for (unsigned int l=0; l<NMMcChamberLayer; l++){
-         delete m_mmcArray[j][k][l]; m_mmcArray[j][k][l] = nullptr;
-      }
-
-  for (unsigned int i=0; i<MdtDetElMaxHash; ++i) {
-    delete m_mdtDEArray[i]; m_mdtDEArray[i] = nullptr;
-  }
-  for (unsigned int i=0; i<RpcDetElMaxHash; ++i) {
-    delete m_rpcDEArray[i]; m_rpcDEArray[i] = nullptr;
-  }
-  for (unsigned int i=0; i<CscDetElMaxHash; ++i) {
-    delete m_cscDEArray[i]; m_cscDEArray[i] = nullptr;
-  }
-  for (unsigned int i=0; i<TgcDetElMaxHash; ++i) {
-    delete m_tgcDEArray[i]; m_tgcDEArray[i] = nullptr;
-  }
-  for (std::map< std::string, MuonStation * >::iterator i =
-           m_MuonStationMap.begin(); i != m_MuonStationMap.end(); ++i)
-  {
-    delete i->second; i->second = nullptr;
-  }
 }
 
 
@@ -299,8 +204,7 @@ void MuonDetectorManager::fillCache()
     fillTgcCache();
     fillCscCache();
 }
-void MuonDetectorManager::fillMdtCache()
-{
+void MuonDetectorManager::fillMdtCache() {
     for (unsigned int i=0; i<NMdtStatType; ++i)
       for (unsigned int j=0; j<NMdtStatEta; ++j)
         for (unsigned int k=0; k<NMdtStatPhi; ++k)
@@ -308,8 +212,7 @@ void MuonDetectorManager::fillMdtCache()
               if (m_mdtArray[i][j][k][l]) m_mdtArray[i][j][k][l]->fillCache();
           }
 }
-void MuonDetectorManager::fillRpcCache()
-{
+void MuonDetectorManager::fillRpcCache() {
     for (unsigned int i=0; i<NRpcStatType; ++i)
       for (unsigned int j=0; j<NRpcStatEta; ++j)
         for (unsigned int k=0; k<NRpcStatPhi; ++k)
@@ -318,16 +221,14 @@ void MuonDetectorManager::fillRpcCache()
               if( m_rpcArray[i][j][k][l][h] ) m_rpcArray[i][j][k][l][h]->fillCache() ;
             }
 }
-void MuonDetectorManager::fillTgcCache()
-{
+void MuonDetectorManager::fillTgcCache() {
     for (unsigned int i=0; i<NTgcStatType; ++i)
       for (unsigned int j=0; j<NTgcStatEta; ++j)
         for (unsigned int k=0; k<NTgcStatPhi; ++k) {
           if ( m_tgcArray[i][j][k] ) m_tgcArray[i][j][k]->fillCache();
         }
 }
-void MuonDetectorManager::fillCscCache()
-{
+void MuonDetectorManager::fillCscCache() {
   if (nCscRE()<1) return;
     for (unsigned int i=0; i<NCscStatType; ++i)
       for (unsigned int j=0; j<NCscStatEta; ++j)
@@ -354,7 +255,7 @@ void MuonDetectorManager::addTreeTop( PVLink pV) {
 void MuonDetectorManager::addMuonStation (MuonStation* mst)
 {
     std::string key = muonStationKey(mst->getStationType(), mst->getEtaIndex(), mst->getPhiIndex());
-    m_MuonStationMap[key] = mst;
+    m_MuonStationMap[key] = std::unique_ptr<MuonStation>(mst);
 }
 
 std::string
@@ -378,8 +279,8 @@ MuonDetectorManager::getMuonStation(std::string stName, int stEtaIndex, int stPh
 
     std::string key = muonStationKey(stName, stEtaIndex, stPhiIndex);
 
-    std::map< std::string, MuonStation *>::const_iterator it = m_MuonStationMap.find(key);
-    if ( it != m_MuonStationMap.end()) return (*it).second;
+    std::map< std::string,  std::unique_ptr<MuonStation>>::const_iterator it = m_MuonStationMap.find(key);
+    if ( it != m_MuonStationMap.end()) return (*it).second.get();
     else return nullptr;
 }
 
@@ -389,8 +290,8 @@ MuonDetectorManager::getMuonStation(std::string stName, int stEtaIndex, int stPh
 
     std::string key = muonStationKey(stName, stEtaIndex, stPhiIndex);
 
-    std::map< std::string, MuonStation *>::const_iterator it = m_MuonStationMap.find(key);
-    if ( it != m_MuonStationMap.end()) return (*it).second;
+    std::map< std::string,  std::unique_ptr<MuonStation>>::const_iterator it = m_MuonStationMap.find(key);
+    if ( it != m_MuonStationMap.end()) return (*it).second.get();
     else return nullptr;
 }
 
@@ -468,7 +369,7 @@ void MuonDetectorManager::addRpcReadoutElement (RpcReadoutElement* x, Identifier
     {
 	if ( !(m_rpcDEArray[idh]) )
 	{
-	    m_rpcDEArray[idh] = new RpcDetectorElement(0, this, m_rpcIdHelper->elementID(id), idh);
+	    m_rpcDEArray[idh] = std::make_unique<RpcDetectorElement>(nullptr, this, m_rpcIdHelper->elementID(id), idh);
 	    m_n_rpcDE++;
 	}
 	m_rpcDEArray[idh]->addRpcReadoutElement(x, dbz_index);
@@ -480,7 +381,7 @@ void MuonDetectorManager::addRpcReadoutElement (RpcReadoutElement* x, Identifier
   if (m_rpcArray[stname_index][steta_index][stphi_index][dbr_index][dbz_index] != nullptr) {
     throw std::runtime_error(Form("File: %s, Line: %d\nMuonDetectorManager::addRpcReadoutElement() - this place is taken [%d][%d][%d][%d][%d] current id is %s stored id %s", __FILE__, __LINE__, stname_index, steta_index, stphi_index, dbr_index, dbz_index, m_rpcIdHelper->show_to_string(id).c_str(), m_rpcIdHelper->show_to_string(m_rpcArray[stname_index][steta_index][stphi_index][dbr_index][dbz_index]->identify()).c_str()));
   }
-  m_rpcArray[stname_index][steta_index][stphi_index][dbr_index][dbz_index] = x;
+  m_rpcArray[stname_index][steta_index][stphi_index][dbr_index][dbz_index] = std::unique_ptr<RpcReadoutElement>(x);
   m_n_rpcRE++;
 
 }
@@ -550,7 +451,7 @@ const MMReadoutElement* MuonDetectorManager::getMMRElement_fromIdFields(int isSm
   if (ml_index < 0 || ml_index >= NMMcChamberLayer) {
     throw std::runtime_error(Form("File: %s, Line: %d\nMuonDetectorManager::getMMRElement_fromIdFields() - ml_index out of range %d 0-%d", __FILE__, __LINE__, ml_index, NMMcChamberLayer-1));
   }
-  return m_mmcArray[steta_index][stphi_index][ml_index];
+  return m_mmcArray[steta_index][stphi_index][ml_index].get();
 }
 void MuonDetectorManager::addMMReadoutElement_withIdFields(MMReadoutElement* x, int isSmall, int stEta, int stPhi, int ml)
 {
@@ -572,7 +473,7 @@ void MuonDetectorManager::addMMReadoutElement_withIdFields(MMReadoutElement* x,
   if (m_mmcArray[steta_index][stphi_index][ml_index] != nullptr) {
     throw std::runtime_error(Form("File: %s, Line: %d\nMuonDetectorManager::addMMReadoutElement_withIdFields() - this place is taken [%d][%d][%d] ......... this RE cannot be added", __FILE__, __LINE__, steta_index, stphi_index, ml_index));
   }
-  m_mmcArray[steta_index][stphi_index][ml_index] = x;
+  m_mmcArray[steta_index][stphi_index][ml_index] = std::unique_ptr<MMReadoutElement>(x);
   m_n_mmcRE++;
 }
 void MuonDetectorManager::addsTgcReadoutElement_withIdFields(sTgcReadoutElement* x, int isSmall, int stEta, int stPhi, int ml)
@@ -595,7 +496,7 @@ void MuonDetectorManager::addsTgcReadoutElement_withIdFields(sTgcReadoutElement*
   if (m_stgArray[steta_index][stphi_index][ml_index] != nullptr) {
     throw std::runtime_error(Form("File: %s, Line: %d\nMuonDetectorManager::addsTgcReadoutElement_withIdFields() - this place is taken [%d][%d][%d] ......... this RE cannot be added", __FILE__, __LINE__, steta_index, stphi_index, ml_index));
   }
-  m_stgArray[steta_index][stphi_index][ml_index] = x;
+  m_stgArray[steta_index][stphi_index][ml_index] = std::unique_ptr<sTgcReadoutElement>(x);
   m_n_stgRE++;
 }
 const sTgcReadoutElement* MuonDetectorManager::getsTgcRElement_fromIdFields(int isSmall, int stEta, int stPhi, int ml) const
@@ -615,7 +516,7 @@ const sTgcReadoutElement* MuonDetectorManager::getsTgcRElement_fromIdFields(int
   if (ml_index < 0 || ml_index >= NsTgChamberLayer) {
     throw std::runtime_error(Form("File: %s, Line: %d\nMuonDetectorManager::getsTgcRElement_fromIdFields() - ml_index out of range %d 0-%d", __FILE__, __LINE__, ml_index, NsTgChamberLayer-1));
   }
-  return m_stgArray[steta_index][stphi_index][ml_index];
+  return m_stgArray[steta_index][stphi_index][ml_index].get();
 }
 
 void MuonDetectorManager::addMMReadoutElement (MMReadoutElement* x, Identifier id)
@@ -659,7 +560,7 @@ void MuonDetectorManager::addMdtReadoutElement (MdtReadoutElement* x, Identifier
     IdentifierHash idh = x->collectionHash();
     if (idh< MdtDetElMaxHash) {
 	if ( !(m_mdtDEArray[idh]) ) {
-	    m_mdtDEArray[idh] = new MdtDetectorElement(0, this, m_mdtIdHelper->elementID(id), idh);
+	    m_mdtDEArray[idh] = std::make_unique<MdtDetectorElement>(nullptr, this, m_mdtIdHelper->elementID(id), idh);
 	    m_n_mdtDE++;
 	}
 	m_mdtDEArray[idh]->addMdtReadoutElement(x, ml);
@@ -699,7 +600,7 @@ void MuonDetectorManager::addMdtReadoutElement (MdtReadoutElement* x, Identifier
   if (m_mdtArray[stname_index][steta_index][stphi_index][ml_index] != nullptr) {
     throw std::runtime_error(Form("File: %s, Line: %d\nMuonDetectorManager::addMdtReadoutElement() - this place is taken [%d][%d][%d][%d] current id is %s stored id %s", __FILE__, __LINE__, stname_index, steta_index, stphi_index, ml_index, m_mdtIdHelper->show_to_string(id).c_str(), m_mdtIdHelper->show_to_string(m_mdtArray[stname_index][steta_index][stphi_index][ml_index]->identify()).c_str()));
   }
-  m_mdtArray[stname_index][steta_index][stphi_index][ml_index] = x;
+  m_mdtArray[stname_index][steta_index][stphi_index][ml_index] = std::unique_ptr<MdtReadoutElement>(x);
 
   m_n_mdtRE++;
 }
@@ -746,7 +647,7 @@ void MuonDetectorManager::addCscReadoutElement (CscReadoutElement* x, Identifier
     IdentifierHash idh = x->detectorElementHash();
     if ( idh< CscDetElMaxHash ) {
 	if ( !(m_cscDEArray[idh]) ) {
-	    m_cscDEArray[idh] = new CscDetectorElement(0, this, m_cscIdHelper->elementID(id), idh);
+	    m_cscDEArray[idh] = std::make_unique<CscDetectorElement>(nullptr, this, m_cscIdHelper->elementID(id), idh);
 	    m_n_cscDE++;
 	}
 	m_cscDEArray[idh]->setReadoutElement(x);
@@ -781,7 +682,7 @@ void MuonDetectorManager::addCscReadoutElement (CscReadoutElement* x, Identifier
     if (m_cscArray[stname_index][steta_index][stphi_index][ml_index] != nullptr) {
       throw std::runtime_error(Form("File: %s, Line: %d\nMuonDetectorManager::addCscReadoutElement() - this place is taken [%d][%d][%d][%d] current id is %s stored id %s", __FILE__, __LINE__, stname_index, steta_index, stphi_index, ml_index, m_cscIdHelper->show_to_string(id).c_str(), m_cscIdHelper->show_to_string(m_cscArray[stname_index][steta_index][stphi_index][ml_index]->identify()).c_str()));
     }
-    m_cscArray[stname_index][steta_index][stphi_index][ml_index] = x;
+    m_cscArray[stname_index][steta_index][stphi_index][ml_index] = std::unique_ptr<CscReadoutElement>(x);
     m_n_cscRE++;
 
 }
@@ -825,7 +726,7 @@ void MuonDetectorManager::addTgcReadoutElement (TgcReadoutElement* x, Identifier
     IdentifierHash idh = x->collectionHash();
     if (idh< TgcDetElMaxHash) {
 	if ( !(m_tgcDEArray[idh]) ) {
-	    m_tgcDEArray[idh] = new TgcDetectorElement(0, this, m_tgcIdHelper->elementID(id), idh);
+	    m_tgcDEArray[idh] = std::make_unique<TgcDetectorElement>(nullptr, this, m_tgcIdHelper->elementID(id), idh);
 	    m_n_tgcDE++;
 	}
 	m_tgcDEArray[idh]->setReadoutElement(x);
@@ -853,7 +754,7 @@ void MuonDetectorManager::addTgcReadoutElement (TgcReadoutElement* x, Identifier
       throw std::runtime_error(Form("File: %s, Line: %d\nMuonDetectorManager::addTgcReadoutElement() - this place is taken [%d][%d][%d] current id is %s stored id %s", __FILE__, __LINE__, stname_index, steta_index, stphi_index, m_tgcIdHelper->show_to_string(id).c_str(), m_tgcIdHelper->show_to_string(m_tgcArray[stname_index][steta_index][stphi_index]->identify()).c_str()));
     }
 
-    m_tgcArray[stname_index][steta_index][stphi_index] = x;
+    m_tgcArray[stname_index][steta_index][stphi_index] = std::unique_ptr<TgcReadoutElement>(x);
 
   m_n_tgcRE++;
 }
@@ -922,16 +823,13 @@ void MuonDetectorManager::checkMdtReadoutElementIndices(int i1, int i2, int i3,
   }
 }
 
-const MdtReadoutElement* MuonDetectorManager::getMdtReadoutElement(int i1, int i2, int i3, int i4)const
-{
+const MdtReadoutElement* MuonDetectorManager::getMdtReadoutElement(int i1, int i2, int i3, int i4)const {
   checkMdtReadoutElementIndices(i1, i2, i3, i4);
-  return m_mdtArray[i1][i2][i3][i4];
+  return m_mdtArray[i1][i2][i3][i4].get();
 }
-
-MdtReadoutElement* MuonDetectorManager::getMdtReadoutElement(int i1, int i2, int i3, int i4)
-{
+MdtReadoutElement* MuonDetectorManager::getMdtReadoutElement(int i1, int i2, int i3, int i4) {
   checkMdtReadoutElementIndices(i1, i2, i3, i4);
-  return m_mdtArray[i1][i2][i3][i4];
+  return m_mdtArray[i1][i2][i3][i4].get();
 }
 
 const CscReadoutElement* MuonDetectorManager::getCscRElement_fromIdFields(int i1,
@@ -964,22 +862,22 @@ void MuonDetectorManager::checkCscReadoutElementIndices(int i1, int i2, int i3,
   }
 }
 
-const CscReadoutElement* MuonDetectorManager::getCscReadoutElement(int i1, int i2, int i3, int i4)const
-{
+const CscReadoutElement* MuonDetectorManager::getCscReadoutElement(int i1, int i2, int i3, int i4)const {
   checkCscReadoutElementIndices(i1, i2, i3, i4);
-  return m_cscArray[i1][i2][i3][i4];
+  return m_cscArray[i1][i2][i3][i4].get();
 }
 
-CscReadoutElement* MuonDetectorManager::getCscReadoutElement(int i1, int i2, int i3, int i4)
-{
+CscReadoutElement* MuonDetectorManager::getCscReadoutElement(int i1, int i2, int i3, int i4) {
   checkCscReadoutElementIndices(i1, i2, i3, i4);
-  return m_cscArray[i1][i2][i3][i4];
+  return m_cscArray[i1][i2][i3][i4].get();
 }
 
 const RpcReadoutElement* MuonDetectorManager::getRpcRElement_fromIdFields(int i1,
                                                                           int i2,
-                                                                          int i3, int i4, int i5, int i6) const
-{
+                                                                          int i3,
+                                                                          int i4,
+                                                                          int i5,
+                                                                          int i6) const {
       int steta_index  = i2 + NRpcStEtaOffset;
       int stphi_index  = i3 - 1;
       int dbr_index    = i4 - 1;
@@ -1048,16 +946,14 @@ void MuonDetectorManager::checkRpcReadoutElementIndices(int i1, int i2, int i3,
   }
 }
 
-const RpcReadoutElement* MuonDetectorManager::getRpcReadoutElement(int i1, int i2, int i3, int i4, int i5)const
-{
+const RpcReadoutElement* MuonDetectorManager::getRpcReadoutElement(int i1, int i2, int i3, int i4, int i5)const {
   checkRpcReadoutElementIndices(i1, i2, i3, i4, i5);
-  return m_rpcArray[i1][i2][i3][i4][i5];
+  return m_rpcArray[i1][i2][i3][i4][i5].get();
 }
 
-RpcReadoutElement* MuonDetectorManager::getRpcReadoutElement(int i1, int i2, int i3, int i4, int i5)
-{
+RpcReadoutElement* MuonDetectorManager::getRpcReadoutElement(int i1, int i2, int i3, int i4, int i5) {
   checkRpcReadoutElementIndices(i1, i2, i3, i4, i5);
-  return m_rpcArray[i1][i2][i3][i4][i5];
+  return m_rpcArray[i1][i2][i3][i4][i5].get();
 }
 
 const TgcReadoutElement* MuonDetectorManager::getTgcRElement_fromIdFields(int i1,
@@ -1073,8 +969,7 @@ const TgcReadoutElement* MuonDetectorManager::getTgcRElement_fromIdFields(int i1
     return getTgcReadoutElement(stname_index, steta_index, stphi_index);
 }
 
-void MuonDetectorManager::checkTgcReadoutElementIndices (int i1, int i2, int i3)const
-{
+void MuonDetectorManager::checkTgcReadoutElementIndices (int i1, int i2, int i3)const {
   if (i1<0 || i1 >= NTgcStatType) {
     throw std::runtime_error(Form("File: %s, Line: %d\nMuonDetectorManager::getTgcReadoutElement() - stNameindex out of range %d 0-%d", __FILE__, __LINE__, i1, NTgcStatType-1));
   }
@@ -1086,16 +981,13 @@ void MuonDetectorManager::checkTgcReadoutElementIndices (int i1, int i2, int i3)
   }
 }
 
-const TgcReadoutElement* MuonDetectorManager::getTgcReadoutElement(int i1, int i2, int i3)const
-{
+const TgcReadoutElement* MuonDetectorManager::getTgcReadoutElement(int i1, int i2, int i3) const {
   checkTgcReadoutElementIndices (i1, i2, i3);
-  return m_tgcArray[i1][i2][i3];
+  return m_tgcArray[i1][i2][i3].get();
 }
-
-TgcReadoutElement* MuonDetectorManager::getTgcReadoutElement(int i1, int i2, int i3)
-{
+TgcReadoutElement* MuonDetectorManager::getTgcReadoutElement(int i1, int i2, int i3) {
   checkTgcReadoutElementIndices (i1, i2, i3);
-  return m_tgcArray[i1][i2][i3];
+  return m_tgcArray[i1][i2][i3].get();
 }
 
 void
@@ -1108,10 +1000,8 @@ MuonDetectorManager::initABlineContainers()
     if (log.level()<=MSG::DEBUG) log << MSG::DEBUG << "Init A/B Line Containers - pointers are <" <<(uintptr_t)&m_aLineContainer << "> and <" << (uintptr_t)&m_bLineContainer << ">" << endmsg;
 
     // loop over stations to fill the A-line map at start-up
-    for (std::map< std::string, MuonStation * >::const_iterator ist=m_MuonStationMap.begin();
-         ist!=m_MuonStationMap.end(); ++ist)
-    {
-        MuonStation * ms = (*ist).second;
+    for (auto&  ist :m_MuonStationMap) {
+        MuonStation * ms = ist.second.get();
         int jff = ms->getPhiIndex();
         int jzz = ms->getEtaIndex();
         std::string stType = ms->getStationType();
@@ -1211,9 +1101,8 @@ MuonDetectorManager::updateAlignment(const ALineMapContainer& alineData)
 {
 #ifdef TESTBLINES
   {
-    for (std::map< std::string, MuonStation *>::const_iterator it(m_MuonStationMap.begin()), end(m_MuonStationMap.end());
-	it!=end; ++it) {
-      MuonStation* station = it->second;
+   for (auto& it: m_MuonStationMap) {
+      MuonStation* station = it.second.get();
       station->setDelta_fromAline( 0., 0., 0., 0., 0., 0.); //double tras, double traz, double trat, double rots, double rotz, double rott
       if (cacheFillingFlag())
       {
@@ -1361,9 +1250,8 @@ MuonDetectorManager::updateDeformations(const BLineMapContainer& blineData)
 {
 #ifdef TESTBLINES
   {
-    for (std::map< std::string, MuonStation *>::const_iterator it(m_MuonStationMap.begin()), end(m_MuonStationMap.end());
-	it!=end; ++it) {
-      MuonStation* station = it->second;
+    for (auto& it : m_MuonStationMap) {
+      MuonStation* station = it.second.get();
       station->clearBLineCache();
       BLinePar* BLine = new BLinePar();
       BLine->setParameters(0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.);
@@ -1517,10 +1405,8 @@ StatusCode MuonDetectorManager::initCSCInternalAlignmentMap()
       log<<MSG::INFO<<"Init of CSC I-Lines will be done via Conditions DB"<<endmsg;
       m_cscALineContainer.clear();
 
-      for (std::map< std::string, MuonStation * >::const_iterator ist=m_MuonStationMap.begin();
-           ist!=m_MuonStationMap.end(); ++ist)
-      {
-          MuonStation * ms = (*ist).second;
+      for (auto& ist :m_MuonStationMap){
+          MuonStation * ms = ist.second.get();
           std::string stType = ms->getStationType();
           if (stType.substr(0,1)!="C") continue;
 
@@ -1830,7 +1716,7 @@ const MdtDetectorElement* MuonDetectorManager::getMdtDetectorElement(IdentifierH
     return nullptr;
   }
 #endif
-  return m_mdtDEArray[id];
+  return m_mdtDEArray[id].get();
 }
 
 const TgcDetectorElement* MuonDetectorManager::getTgcDetectorElement(IdentifierHash id) const {
@@ -1841,7 +1727,7 @@ const TgcDetectorElement* MuonDetectorManager::getTgcDetectorElement(IdentifierH
     return nullptr;
   }
 #endif
-  return m_tgcDEArray[id];
+  return m_tgcDEArray[id].get();
 }
 
 const CscDetectorElement* MuonDetectorManager::getCscDetectorElement(IdentifierHash id) const {
@@ -1852,7 +1738,7 @@ const CscDetectorElement* MuonDetectorManager::getCscDetectorElement(IdentifierH
     return nullptr;
   }
 #endif
-  return m_cscDEArray[id];
+  return m_cscDEArray[id].get();
 }
 
 const RpcDetectorElement* MuonDetectorManager::getRpcDetectorElement(IdentifierHash id) const {
@@ -1863,7 +1749,7 @@ const RpcDetectorElement* MuonDetectorManager::getRpcDetectorElement(IdentifierH
     return nullptr;
   }
 #endif
-  return m_rpcDEArray[id];
+  return m_rpcDEArray[id].get();
 }
 
 unsigned int MuonDetectorManager::rpcStationTypeIdx(const int stationName) const {
diff --git a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/CSC_RegSelCondAlg.cxx b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/CSC_RegSelCondAlg.cxx
index 315462d996d0cf86106c6fc2c25536d0d7981813..b1f67570644e646d3f3bf81e32b87f3f96ca457c 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/CSC_RegSelCondAlg.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/CSC_RegSelCondAlg.cxx
@@ -49,7 +49,23 @@ CSC_RegSelCondAlg::CSC_RegSelCondAlg(const std::string& name, ISvcLocator* pSvcL
 
 
 
-std::unique_ptr<RegSelSiLUT> CSC_RegSelCondAlg::createTable( const MuonMDT_CablingMap* /* mdtCabling */ ) const { 
+StatusCode CSC_RegSelCondAlg::initialize() {
+  ATH_CHECK(MuonRegSelCondAlg::initialize());
+  ATH_CHECK(m_mdtCablingKey.initialize());
+  return StatusCode::SUCCESS;
+}
+
+
+
+std::unique_ptr<RegSelSiLUT> CSC_RegSelCondAlg::createTable( const EventContext& ctx, EventIDRange& id_range ) const { 
+
+  SG::ReadCondHandle<MuonMDT_CablingMap> mdtCabling( m_mdtCablingKey, ctx );
+
+  if( !mdtCabling.range( id_range ) ) {
+    ATH_MSG_ERROR("Failed to retrieve validity range for " << mdtCabling.key());
+    return std::unique_ptr<RegSelSiLUT>(nullptr);
+  }   
+  
 
   /// now get the CSC cabling service ...
 
diff --git a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/CSC_RegSelCondAlg.h b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/CSC_RegSelCondAlg.h
index fa51fe5f81dc70b18f6fea196e6df2f7bbc3515f..49d7fbcde03f990ce1dc24b8aa5803b1a1b8e916 100755
--- a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/CSC_RegSelCondAlg.h
+++ b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/CSC_RegSelCondAlg.h
@@ -21,8 +21,13 @@ public:
 
   CSC_RegSelCondAlg( const std::string& name, ISvcLocator* pSvcLocator );
 
-  std::unique_ptr<RegSelSiLUT> createTable( const MuonMDT_CablingMap* mdtCabling ) const;
+  std::unique_ptr<RegSelSiLUT> createTable( const EventContext& ctx, EventIDRange& id_range ) const override;
 
+  virtual StatusCode initialize() override;
+
+  SG::ReadCondHandleKey<MuonMDT_CablingMap> m_mdtCablingKey
+    { this, "Cabling", "MuonMDT_CablingMap", "Key of output MDT cabling map" };
+  
 };
 
 #endif // CSC_RegSelCondAlg_h
diff --git a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/MDT_RegSelCondAlg.cxx b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/MDT_RegSelCondAlg.cxx
index 93d4e4ebd2fb2cf7556f4bbfdeb8846b359dba34..ac71366973cd1ba9eab28eb0fc1edd55eed75bff 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/MDT_RegSelCondAlg.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/MDT_RegSelCondAlg.cxx
@@ -39,8 +39,27 @@ MDT_RegSelCondAlg::MDT_RegSelCondAlg(const std::string& name, ISvcLocator* pSvcL
 
 
 
-std::unique_ptr<RegSelSiLUT> MDT_RegSelCondAlg::createTable( const MuonMDT_CablingMap* cabling ) const { 
-  
+
+StatusCode MDT_RegSelCondAlg::initialize() {
+  ATH_CHECK(MuonRegSelCondAlg::initialize());
+  ATH_CHECK(m_cablingKey.initialize());
+  return StatusCode::SUCCESS;
+}
+
+
+
+
+std::unique_ptr<RegSelSiLUT> MDT_RegSelCondAlg::createTable( const EventContext& ctx, EventIDRange& id_range ) const { 
+
+  SG::ReadCondHandle<MuonMDT_CablingMap> cabling( m_cablingKey, ctx );
+
+  if( !cabling.range( id_range ) ) {
+    ATH_MSG_ERROR("Failed to retrieve validity range for " << cabling.key());
+    return std::unique_ptr<RegSelSiLUT>(nullptr);
+  }   
+
+  /// create the new lookup table
+
   const MuonGM::MuonDetectorManager* manager = nullptr; // again 0 would do as well here 
   
   StatusCode sc = detStore()->retrieve( manager );
diff --git a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/MDT_RegSelCondAlg.h b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/MDT_RegSelCondAlg.h
index 1de2560110d41b456acc48b5dae7e219438d3153..ff42d174c7c6975cf63523a037e94d0e92bbc8c3 100755
--- a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/MDT_RegSelCondAlg.h
+++ b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/MDT_RegSelCondAlg.h
@@ -20,7 +20,12 @@ public:
 
   MDT_RegSelCondAlg( const std::string& name, ISvcLocator* pSvcLocator );
 
-  std::unique_ptr<RegSelSiLUT> createTable( const MuonMDT_CablingMap* cabling ) const override;   
+  std::unique_ptr<RegSelSiLUT> createTable( const EventContext& ctx, EventIDRange& id_range ) const override;   
+
+  virtual StatusCode initialize() override;
+
+  SG::ReadCondHandleKey<MuonMDT_CablingMap> m_cablingKey
+    { this, "Cabling", "MuonMDT_CablingMap", "Key of output MDT cabling map" };
 
 };
 
diff --git a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/MM_RegSelCondAlg.cxx b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/MM_RegSelCondAlg.cxx
index 686fdc8981fa6b3fd64f47cff96abef21bad6c28..fb5a9645592fe9f5db460dcdf1b400fe16d1a9cd 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/MM_RegSelCondAlg.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/MM_RegSelCondAlg.cxx
@@ -51,8 +51,23 @@ MM_RegSelCondAlg::MM_RegSelCondAlg(const std::string& name, ISvcLocator* pSvcLoc
 
 
 
+StatusCode MM_RegSelCondAlg::initialize() {
+  ATH_CHECK(MuonRegSelCondAlg::initialize());
+  ATH_CHECK(m_mdtCablingKey.initialize());
+  return StatusCode::SUCCESS;
+}
+
+
+
+std::unique_ptr<RegSelSiLUT> MM_RegSelCondAlg::createTable( const EventContext& ctx, EventIDRange& id_range ) const { 
 
-std::unique_ptr<RegSelSiLUT> MM_RegSelCondAlg::createTable( const MuonMDT_CablingMap* /* mdtCabling */ ) const { 
+  SG::ReadCondHandle<MuonMDT_CablingMap> mdtCabling( m_mdtCablingKey, ctx );
+ 
+  if( !mdtCabling.range( id_range ) ) {
+    ATH_MSG_ERROR("Failed to retrieve validity range for " << mdtCabling.key());
+    return std::unique_ptr<RegSelSiLUT>(nullptr);
+  }   
+  
 
   /// no NSW cabling available at the moment ...
 
diff --git a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/MM_RegSelCondAlg.h b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/MM_RegSelCondAlg.h
index f21403219f3288c25aea143c1bf9f51fc54baf1b..10449d690f18ca957174dd889dbc52e4cbd225ad 100755
--- a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/MM_RegSelCondAlg.h
+++ b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/MM_RegSelCondAlg.h
@@ -21,8 +21,13 @@ public:
 
   MM_RegSelCondAlg( const std::string& name, ISvcLocator* pSvcLocator );
 
-  std::unique_ptr<RegSelSiLUT> createTable( const MuonMDT_CablingMap* mdtCabling ) const;
+  std::unique_ptr<RegSelSiLUT> createTable( const EventContext& ctx, EventIDRange& id_range ) const override;
 
+  virtual StatusCode initialize() override;
+
+  SG::ReadCondHandleKey<MuonMDT_CablingMap> m_mdtCablingKey
+    { this, "Cabling", "MuonMDT_CablingMap", "Key of output MDT cabling map" };
+  
 };
 
 #endif // CSC_RegSelCondAlg_h
diff --git a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/MuonRegSelCondAlg.cxx b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/MuonRegSelCondAlg.cxx
index e008e4a4589289e4bb03129ba734c08fc8ce925d..a7799acd7afc6b4d2b95985f3fa1958493a24eb6 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/MuonRegSelCondAlg.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/MuonRegSelCondAlg.cxx
@@ -14,17 +14,14 @@
 
 #include "GaudiKernel/EventIDRange.h"
 #include "StoreGate/WriteCondHandle.h"
+#include "MuonRegSelCondAlg.h"
+
 
 #include <iostream>
 #include <fstream>
 #include <string>
 
 
-#include "MuonCablingData/MuonMDT_CablingMap.h"
-
-#include "MDT_RegSelCondAlg.h"
-
-
 
 MuonRegSelCondAlg::MuonRegSelCondAlg(const std::string& name, ISvcLocator* pSvcLocator):
   AthReentrantAlgorithm( name, pSvcLocator ),
@@ -42,7 +39,6 @@ MuonRegSelCondAlg::MuonRegSelCondAlg(const std::string& name, ISvcLocator* pSvcL
 StatusCode MuonRegSelCondAlg::initialize()
 {
   ATH_MSG_DEBUG("MuonRegSelCondAlg::initialize() ");
-  ATH_CHECK(m_cablingKey.initialize());
   ATH_CHECK(m_tableKey.initialize());
   ATH_MSG_INFO("MuonRegSelCondAlg::initialize() " << m_tableKey );
   return StatusCode::SUCCESS;
@@ -50,7 +46,7 @@ StatusCode MuonRegSelCondAlg::initialize()
 
 
 
-StatusCode MuonRegSelCondAlg::execute(const EventContext& ctx)  const
+StatusCode MuonRegSelCondAlg::execute(const EventContext& ctx )  const
 {
   ATH_MSG_DEBUG("MuonRegSelCondAlg::execute() -- enter -- ");
   
@@ -69,21 +65,11 @@ StatusCode MuonRegSelCondAlg::execute(const EventContext& ctx)  const
     return StatusCode::SUCCESS;
   }
 
-
- 
-
-  SG::ReadCondHandle<MuonMDT_CablingMap> cabling( m_cablingKey, ctx );
+  /// create the new lookup table
 
   EventIDRange id_range;
-  
-  if( !cabling.range( id_range ) ) {
-    ATH_MSG_ERROR("Failed to retrieve validity range for " << cabling.key());
-    return StatusCode::FAILURE;
-  }   
-
-  /// create the new lookuo table
 
-  std::unique_ptr<IRegSelLUT> rd = createTable( *cabling );
+  std::unique_ptr<IRegSelLUT> rd = createTable( ctx, id_range );
 
   if ( !rd ) return StatusCode::FAILURE;
 
diff --git a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/MuonRegSelCondAlg.h b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/MuonRegSelCondAlg.h
index 3b67f5531661d50570f74183957ecbaba319a4bc..758b4cf9de7ffd6305e064282c3669e23a964008 100755
--- a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/MuonRegSelCondAlg.h
+++ b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/MuonRegSelCondAlg.h
@@ -11,6 +11,7 @@
 #ifndef MuonRegSelCondAlg_h
 #define MuonRegSelCondAlg_h
 
+#include "GaudiKernel/EventIDRange.h"
 #include "GaudiKernel/ISvcLocator.h"
 
 #include "AthenaBaseComps/AthReentrantAlgorithm.h"
@@ -38,24 +39,19 @@ public:
   MuonRegSelCondAlg( const std::string& name, ISvcLocator* pSvcLocator );
 
   virtual StatusCode  initialize() override;
-  virtual StatusCode  execute (const EventContext& ctx) const override;
+  virtual StatusCode  execute(const EventContext& ctx) const override;
 
-  virtual std::unique_ptr<RegSelSiLUT> createTable( const MuonMDT_CablingMap* cabling ) const = 0;   
+  virtual std::unique_ptr<RegSelSiLUT> createTable( const EventContext& ctx, EventIDRange& id_range ) const = 0;   
 
  private:
 
   std::string m_managerName;
   bool        m_printTable;
  
-  SG::ReadCondHandleKey<MuonMDT_CablingMap> m_cablingKey
-    { this, "Cabling", "MuonMDT_CablingMap", "Key of output MDT cabling map" };
-
   /// Output conditions object
   SG::WriteCondHandleKey<IRegSelLUTCondData> m_tableKey  
     { this, "RegSelLUT", "RegSelLUTCondData", "Region Selector lookup table" };
 
-
-
 };
 
 #endif // MuonRegSelCondAlg_h
diff --git a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/RPC_RegSelCondAlg.cxx b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/RPC_RegSelCondAlg.cxx
index 440e412f305b9c1907a00ec5eac5a8611dffa7c2..5e3797a37b40437e42cdcb39190b884b05817979 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/RPC_RegSelCondAlg.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/RPC_RegSelCondAlg.cxx
@@ -42,10 +42,17 @@ StatusCode RPC_RegSelCondAlg::initialize() {
   return StatusCode::SUCCESS;
 }
 
-std::unique_ptr<RegSelSiLUT> RPC_RegSelCondAlg::createTable( const MuonMDT_CablingMap* /* mdtCabling */ ) const { 
+std::unique_ptr<RegSelSiLUT> RPC_RegSelCondAlg::createTable( const EventContext& ctx, EventIDRange& id_range ) const { 
 
-  SG::ReadCondHandle<RpcCablingCondData> cablingCondData{m_rpcReadKey, Gaudi::Hive::currentContext()};
-  const RpcCablingCondData* rpcCabling{*cablingCondData};
+  SG::ReadCondHandle<RpcCablingCondData> cablingCondData( m_rpcReadKey, ctx );
+
+  if( !cablingCondData.range( id_range ) ) {
+    ATH_MSG_ERROR("Failed to retrieve validity range for " << cablingCondData.key());
+    return std::unique_ptr<RegSelSiLUT>(nullptr);
+  }   
+
+
+  const RpcCablingCondData* cabling{*cablingCondData};
 
   const MuonGM::MuonDetectorManager* manager = nullptr;
 
@@ -78,7 +85,7 @@ std::unique_ptr<RegSelSiLUT> RPC_RegSelCondAlg::createTable( const MuonMDT_Cabli
     }
     
     std::vector<uint32_t> robIds;
-    if ( (rpcCabling->giveROB_fromPRD(prdHashId, robIds)).isFailure() ) { 
+    if ( (cabling->giveROB_fromPRD(prdHashId, robIds)).isFailure() ) { 
       ATH_MSG_ERROR( "RegSelCondAlg_RPC could not get ROBid" );
       return std::unique_ptr<RegSelSiLUT>(nullptr);
     }
diff --git a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/RPC_RegSelCondAlg.h b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/RPC_RegSelCondAlg.h
index 11f8b1fcc0bee9312ec31bb4f08d87d67650e4f9..76cc137f864e2a3af6fe98292e2b5359067409a9 100755
--- a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/RPC_RegSelCondAlg.h
+++ b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/RPC_RegSelCondAlg.h
@@ -28,11 +28,14 @@ public:
 
   RPC_RegSelCondAlg( const std::string& name, ISvcLocator* pSvcLocator );
 
-  std::unique_ptr<RegSelSiLUT> createTable( const MuonMDT_CablingMap* mdtCabling ) const override;
+  std::unique_ptr<RegSelSiLUT> createTable( const EventContext& ctx, EventIDRange& id_range ) const override;
 
   virtual StatusCode initialize() override;
+
 private:
-  SG::ReadCondHandleKey<RpcCablingCondData> m_rpcReadKey{this, "RpcCablingKey", "RpcCablingCondData", "Key of RpcCablingCondData"};
+
+  SG::ReadCondHandleKey<RpcCablingCondData> m_rpcReadKey
+    { this, "RpcCablingKey", "RpcCablingCondData", "Key of RpcCablingCondData" };
 
 };
 
diff --git a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/TGC_RegSelCondAlg.cxx b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/TGC_RegSelCondAlg.cxx
index 634918e7a81e2c8292759956449a37260fbb037a..1beb92246523c999e8f4feb121f6482539065b0a 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/TGC_RegSelCondAlg.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/TGC_RegSelCondAlg.cxx
@@ -48,10 +48,23 @@ TGC_RegSelCondAlg::TGC_RegSelCondAlg(const std::string& name, ISvcLocator* pSvcL
 
 
 
+StatusCode TGC_RegSelCondAlg::initialize() {
+  ATH_CHECK(MuonRegSelCondAlg::initialize());
+  ATH_CHECK(m_mdtCablingKey.initialize());
+  return StatusCode::SUCCESS;
+}
+
+
 
+std::unique_ptr<RegSelSiLUT> TGC_RegSelCondAlg::createTable( const EventContext& ctx, EventIDRange& id_range ) const { 
 
+  SG::ReadCondHandle<MuonMDT_CablingMap> mdtCabling( m_mdtCablingKey, ctx );
+
+  if( !mdtCabling.range( id_range ) ) {
+    ATH_MSG_ERROR("Failed to retrieve validity range for " << mdtCabling.key());
+    return std::unique_ptr<RegSelSiLUT>(nullptr);
+  }   
 
-std::unique_ptr<RegSelSiLUT> TGC_RegSelCondAlg::createTable( const MuonMDT_CablingMap* /* mdtCabling */ ) const { 
 
   /// now get the TGC cabling service ...
 
diff --git a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/TGC_RegSelCondAlg.h b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/TGC_RegSelCondAlg.h
index aa0ce6d5bfa610687bc255afb4d6eb1cbe8d78db..afdb30389b0480dd6ad56f3d39d02c3fd05020e2 100755
--- a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/TGC_RegSelCondAlg.h
+++ b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/TGC_RegSelCondAlg.h
@@ -20,7 +20,12 @@ public:
 
   TGC_RegSelCondAlg( const std::string& name, ISvcLocator* pSvcLocator );
 
-  std::unique_ptr<RegSelSiLUT> createTable( const MuonMDT_CablingMap* mdtCabling ) const;
+  std::unique_ptr<RegSelSiLUT> createTable( const EventContext& ctx, EventIDRange& id_range ) const override;
+
+  virtual StatusCode initialize() override;
+
+  SG::ReadCondHandleKey<MuonMDT_CablingMap> m_mdtCablingKey
+    { this, "Cabling", "MuonMDT_CablingMap", "Key of output MDT cabling map" };
 
 };
 
diff --git a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/sTGC_RegSelCondAlg.cxx b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/sTGC_RegSelCondAlg.cxx
index dcafed58827982d78e90ae0eca6ce9a60382ae5e..5a93655c60df951282b5f29985bed77c8788d517 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/sTGC_RegSelCondAlg.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/sTGC_RegSelCondAlg.cxx
@@ -50,8 +50,25 @@ sTGC_RegSelCondAlg::sTGC_RegSelCondAlg(const std::string& name, ISvcLocator* pSv
 
 
 
+StatusCode sTGC_RegSelCondAlg::initialize() {
+  ATH_CHECK(MuonRegSelCondAlg::initialize());
+  ATH_CHECK(m_mdtCablingKey.initialize());
+  return StatusCode::SUCCESS;
+}
+
+
+
+std::unique_ptr<RegSelSiLUT> sTGC_RegSelCondAlg::createTable( const EventContext& ctx, EventIDRange& id_range ) const { 
 
-std::unique_ptr<RegSelSiLUT> sTGC_RegSelCondAlg::createTable( const MuonMDT_CablingMap* /* mdtCabling */ ) const { 
+  /// get the MDT cabling map as a proxy for the id_range
+  
+  SG::ReadCondHandle<MuonMDT_CablingMap> mdtCabling( m_mdtCablingKey, ctx );
+ 
+  if( !mdtCabling.range( id_range ) ) {
+    ATH_MSG_ERROR("Failed to retrieve validity range for " << mdtCabling.key());
+    return std::unique_ptr<RegSelSiLUT>(nullptr);
+  }   
+  
 
   /// no NSW cabling available at the moment ...
 
diff --git a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/sTGC_RegSelCondAlg.h b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/sTGC_RegSelCondAlg.h
index ace1a281544f3884315ef0ed6c10c246ec199f04..ff6c22c2a7d779aa3d0fcdca92565de445312e82 100755
--- a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/sTGC_RegSelCondAlg.h
+++ b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/sTGC_RegSelCondAlg.h
@@ -25,8 +25,13 @@ public:
 
   sTGC_RegSelCondAlg( const std::string& name, ISvcLocator* pSvcLocator );
 
-  std::unique_ptr<RegSelSiLUT> createTable( const MuonMDT_CablingMap* mdtCabling ) const;
+  std::unique_ptr<RegSelSiLUT> createTable(  const EventContext& ctx, EventIDRange& id_range ) const override;
 
+  virtual StatusCode initialize() override;
+
+  SG::ReadCondHandleKey<MuonMDT_CablingMap> m_mdtCablingKey
+     { this, "Cabling", "MuonMDT_CablingMap", "Key of output MDT cabling map" };
+  
 };
 
 #endif // sTGC_RegSelCondAlg_h
diff --git a/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonTrackingGeometryBuilder.cxx b/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonTrackingGeometryBuilder.cxx
index c481613211d08187d8dee4046417f2dc3d8a56ac..a36167934d7a38c12a9b3eb1e3e80638f628566f 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonTrackingGeometryBuilder.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonTrackingGeometryBuilder.cxx
@@ -178,7 +178,7 @@ const Trk::TrackingGeometry* Muon::MuonTrackingGeometryBuilder::trackingGeometry
   RZPairVector envelopeDefs;
   if (m_enclosingEnvelopeSvc) {
     // get the dimensions from the envelope service
-    RZPairVector& envelopeDefsIn = m_enclosingEnvelopeSvc->getMuonRZValues();
+    const RZPairVector& envelopeDefsIn = m_enclosingEnvelopeSvc->getMuonRZBoundary();
 
     // find the max,max pair
     unsigned int ii=0;
@@ -379,7 +379,7 @@ const Trk::TrackingGeometry* Muon::MuonTrackingGeometryBuilder::trackingGeometry
     
   } else {     // no input, create the enclosed volume
     if (m_loadMSentry && m_enclosingEnvelopeSvc ) {
-      RZPairVector& envelopeDefs = m_enclosingEnvelopeSvc->getCaloRZValues();
+      const RZPairVector& envelopeDefs = m_enclosingEnvelopeSvc->getCaloRZBoundary();
       // to be implemented in detail - for the moment, take just maximal extent
       ATH_MSG_DEBUG( " m_loadMSentry " << m_loadMSentry << " m_enclosingEnvelopeSvc " << m_enclosingEnvelopeSvc );
       double rmax = 0.; double zmax = 0.;
diff --git a/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonTrackingGeometryBuilderCond.cxx b/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonTrackingGeometryBuilderCond.cxx
index 4b4dfeb861e7da1ea92326c8a4a702d308468c99..eee3037e4e40ae25b290052206e3546038e9f981 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonTrackingGeometryBuilderCond.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonTrackingGeometryBuilderCond.cxx
@@ -185,7 +185,7 @@ std::pair<EventIDRange, const Trk::TrackingGeometry*> Muon::MuonTrackingGeometry
   RZPairVector envelopeDefs;
   if (m_enclosingEnvelopeSvc) {
     // get the dimensions from the envelope service
-    RZPairVector& envelopeDefsIn = m_enclosingEnvelopeSvc->getMuonRZValues();
+    const RZPairVector& envelopeDefsIn = m_enclosingEnvelopeSvc->getMuonRZBoundary();
 
     // find the max,max pair
     unsigned int ii=0;
@@ -386,7 +386,7 @@ std::pair<EventIDRange, const Trk::TrackingGeometry*> Muon::MuonTrackingGeometry
     
   } else {     // no input, create the enclosed volume
     if (m_loadMSentry && m_enclosingEnvelopeSvc ) {
-      RZPairVector& envelopeDefs = m_enclosingEnvelopeSvc->getCaloRZValues();
+      const RZPairVector& envelopeDefs = m_enclosingEnvelopeSvc->getCaloRZBoundary();
       // to be implemented in detail - for the moment, take just maximal extent
       ATH_MSG_DEBUG( " m_loadMSentry " << m_loadMSentry << " m_enclosingEnvelopeSvc " << m_enclosingEnvelopeSvc );
       double rmax = 0.; double zmax = 0.;
diff --git a/MuonSpectrometer/MuonDigitization/CSC_Digitization/CSC_Digitization/CSC_Digitizer.h b/MuonSpectrometer/MuonDigitization/CSC_Digitization/CSC_Digitization/CSC_Digitizer.h
index a3a78d7cae1b345c5a666ae52c373e4f1c118a18..cd8f0acc941298bd9001ec2c3e12dc493f9bddbb 100644
--- a/MuonSpectrometer/MuonDigitization/CSC_Digitization/CSC_Digitization/CSC_Digitizer.h
+++ b/MuonSpectrometer/MuonDigitization/CSC_Digitization/CSC_Digitization/CSC_Digitizer.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 MUONDIGITIZATION_CSC_DIGITIZER_H
@@ -113,9 +113,6 @@ private:
   void fillMaps(const IdentifierHash hash, const double driftTime, const double stripCharge,
 		std::vector<IdentifierHash>& hashVec,
 		std::map<IdentifierHash,std::pair<double,double> >& data_map);
-  //  void fillSampleMaps(const IdentifierHash hash, const double driftTime, const double stripCharge,
-  //                      std::vector<IdentifierHash>& hashVec,
-  //                      std::map<IdentifierHash,std::vector<float> >& data_map); // new interface trying to provide 4 samples instead of q,t
   void fillSampleMaps(const IdentifierHash hash, const double driftTime, const double stripCharge,
                       std::vector<IdentifierHash>& hashVec,
                       std::map<IdentifierHash,std::vector<float> >& data_map, bool phase=0); // new interface trying to provide 4 samples instead of q,t
@@ -123,15 +120,11 @@ private:
 private:
   
   // private data members
-  CscHitIdHelper * m_cscHitHelper;
-  const   CscIdHelper * m_cscIdHelper;
-  const   MuonGM::MuonDetectorManager * m_muonMgr;
+  CscHitIdHelper* m_cscHitHelper;
+  const CscIdHelper* m_cscIdHelper;
+  const MuonGM::MuonDetectorManager* m_muonMgr; // cannot use ReadCondHandleKey since no athena component
   ICscCalibTool* m_pcalib;
-  // Calibration tool.
-  //  double m_FlatDist;
-  //  double m_GaussDist;  
-  //  double m_PoissonDist;  
-  //  double m_GammaDist;
+
   int    m_maxElectron;
   bool    m_NInterFromEnergyLoss;
   double m_electronEnergy;
diff --git a/MuonSpectrometer/MuonDigitization/CSC_Digitization/CSC_Digitization/CscDigitizationTool.h b/MuonSpectrometer/MuonDigitization/CSC_Digitization/CSC_Digitization/CscDigitizationTool.h
index ef250e8c32576ca92fd91fa573ecb1b144bddcdd..173e4faebf2950e77a24a64b4f9ce39dc6af39d2 100644
--- a/MuonSpectrometer/MuonDigitization/CSC_Digitization/CSC_Digitization/CscDigitizationTool.h
+++ b/MuonSpectrometer/MuonDigitization/CSC_Digitization/CSC_Digitization/CscDigitizationTool.h
@@ -92,7 +92,6 @@ private:
   SG::WriteHandleKey<CscSimDataCollection> m_cscSimDataCollectionWriteHandleKey{this,"CSCSimDataCollectionOutputName","CSC_SDO","WriteHandleKey for Output CscSimDataCollection"};
   SG::WriteHandleKey<CscDigitContainer> m_cscDigitContainerKey{this,"OutputObjectName","CSC_DIGITS","CSC digit container object"};
 
-  const MuonGM::MuonDetectorManager* m_geoMgr{nullptr};
   std::unique_ptr<CSC_Digitizer> m_cscDigitizer{nullptr};
 
   ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
diff --git a/MuonSpectrometer/MuonDigitization/CSC_Digitization/src/CscDigitizationTool.cxx b/MuonSpectrometer/MuonDigitization/CSC_Digitization/src/CscDigitizationTool.cxx
index 6bf855c38b2855956650b4d0811530fe23bc4804..01fbe8172e362b35d17add0b80391f0048b26d1c 100644
--- a/MuonSpectrometer/MuonDigitization/CSC_Digitization/src/CscDigitizationTool.cxx
+++ b/MuonSpectrometer/MuonDigitization/CSC_Digitization/src/CscDigitizationTool.cxx
@@ -40,7 +40,8 @@ StatusCode CscDigitizationTool::initialize() {
   ATH_MSG_DEBUG ( "  CscDigitContainer key     " << m_cscDigitContainerKey.key());
 
   // initialize transient detector store and MuonDetDescrManager
-  ATH_CHECK(detStore()->retrieve(m_geoMgr));
+  const MuonGM::MuonDetectorManager* muDetMgr=nullptr;
+  ATH_CHECK(detStore()->retrieve(muDetMgr));
   ATH_MSG_DEBUG ( "MuonDetectorManager retrieved from StoreGate.");
 
   if (m_onlyUseContainerName) {
@@ -54,7 +55,7 @@ StatusCode CscDigitizationTool::initialize() {
   ATH_CHECK(m_pcalib.retrieve());
 
   //initialize the CSC digitizer
-  m_cscDigitizer = std::make_unique<CSC_Digitizer>(CscHitIdHelper::GetHelper(), m_geoMgr, &*(m_pcalib));
+  m_cscDigitizer = std::make_unique<CSC_Digitizer>(CscHitIdHelper::GetHelper(), muDetMgr, &*(m_pcalib));
   m_cscDigitizer->setAmplification(m_amplification);
   m_cscDigitizer->setDebug        ( msgLvl(MSG::DEBUG) );
   m_cscDigitizer->setDriftVelocity(m_driftVelocity);
diff --git a/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/MDT_Response_DigiTool.h b/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/MDT_Response_DigiTool.h
index 63ab8b9bedf8b344a287e692b19e3176bfeb8be8..3858fecda5ede5b8a31532eba2edd65fdbae75a3 100644
--- a/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/MDT_Response_DigiTool.h
+++ b/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/MDT_Response_DigiTool.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 MDT_DIGITIZATION_MDT_RESPONSE_DIGITOOL_H
@@ -38,7 +38,7 @@ class MDT_Response_DigiTool : public AthAlgTool,
 
   StatusCode initialize();
 
-  bool initializeTube();
+  bool initializeTube(const MuonGM::MuonDetectorManager* detMgr);
 
  private:
   MDT_Response m_tube;
@@ -47,7 +47,6 @@ class MDT_Response_DigiTool : public AthAlgTool,
   double m_threshold;
   double m_attenuationLength;
 
-  const MuonGM::MuonDetectorManager* m_muonGeoMgr;
   const MdtIdHelper*         m_idHelper;
   bool m_DoQballGamma;
 };
diff --git a/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/MdtDigitizationTool.h b/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/MdtDigitizationTool.h
index d0c465bc84f9d332e93c4a81df87422c6ba99e88..7d51e51e655a390170e2f5646730ff11962d8339 100644
--- a/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/MdtDigitizationTool.h
+++ b/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/MdtDigitizationTool.h
@@ -136,7 +136,7 @@ class MdtDigitizationTool : public PileUpToolBase {
  private:
   CLHEP::HepRandomEngine*   getRandomEngine(const std::string& streamName, const EventContext& ctx) const;
   int                       digitizeTime(double time, bool isHPTDC, CLHEP::HepRandomEngine *rndmEngine) const;
-  double                    minimumTof(Identifier DigitId) const;
+  double                    minimumTof(Identifier DigitId, const MuonGM::MuonDetectorManager* detMgr) const;
 
   bool                      insideMatchingWindow(double time) const;
   bool                      insideMaskWindow(double time) const;
diff --git a/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/RT_Relation_DigiTool.h b/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/RT_Relation_DigiTool.h
index 8c004f60c83ae7d799d05f5311203bc57498d832..8bf9724161b9c0470b2fe33b4fdd6bb169713f7d 100644
--- a/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/RT_Relation_DigiTool.h
+++ b/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/RT_Relation_DigiTool.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 MDT_DIGITIZATION_RT_RELATION_DIGITOOL_H
@@ -38,7 +38,7 @@ class RT_Relation_DigiTool : public AthAlgTool,
   
   virtual StatusCode initialize() override;
 
-  bool initializeTube();
+  bool initializeTube(const MuonGM::MuonDetectorManager* detMgr);
 
  private:
   double getDriftTime(double radius) const;
@@ -50,7 +50,6 @@ class RT_Relation_DigiTool : public AthAlgTool,
 
   std::vector <Rt_relation *> m_rt;
 
-  const MuonGM::MuonDetectorManager* m_muonGeoMgr;
   const MdtIdHelper*         m_idHelper;
 
 };
diff --git a/MuonSpectrometer/MuonDigitization/MDT_Digitization/src/MDT_Response_DigiTool.cxx b/MuonSpectrometer/MuonDigitization/MDT_Digitization/src/MDT_Response_DigiTool.cxx
index ccdebb35a37c94201715ef1e328ae5a436e8cd8f..510fb343612a91d2ef4d27dffed55f9c6561e11e 100644
--- a/MuonSpectrometer/MuonDigitization/MDT_Digitization/src/MDT_Response_DigiTool.cxx
+++ b/MuonSpectrometer/MuonDigitization/MDT_Digitization/src/MDT_Response_DigiTool.cxx
@@ -11,13 +11,9 @@
 
 using namespace MuonGM;
 
-MDT_Response_DigiTool::MDT_Response_DigiTool( const std::string& type,
-					      const std::string& name,
-					      const IInterface* parent )
-  : AthAlgTool(type,name,parent)
-	 , m_muonGeoMgr(0)
-	 , m_idHelper(0)
-{
+MDT_Response_DigiTool::MDT_Response_DigiTool( const std::string& type, const std::string& name, const IInterface* parent) :
+  AthAlgTool(type,name,parent),
+	m_idHelper(nullptr) {
   declareInterface<IMDT_DigitizationTool>(this);
 
   declareProperty("ClusterDensity",   m_clusterDensity = 8.5);
@@ -62,30 +58,28 @@ MDT_Response_DigiTool::digitize(const MdtDigiToolInput& input, CLHEP::HepRandomE
 
 StatusCode MDT_Response_DigiTool::initialize()
 {
+  const MuonGM::MuonDetectorManager* muDetMgr=nullptr;
   if(detStore()->contains<MuonDetectorManager>( "Muon" )){
-    StatusCode status = detStore()->retrieve(m_muonGeoMgr);
-    if (status.isFailure()) {
-      ATH_MSG_FATAL("Could not retrieve MuonGeoModelDetectorManager!");
-      return status;
-    }
-    else {
+      ATH_CHECK(detStore()->retrieve(muDetMgr));
       ATH_MSG_DEBUG("MuonGeoModelDetectorManager retrieved from StoreGate.");
       //initialize the MdtIdHelper
-      m_idHelper = m_muonGeoMgr->mdtIdHelper();
+      m_idHelper = muDetMgr->mdtIdHelper();
       ATH_MSG_DEBUG("MdtIdHelper: " << m_idHelper );
-      if(!m_idHelper) return status;
-    }
+      if(!m_idHelper) {
+        ATH_MSG_ERROR("MdtIdHelper is nullptr");
+        return StatusCode::FAILURE;
+      }
   }
  
-  initializeTube();
+  initializeTube(muDetMgr);
 
   return StatusCode::SUCCESS;
 }
 
-bool MDT_Response_DigiTool::initializeTube(){
+bool MDT_Response_DigiTool::initializeTube(const MuonGM::MuonDetectorManager* detMgr) {
 
   // initialize MDT_Response
-  double innerR(m_muonGeoMgr->getGenericMdtDescriptor()->innerRadius);
+  double innerR(detMgr->getGenericMdtDescriptor()->innerRadius);
 
   ATH_MSG_DEBUG("INITIALIZED Inner tube radius to " << innerR );
   m_tube.SetTubeRadius(innerR);
diff --git a/MuonSpectrometer/MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.cxx b/MuonSpectrometer/MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.cxx
index 08c1781544f3ab94fa19963e8d658cb03e0adb2f..deff99b51f64ff4cbfe74903c2103dadd6d0800b 100644
--- a/MuonSpectrometer/MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.cxx
+++ b/MuonSpectrometer/MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.cxx
@@ -759,7 +759,7 @@ bool MdtDigitizationTool::checkMDTSimHit(const MDTSimHit& hit) const {
   }
   
   if (m_useTof) {
-    double minTof = minimumTof(DigitId);
+    double minTof = minimumTof(DigitId, m_MuonGeoMgr);
     if(( hit.globalTime() < 0 || hit.globalTime() > 10*minTof) && m_DiscardEarlyHits) {
       ok = false;
       ATH_MSG_DEBUG( "MDTSimHit has invalid global time: " << hit.globalTime() << "   minimum Tof " << minTof );
@@ -854,7 +854,7 @@ bool MdtDigitizationTool::createDigits(MdtDigitContainer* digitContainer, MuonSi
     
     // check if the hits lies within the TDC time window
     // subtrack the minimum Tof (= globalPosition().mag()/c) from the tof of the hit 
-    double relativeTime = driftTime - minimumTof(idDigit);
+    double relativeTime = driftTime - minimumTof(idDigit, m_MuonGeoMgr);
     bool insideMatch = insideMatchingWindow( relativeTime );
     bool insideMask = insideMaskWindow( relativeTime );
     if( insideMask && insideMatch ) {
@@ -964,12 +964,12 @@ int MdtDigitizationTool::digitizeTime(double time, bool isHPTDC, CLHEP::HepRando
 }
 
 
-double MdtDigitizationTool::minimumTof(Identifier DigitId) const { 
+double MdtDigitizationTool::minimumTof(Identifier DigitId, const MuonGM::MuonDetectorManager* detMgr) const { 
   if(!m_useTof) return 0.;
   
   // get distance to vertex for tof correction before applying the time window
   double distanceToVertex(0.);
-  const MuonGM::MdtReadoutElement* element = m_MuonGeoMgr->getMdtReadoutElement(DigitId);
+  const MuonGM::MdtReadoutElement* element = detMgr->getMdtReadoutElement(DigitId);
   
   if (0 == element) {
     ATH_MSG_ERROR( "MuonGeoManager does not return valid element for given id!" );
diff --git a/MuonSpectrometer/MuonDigitization/MDT_Digitization/src/RT_Relation_DigiTool.cxx b/MuonSpectrometer/MuonDigitization/MDT_Digitization/src/RT_Relation_DigiTool.cxx
index 386be81f8504dfc29e44e43a8642da28f8f021fc..b0207758948c529876ecc96508cd83969d1c869d 100644
--- a/MuonSpectrometer/MuonDigitization/MDT_Digitization/src/RT_Relation_DigiTool.cxx
+++ b/MuonSpectrometer/MuonDigitization/MDT_Digitization/src/RT_Relation_DigiTool.cxx
@@ -19,7 +19,6 @@ RT_Relation_DigiTool::RT_Relation_DigiTool( const std::string& type,
 					    const IInterface* parent )
   : AthAlgTool(type,name,parent)
   , m_maxRadius(0)
-  , m_muonGeoMgr(0)
   , m_idHelper(0)
 {
   declareInterface<IMDT_DigitizationTool>(this);
@@ -43,30 +42,27 @@ MdtDigiToolOutput RT_Relation_DigiTool::digitize(const MdtDigiToolInput& input,C
 
 StatusCode RT_Relation_DigiTool::initialize()
 {
-
+  const MuonGM::MuonDetectorManager* muDetMgr=nullptr;
   if(detStore()->contains<MuonDetectorManager>( "Muon" )){
-    StatusCode status = detStore()->retrieve(m_muonGeoMgr);
-    if (status.isFailure()) {
-      ATH_MSG_FATAL("Could not retrieve MuonGeoModelDetectorManager!");
-      return status;
-    }
-    else {
+      ATH_CHECK(detStore()->retrieve(muDetMgr));
       ATH_MSG_DEBUG("MuonGeoModelDetectorManager retrieved from StoreGate.");
       //initialize the MdtIdHelper
-      m_idHelper = m_muonGeoMgr->mdtIdHelper();
+      m_idHelper = muDetMgr->mdtIdHelper();
       ATH_MSG_DEBUG("MdtIdHelper: " << m_idHelper );
-      if(!m_idHelper) return status;
-    }
+      if(!m_idHelper) {
+        ATH_MSG_ERROR("MdtIdHelper is nullptr");
+        return StatusCode::FAILURE;
+      }
   }
 
-  initializeTube();
+  initializeTube(muDetMgr);
 
   return StatusCode::SUCCESS;
 }
 
-bool RT_Relation_DigiTool::initializeTube(){
+bool RT_Relation_DigiTool::initializeTube(const MuonGM::MuonDetectorManager* detMgr){
 
-  m_maxRadius = m_muonGeoMgr->getGenericMdtDescriptor()->innerRadius;
+  m_maxRadius = detMgr->getGenericMdtDescriptor()->innerRadius;
 
   if (m_rt.size() < 1) {
     std::string inputFile = RT_DATA;
@@ -86,8 +82,6 @@ bool RT_Relation_DigiTool::initializeTube(){
     m_rt[0]->read_rt(rt_file);
   }
 
-  m_maxRadius = m_muonGeoMgr->getGenericMdtDescriptor()->innerRadius;
-
   ATH_MSG_DEBUG("Initialized Inner tube radius to " << m_maxRadius );
 
   return true;
diff --git a/MuonSpectrometer/MuonDigitization/MM_Digitization/MM_Digitization/MM_Response_DigitTool.h b/MuonSpectrometer/MuonDigitization/MM_Digitization/MM_Digitization/MM_Response_DigitTool.h
index 89de12db0b9bc337e319c16c0b19a0fba569a913..c9aff61fca443f385c214e348e561e58a6a985da 100644
--- a/MuonSpectrometer/MuonDigitization/MM_Digitization/MM_Digitization/MM_Response_DigitTool.h
+++ b/MuonSpectrometer/MuonDigitization/MM_Digitization/MM_Digitization/MM_Response_DigitTool.h
@@ -23,10 +23,6 @@ input quantities into the output
 -----------------------------------------------*/
 /*******************************************************************************/
 
-namespace MuonGM{
-  class MuonDetectorManager;
-}
-
 class MM_Response_DigitTool : public AthAlgTool, virtual public IMM_DigitizationTool {
  public:
   MM_Response_DigitTool( const std::string& type, const std::string& name, const IInterface* parent);
@@ -35,11 +31,6 @@ class MM_Response_DigitTool : public AthAlgTool, virtual public IMM_Digitization
   StatusCode initialize();
   bool initializeStrip();
 
- private:
-
-  // const MuonGM::MuonDetectorManager* m_muonGeoMgr;
-  // ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
-
  protected:
   CLHEP::HepRandomEngine *m_rndmEngine;    // Random number engine used - not init in SiDigitization
   std::string m_rndmEngineName;// name of random engine
diff --git a/MuonSpectrometer/MuonDigitization/MM_Digitization/src/MM_Response_DigitTool.cxx b/MuonSpectrometer/MuonDigitization/MM_Digitization/src/MM_Response_DigitTool.cxx
index 577c1c8c2c5e8097b19ea56410f4913b3b418f51..124f7c648c541c3a657d63cf0b8abb6ddf042b6c 100644
--- a/MuonSpectrometer/MuonDigitization/MM_Digitization/src/MM_Response_DigitTool.cxx
+++ b/MuonSpectrometer/MuonDigitization/MM_Digitization/src/MM_Response_DigitTool.cxx
@@ -5,17 +5,13 @@
 #include "MM_Digitization/MM_Response_DigitTool.h"
 
 #include "MM_Digitization/MM_DigitToolInput.h"
-// #include "MuonReadoutGeometry/MuonDetectorManager.h"
 
 #include <iostream>
 #include <vector>
 
-using namespace MuonGM;
-
 /*******************************************************************************/
 MM_Response_DigitTool::MM_Response_DigitTool(const std::string& type, const std::string& name, const IInterface* parent) :
   AthAlgTool(type,name,parent),
-  // m_muonGeoMgr(0),
   m_rndmEngine(0),
   m_rndmEngineName("MuonDigitization"),
   m_rndmSvc("AtRndmGenSvc", name )
@@ -35,11 +31,6 @@ MM_DigitToolOutput MM_Response_DigitTool::digitize( /*const MmDigitToolInput& in
 /*******************************************************************************/
 StatusCode MM_Response_DigitTool::initialize()
 {
-  // if(detStore()->contains<MuonDetectorManager>( "Muon" )){
-  //   ATH_CHECK( detStore()->retrieve(m_muonGeoMgr) );
-  //   ATH_MSG_DEBUG("MuonGeoModelDetectorManager retrieved from StoreGate.");
-  // }
-  // ATH_CHECK(m_idHelperSvc.retrieve());
   ATH_CHECK( m_rndmSvc.retrieve() );
 
   // getting our random numbers stream
diff --git a/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TgcDigitMaker.h b/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TgcDigitMaker.h
index 5fc861efdef3619c7882c1e375006bd71254863c..b4c6a69ef672dfc869fcda327ae2df19fad1a809 100644
--- a/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TgcDigitMaker.h
+++ b/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TgcDigitMaker.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
 */
 
 // TgcDigitMaker.h
@@ -174,7 +174,7 @@ class TgcDigitMaker {
 
   TgcHitIdHelper* m_hitIdHelper;
   unsigned int m_runperiod;
-  const MuonGM::MuonDetectorManager* m_mdManager;
+  const MuonGM::MuonDetectorManager* m_mdManager; // cannot use ReadCondHandleKey since no athena component
   const TgcIdHelper* m_idHelper;
   float m_efficiencyOfWireGangs;
   float m_efficiencyOfStrips;
diff --git a/MuonSpectrometer/MuonGeoModel/src/RDBReaderAtlas.cxx b/MuonSpectrometer/MuonGeoModel/src/RDBReaderAtlas.cxx
index 0bc1b2a361e88dbc5d7b32d249cda82841c8e05a..e84fa4a899cd99f201025268f889da3f15a2dcbb 100755
--- a/MuonSpectrometer/MuonGeoModel/src/RDBReaderAtlas.cxx
+++ b/MuonSpectrometer/MuonGeoModel/src/RDBReaderAtlas.cxx
@@ -613,28 +613,31 @@ void RDBReaderAtlas::ProcessTGCreadout () {
         m_mgr->storeTgcReadoutParams(std::move(rpar));
       }
     }
-  } else { //if (getGeometryVersion().substr(0,1) == "Q")
+  } else {
     //
     // in case of layout Q and following
     //
     AmdcDb* theAmdcDb = dynamic_cast<AmdcDb*>(m_pRDBAccess);
-    IRDBRecordset_ptr ggln = m_pRDBAccess->getRecordsetPtr("GGLN",m_geoTag,m_geoNode);
-    if (theAmdcDb) ggln = theAmdcDb->getRecordsetPtr("GGLN",m_geoTag,m_geoNode);
+    IRDBRecordset_ptr ggln = theAmdcDb ? theAmdcDb->getRecordsetPtr("GGLN","Amdc")  : m_pRDBAccess->getRecordsetPtr("GGLN",m_geoTag,m_geoNode);
 
     int version(0);
     float wirespacing(0);
-    if(ggln->size()){
+    unsigned int gglnSize(0);
+    if (ggln) gglnSize = ggln->size();
+    else {
+      log << MSG::WARNING << " ProcessTGCreadout - IRDBRecordset_ptr GGLN is nullptr" << endmsg;
+    }
+    if(gglnSize){
       version = (int) (*ggln)[0]->getInt("VERS");
       wirespacing = (*ggln)[0]->getFloat("WIRESP")*Gaudi::Units::mm;
     }
 
-    log << MSG::INFO
-        << " ProcessTGCreadout - version " << version << " wirespacing " << wirespacing << endmsg;
+    log << MSG::INFO << " ProcessTGCreadout - version " << version << " wirespacing " << wirespacing << endmsg;
 
     MYSQL *mysql = MYSQL::GetPointer();
 
     // loop over the banks of station components: ALMN
-    for (unsigned int ich = 0; ich<ggln->size(); ++ich) {
+    for (unsigned int ich = 0; ich<gglnSize; ++ich) {
       int type = (int)(*ggln)[ich]->getInt("JSTA");
       std::string name = "TGCReadout"+MuonGM::buildString(type,2);
 
diff --git a/MuonSpectrometer/MuonIdHelpersAlgs/MuonIdHelpersAlgs/CscHashId.h b/MuonSpectrometer/MuonIdHelpersAlgs/MuonIdHelpersAlgs/CscHashId.h
index cedc0afa963d7b962fa9eaee68118d39a6f938c5..794d5c0cc05a6836ea22a34458afbb6a0d993f46 100644
--- a/MuonSpectrometer/MuonIdHelpersAlgs/MuonIdHelpersAlgs/CscHashId.h
+++ b/MuonSpectrometer/MuonIdHelpersAlgs/MuonIdHelpersAlgs/CscHashId.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 CSCHASHID_H
@@ -12,9 +12,6 @@
 
 class StoreGateSvc;
 class CscIdHelper;
-namespace MuonGM {
-class MuonDetectorManager;
-}
 
 /////////////////////////////////////////////////////////////////////////////
 
@@ -23,20 +20,17 @@ class CscHashId: public AthAlgorithm {
 public:
 
   CscHashId (const std::string& name, ISvcLocator* pSvcLocator);
-  ~CscHashId();
+  ~CscHashId()=default;
 
   StatusCode initialize();
   StatusCode execute();
-  StatusCode finalize();
 
 private:
 
   StatusCode cscHash();
 
 private:
-
   const CscIdHelper          * m_cscId;
-  const MuonGM::MuonDetectorManager  * m_muon_mgr;
 
 };
 
diff --git a/MuonSpectrometer/MuonIdHelpersAlgs/src/CscHashId.cxx b/MuonSpectrometer/MuonIdHelpersAlgs/src/CscHashId.cxx
index ba3e1944544efbf56be5f1c81880db8181d76b4d..b44fa1a9d33f681814bc48e1d86d2b2bcf511b5d 100644
--- a/MuonSpectrometer/MuonIdHelpersAlgs/src/CscHashId.cxx
+++ b/MuonSpectrometer/MuonIdHelpersAlgs/src/CscHashId.cxx
@@ -16,22 +16,16 @@
 
 CscHashId::CscHashId(const std::string& name, ISvcLocator* pSvcLocator) :
   AthAlgorithm(name, pSvcLocator),
-  m_cscId(NULL), m_muon_mgr(NULL)
-   {
-
+  m_cscId(nullptr) {
 }
-
-CscHashId::~CscHashId()
-{}
-
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
 
 StatusCode CscHashId::initialize(){
 
   ATH_MSG_DEBUG( " in initialize()"  );
-            
-  ATH_CHECK( detStore()->retrieve( m_muon_mgr ) );
-  m_cscId = m_muon_mgr->cscIdHelper();
+  const MuonGM::MuonDetectorManager* muDetMgr=nullptr;
+  ATH_CHECK(detStore()->retrieve(muDetMgr));
+  m_cscId = muDetMgr->cscIdHelper();
 
   return StatusCode::SUCCESS;
 }
@@ -47,12 +41,6 @@ StatusCode CscHashId::execute() {
   return StatusCode::SUCCESS;
 }
 
-StatusCode CscHashId::finalize() {
- 
-  ATH_MSG_DEBUG( "in finalize()"  );
-  return StatusCode::SUCCESS;
-}
-
 StatusCode CscHashId::cscHash() {
   ATH_MSG_DEBUG( "in execute(): testing CSC IdHelper"  );
 
diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscAlignmentTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscAlignmentTool.cxx
index 62df9088a77b975d04196bad84bf0cf6486376b7..f203666f1ef5710ce2397bc939893520213b58ae 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscAlignmentTool.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscAlignmentTool.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
 */
 
 // CscAlignmentTool.cxx
@@ -9,15 +9,11 @@
 #include "MuonReadoutGeometry/MuonDetectorManager.h"
 #include "MuonIdHelpers/CscIdHelper.h"
 
-using std::vector;
-using std::string;
-
 //**********************************************************************
 
-CscAlignmentTool::
-CscAlignmentTool(string type, string aname, const IInterface* parent)
-  : AthAlgTool(type, aname, parent),
-    m_pmuon_detmgr(0), m_phelper(0)
+CscAlignmentTool::CscAlignmentTool(const std::string& type, const std::string& aname, const IInterface* parent) :
+  AthAlgTool(type, aname, parent),
+  m_phelper(nullptr)
 {
   declareInterface<ICscAlignmentTool>(this);
   declareProperty("useAlignment", m_useAlignment=false); // in strips
@@ -28,10 +24,6 @@ CscAlignmentTool(string type, string aname, const IInterface* parent)
 
 //**********************************************************************
 
-CscAlignmentTool::~CscAlignmentTool() { }
-
-//**********************************************************************
-
 StatusCode CscAlignmentTool::initialize() {
 
   ATH_MSG_DEBUG ( "Initializing " << name() );
@@ -39,22 +31,11 @@ StatusCode CscAlignmentTool::initialize() {
   ATH_MSG_DEBUG ( "     EtaPos AlignConsts size :" << m_etaposAlignconsts.size() );
   ATH_MSG_DEBUG ( "     PhiPos AlignConsts size :" << m_phiposAlignconsts.size() );
 
-  // Retrieve the detector descriptor.
-  if ( detStore()->retrieve(m_pmuon_detmgr).isFailure() ) {
-    ATH_MSG_ERROR ( " Cannot retrieve MuonGeoModel " );
-    return StatusCode::RECOVERABLE;
-  }
+  const MuonGM::MuonDetectorManager* muDetMgr=nullptr;
+  ATH_CHECK_RECOVERABLE(detStore()->retrieve(muDetMgr));
   ATH_MSG_DEBUG ( "Retrieved geometry." );
-  m_phelper = m_pmuon_detmgr->cscIdHelper();
-
-
-  return StatusCode::SUCCESS;
-}
-
-//**********************************************************************
+  m_phelper = muDetMgr->cscIdHelper();
 
-StatusCode CscAlignmentTool::finalize() {
-  ATH_MSG_VERBOSE ( "Finalizing " << name() );
   return StatusCode::SUCCESS;
 }
 
diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscAlignmentTool.h b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscAlignmentTool.h
index 5cb813306a7b3c34fcfe893d246461cd3bd4e215..5c203c0eaf49f200a5bf74f5fae3c6a867ee4a57 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscAlignmentTool.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscAlignmentTool.h
@@ -1,9 +1,7 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
-// CscAlignmentTool.h
-
 #ifndef CscAlignmentTool_H
 #define CscAlignmentTool_H
 
@@ -12,43 +10,32 @@
 //
 // Strip fitter using the parabolic fit fron the CSC calibration tool.
 
-#include <vector>
 #include "AthenaBaseComps/AthAlgTool.h"
-#include "GaudiKernel/ToolHandle.h"
 #include "CscClusterization/ICscAlignmentTool.h"
+
+#include <string>
+#include <vector>
+
 class Identifier;
 class CscIdHelper;
-namespace MuonGM 
-{
-    class MuonDetectorManager;
-}
 
 class CscAlignmentTool : virtual public ICscAlignmentTool, public AthAlgTool {
 
 public:  // Ctors and dtor.
 
   // Constructor.
-  CscAlignmentTool(std::string, std::string, const IInterface*);
+  CscAlignmentTool(const std::string&, const std::string&, const IInterface*);
 
   // Destructor.
-  ~CscAlignmentTool();
-
-public:  // AlgTool methods
+  ~CscAlignmentTool()=default;
 
   // Initialization.
   StatusCode initialize();
 
-  // Finalization.
-  StatusCode finalize();
-
 public:
   double getAlignmentOffset(Identifier pstripId) const;
 
-  
-
 private:  // data
-  // Pointer to muon geometry manager.
-  const MuonGM::MuonDetectorManager* m_pmuon_detmgr;
   const CscIdHelper* m_phelper;
 
   // Strip fitter.
diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscBipolarStripFitter.cxx b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscBipolarStripFitter.cxx
index d8ce1fb2dc60e94bb1494cf7d69c483742fa1883..545302aabd03faf5ee7d3ba5a1ffca541a916671 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscBipolarStripFitter.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscBipolarStripFitter.cxx
@@ -20,16 +20,14 @@
 //
 
 using Muon::CscStripPrepData;
-using std::string;
 
 typedef ICscStripFitter::Result     Result;
 typedef ICscStripFitter::ChargeList ChargeList;
 
 //**********************************************************************
 
-CscBipolarStripFitter::CscBipolarStripFitter(string type, string aname, const IInterface *parent)
+CscBipolarStripFitter::CscBipolarStripFitter(const std::string& type, const std::string& aname, const IInterface *parent)
     : AthAlgTool(type, aname, parent),
-      m_pmuon_detmgr(0),
       m_phelper(0),
       m_n(0),
       m_n2(0),
@@ -50,10 +48,6 @@ CscBipolarStripFitter::CscBipolarStripFitter(string type, string aname, const II
 
 //**********************************************************************
 
-CscBipolarStripFitter::~CscBipolarStripFitter() {}
-
-//**********************************************************************
-
 StatusCode
 CscBipolarStripFitter::initialize()
 {
@@ -70,11 +64,11 @@ CscBipolarStripFitter::initialize()
     /** CSC calibratin tool for the Condtiions Data base access */
     ATH_CHECK_RECOVERABLE(m_cscCalibTool.retrieve());
 
-    // Retrieve the detector descriptor.
-    ATH_CHECK_RECOVERABLE(detStore()->retrieve(m_pmuon_detmgr));
+    const MuonGM::MuonDetectorManager* muDetMgr=nullptr;
+    ATH_CHECK_RECOVERABLE(detStore()->retrieve(muDetMgr));
     ATH_MSG_DEBUG("Retrieved geometry.");
 
-    m_phelper = m_pmuon_detmgr->cscIdHelper();
+    m_phelper = muDetMgr->cscIdHelper();
 
     m_n          = m_cscCalibTool->getNumberOfIntegration();   // 12.;
     m_n2         = m_cscCalibTool->getNumberOfIntegration2();  // 11.66;
@@ -93,15 +87,6 @@ CscBipolarStripFitter::initialize()
 
 //**********************************************************************
 
-StatusCode
-CscBipolarStripFitter::finalize()
-{
-    ATH_MSG_DEBUG("Finalizing " << name());
-    return StatusCode::SUCCESS;
-}
-
-//**********************************************************************
-
 Result
 CscBipolarStripFitter::fit(const ChargeList &chgs, double period, Identifier &stripId) const
 {
diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscBipolarStripFitter.h b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscBipolarStripFitter.h
index 0b2a1c2d1ffc80ddef61e28010500749e698a185..093bd88d290c514604dde7b67095a9868530de76 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscBipolarStripFitter.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscBipolarStripFitter.h
@@ -2,8 +2,6 @@
   Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
-// CscBipolarStripFitter.h
-
 #ifndef CscBipolarStripFitter_H
 #define CscBipolarStripFitter_H
 ///////////////////////////////////////////
@@ -25,27 +23,21 @@ class CscIdHelper;
 namespace Muon {
 class CscStripPrepData;
 }
-namespace MuonGM {
-class MuonDetectorManager;
-}
 
 
 class CscBipolarStripFitter : virtual public ICscStripFitter, public AthAlgTool {
 
   public:  // Ctors and dtor.
     // Constructor.
-    CscBipolarStripFitter(std::string, std::string, const IInterface *);
+    CscBipolarStripFitter(const std::string&, const std::string&, const IInterface*);
 
     // Destructor.
-    ~CscBipolarStripFitter();
+    ~CscBipolarStripFitter()=default;
 
   public:  // AlgTool methods
     // Initialization.
     StatusCode initialize();
 
-    // Finalization.
-    StatusCode finalize();
-
   public:  // Interface methods
     // Tell compiler not to hide other fit methods.
     using ICscStripFitter::fit;
@@ -54,9 +46,7 @@ class CscBipolarStripFitter : virtual public ICscStripFitter, public AthAlgTool
     // If that fit fails, the peak channel is used.
     Result fit(const ChargeList &charges, double samplingTime, Identifier &stripId) const;
 
-  private:  // data
-    // Pointer to muon geometry manager.
-    const MuonGM::MuonDetectorManager *m_pmuon_detmgr;
+  private:
     const CscIdHelper *                m_phelper;
 
     // Calibration tool.
diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscClusterUtilTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscClusterUtilTool.cxx
index 96a36efbb86a7d05a6f71cdbb0c55cd3660f98e1..6047001b41eaa5a7d91dce9b0349f21524059eff 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscClusterUtilTool.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscClusterUtilTool.cxx
@@ -2,8 +2,6 @@
   Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
-// CscClusterUtilTool.cxx
-
 #include "CscClusterUtilTool.h"
 
 #include "CscClusterization/ICscClusterFitter.h"
@@ -20,14 +18,11 @@ using Muon::CscPrepData;
 using Muon::CscStripPrepData;
 using Muon::CscStripPrepDataCollection;
 using Muon::CscStripPrepDataContainer;
-using std::string;
-using std::vector;
 
 //**********************************************************************
 
-CscClusterUtilTool::CscClusterUtilTool(string type, string aname, const IInterface* parent)
+CscClusterUtilTool::CscClusterUtilTool(const std::string& type, const std::string& aname, const IInterface* parent)
     : AthAlgTool(type, aname, parent),
-      m_pmuon_detmgr(0),
       m_phelper(0),
       m_cscStripLocation("CSC_Measurements")
 {
@@ -37,10 +32,6 @@ CscClusterUtilTool::CscClusterUtilTool(string type, string aname, const IInterfa
 
 //**********************************************************************
 
-CscClusterUtilTool::~CscClusterUtilTool() {}
-
-//**********************************************************************
-
 StatusCode
 CscClusterUtilTool::initialize()
 {
@@ -58,23 +49,14 @@ CscClusterUtilTool::initialize()
     ATH_CHECK(m_precClusterFitter.retrieve());
     ATH_MSG_DEBUG("Retrieved CSC precision cluster fitting tool");
 
-    // Retrieve the detector descriptor.
-    ATH_CHECK_RECOVERABLE(detStore()->retrieve(m_pmuon_detmgr));
+    const MuonGM::MuonDetectorManager* muDetMgr=nullptr;
+    ATH_CHECK_RECOVERABLE(detStore()->retrieve(muDetMgr));
     ATH_MSG_DEBUG("Retrieved geometry.");
-    m_phelper = m_pmuon_detmgr->cscIdHelper();
+    m_phelper = muDetMgr->cscIdHelper();
 
     return StatusCode::SUCCESS;
 }
 
-//**********************************************************************
-
-StatusCode
-CscClusterUtilTool::finalize()
-{
-    ATH_MSG_VERBOSE("Finalizing " << name());
-    return StatusCode::SUCCESS;
-}
-
 //**********************************************************************
 void
 CscClusterUtilTool::getStripFits(const Trk::RIO_OnTrack* rot, ICscClusterFitter::StripFitList& sfits) const
@@ -123,7 +105,7 @@ CscClusterUtilTool::getStripFits(const CscPrepData* MClus, ICscClusterFitter::St
 
     sfits.clear();
 
-    vector<const CscStripPrepData*> strPrepDatas = getStrips(MClus);
+    std::vector<const CscStripPrepData*> strPrepDatas = getStrips(MClus);
     for (unsigned int i = 0; i < strPrepDatas.size(); ++i) {
         ICscClusterFitter::StripFit sfit;
         sfit = m_stripFitter->fit(*strPrepDatas[i]);
@@ -155,17 +137,17 @@ CscClusterUtilTool::getRefitCluster(const CscPrepData* MClus, double tantheta) c
 }
 /////////////////////////////////////////////////////////////////////////////
 
-vector<const CscStripPrepData*>
+std::vector<const CscStripPrepData*>
 CscClusterUtilTool::getStrips(const CscPrepData* MClus) const
 {
 
-    vector<const CscStripPrepData*> strips;
+    std::vector<const CscStripPrepData*> strips;
     if (!MClus) {
         ATH_MSG_WARNING(" Muon::CscPrepData* pprd is empty !");
         return strips;
     }
 
-    vector<Identifier> prd_digit_ids = MClus->rdoList();
+    std::vector<Identifier> prd_digit_ids = MClus->rdoList();
 
     SG::ReadHandle<Muon::CscStripPrepDataContainer> pdigcont(m_cscStripLocation);
 
diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscClusterUtilTool.h b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscClusterUtilTool.h
index 5df430ed5a18b7b384acc11a26f968b782a34b37..5127e82d2abaf65b00ef3d24864383bd4d9b486e 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscClusterUtilTool.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscClusterUtilTool.h
@@ -18,14 +18,11 @@
 #include "CscClusterization/ICscClusterUtilTool.h"
 #include "GaudiKernel/ToolHandle.h"
 class CscIdHelper;
-namespace MuonGM {
-class MuonDetectorManager;
-}
 namespace Muon {
 class CscClusterOnTrack;
 class CscPrepData;
 class CscStripPrepData;
-}  // namespace Muon
+}
 namespace Trk {
 class RIO_OnTrack;
 }
@@ -34,19 +31,13 @@ class CscClusterUtilTool : virtual public ICscClusterUtilTool, public AthAlgTool
 
   public:  // Ctors and dtor.
     // Constructor.
-    CscClusterUtilTool(std::string, std::string, const IInterface*);
+    CscClusterUtilTool(const std::string&, const std::string&, const IInterface*);
 
     // Destructor.
-    ~CscClusterUtilTool();
+    ~CscClusterUtilTool()=default;
 
-  public:  // AlgTool methods
-    // Initialization.
     StatusCode initialize();
 
-    // Finalization.
-    StatusCode finalize();
-
-  public:
     ICscClusterFitter::Results getRefitCluster(const Muon::CscPrepData* MClus, double tantheta) const;
 
     void getStripFits(const Trk::RIO_OnTrack* rot, ICscClusterFitter::StripFitList& sfits) const;
@@ -55,11 +46,8 @@ class CscClusterUtilTool : virtual public ICscClusterUtilTool, public AthAlgTool
 
     std::vector<const Muon::CscStripPrepData*> getStrips(const Muon::CscPrepData* MClus) const;
 
-
-  private:  // data
-    // Pointer to muon geometry manager.
-    const MuonGM::MuonDetectorManager* m_pmuon_detmgr;
-    const CscIdHelper*                 m_phelper;
+  private:
+    const CscIdHelper* m_phelper;
 
     // Strip fitter.
     ToolHandle<ICscStripFitter> m_stripFitter{
diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscPeakThresholdClusterBuilderTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscPeakThresholdClusterBuilderTool.cxx
index 1564738d8225d54be30a3f45b1aa70af5ea7feb6..28befc2018edfa6f78acb5a2f822c2f969b0425d 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscPeakThresholdClusterBuilderTool.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscPeakThresholdClusterBuilderTool.cxx
@@ -72,8 +72,7 @@ CscPeakThresholdClusterBuilderTool::CscPeakThresholdClusterBuilderTool(const std
                                                                        const std::string& aname,
                                                                        const IInterface*  parent)
     : AthAlgTool(type, aname, parent),
-      m_digit_key("CSC_Measurements"),
-      m_fullEventDone(false)
+      m_digit_key("CSC_Measurements")
 {
 
     declareInterface<ICscClusterBuilder>(this);
diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscPeakThresholdClusterBuilderTool.h b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscPeakThresholdClusterBuilderTool.h
index 2b7326056c1e304fcb1a361d2f20c11ca2b8bd6e..7ebb1026e07d53472ca430a7296b600c3c5b9b05 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscPeakThresholdClusterBuilderTool.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscPeakThresholdClusterBuilderTool.h
@@ -150,9 +150,6 @@ class CscPeakThresholdClusterBuilderTool : virtual public ICscClusterBuilder, pu
         "MuonDetectorManager",
         "Key of input MuonDetectorManager condition data",
     };
-
-    // keep track of full event being already processed
-    bool m_fullEventDone;
 };
 
 #endif
diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/SimpleCscClusterFitter.cxx b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/SimpleCscClusterFitter.cxx
index 09c175ef1a0791e35b6cdf23d7386161ca755b68..e0d9ee28ed5f6189a4ed05eac5f0fa0dd95ba30f 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/SimpleCscClusterFitter.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/SimpleCscClusterFitter.cxx
@@ -46,7 +46,6 @@ SimpleCscClusterFitter::initialize()
     ATH_MSG_DEBUG("  Position option: " << m_option);
     ATH_MSG_DEBUG("  Intrinsic width: " << m_intrinsic_cluster_width << " mm");
 
-    ATH_CHECK(detStore()->retrieve(m_detMgr, "Muon"));
     ATH_CHECK(m_idHelperSvc.retrieve());
 
     if (m_alignmentTool.retrieve().isFailure()) {
diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/SimpleCscClusterFitter.h b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/SimpleCscClusterFitter.h
index bcffb8c22a263122dc8c92f9ac19900fd27c0d83..c7ba21c88d1d274ae2eb83a9482bf2165643decc 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/SimpleCscClusterFitter.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/SimpleCscClusterFitter.h
@@ -46,8 +46,6 @@ class SimpleCscClusterFitter : virtual public ICscClusterFitter, public AthAlgTo
     double      m_defaultErrorScaler_eta;
     double      m_defaultErrorScaler_phi;
 
-    const MuonGM::MuonDetectorManager* m_detMgr;
-
     ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{this, "MuonIdHelperSvc",
                                                         "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
 
diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MuonClusterization/MuonClusterization/MdtHitClustering.h b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MuonClusterization/MuonClusterization/MdtHitClustering.h
index 4036d55365b4fb413092bc5caa4c6f16d1a2b18a..996cfa02457bf8e48e72707b90aa07550a48203a 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MuonClusterization/MuonClusterization/MdtHitClustering.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MuonClusterization/MuonClusterization/MdtHitClustering.h
@@ -106,7 +106,7 @@ namespace Muon {
     void layers( const MdtCluster& cl, int& all, int& inTime, int& inTimeAndBefore ) const;
 
     const MdtIdHelper* m_mdtIdHelper;
-    const MuonGM::MuonDetectorManager* m_detMgr;
+    const MuonGM::MuonDetectorManager* m_detMgr; // cannot use ReadCondHandleKey since no athena component
     const MuonGM::MdtReadoutElement* detEl1;
     const MuonGM::MdtReadoutElement* detEl2;
     unsigned int nlay;
diff --git a/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/MuonHoughPatternTools/MuonLayerHoughTool.h b/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/MuonHoughPatternTools/MuonLayerHoughTool.h
index 95649b1bd63a5ffda67f45d86685d12075a701b9..28bc66cf3bab33a0bfd2f1d9483b57ea9a9c95e8 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/MuonHoughPatternTools/MuonLayerHoughTool.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/MuonHoughPatternTools/MuonLayerHoughTool.h
@@ -218,7 +218,7 @@ namespace Muon {
     void insertHash( int sector, const IdentifierHash& hash, const Identifier& id );
 
     void matchTruth( std::set<Identifier>& truthHits, const PRD_MultiTruthCollection& truthCol, const Identifier& id, MuonHough::HitDebugInfo& debug ) const;
-    void initializeSectorMapping();
+    void initializeSectorMapping(const MuonGM::MuonDetectorManager* detMgr);
     void getTruth() const;
     void printTruthSummary( std::set<Identifier>& truth, std::set<Identifier>& found ) const;
 
@@ -232,7 +232,6 @@ namespace Muon {
     ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
     ToolHandle<MuonEDMPrinterTool> m_printer{this, "printerTool", "Muon::MuonEDMPrinterTool/MuonEDMPrinterTool"};
     ToolHandle<Muon::IMuonTruthSummaryTool> m_truthSummaryTool{this, "MuonTruthSummaryTool", "Muon::MuonTruthSummaryTool/MuonTruthSummaryTool"};
-    const MuonGM::MuonDetectorManager* m_detMgr;
 
     std::vector<MuonHough::MuonLayerHoughSelector> m_selectors;
     std::vector<MuonHough::MuonLayerHoughSelector> m_selectorsLoose;
diff --git a/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/src/MuonLayerHoughTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/src/MuonLayerHoughTool.cxx
index 8c99a27f0a2e3e9e5cbc9883ba7272eba57c37f6..cca10df314b68a5b43022e13f55863dae96ce2bb 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/src/MuonLayerHoughTool.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/src/MuonLayerHoughTool.cxx
@@ -21,7 +21,6 @@ namespace Muon {
 
   MuonLayerHoughTool::MuonLayerHoughTool(const std::string& type, const std::string& name, const IInterface* parent):
     AthAlgTool(type,name,parent),
-    m_detMgr(nullptr),
     m_ntechnologies(UINT_MAX), // gets set inside initialize()
     m_techToTruthNameIdx()
   {
@@ -39,7 +38,8 @@ namespace Muon {
     } else {
       m_truthSummaryTool.disable();
     }
-    ATH_CHECK( detStore()->retrieve( m_detMgr ) );
+    const MuonGM::MuonDetectorManager* muDetMgr=nullptr;
+    ATH_CHECK( detStore()->retrieve( muDetMgr ) );
 
     if( m_doNtuple ){
       if (Gaudi::Concurrency::ConcurrencyFlags::concurrent() && Gaudi::Concurrency::ConcurrencyFlags::numThreads()>1) {
@@ -62,7 +62,7 @@ namespace Muon {
       m_ntuple = 0;
     }
     
-    initializeSectorMapping();
+    initializeSectorMapping(muDetMgr);
 
     // if m_truthNames is empty, fill it if running on truth
     if( m_truthNames.empty() && m_doTruth ){
@@ -2156,7 +2156,7 @@ namespace Muon {
   }
 
   // all chambers are mapped onto a layer and sector map
-  void MuonLayerHoughTool::initializeSectorMapping() {
+  void MuonLayerHoughTool::initializeSectorMapping(const MuonGM::MuonDetectorManager* detMgr) {
     m_collectionsPerSector.resize(MuonStationIndex::numberOfSectors());
     // set sector numbers
     unsigned int nsectorHashMax = MuonStationIndex::sectorLayerHashMax();
@@ -2229,7 +2229,7 @@ namespace Muon {
     it = m_idHelperSvc->tgcIdHelper().module_begin();
     it_end = m_idHelperSvc->tgcIdHelper().module_end();
     for( ;it!=it_end; ++it ){
-      const MuonGM::TgcReadoutElement* detEl = m_detMgr->getTgcReadoutElement(*it);
+      const MuonGM::TgcReadoutElement* detEl = detMgr->getTgcReadoutElement(*it);
       if( !detEl ) {
         ATH_MSG_DEBUG(" No detector element found for " << m_idHelperSvc->toString(*it) );
         continue;
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MdtDriftCircleOnTrackCreator/MdtDriftCircleOnTrackCreator/MdtDriftCircleOnTrackCreator.h b/MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MdtDriftCircleOnTrackCreator/MdtDriftCircleOnTrackCreator/MdtDriftCircleOnTrackCreator.h
index 179a04421fce066b1e28fb3de19ebf07e1ccd824..77f8091767c2f06963fe210dd9520dc131aa2112 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MdtDriftCircleOnTrackCreator/MdtDriftCircleOnTrackCreator/MdtDriftCircleOnTrackCreator.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MdtDriftCircleOnTrackCreator/MdtDriftCircleOnTrackCreator/MdtDriftCircleOnTrackCreator.h
@@ -18,11 +18,12 @@
 #include "MdtCalibSvc/MdtCalibrationDbTool.h"
 #include "TrkEventPrimitives/LocalParameters.h"
 #include "TrkSpaceTimePoint/SpaceTimePoint.h"
+#include "MdtCalibSvc/MdtCalibrationSvcSettings.h"
 
 #include <bitset>
 #include <string>
+#include <memory>
 
-class MdtCalibrationSvcSettings;
 class MdtCalibrationSvcInput;
 
 namespace Muon {
@@ -72,7 +73,6 @@ namespace Muon {
       MdtDriftCircleOnTrackCreator(const std::string&,const std::string&,const IInterface*);
       virtual ~MdtDriftCircleOnTrackCreator()=default;
       virtual StatusCode initialize();
-      virtual StatusCode finalize();
 
       /** @brief Calibrate a MdtPrepData object. The result is stored in a new MdtDriftCircleOnTrack object.
       Included calibrations:
@@ -201,7 +201,7 @@ namespace Muon {
       double                               m_fixedError; //!< Error used when m_doFixed error =true or m_scaleErrorManually = true
       double                               m_globalToLocalTolerance; 
       
-      MdtCalibrationSvcSettings*           m_mdtCalibSvcSettings; 
+      std::unique_ptr<MdtCalibrationSvcSettings>           m_mdtCalibSvcSettings; 
 
       // Member variables used to fill the default error strategy
       MuonDriftCircleErrorStrategy        m_errorStrategy; //!< Error strategy for created ROTs
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MdtDriftCircleOnTrackCreator/src/MdtDriftCircleOnTrackCreator.cxx b/MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MdtDriftCircleOnTrackCreator/src/MdtDriftCircleOnTrackCreator.cxx
index 22b742b84736d57733bd9d28407d7544733f99f7..d7d7affb396fbe15423793956796b4d41da68fba 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MdtDriftCircleOnTrackCreator/src/MdtDriftCircleOnTrackCreator.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MdtDriftCircleOnTrackCreator/src/MdtDriftCircleOnTrackCreator.cxx
@@ -3,8 +3,6 @@
 */
 
 #include "MdtDriftCircleOnTrackCreator/MdtDriftCircleOnTrackCreator.h"
-
-#include "MdtCalibSvc/MdtCalibrationSvcSettings.h"
 #include "MdtCalibSvc/MdtCalibrationSvcInput.h"
 #include "MdtCalibData/MdtRtRelation.h"
 #include "MdtCalibData/MdtFullCalibData.h"
@@ -25,13 +23,10 @@
 
 Muon::MdtDriftCircleOnTrackCreator::MdtDriftCircleOnTrackCreator(const std::string& ty,const std::string& na,const IInterface* pa) :
     AthAlgTool(ty,na,pa),
-    m_mdtCalibSvcSettings(nullptr),
+    m_mdtCalibSvcSettings(new MdtCalibrationSvcSettings()), // create calibration service settings 
     m_errorStrategy(Muon::MuonDriftCircleErrorStrategyInput())
 {
-  // create calibration service settings 
-  m_mdtCalibSvcSettings = new MdtCalibrationSvcSettings();
-  
-  // algtool interface - necessary!
+    // algtool interface - necessary!
   declareInterface<IMdtDriftCircleOnTrackCreator>(this);
   declareInterface<IRIO_OnTrackCreator>(this);
   
@@ -102,26 +97,31 @@ StatusCode Muon::MdtDriftCircleOnTrackCreator::initialize()
     // By default use one of the real strategies - don't default to unknown!
     m_errorStrategy.setStrategy(MuonDriftCircleErrorStrategy::Muon);
   }
-  ATH_MSG_INFO("Constructed default MuonDriftCircleErrorStrategy: ");
-  if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::BroadError ) ) ATH_MSG_INFO(" Broad");
-  if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::ScaledError ) ) ATH_MSG_INFO(" Scaled"); 
-  if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::FixedError ) ) ATH_MSG_INFO(" Fixed");
-  if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::ParameterisedErrors ) ) ATH_MSG_INFO(" Parm");
-  if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::StationError ) ) ATH_MSG_INFO(" Station");
-  if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::ErrorAtPredictedPosition ) ) ATH_MSG_INFO(" ErrAtPos");
-  if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::T0Refit ) ) ATH_MSG_INFO(" T0");
-  if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::WireSagGeomCorrection ) ) ATH_MSG_INFO(" WireG");
-  if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::TofCorrection ) ) ATH_MSG_INFO(" TOF");
-  if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::PropCorrection ) ) ATH_MSG_INFO(" Prop");
-  if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::TempCorrection ) ) ATH_MSG_INFO(" Temp");
-  if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::MagFieldCorrection ) ) ATH_MSG_INFO(" Mag");
-  if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::WireSagTimeCorrection ) ) ATH_MSG_INFO(" WireT");
-  if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::SlewCorrection ) ) ATH_MSG_INFO(" Slew");
-  if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::BackgroundCorrection ) ) ATH_MSG_INFO(" Back");
-  if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::Segment ) ) ATH_MSG_INFO(" Seg");
-  
-  if( !m_isMC && m_looseErrors )  ATH_MSG_INFO( "Using Data Loose error tuning");
-  if( !m_isMC && !m_looseErrors ) ATH_MSG_INFO( "Using Data Tight error tuning");
+  if (msgLevel(MSG::INFO)) {
+    std::stringstream ss;
+    ss << "Constructed default MuonDriftCircleErrorStrategy:";
+    if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::BroadError ) ) ss << " Broad";
+    if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::ScaledError ) ) ss << " Scaled"; 
+    if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::FixedError ) ) ss << " Fixed";
+    if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::ParameterisedErrors ) ) ss << " Parm";
+    if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::StationError ) ) ss << " Station";
+    if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::ErrorAtPredictedPosition ) ) ss << " ErrAtPos";
+    if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::T0Refit ) ) ss << " T0";
+    if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::WireSagGeomCorrection ) ) ss << " WireG";
+    if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::TofCorrection ) ) ss << " TOF";
+    if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::PropCorrection ) ) ss << " Prop";
+    if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::TempCorrection ) ) ss << " Temp";
+    if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::MagFieldCorrection ) ) ss << " Mag";
+    if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::WireSagTimeCorrection ) ) ss << " WireT";
+    if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::SlewCorrection ) ) ss << " Slew";
+    if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::BackgroundCorrection ) ) ss << " Back";
+    if( m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::Segment ) ) ss << " Seg";
+    ss << ". ";
+    if( !m_isMC && m_looseErrors )  ss << "Using Data Loose error tuning";
+    if( !m_isMC && !m_looseErrors ) ss <<  "Using Data Tight error tuning";
+
+    msg(MSG::INFO) << ss.str() << endmsg;
+  }
   if( m_isMC )                    ATH_MSG_INFO( "Using MC error tuning");
   ATH_MSG_VERBOSE( "A correction is made if set to true: do_MDT = " << m_doMdt ); 
   
@@ -141,11 +141,6 @@ StatusCode Muon::MdtDriftCircleOnTrackCreator::initialize()
   return StatusCode::SUCCESS; 
 } 
 
-StatusCode Muon::MdtDriftCircleOnTrackCreator::finalize()
-{
-  delete m_mdtCalibSvcSettings;
-  return AthAlgTool::finalize(); 
-}
 
 Muon::MdtDriftCircleOnTrack* Muon::MdtDriftCircleOnTrackCreator::createRIO_OnTrack( 
                                                                                          const MdtPrepData& mdtPrd,
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MuonClusterOnTrackCreator/src/CscClusterOnTrackCreator.cxx b/MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MuonClusterOnTrackCreator/src/CscClusterOnTrackCreator.cxx
index 7c4cfd1227ce3089408b6504615073f47b3939e4..6e4323af41a1065c1b3ed8f3566b9331163d8c07 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MuonClusterOnTrackCreator/src/CscClusterOnTrackCreator.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MuonClusterOnTrackCreator/src/CscClusterOnTrackCreator.cxx
@@ -330,7 +330,11 @@ namespace Muon {
       std::vector<ICscClusterFitter::Result> results, results0;
       results = m_clusterUtilTool->getRefitCluster(MClus,tantheta);
       results0 = m_clusterUtilTool->getRefitCluster(MClus,0);
-      
+
+      if(results.empty() || results0.empty()){
+	ATH_MSG_VERBOSE("No fit result");
+	return new CscClusterOnTrack(MClus,locpar,loce,positionAlongStrip,MClus->status(),MClus->timeStatus(),MClus->time());
+      }
       ICscClusterFitter::Result res, res0;
       res = results[0];
       res0 = results0[0]; // result at normal angle to make error blown correctly in case of cosmic
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonRecTools.py b/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonRecTools.py
index 65f39261428b6ecd5a26a5c477a021d9db04e6b1..f967c9556df00edbce6a1156d2dfa54f22ef99ad 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonRecTools.py
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonRecTools.py
@@ -156,8 +156,6 @@ class MuonRotCreator(Trk__RIO_OnTrackCreator,ConfiguredBase):
         kwargs.setdefault("ToolMuonDriftCircle", "MdtDriftCircleOnTrackCreator")
         kwargs.setdefault("ToolMuonCluster", "MuonClusterOnTrackCreator")
         kwargs.setdefault("Mode", 'muon' )
-        from InDetRecExample.TrackingCommon import getInDetPixelClusterOnTrackToolDigital
-        kwargs.setdefault("ToolPixelCluster", getInDetPixelClusterOnTrackToolDigital( "PixelClusterOnTrackTool" ) )
         super(MuonRotCreator,self).__init__(name,**kwargs)
 # end of class MuonRotCreator
 
@@ -499,4 +497,4 @@ def MuonLayerSegmentFinderTool(name='MuonLayerSegmentFinderTool',extraFlags=None
     kwargs.setdefault("Csc4DSegmentMaker", getPublicTool("Csc4dSegmentMaker") if MuonGeometryFlags.hasCSC() else "")
     kwargs.setdefault("MuonClusterSegmentFinder",getPublicTool("MuonClusterSegmentFinder"))
 
-    return CfgMgr.Muon__MuonLayerSegmentFinderTool(name,**kwargs)
\ No newline at end of file
+    return CfgMgr.Muon__MuonLayerSegmentFinderTool(name,**kwargs)
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTGRecTools/MuonTGRecTools/MuonTGMeasurementTool.h b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTGRecTools/MuonTGRecTools/MuonTGMeasurementTool.h
index c057ed1b5ec1751ce1ec781267df1a479c36d602..6a7ab591ba23fe2ebc3cd1c8051cf8bdc5d7f7b1 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTGRecTools/MuonTGRecTools/MuonTGMeasurementTool.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTGRecTools/MuonTGRecTools/MuonTGMeasurementTool.h
@@ -89,7 +89,7 @@ private:
   SG::ReadCondHandleKey<MuonGM::MuonDetectorManager> m_DetectorManagerKey {this, "DetectorManagerKey", 
       "MuonDetectorManager", 
       "Key of input MuonDetectorManager condition data"};    
-  const MuonGM::MuonDetectorManager* m_muonDetMgr;
+  const MuonGM::MuonDetectorManager* m_muonDetMgr; // nominal MuonDetectorManager from DetectorStore (used if UseDSManager=true)
  
   // -- algorithm members
   mutable MuonTGHits* m_hits           ATLAS_THREAD_SAFE; //Marked as thread-safe because it's disabled when running multi-threaded
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonStationIntersectSvc/MuonStationIntersectSvc/MdtIntersectGeometry.h b/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonStationIntersectSvc/MuonStationIntersectSvc/MdtIntersectGeometry.h
index c464247efaa8083b652d033b4fbed7095fc725e0..1cb2f0457dc63d1cca8d9237010e58aa15cdbb31 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonStationIntersectSvc/MuonStationIntersectSvc/MdtIntersectGeometry.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonStationIntersectSvc/MuonStationIntersectSvc/MdtIntersectGeometry.h
@@ -47,7 +47,7 @@ namespace Muon {
     TrkDriftCircleMath::MdtChamberGeometry* m_mdtGeometry;
     const MuonGM::MdtReadoutElement*        m_detElMl0;
     const MuonGM::MdtReadoutElement*        m_detElMl1;
-    const MuonGM::MuonDetectorManager*      m_detMgr;
+    const MuonGM::MuonDetectorManager*      m_detMgr; // cannot use ReadCondHandleKey since no athena component
     const MdtCondDbData*                    m_dbData;
     const Muon::IMuonIdHelperSvc*           m_idHelperSvc;
     std::set<Identifier>                    m_deadTubesML;
diff --git a/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/RPC_LinearSegmentMakerTool/RPC_LinearSegmentMakerTool/RPC_LinearSegmentMakerTool.h b/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/RPC_LinearSegmentMakerTool/RPC_LinearSegmentMakerTool/RPC_LinearSegmentMakerTool.h
index 01218cd6de124379ac2574b568e5cfedb1885214..e8462e30282f46fdefe7511061f38df1b3524db1 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/RPC_LinearSegmentMakerTool/RPC_LinearSegmentMakerTool/RPC_LinearSegmentMakerTool.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/RPC_LinearSegmentMakerTool/RPC_LinearSegmentMakerTool/RPC_LinearSegmentMakerTool.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 RPC_LINEARSEGMENTMAKERTOOL_H
@@ -10,11 +10,6 @@
 
 class RpcIdHelper;
 
-namespace MuonGM
-{
-    class MuonDetectorManager;
-}
-
 class RPC_LinearSegmentMakerTool : virtual public Muon::IMuonSegmentMaker, public AthAlgTool
 {
 public:
@@ -23,7 +18,6 @@ public:
                                const IInterface* pIID);
 
     StatusCode initialize();
-    StatusCode Finalize();
     virtual void
       find(const std::vector<const Trk::RIO_OnTrack*>&,
 	   Trk::SegmentCollection*) const
@@ -65,7 +59,6 @@ private:
                     double& z, int& nZ,
                     double& phi, int& nPhi);
 
-    const MuonGM::MuonDetectorManager* m_pMuonMgr;
     const RpcIdHelper*                 m_pIdHelper;
     DoubleProperty                     m_fExclChi2;
 };
diff --git a/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/RPC_LinearSegmentMakerTool/src/RPC_LinearSegmentMakerTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/RPC_LinearSegmentMakerTool/src/RPC_LinearSegmentMakerTool.cxx
index 9579acffb2c2dd03cc4a4d4428f6066407793b2c..a3f16212a903c0fecd5cf13eea9fe35e5b898f6d 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/RPC_LinearSegmentMakerTool/src/RPC_LinearSegmentMakerTool.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/RPC_LinearSegmentMakerTool/src/RPC_LinearSegmentMakerTool.cxx
@@ -1,7 +1,7 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
 #include "RPC_LinearSegmentMakerTool/RPC_LinearSegmentMakerTool.h"
 #include "MuonLinearSegmentMakerUtilities/Fit2D.h"
 #include "MuonLinearSegmentMakerUtilities/MuonLinearSegmentMakerUtilities.h"
@@ -19,7 +19,7 @@ RPC_LinearSegmentMakerTool::RPC_LinearSegmentMakerTool(const std::string& type,
                                                        const std::string& name,
                                                        const IInterface* pIID) :
 AthAlgTool(type, name, pIID),
-m_pIdHelper(NULL)
+m_pIdHelper(nullptr)
 {
     declareInterface<Muon::IMuonSegmentMaker>(this);
     declareProperty("OutlierChi2", m_fExclChi2 = 10.0);
@@ -28,28 +28,11 @@ m_pIdHelper(NULL)
 StatusCode RPC_LinearSegmentMakerTool::initialize()
 {
     ATH_MSG_INFO("Initializing RPC_LinearSegmentMakerTool - package version " << PACKAGE_VERSION );
-    StatusCode sc = StatusCode::SUCCESS;
 
-    // initialize RpcIdHelper
-    StoreGateSvc* pDetStore = NULL;
-    sc = svcLoc()->service("DetectorStore", pDetStore);
-    if (sc.isFailure() || pDetStore == NULL)
-    {
-        ATH_MSG_ERROR("Cannot locate DetectorStore");
-        return sc;
-    }
-    sc = pDetStore->retrieve(m_pMuonMgr);
-    if (sc.isFailure() || m_pMuonMgr == NULL)
-    {
-        ATH_MSG_ERROR("Cannot retrieve MuonDetectorManager");
-        return sc;
-    }
-    m_pIdHelper = m_pMuonMgr->rpcIdHelper();
-    return StatusCode::SUCCESS;
-}
+    const MuonGM::MuonDetectorManager* muDetMgr=nullptr;
+    ATH_CHECK(detStore()->retrieve(muDetMgr));
 
-StatusCode RPC_LinearSegmentMakerTool::Finalize()
-{
+    m_pIdHelper = muDetMgr->rpcIdHelper();
     return StatusCode::SUCCESS;
 }
 
@@ -82,11 +65,11 @@ static inline double getFirstPointR(const Muon::Fit2D::PointArray& points)
     return 0.0;
 }
 
-void
+void
 RPC_LinearSegmentMakerTool::find(const Trk::TrackRoad& road,
                                  const std::vector< std::vector< const Muon::MdtDriftCircleOnTrack* > >&,
                                  const std::vector< std::vector< const Muon::MuonClusterOnTrack* > >& clusters,
-				 Trk::SegmentCollection*,
+				 Trk::SegmentCollection*,
                                  bool,double) const
 {
     ATH_MSG_DEBUG("RPC_LinearSegmentMakerTool::find");
diff --git a/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/TGC_LinearSegmentMakerTool/TGC_LinearSegmentMakerTool/TGC_LinearSegmentMakerTool.h b/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/TGC_LinearSegmentMakerTool/TGC_LinearSegmentMakerTool/TGC_LinearSegmentMakerTool.h
index 3edd22f91b6dff829bff36a1a34265836cdad387..9070f0e7f4f9747132fb2e217c0105ef3ee1f07e 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/TGC_LinearSegmentMakerTool/TGC_LinearSegmentMakerTool/TGC_LinearSegmentMakerTool.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/TGC_LinearSegmentMakerTool/TGC_LinearSegmentMakerTool/TGC_LinearSegmentMakerTool.h
@@ -8,21 +8,15 @@
 #include "AthenaBaseComps/AthAlgTool.h"
 #include "GaudiKernel/ToolHandle.h"
 #include "MuonRecToolInterfaces/IMuonSegmentMaker.h"
-//#include "CLHEP/Vector/TwoVector.h"
 #include "TrkExInterfaces/IIntersector.h"
 
 class TgcIdHelper;
 
-namespace MuonGM {
-class MuonDetectorManager;
-}
-
 class TGC_LinearSegmentMakerTool : virtual public Muon::IMuonSegmentMaker, public AthAlgTool {
   public:
     TGC_LinearSegmentMakerTool(const std::string& type, const std::string& name, const IInterface* pIID);
 
     StatusCode   initialize();
-    StatusCode   Finalize();
     virtual void find(const std::vector<const Trk::RIO_OnTrack*>&, Trk::SegmentCollection*) const {}
 
     virtual void find(const std::vector<const Trk::RIO_OnTrack*>&, const std::vector<const Trk::RIO_OnTrack*>&) const {}
@@ -46,7 +40,6 @@ class TGC_LinearSegmentMakerTool : virtual public Muon::IMuonSegmentMaker, publi
                       double momentum = 1e9) const;
 
   private:
-    const MuonGM::MuonDetectorManager* m_pMuonMgr;
     const TgcIdHelper*                 m_pIdHelper;
     DoubleProperty                     m_fExclChi2;
 
diff --git a/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/TGC_LinearSegmentMakerTool/src/TGC_LinearSegmentMakerTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/TGC_LinearSegmentMakerTool/src/TGC_LinearSegmentMakerTool.cxx
index f06ac81cb784cff88cb60a9680121b8abc8caed5..b215c2cd34ce8ba4dbe54dc5e3073207df1713d4 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/TGC_LinearSegmentMakerTool/src/TGC_LinearSegmentMakerTool.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/TGC_LinearSegmentMakerTool/src/TGC_LinearSegmentMakerTool.cxx
@@ -25,7 +25,7 @@
 TGC_LinearSegmentMakerTool::TGC_LinearSegmentMakerTool(const std::string& type, const std::string& name,
                                                        const IInterface* pIID)
     : AthAlgTool(type, name, pIID),
-      m_pIdHelper(NULL)
+      m_pIdHelper(nullptr)
 {
     declareInterface<Muon::IMuonSegmentMaker>(this);
     declareProperty("OutlierChi2", m_fExclChi2 = 10.0);
@@ -35,32 +35,15 @@ StatusCode
 TGC_LinearSegmentMakerTool::initialize()
 {
     ATH_MSG_INFO("Initializing TGC_LinearSegmentMakerTool - package version " << PACKAGE_VERSION);
-    StatusCode sc = StatusCode::SUCCESS;
 
-    // initialize TgcIdHelper
-    StoreGateSvc* pDetStore = NULL;
-    sc                      = svcLoc()->service("DetectorStore", pDetStore);
-    if (sc.isFailure() || pDetStore == NULL) {
-        ATH_MSG_ERROR("Cannot locate DetectorStore");
-        return sc;
-    }
-    sc = pDetStore->retrieve(m_pMuonMgr);
-    if (sc.isFailure() || m_pMuonMgr == NULL) {
-        ATH_MSG_ERROR("Cannot retrieve MuonDetectorManager");
-        return sc;
-    }
-    m_pIdHelper = m_pMuonMgr->tgcIdHelper();
+    const MuonGM::MuonDetectorManager* muDetMgr=nullptr;
+    ATH_CHECK(detStore()->retrieve(muDetMgr));
+    m_pIdHelper = muDetMgr->tgcIdHelper();
 
     ATH_CHECK(m_pIntersector.retrieve());
     return StatusCode::SUCCESS;
 }
 
-StatusCode
-TGC_LinearSegmentMakerTool::Finalize()
-{
-    return StatusCode::SUCCESS;
-}
-
 static std::string
 point2String(const Amg::Vector3D& pt)
 {
diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAMonitoring/share/MuonDQAMonitoring_Tier0.py b/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAMonitoring/share/MuonDQAMonitoring_Tier0.py
index c79b4612390dcd4206bfa2c251e3025f5bf430e9..2609022fc766e04558d3619ab44b50956561da0d 100644
--- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAMonitoring/share/MuonDQAMonitoring_Tier0.py
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAMonitoring/share/MuonDQAMonitoring_Tier0.py
@@ -25,7 +25,7 @@ else:
 #--------------------------------------------------------------  
 
 if not 'DQMonFlags' in dir():
-   print "MuonDQAMonitoring_Tier0.py: DQMonFlags not yet imported - I import them now"
+   print("MuonDQAMonitoring_Tier0.py: DQMonFlags not yet imported - I import them now")
    from AthenaMonitoring.DQMonFlags import DQMonFlags
 
 if DQMonFlags.monManEnvironment() == 'tier0Raw':
diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAMonitoring/share/MuonDQAMonitoring_jobOptions.py b/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAMonitoring/share/MuonDQAMonitoring_jobOptions.py
index 9e9428ffe70f0530c4973db063d2fc12836bc998..88bd322a3deac910b2ef9f45f2b58bde46583b9c 100644
--- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAMonitoring/share/MuonDQAMonitoring_jobOptions.py
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAMonitoring/share/MuonDQAMonitoring_jobOptions.py
@@ -17,7 +17,7 @@ from AthenaCommon.AlgSequence import AlgSequence
 topSequence = AlgSequence()
 
 if not 'MuonDQAFlags' in dir():
-    print "MuonDQAFlags.py: MuonDQAFlags not yet imported - I import them now"
+    print("MuonDQAFlags.py: MuonDQAFlags not yet imported - I import them now")
     from MuonDQAMonFlags.MuonDQAFlags import MuonDQAFlags as MuonDQAFlags
 
 #--------------------------------------------------------------  
@@ -31,7 +31,7 @@ else:
 MuonDQAFlags.doMuonMonitoring = True
  
 if not 'DQMonFlags' in dir():
-    print "DataQualityMon_RecExCommon_Flags_jobOptions.py: DQMonFlags not yet imported - I import them now"
+    print("DataQualityMon_RecExCommon_Flags_jobOptions.py: DQMonFlags not yet imported - I import them now")
     from AthenaMonitoring.DQMonFlags import DQMonFlags
     monEnv="tier0ESD"
 
diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/CMakeLists.txt b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..755061059cce7572257f243970d131f7d09926fa
--- /dev/null
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/CMakeLists.txt
@@ -0,0 +1,22 @@
+################################################################################
+# Package: MMRawDataMonitoring
+################################################################################
+
+# Declare the package name:
+atlas_subdir( MMRawDataMonitoring )
+
+# External dependencies:
+find_package( ROOT COMPONENTS Graf Core Tree MathCore Hist RIO pthread Graf3d Gpad Html Postscript Gui GX11TTF GX11 )
+
+# Component(s) in the package:
+atlas_add_component( MMRawDataMonitoring
+                     src/*.cxx
+                     src/components/*.cxx
+                     INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+ 		     LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaBaseComps AthenaMonitoringLib EventInfo MuonIdHelpersLib MuonPrepRawData MuonDQAUtilsLib TrkSegment Identifier xAODEventInfo xAODTrigger GaudiKernel MuonCalibIdentifier MuonReadoutGeometry MuonRIO_OnTrack MuonSegment AnalysisTriggerEvent LWHists TrkEventPrimitives GeoModelUtilities MuonAnalysisInterfacesLib) 
+
+#
+# Install files from the package:
+atlas_install_headers( MMRawDataMonitoring )
+atlas_install_joboptions( share/*.py )
+atlas_install_python_modules( python/*.py )
diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/MMRawDataMonitoring/ATLAS_CHECK_THREAD_SAFETY b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/MMRawDataMonitoring/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..8d1faf319c618962e30357a576288d7bdfd3226e
--- /dev/null
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/MMRawDataMonitoring/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring
diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/MMRawDataMonitoring/MMRawDataMonAlg.h b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/MMRawDataMonitoring/MMRawDataMonAlg.h
new file mode 100755
index 0000000000000000000000000000000000000000..d63ec4b50663df5cb625041bed78081925517d40
--- /dev/null
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/MMRawDataMonitoring/MMRawDataMonAlg.h
@@ -0,0 +1,98 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+///////////////////////////////////////////////////////////////////////////////////////////
+// Package : MMRawDataMonitoring
+// Author:  M. Biglietti, E. Rossi (Roma Tre)
+//
+// DESCRIPTION:
+// Subject: MM-->Offline Muon Data Quality
+///////////////////////////////////////////////////////////////////////////////////////////
+
+#ifndef MMRawDataMonAlg_H
+#define MMRawDataMonAlg_H
+
+//Core Include
+#include "AthenaMonitoring/AthMonitorAlgorithm.h"
+#include "AthenaMonitoringKernel/Monitored.h"
+#include "GaudiKernel/ServiceHandle.h"
+#include "GaudiKernel/ToolHandle.h" 
+//Helper Includes
+
+#include "MuonAnalysisInterfaces/IMuonSelectionTool.h"
+#include "MuonPrepRawData/MuonPrepDataContainer.h"
+#include "MuonPrepRawData/MMPrepDataCollection.h"
+#include "MuonIdHelpers/IMuonIdHelperSvc.h"
+#include "MuonReadoutGeometry/MuonDetectorManager.h"
+#include "AthenaMonitoring/DQAtlasReadyFilterTool.h"
+#include "xAODTrigger/MuonRoIContainer.h"
+#include "xAODMuon/MuonContainer.h"
+#include "MuonPrepRawData/MuonPrepDataContainer.h"
+#include "MuonPrepRawData/MMPrepDataContainer.h"
+#include "MuonPrepRawData/MMPrepData.h"
+#include "StoreGate/ReadHandleKey.h"
+
+
+namespace Muon {
+  class MMPrepData;
+  }
+
+namespace {
+  struct MMOverviewHistogramStruct;
+  struct MMSummaryHistogramStruct;
+}
+
+//stl includes                                                                                              
+#include <string>
+
+class MMRawDataMonAlg: public AthMonitorAlgorithm {
+ public:
+
+  MMRawDataMonAlg( const std::string& name, ISvcLocator* pSvcLocator );
+
+  //  virtual ~MMRawDataMonAlg();
+  virtual ~MMRawDataMonAlg()=default;
+  virtual StatusCode initialize() override;
+  virtual StatusCode fillHistograms(const EventContext& ctx) const override;
+  
+ private:  
+
+  ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
+
+  ToolHandle<CP::IMuonSelectionTool> m_muonSelectionTool{this,"MuonSelectionTool","CP::MuonSelectionTool/MuonSelectionTool"};
+  SG::ReadCondHandleKey<MuonGM::MuonDetectorManager> m_DetectorManagerKey {this, "DetectorManagerKey",
+     "MuonDetectorManager","Key of input MuonDetectorManager condition data"};
+ 
+  virtual StatusCode  fillMMOverviewVects(const Muon::MMPrepData*, MMOverviewHistogramStruct& vects) const;
+  virtual void  fillMMOverviewHistograms(const MMOverviewHistogramStruct& vects,const int lb) const;
+  virtual StatusCode  fillMMSummaryVects( const Muon::MMPrepData*, MMSummaryHistogramStruct (&vects)[2][2][8][2][2][4]) const; //[side][sector][stationPhi][stationEta][multiplet][gas_gap]
+  virtual StatusCode  fillMMHistograms( const Muon::MMPrepData* ) const;                                      
+  virtual StatusCode  fillMMSummaryHistograms( const MMSummaryHistogramStruct (&vects)[2][2][8][2][2][4]) const;
+
+  void clusterFromTrack(const xAOD::TrackParticleContainer*,const int lb) const;
+  
+  int get_PCB_from_channel(const int channel) const;
+  int get_sectorPhi_from_stationPhi_stName(const int stationPhi, const std::string& stName) const;
+  int get_sectorEta_from_stationEta(const int stationEta) const;
+
+  int get_bin_for_occ_CSide_hist(const int stationEta, const int multiplet, const int gas_gap) const;
+  int get_bin_for_occ_ASide_hist(const int stationEta, const int multiplet, const int gas_gap) const;
+  int get_bin_for_occ_CSide_pcb_eta2_hist(const int stationEta, const int multiplet, const int gas_gap, const int PCB) const;
+  int get_bin_for_occ_CSide_pcb_eta1_hist(const int stationEta, const int multiplet, const int gas_gap, const int PCB) const;
+  int get_bin_for_occ_ASide_pcb_eta2_hist(const int stationEta, const int multiplet, const int gas_gap, const int PCB) const;
+  int get_bin_for_occ_ASide_pcb_eta1_hist(const int stationEta, const int multiplet, const int gas_gap, const int PCB) const;
+  int get_bin_for_occ_lb_CSide_pcb_eta2_hist(const int stationEta, const int multiplet, const int gas_gap, const int PCB,const int isector) const;
+  int get_bin_for_occ_lb_CSide_pcb_eta1_hist(const int stationEta, const int multiplet, const int gas_gap, const int PCB,int isector) const;
+  int get_bin_for_occ_lb_ASide_pcb_eta1_hist(const int stationEta, const int multiplet, const int gas_gap, const int PCB,int isector) const;
+  int get_bin_for_occ_lb_ASide_pcb_eta2_hist(const int stationEta, const int multiplet, const int gas_gap, const int PCB, const int isector) const;
+
+  SG::ReadHandleKey<Muon::MMPrepDataContainer> m_MMContainerKey{this,"MMPrepDataContainerName","MM_Measurements"};
+  SG::ReadHandleKey<xAOD::MuonContainer> m_muonKey{this,"MuonKey","Muons","muons"};
+
+  Gaudi::Property<bool> m_doMMESD{this,"DoMMESD",true};
+  Gaudi::Property<bool> m_do_mm_overview{this,"do_mm_overview",true};
+  
+   
+};    
+#endif
diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/python/MMMonUtils.py b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/python/MMMonUtils.py
new file mode 100644
index 0000000000000000000000000000000000000000..093e4ba8b193f1a31627974860eaf8e09909cf1c
--- /dev/null
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/python/MMMonUtils.py
@@ -0,0 +1,22 @@
+#                                                                
+#Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+# 
+
+import MMRawDataMonitoring.MMRawMonLabels as labels
+from MMRawDataMonitoring.MMRawMonLabels import *
+
+def getMMLabel(x,y):
+
+    labelx = getattr(labels, x)
+    labely = getattr(labels, y)
+    return labelx,labely
+
+def getMMLabelY(y):
+
+    labely = getattr(labels, y)
+    return labely
+
+def getMMLabelX(x):
+
+    labelx = getattr(labels, x)
+    return labelx
diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/python/MMMonitorAlgorithm.py b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/python/MMMonitorAlgorithm.py
new file mode 100644
index 0000000000000000000000000000000000000000..b85f5ff7b97427ee777e00898e583f671b0a63fc
--- /dev/null
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/python/MMMonitorAlgorithm.py
@@ -0,0 +1,201 @@
+#
+#Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration                                    
+        
+#
+
+from AthenaConfiguration.ComponentFactory import CompFactory
+from MMMonUtils import getMMLabel,getMMLabelY
+
+def MMMonitoringConfig(inputFlags):
+    '''Function to configures some algorithms in the monitoring system.'''
+
+    ### STEP 1 ###
+    # Define one top-level monitoring algorithm. The new configuration 
+    # framework uses a component accumulator.
+    from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+    result = ComponentAccumulator()
+    # Make sure muon geometry is configured
+    from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg
+    result.merge(MuonGeoModelCfg(inputFlags))
+
+    # The following class will make a sequence, configure algorithms, and link
+    # them to GenericMonitoringTools
+
+    from AthenaMonitoring import AthMonitorCfgHelper
+    helper = AthMonitorCfgHelper(inputFlags,'MMAthMonitorCfg')
+    
+    # Adding an algorithm to the helper. 
+
+    mmMonAlg = helper.addAlgorithm(CompFactory.MMRawDataMonAlg,'MMMonAlg')
+    mmMonAlg.DoMMESD = True    
+    
+    # Add a generic monitoring tool (a "group" in old language). The returned                                
+    # object here is the standard GenericMonitoringTool. 
+
+    mmGroup = helper.addGroup(mmMonAlg,'mmMonitor','Muon/MuonRawDataMonitoring/MM/')
+    
+    # Configure histograms
+
+    # Overview histograms
+    mmGroup.defineHistogram('charge_all;Charge',  type='TH1F',
+                            title='Charge;Charge[fC];Number of Entries',
+                        path='Overview',   xbins=120, xmin=0., xmax=1200.
+                       )
+
+    mmGroup.defineHistogram('x_mon,y_mon;Posy_vs_Posx', type='TH2F', title="Posy vs Posx;MM-GlobalX [mm];MM-GlobalY [mm];", path='Overview',xbins=500, xmin=-5000, xmax=5000., ybins=500, ymin=-5000.,ymax=5000.)
+    
+    mmGroup.defineHistogram('R_mon,z_mon;Posz_vs_R', type='TH2F', title="Posz vs R;MM-GlobalR [mm];MM-GlobalZ [mm];", path='Overview',xbins=500, xmin=0, xmax=5000., ybins=1000, ymin=-8000 ,ymax=8000)
+    
+    mmGroup.defineHistogram('numberofstrips_percluster;Number_of_strips_percluster',  type='TH1F',
+                        title='Number of strips per cluster;Number of strips;Number of Entries',
+                            path='Overview',   xbins=20, xmin=0., xmax=20.)
+    
+    mmGroup.defineHistogram('mu_TPC_angle;uTPC_angle',  type='TH1F',
+                            title='#mu TPC angle;#mu TPC angle [degrees];Number of Entries',
+                            path='Overview',   xbins=2000, xmin=-100, xmax=100)
+
+    mmGroup.defineHistogram('mu_TPC_chi2;uTPC_chi2',  type='TH1F',
+                        title='#mu TPC #chi2; #mu TPC #chi2;Number of Entries',
+                        path='Overview',   xbins=100, xmin=0., xmax=1.)
+
+    mmGroup.defineHistogram('time_all;Time',  type='TH1F',
+                        title='Time;Time[ns];Number of Entries',
+                        path='Overview',   xbins=1000, xmin=0., xmax=10000.)
+
+    mmGroup.defineHistogram('statEta_strip,strip_number;Strip_Numbers_vs_StationEta',    type='TH2F',
+                            title='Strip Numbers vs Station Eta;; Strip Numbers;',
+                            path='Overview',   xbins=5, xmin=-2, xmax=3., xlabels=['#eta-2','#eta-1','','#eta1','#eta2'], ybins=5120, ymin=0., ymax=5120.)
+
+    thisLabelx,thisLabely=getMMLabel("x_lab_occ_etaminus1","y_lab_occ_etaminus1")
+
+    mmGroup.defineHistogram('sector_CSide_eta1,stationPhi_CSide_eta1;Occupancy_CSide_eta1_PCB', type='TH2F', title='Occupancy CSide eta1 PCB; ; ;', path='Occupancy', xbins=40, xmin=0, xmax=40., ybins=16, ymin=1, ymax=17,xlabels=thisLabelx, ylabels=thisLabely)
+
+    mmGroup.defineHistogram('sector_CSide_eta1_ontrack,stationPhi_CSide_eta1_ontrack;Occupancy_CSide_eta1_PCB_ontrack', type='TH2F', title='Occupancy CSide eta1 PCB ontrack; ; ;', path='Occupancy_ontrack', xbins=40, xmin=0, xmax=40., ybins=16, ymin=1, ymax=17,xlabels=thisLabelx, ylabels=thisLabely)
+
+    thisLabelx1,thisLabely1=getMMLabel("x_lab_occ_etaminus2","y_lab_occ_etaminus2")
+
+    mmGroup.defineHistogram('sector_CSide_eta2,stationPhi_CSide_eta2;Occupancy_CSide_eta2_PCB', type='TH2F', title='Occupancy CSide eta2 PCB; ; ;', path='Occupancy', xbins=24, xmin=0, xmax=24., ybins=16, ymin=1, ymax=17,xlabels=thisLabelx1, ylabels=thisLabely1)
+
+    mmGroup.defineHistogram('sector_CSide_eta2_ontrack,stationPhi_CSide_eta2_ontrack;Occupancy_CSide_eta2_PCB_ontrack', type='TH2F', title='Occupancy CSide eta2 PCB ontrack; ; ;', path='Occupancy_ontrack', xbins=24, xmin=0, xmax=24., ybins=16, ymin=1, ymax=17,xlabels=thisLabelx1, ylabels=thisLabely1)
+
+    thisLabelx2,thisLabely2=getMMLabel("x_lab_occ_eta1","y_lab_occ_eta1")
+
+    mmGroup.defineHistogram('sector_ASide_eta1,stationPhi_ASide_eta1;Occupancy_ASide_eta1_PCB', type='TH2F', title='Occupancy ASide eta1 PCB; ; ;', path='Occupancy', xbins=40, xmin=0, xmax=40., ybins=16, ymin=1, ymax=17,xlabels=thisLabelx2, ylabels=thisLabely2)
+
+    mmGroup.defineHistogram('sector_ASide_eta1_ontrack,stationPhi_ASide_eta1_ontrack;Occupancy_ASide_eta1_PCB_ontrack', type='TH2F', title='Occupancy ASide eta1 PCB ontrack; ; ;', path='Occupancy_ontrack', xbins=40, xmin=0, xmax=40., ybins=16, ymin=1, ymax=17,xlabels=thisLabelx2, ylabels=thisLabely2)
+
+    thisLabelx3,thisLabely3=getMMLabel("x_lab_occ_eta2","y_lab_occ_eta2")
+
+    mmGroup.defineHistogram('sector_ASide_eta2,stationPhi_ASide_eta2;Occupancy_ASide_eta2_PCB', type='TH2F', title='Occupancy ASide eta2 PCB; ; ;', path='Occupancy', xbins=24, xmin=0, xmax=24., ybins=16, ymin=1, ymax=17,xlabels=thisLabelx3, ylabels=thisLabely3)
+
+    mmGroup.defineHistogram('sector_ASide_eta2_ontrack,stationPhi_ASide_eta2_ontrack;Occupancy_ASide_eta2_PCB_ontrack', type='TH2F', title='Occupancy ASide eta2 PCB ontrack; ; ;', path='Occupancy_ontrack', xbins=24, xmin=0, xmax=24., ybins=16, ymin=1, ymax=17,xlabels=thisLabelx3, ylabels=thisLabely3)
+
+    thisLabely4=getMMLabelY("y_lab_lb_CSide_eta2")
+
+    mmGroup.defineHistogram('lb_mon,sector_lb_CSide_eta2;Occupancy_lb_CSide_eta2_PCB', type='TH2F', title="Occupancy lb CSide eta2 PCB; ; ;", path='Occupancy', xbins=100,xmin=-0.5,xmax=99.5,ymin=1, ymax=49,ylabels=thisLabely4,opt='kAddBinsDynamically')
+
+    mmGroup.defineHistogram('lb_ontrack,sector_lb_CSide_eta2_ontrack;Occupancy_lb_CSide_eta2_PCB_ontrack', type='TH2F', title="Occupancy lb CSide eta2 PCB ontrack; ; ;", path='Occupancy_ontrack', xbins=100,xmin=-0.5,xmax=99.5,ymin=1, ymax=49, ylabels=thisLabely4, opt='kAddBinsDynamically')
+
+    thisLabely5=getMMLabelY("y_lab_lb_CSide_eta1")
+
+    mmGroup.defineHistogram('lb_mon,sector_lb_CSide_eta1;Occupancy_lb_CSide_eta1_PCB', type='TH2F', title="Occupancy lb CSide eta1 PCB; ; ;", path='Occupancy', xbins=100,xmin=-0.5,xmax=99.5,ymin=1, ymax=81,ylabels=thisLabely5,opt='kAddBinsDynamically')
+
+    mmGroup.defineHistogram('lb_ontrack,sector_lb_CSide_eta1_ontrack;Occupancy_lb_CSide_eta1_PCB_ontrack', type='TH2F', title="Occupancy lb CSide eta1 PCB ontrack; ; ;", path='Occupancy_ontrack', xbins=100,xmin=-0.5,xmax=99.5,ymin=1, ymax=81,ylabels=thisLabely5,opt='kAddBinsDynamically')
+
+    thisLabely6=getMMLabelY("y_lab_lb_ASide_eta1")
+
+    mmGroup.defineHistogram('lb_mon,sector_lb_ASide_eta1;Occupancy_lb_ASide_eta1_PCB', type='TH2F', title="Occupancy lb ASide eta1 PCB; ; ;", path='Occupancy', xbins=100,xmin=-0.5,xmax=99.5,ymin=1, ymax=81,ylabels=thisLabely6,opt='kAddBinsDynamically')
+
+    mmGroup.defineHistogram('lb_ontrack,sector_lb_ASide_eta1_ontrack;Occupancy_lb_ASide_eta1_PCB_ontrack', type='TH2F', title="Occupancy lb ASide eta1 PCB ontrack; ; ;", path='Occupancy_ontrack', xbins=100,xmin=-0.5,xmax=99.5,ymin=1, ymax=81,ylabels=thisLabely6,opt='kAddBinsDynamically')
+
+    thisLabely7=getMMLabelY("y_lab_lb_ASide_eta2")
+
+    mmGroup.defineHistogram('lb_mon,sector_lb_ASide_eta2;Occupancy_lb_ASide_eta2_PCB', type='TH2F', title="Occupancy lb ASide eta2 PCB; ; ;", path='Occupancy', xbins=100,xmin=-0.5,xmax=99.5,ymin=1, ymax=49,ylabels=thisLabely7,opt='kAddBinsDynamically')
+
+    mmGroup.defineHistogram('lb_ontrack,sector_lb_ASide_eta2_ontrack;Occupancy_lb_ASide_eta2_PCB_ontrack', type='TH2F', title="Occupancy lb ASide eta2 PCB ontrack; ; ;", path='Occupancy_ontrack', xbins=100,xmin=-0.5,xmax=99.5,ymin=1, ymax=49,ylabels=thisLabely7,opt='kAddBinsDynamically')
+
+    side = ["CSide","ASide"]
+    sector = ["MMS","MML"]
+    etasector  = ["1","2"]
+    for iside in side:
+
+        if iside=="ASide":
+            thisLabelx11,thisLabely11=getMMLabel("x_lab_occ_ASide","y_lab_occ_ASide")
+        if iside=="CSide":
+            thisLabelx11,thisLabely11=getMMLabel("x_lab_occ_CSide","y_lab_occ_CSide")
+
+        MM_SideGroup="MM_sideGroup{0}".format(iside)
+        mmSideGroup=helper.addGroup(mmMonAlg, MM_SideGroup, "Muon/MuonRawDataMonitoring/MM/"+iside)
+        
+        # Histograms for each sector
+        phimax=8
+        multipletmin=1
+        multipletmax=2
+        for isector in sector:
+            for phi in range(1, phimax+1):
+                title_MMSummary="Number of strips per cluster,"+iside+" "+isector+" stPhi "+str(phi)   
+                var="sector_strip_"+iside+"_"+isector+"_phi"+str(phi)+",strip_number_"+iside+"_"+isector+"_phi"+str(phi)+";Strip_number_pergap_"+iside+"_"+isector+"stPhi"+str(phi)
+                mmSideGroup.defineHistogram(var, type='TH2F', title=title_MMSummary+"; ;Strip Number",      path='Number_of_strips_percluster_perPhiSector',   xbins=16, xmin=0, xmax=16, xlabels=thisLabelx11, ybins=5120, ymin=0., ymax=5120.)
+                for eta in etasector:
+                    for multi in range(multipletmin, multipletmax+1):
+                        for gas_gap in range(1,5):
+
+                            # Histograms for each layer
+
+                            title_MMSummary_charge="Charge "+iside+" "+isector+" stPhi"+str(phi)+" stEta"+str(eta)+" multiplet"+str(multi)+" gap"+str(gas_gap)
+                            var1="charge_"+iside+"_sector_"+isector+"_phi"+str(phi)+"_stationEta"+str(eta)+"_multiplet"+str(multi)+"_gas_gap"+str(gas_gap)+";Charge_"+iside+"_"+isector+"_stPhi"+str(phi)+"_stEta"+str(eta)+"_multiplet"+str(multi)+"_gap"+str(gas_gap)
+                            mmSideGroup.defineHistogram(var1,  type='TH1F', title=title_MMSummary_charge+';Charge [fC];Number of Entries',path='Charge_perLayer',   xbins=120, xmin=0., xmax=1200.)
+                            title_MMSummary_angle="uTPC angle "+iside+" "+isector+" stPhi"+str(phi)+" stEta"+str(eta)+" multiplet"+str(multi)+" gap"+str(gas_gap)
+                            var3="mu_TPC_angle_"+iside+"_sector_"+isector+"_phi"+str(phi)+"_stationEta"+str(eta)+"_multiplet"+str(multi)+"_gas_gap"+str(gas_gap)+";uTPCangle_"+iside+"_"+isector+"_stPhi"+str(phi)+"_stEta"+str(eta)+"_multiplet"+str(multi)+"_gap"+str(gas_gap)
+                            mmSideGroup.defineHistogram(var3,  type='TH1F', title=title_MMSummary_angle+"; #muTPC angle [degrees];Number of Entries",path='uTPC_angle_perLayer',    xbins=2000, xmin=-100, xmax=100)
+
+        for gas1 in range(1, 5):
+            for multi1 in range(1, 3):
+                title_ontrack="Posy vs Posx "+iside+" multiplet"+str(multi1)+" gap"+str(gas1)+" ontrack"
+                var_ontrack="x_"+iside+"_multiplet"+str(multi1)+"_gas_gap_"+str(gas1)+"_ontrack,y_"+iside+"_multiplet"+str(multi1)+"_gas_gap_"+str(gas1)+"_ontrack;Posy_vs_Posx_"+iside+"_multiplet"+str(multi1)+"_gas_gap_"+str(gas1)+"_ontrack"
+                mmSideGroup.defineHistogram(var_ontrack, type='TH2F', title=title_ontrack+";MM-GlobalX [mm];MM-GlobalY [mm];", path='PosY_vs_Posx_perLayer_ontrack',xbins=500, xmin=-5000, xmax=5000., ybins=500, ymin=-5000.,ymax=5000.)
+
+
+#    mmMonAlg.TriggerChain = ''
+
+    ####acc, seq = helper.result()
+    acc = helper.result()
+    result.merge(acc)
+    return result
+
+if __name__=='__main__':
+    # Setup the Run III behavior
+    from AthenaCommon.Configurable import Configurable
+    Configurable.configurableRun3Behavior = 1
+
+    from AthenaCommon.Constants import DEBUG
+    
+    # Set the Athena configuration flags
+    from AthenaConfiguration.AllConfigFlags import ConfigFlags
+    #ConfigFlags.Input.Files = ['/afs/cern.ch/work/e/elrossi/DQ_Run3/WorkDir/group.det-muon/group.det-muon.21673292.EXT1._000048.ESD.pool.root']
+    #ConfigFlags.Input.Files = ['/afs/cern.ch/work/e/elrossi/DQ_Run3/WorkDir/group.det-muon_Sym/group.det-muon.21823259.EXT1._000045_uTPC.ESD.pool.root']
+    #ConfigFlags.Input.Files = ["/afs/cern.ch/user/b/bigliett/work/DQ/group.det-muon.DiMuon10_100GeV.ESD.rel213_2020-06-18T2149_R3S_uTPC_v01_EXT1/group.det-muon.21673283.EXT1._000037.ESD.pool.root"]
+    #ConfigFlags.Input.Files = ['/afs/cern.ch/work/e/elrossi/DQ_updated_308/WorkDir/group.det-muon/group.det-muon.22415666.EXT1._000048.ESD.pool.root']
+    ConfigFlags.Input.Files = ['/afs/cern.ch/work/e/elrossi/DQ_Run3/WorkDir/group.det-muon_Sym/group.det-muon.21670802.EXT1._000006.ESD.pool.root','/afs/cern.ch/work/e/elrossi/DQ_updated/WorkDir/group.det-muon_Sym/group.det-muon.21670802.EXT1._000045.ESD.pool.root','/afs/cern.ch/work/e/elrossi/DQ_updated/WorkDir/group.det-muon_Sym/group.det-muon.21670802.EXT1._000030.ESD.pool.root','/afs/cern.ch/work/e/elrossi/DQ_updated/WorkDir/group.det-muon_Sym/group.det-muon.21670802.EXT1._000046.ESD.pool.root','/afs/cern.ch/work/e/elrossi/DQ_updated/WorkDir/group.det-muon_Sym/group.det-muon.21670802.EXT1._000014.ESD.pool.root']
+    #from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
+  #  ConfigFlags.Input.isMC = True
+    ConfigFlags.Output.HISTFileName = 'monitor.root'
+
+    ConfigFlags.Detector.GeometryMM=True
+    ConfigFlags.Muon.doMicromegas = True
+    ConfigFlags.DQ.useTrigger=False
+
+    ConfigFlags.lock()
+    ConfigFlags.dump()
+    # Initialize configuration object, add accumulator, merge, and run.
+    from AthenaConfiguration.MainServicesConfig import MainServicesCfg 
+    from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
+    cfg = MainServicesCfg(ConfigFlags)
+    cfg.merge(PoolReadCfg(ConfigFlags))
+    
+    mmMonitorAcc  =  MMMonitoringConfig(ConfigFlags)
+    mmMonitorAcc.OutputLevel=DEBUG
+    cfg.merge(mmMonitorAcc)
+    #cfg.printConfig(withDetails=True, summariseProps = True)  
+    # number of events selected in the ESD
+    cfg.run(1000)
diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/python/MMRawMonLabels.py b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/python/MMRawMonLabels.py
new file mode 100644
index 0000000000000000000000000000000000000000..db27532b997cb9a97c08173e36a4c615ac0edb0f
--- /dev/null
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/python/MMRawMonLabels.py
@@ -0,0 +1,36 @@
+#                                                           
+#Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+#
+
+#x-y labels for occupancy plots
+ 
+
+x_lab_occ_etaminus1=['#eta-1 ml1 gp1 PCB 1','#eta-1 ml1 gp1 PCB 2','#eta-1 ml1 gp1 PCB 3','#eta-1 ml1 gp1 PCB 4','#eta-1 ml1 gp1 PCB 5', '#eta-1 ml1 gp2 PCB 1','#eta-1 ml1 gp2 PCB 2','#eta-1 ml1 gp2 PCB 3','#eta-1 ml1 gp2 PCB 4','#eta-1 ml1 gp2 PCB 5', '#eta-1 ml1 gp3 PCB 1','#eta-1 ml1 gp3 PCB 2','#eta-1 ml1 gp3 PCB 3','#eta-1 ml1 gp3 PCB 4', '#eta-1 ml1 gp3 PCB 5', '#eta-1 ml1 gp4 PCB 1','#eta-1 ml1 gp4 PCB 2','#eta-1 ml1 gp4 PCB 3','#eta-1 ml1 gp4 PCB 4','#eta-1 ml1 gp4 PCB 5','#eta-1 ml2 gp1 PCB 1','#eta-1 ml2 gp1 PCB 2','#eta-1 ml2 gp1 PCB 3','#eta-1 ml2 gp1 PCB 4','#eta-1 ml2 gp1 PCB 5','#eta-1 ml2 gp2 PCB 1','#eta-1 ml2 gp2 PCB 2','#eta-1 ml2 gp2 PCB 3','#eta-1 ml2 gp2 PCB 4','#eta-1 ml2 gp2 PCB 5','#eta-1 ml2 gp3 PCB 1','#eta-1 ml2 gp3 PCB 2','#eta-1 ml2 gp3 PCB 3','#eta-1 ml2 gp3 PCB 4','#eta-1 ml2 gp3 PCB 5','#eta-1 ml2 gp4 PCB 1','#eta-1 ml2 gp4 PCB 2','#eta-1 ml2 gp4 PCB 3','#eta-1 ml2 gp4 PCB 4','#eta-1 ml2 gp4 PCB 5']
+y_lab_occ_etaminus1=['#phi1 MMS','#phi1 MML','#phi2 MMS','#phi2 MML','#phi3 MMS','#phi3 MML','#phi4 MMS','#phi4 MML','#phi5 MMS','#phi5 MML','#phi6 MMS','#phi6 MML','#phi7 MMS','#phi7 MML','#phi8 MMS','#phi8 MML']
+
+
+x_lab_occ_etaminus2=['#eta-2 ml1 gp1 PCB 1','#eta-2 ml1 gp1 PCB 2','#eta-2 ml1 gp1 PCB 3', '#eta-2 ml1 gp2 PCB 1','#eta-2 ml1 gp2 PCB 2','#eta-2 ml1 gp2 PCB 3', '#eta-2 ml1 gp3 PCB 1','#eta-2 ml1 gp3 PCB 2','#eta-2 ml1 gp3 PCB 3', '#eta-2 ml1 gp4 PCB 1','#eta-2 ml1 gp4 PCB 2','#eta-2 ml1 gp4 PCB 3','#eta-2 ml2 gp1 PCB 1','#eta-2 ml2 gp1 PCB 2','#eta-2 ml2 gp1 PCB 3','#eta-2 ml2 gp2 PCB 1','#eta-2 ml2 gp2 PCB 2','#eta-2 ml2 gp2 PCB 3','#eta-2 ml2 gp3 PCB 1','#eta-2 ml2 gp3 PCB 2','#eta-2 ml2 gp3 PCB 3','#eta-2 ml2 gp4 PCB 1','#eta-2 ml2 gp4 PCB 2','#eta-2 ml2 gp4 PCB 3']
+y_lab_occ_etaminus2=['#phi1 MMS','#phi1 MML','#phi2 MMS','#phi2 MML','#phi3 MMS','#phi3 MML','#phi4 MMS','#phi4 MML','#phi5 MMS','#phi5 MML','#phi6 MMS','#phi6 MML','#phi7 MMS','#phi7 MML','#phi8 MMS','#phi8 MML']
+
+x_lab_occ_ASide=['#eta1 ml1 gp1','#eta1 ml1 gp2', '#eta1 ml1 gp3', '#eta1 ml1 gp4', '#eta1 ml2 gp1','#eta1 ml2 gp2','#eta1 ml2 gp3','#eta1 ml2 gp4','#eta2 ml1 gp1','#eta2 ml1 gp2','#eta2 ml1 gp3','#eta2 ml1 gp4','#eta2 ml2 gp1','#eta2 ml2 gp2','#eta2 ml2 gp3','#eta2 ml2 gp4']
+y_lab_occ_ASide=['#phi1 MMS','#phi1 MML','#phi2 MMS','#phi2 MML','#phi3 MMS','#phi3 MML','#phi4 MMS','#phi4 MML','#phi5 MMS','#phi5 MML','#phi6 MMS','#phi6 MML','#phi7 MMS','#phi7 MML','#phi8 MMS','#phi8 MML']
+
+
+x_lab_occ_CSide=['#eta-2 ml1 gp1', '#eta-2 ml1 gp2', '#eta-2 ml1 gp3', '#eta-2 ml1 gp4','#eta-2 ml2 gp1','#eta-2 ml2gp2','#eta-2 ml2 gp3','#eta-2 ml2gp4','#eta-1 ml1 gp1','#eta-1 ml1 gp2','#eta-1 ml1 gp3', '#eta-1 ml1 gp4','#eta-1 ml2 gp1','#eta-1 ml2 gp2','#eta-1 ml2 gp3','#eta-1 ml2 gp4']
+y_lab_occ_CSide=['#phi1 MMS','#phi1 MML','#phi2 MMS','#phi2 MML','#phi3 MMS','#phi3 MML','#phi4 MMS','#phi4 MML','#phi5 MMS','#phi5 MML','#phi6 MMS','#phi6 MML','#phi7 MMS','#phi7 MML','#phi8 MMS','#phi8 MML']
+
+
+
+x_lab_occ_eta1=['#eta1 ml1 gp1 PCB 1','#eta1 ml1 gp1 PCB 2','#eta1 ml1 gp1 PCB 3','#eta1 ml1 gp1 PCB 4','#eta1 ml1 gp1 PCB 5', '#eta1 ml1 gp2 PCB 1','#eta1 ml1 gp2 PCB 2','#eta1 ml1 gp2 PCB 3','#eta1 ml1 gp2 PCB 4','#eta1 ml1 gp2 PCB 5', '#eta1 ml1 gp3 PCB 1','#eta1 ml1 gp3 PCB 2','#eta1 ml1 gp3 PCB 3','#eta1 ml1 gp3 PCB 4', '#eta1 ml1 gp3 PCB 5', '#eta1 ml1 gp4 PCB 1','#eta1 ml1 gp4 PCB 2','#eta1 ml1 gp4 PCB 3','#eta1 ml1 gp4 PCB 4','#eta1 ml1 gp4 PCB 5','#eta1 ml2 gp1 PCB 1','#eta1 ml2 gp1 PCB 2','#eta1 ml2 gp1 PCB 3','#eta1 ml2 gp1 PCB 4','#eta1 ml2 gp1 PCB 5','#eta1 ml2 gp2 PCB 1','#eta1 ml2 gp2 PCB 2','#eta1 ml2 gp2 PCB 3','#eta1 ml2 gp2 PCB 4','#eta1 ml2 gp2 PCB 5','#eta1 ml2 gp3 PCB 1','#eta1 ml2 gp3 PCB 2','#eta1 ml2 gp3 PCB 3','#eta1 ml2 gp3 PCB 4','#eta1 ml2 gp3 PCB 5','#eta1 ml2 gp4 PCB 1','#eta1 ml2 gp4 PCB 2','#eta1 ml2 gp4 PCB 3','#eta1 ml2 gp4 PCB 4','#eta1 ml2 gp4 PCB 5']
+y_lab_occ_eta1=['#phi1 MMS','#phi1 MML','#phi2 MMS','#phi2 MML','#phi3 MMS','#phi3 MML','#phi4 MMS','#phi4 MML','#phi5 MMS','#phi5 MML','#phi6 MMS','#phi6 MML','#phi7 MMS','#phi7 MML','#phi8 MMS','#phi8 MML']
+
+x_lab_occ_eta2=['#eta2 ml1 gp1 PCB 1','#eta2 ml1 gp1 PCB 2','#eta2 ml1 gp1 PCB 3', '#eta2 ml1 gp2 PCB 1','#eta2 ml1 gp2 PCB 2','#eta2 ml1 gp2 PCB 3', '#eta2 ml1 gp3 PCB 1','#eta2 ml1 gp3 PCB 2','#eta2 ml1 gp3 PCB 3', '#eta2 ml1 gp4 PCB 1','#eta2 ml1 gp4 PCB 2','#eta2 ml1 gp4 PCB 3','#eta2 ml2 gp1 PCB 1','#eta2 ml2 gp1 PCB 2','#eta2 ml2 gp1 PCB 3','#eta2 ml2 gp2 PCB 1','#eta2 ml2 gp2 PCB 2','#eta2 ml2 gp2 PCB 3','#eta2 ml2 gp3 PCB 1','#eta2 ml2 gp3 PCB 2','#eta2 ml2 gp3 PCB 3','#eta2 ml2 gp4 PCB 1','#eta2 ml2 gp4 PCB 2','#eta2 ml2 gp4 PCB 3']
+y_lab_occ_eta2=['#phi1 MMS','#phi1 MML','#phi2 MMS','#phi2 MML','#phi3 MMS','#phi3 MML','#phi4 MMS','#phi4 MML','#phi5 MMS','#phi5 MML','#phi6 MMS','#phi6 MML','#phi7 MMS','#phi7 MML','#phi8 MMS','#phi8 MML']
+
+y_lab_lb_ASide_eta1=['#eta1 ml1 gp1 PCB 1 MMS','#eta1 ml1 gp1 PCB 2 MMS','#eta1 ml1 gp1 PCB 3 MMS','#eta1 ml1 gp1 PCB 4 MMS','#eta1 ml1 gp1 PCB 5 MMS','#eta1 ml1 gp1 PCB 1 MML','#eta1 ml1 gp1 PCB 2 MML','#eta1 ml1 gp1 PCB 3 MML','#eta1 ml1 gp1 PCB 4 MML','#eta1 ml1 gp1 PCB 5 MML','#eta1 ml1 gp2 PCB 1 MMS','#eta1 ml1 gp2 PCB 2 MMS','#eta1 ml1 gp2 PCB 3 MMS','#eta1 ml1 gp2 PCB 4 MMS','#eta1 ml1 gp2 PCB 5 MMS','#eta1 ml1 gp2 PCB 1 MML','#eta1 ml1 gp2 PCB 2 MML','#eta1 ml1 gp2 PCB 3 MML','#eta1 ml1 gp2 PCB 4 MML','#eta1 ml1 gp2 PCB 5 MML', '#eta1 ml1 gp3 PCB 1 MMS','#eta1 ml1 gp3 PCB 2 MMS','#eta1 ml1 gp3 PCB 3 MMS','#eta1 ml1 gp3 PCB 4 MMS','#eta1 ml1 gp3 PCB 5 MMS','#eta1 ml1 gp3 PCB 1 MML','#eta1 ml1 gp3 PCB 2 MML','#eta1 ml1 gp3 PCB 3 MML','#eta1 ml1 gp3 PCB 4 MML','#eta1 ml1 gp3 PCB 5 MML', '#eta1 ml1 gp4 PCB 1 MMS','#eta1 ml1 gp4 PCB 2 MMS','#eta1 ml1 gp4 PCB 3 MMS','#eta1 ml1 gp4 PCB 4 MMS','#eta1 ml1 gp4 PCB 5 MMS','#eta1 ml1 gp4 PCB 1 MML','#eta1 ml1 gp4 PCB 2 MML','#eta1 ml1 gp4 PCB 3 MML','#eta1 ml1 gp4 PCB 4 MML','#eta1 ml1 gp4 PCB 5 MML', '#eta1 ml2 gp1 PCB 1 MMS','#eta1 ml2 gp1 PCB 2 MMS','#eta1 ml2 gp1 PCB 3 MMS','#eta1 ml2 gp1 PCB 4 MMS','#eta1 ml2 gp1 PCB 5 MMS','#eta1 ml2 gp1 PCB 1 MML','#eta1 ml2 gp1 PCB 2 MML','#eta1 ml2 gp1 PCB 3 MML','#eta1 ml2 gp1 PCB 4 MML','#eta1 ml2 gp1 PCB 5 MML','#eta1 ml2 gp2 PCB 1 MMS','#eta1 ml2 gp2 PCB 2 MMS','#eta1 ml2 gp2 PCB 3 MMS','#eta1 ml2 gp2 PCB 4 MMS','#eta1 ml2 gp2 PCB 5 MMS','#eta1 ml2 gp2 PCB 1 MML','#eta1 ml2 gp2 PCB 2 MML','#eta1 ml2 gp2 PCB 3 MML','#eta1 ml2 gp2 PCB 4 MML','#eta1 ml2 gp2 PCB 5 MML','#eta1 ml2 gp3 PCB 1 MMS','#eta1 ml2 gp3 PCB 2 MMS','#eta1 ml2 gp3 PCB 3 MMS','#eta1 ml2 gp3 PCB 4 MMS','#eta1 ml2 gp3 PCB 5 MMS','#eta1 ml2 gp3 PCB 1 MML','#eta1 ml2 gp3 PCB 2 MML','#eta1 ml2 gp3 PCB 3 MML','#eta1 ml2 gp3 PCB 4 MML','#eta1 ml2 gp3 PCB 5 MML','#eta1 ml2 gp4 PCB 1 MMS','#eta1 ml2 gp4 PCB 2 MMS','#eta1 ml2 gp4 PCB 3 MMS','#eta1 ml2 gp4 PCB 4 MMS','#eta1 ml2 gp4 PCB 5 MMS','#eta1 ml2 gp4 PCB 1 MML','#eta1 ml2 gp4 PCB 2 MML','#eta1 ml2 gp4 PCB 3 MML','#eta1 ml2 gp4 PCB 4 MML','#eta1 ml2 gp4 PCB 5 MML']
+
+y_lab_lb_ASide_eta2=['#eta2 ml1 gp1 PCB 1 MMS','#eta2 ml1 gp1 PCB 2 MMS','#eta2 ml1 gp1 PCB 3 MMS','#eta2 ml1 gp1 PCB 1 MML','#eta2 ml1 gp1 PCB 2 MML','#eta2 ml1 gp1 PCB 3 MML','#eta2 ml1 gp2 PCB 1 MMS','#eta2 ml1 gp2 PCB 2 MMS','#eta2 ml1 gp2 PCB 3 MMS','#eta2 ml1 gp2 PCB 1 MML','#eta2 ml1 gp2 PCB 2 MML','#eta2 ml1 gp2 PCB 3 MML','#eta2 ml1 gp3 PCB 1 MMS','#eta2 ml1 gp3 PCB 2 MMS','#eta2 ml1 gp3 PCB 3 MMS','#eta2 ml1 gp3 PCB 1 MML','#eta2 ml1 gp3 PCB 2 MML','#eta2 ml1 gp3 PCB 3 MML','#eta2 ml1 gp4 PCB 1 MMS','#eta2 ml1 gp4 PCB 2 MMS','#eta2 ml1 gp4 PCB 3 MMS','#eta2 ml1 gp4 PCB 1 MML','#eta2 ml1 gp4 PCB 2 MML','#eta2 ml1 gp4 PCB 3 MML','#eta2 ml2 gp1 PCB 1 MMS','#eta2 ml2 gp1 PCB 2 MMS','#eta2 ml2 gp1 PCB 3 MMS','#eta2 ml2 gp1 PCB 1 MML','#eta2 ml2 gp1 PCB 2 MML','#eta2 ml2 gp1 PCB 3 MML','#eta2 ml2 gp2 PCB 1 MMS','#eta2 ml2 gp2 PCB 2 MMS','#eta2 ml2 gp2 PCB 3 MMS','#eta2 ml2 gp2 PCB 1 MML','#eta2 ml2 gp2 PCB 2 MML','#eta2 ml2 gp2 PCB 3 MML','#eta2 ml2 gp3 PCB 1 MMS','#eta2 ml2 gp3 PCB 2 MMS','#eta2 ml2 gp3 PCB 3 MMS','#eta2 ml2 gp3 PCB 1 MML','#eta2 ml2 gp3 PCB 2 MML','#eta2 ml2 gp3 PCB 3 MML','#eta2 ml2 gp4 PCB 1 MMS','#eta2 ml2 gp4 PCB 2 MMS','#eta2 ml2 gp4 PCB 3 MMS','#eta2 ml2 gp4 PCB 1 MML','#eta2 ml2 gp4 PCB 2 MML','#eta2 ml2 gp4 PCB 3 MML']
+
+y_lab_lb_CSide_eta2=['#eta-2 ml1 gp1 PCB 1 MMS','#eta-2 ml1 gp1 PCB 2 MMS','#eta-2 ml1 gp1 PCB 3 MMS','#eta-2 ml1 gp1 PCB 1 MML','#eta-2 ml1 gp1 PCB 2 MML','#eta-2 ml1 gp1 PCB 3 MML', '#eta-2 ml1 gp2 PCB 1 MMS','#eta-2 ml1 gp2 PCB 2 MMS','#eta-2 ml1 gp2 PCB 3 MMS','#eta-2 ml1 gp2 PCB 1 MML','#eta-2 ml1 gp2 PCB 2 MML','#eta-2 ml1 gp2 PCB 3 MML', '#eta-2 ml1 gp3 PCB 1 MMS','#eta-2 ml1 gp3 PCB 2 MMS','#eta-2 ml1 gp3 PCB 3 MMS','#eta-2 ml1 gp3 PCB 1 MML','#eta-2 ml1 gp3 PCB 2 MML','#eta-2 ml1 gp3 PCB 3 MML', '#eta-2 ml1 gp4 PCB 1 MMS','#eta-2 ml1 gp4 PCB 2 MMS','#eta-2 ml1 gp4 PCB 3 MMS','#eta-2 ml1 gp4 PCB 1 MML','#eta-2 ml1 gp4 PCB 2 MML','#eta-2 ml1 gp4 PCB 3 MML','#eta-2 ml2 gp1 PCB 1 MMS','#eta-2 ml2 gp1 PCB 2 MMS','#eta-2 ml2 gp1 PCB 3 MMS','#eta-2 ml2 gp1 PCB 1 MML','#eta-2 ml2 gp1 PCB 2 MML','#eta-2 ml2 gp1 PCB 3 MML','#eta-2 ml2 gp2 PCB 1 MMS','#eta-2 ml2 gp2 PCB 2 MMS','#eta-2 ml2 gp2 PCB 3 MMS','#eta-2 ml2 gp2 PCB 1 MML','#eta-2 ml2 gp2 PCB 2 MML','#eta-2 ml2 gp2 PCB 3 MML','#eta-2 ml2 gp3 PCB 1 MMS','#eta-2 ml2 gp3 PCB 2 MMS','#eta-2 ml2 gp3 PCB 3 MMS','#eta-2 ml2 gp3 PCB 1 MML','#eta-2 ml2 gp3 PCB 2 MML','#eta-2 ml2 gp3 PCB 3 MML','#eta-2 ml2 gp4 PCB 1 MMS','#eta-2 ml2 gp4 PCB 2 MMS','#eta-2 ml2 gp4 PCB 3 MMS','#eta-2 ml2 gp4 PCB 1 MML','#eta-2 ml2 gp4 PCB 2 MML','#eta-2 ml2 gp4 PCB 3 MML']
+
+y_lab_lb_CSide_eta1=['#eta-1 ml1 gp1 PCB 1 MMS','#eta-1 ml1 gp1 PCB 2 MMS','#eta-1 ml1 gp1 PCB 3 MMS','#eta-1 ml1 gp1 PCB 4 MMS','#eta-1 ml1 gp1 PCB 5 MMS','#eta-1 ml1 gp1 PCB 1 MML','#eta-1 ml1 gp1 PCB 2 MML','#eta-1 ml1 gp1 PCB 3 MML','#eta-1 ml1 gp1 PCB 4 MML','#eta-1 ml1 gp1 PCB 5 MML','#eta-1 ml1 gp2 PCB 1 MMS','#eta-1 ml1 gp2 PCB 2 MMS','#eta-1 ml1 gp2 PCB 3 MMS','#eta-1 ml1 gp2 PCB 4 MMS','#eta-1 ml1 gp2 PCB 5 MMS','#eta-1 ml1 gp2 PCB 1 MML','#eta-1 ml1 gp2 PCB 2 MML','#eta-1 ml1 gp2 PCB 3 MML','#eta-1 ml1 gp2 PCB 4 MML','#eta-1 ml1 gp2 PCB 5 MML','#eta-1 ml1 gp3 PCB 1 MMS','#eta-1 ml1 gp3 PCB 2 MMS','#eta-1 ml1 gp3 PCB 3 MMS','#eta-1 ml1 gp3 PCB 4 MMS','#eta-1 ml1 gp3 PCB 5 MMS','#eta-1 ml1 gp3 PCB 1 MML','#eta-1 ml1 gp3 PCB 2 MML','#eta-1 ml1 gp3 PCB 3 MML','#eta-1 ml1 gp3 PCB 4 MML','#eta-1 ml1 gp3 PCB 5 MML', '#eta-1 ml1 gp4 PCB 1 MMS','#eta-1 ml1 gp4 PCB 2 MMS','#eta-1 ml1 gp4 PCB 3 MMS','#eta-1 ml1 gp4 PCB 4 MMS','#eta-1 ml1 gp4 PCB 5 MMS','#eta-1 ml1 gp4 PCB 1 MMS','#eta-1 ml1 gp4 PCB 2 MMS','#eta-1 ml1 gp4 PCB 3 MMS','#eta-1 ml1 gp4 PCB 4 MMS','#eta-1 ml1 gp4 PCB 5 MMS','#eta-1 ml2 gp1 PCB 1 MMS','#eta-1 ml2 gp1 PCB 2 MMS','#eta-1 ml2 gp1 PCB 3 MMS','#eta-1 ml2 gp1 PCB 4 MMS','#eta-1 ml2 gp1 PCB 5 MMS','#eta-1 ml2 gp1 PCB 1 MML','#eta-1 ml2 gp1 PCB 2 MML','#eta-1 ml2 gp1 PCB 3 MML','#eta-1 ml2 gp1 PCB 4 MML','#eta-1 ml2 gp1 PCB 5 MML','#eta-1 ml2 gp2 PCB 1 MMS','#eta-1 ml2 gp2 PCB 2 MMS','#eta-1 ml2 gp2 PCB 3 MMS','#eta-1 ml2 gp2 PCB 4 MMS','#eta-1 ml2 gp2 PCB 5 MMS','#eta-1 ml2 gp2 PCB 1 MML','#eta-1 ml2 gp2 PCB 2 MML','#eta-1 ml2 gp2 PCB 3 MML','#eta-1 ml2 gp2 PCB 4 MML','#eta-1 ml2 gp2 PCB 5 MML','#eta-1 ml2 gp3 PCB 1 MMS','#eta-1 ml2 gp3 PCB 2 MMS','#eta-1 ml2 gp3 PCB 3 MMS','#eta-1 ml2 gp3 PCB 4 MMS','#eta-1 ml2 gp3 PCB 5 MMS','#eta-1 ml2 gp3 PCB 1 MMS','#eta-1 ml2 gp3 PCB 2 MMS','#eta-1 ml2 gp3 PCB 3 MMS','#eta-1 ml2 gp3 PCB 4 MMS','#eta-1 ml2 gp3 PCB 5 MMS','#eta-1 ml2 gp4 PCB 1 MMS','#eta-1 ml2 gp4 PCB 2 MMS','#eta-1 ml2 gp4 PCB 3 MMS','#eta-1 ml2 gp4 PCB 4 MMS','#eta-1 ml2 gp4 PCB 5 MMS','#eta-1 ml2 gp4 PCB 1 MML','#eta-1 ml2 gp4 PCB 2 MML','#eta-1 ml2 gp4 PCB 3 MML','#eta-1 ml2 gp4 PCB 4 MML','#eta-1 ml2 gp4 PCB 5 MML']
diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/share/MMMonRecOptions.py b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/share/MMMonRecOptions.py
new file mode 100644
index 0000000000000000000000000000000000000000..07d0e971ab762d20e7908cb02d2f27a9f482cfe8
--- /dev/null
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/share/MMMonRecOptions.py
@@ -0,0 +1,69 @@
+###### Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration ####### 
+
+from RecExConfig.RecFlags import rec
+from RecExConfig.RecAlgsFlags import recAlgs
+recAlgs.doTrigger=False
+
+# reat ESD don't write anything
+rec.readESD=True
+rec.doWriteAOD=False
+rec.doWriteESD=False
+rec.doWriteTAG=False
+rec.doAOD=False
+rec.doDPD=False
+rec.doESD=False
+doTAG=False
+# switch off as much as possible
+rec.doTruth=False
+rec.doRecoTiming=False
+
+rec.doShowSizeStatistics=False
+rec.readTAG=False
+rec.readRDO=False
+rec.doContainerRemapping=False
+rec.doJiveXML=False
+rec.doEdmMonitor=False
+rec.doDumpPoolInputContent=False
+rec.doHeavyIon=False
+rec.doHIP=False
+rec.doWriteBS=False
+rec.doPhysValMonHists=False
+rec.doVP1=False
+rec.doJiveXML=False
+rec.doCheckDictionary=False
+rec.doFileMetaData=False
+rec.doAODCaloCells=False
+recAlgs.doAtlfast=False
+recAlgs.doMonteCarloReact=False
+rec.doEgamma=False
+rec.CBNTAthenaAware=False
+rec.doAODSelect=False
+rec.doWritexAOD=False
+rec.doPerfMon=False
+rec.doTagRawSummary=False
+rec.doBTagging=False
+rec.doSemiDetailedPerfMon=False
+rec.doAODall=False
+rec.doTau=False
+rec.doJetMissingETTag=False
+
+recAlgs.doCaloTrkMuId=False
+recAlgs.doEFlow=False
+recAlgs.doMissingET=False
+recAlgs.doMuGirl=False
+recAlgs.doMuTag=False
+recAlgs.doMuonIDCombined=False
+recAlgs.doMuonIDStandAlone=False
+recAlgs.doStaco=False
+recAlgs.doTileMuID=False
+recAlgs.doTrackParticleCellAssociation=False
+recAlgs.doTrackRecordFilter=False
+
+rec.AutoConfiguration = [ "everything" ]
+
+from AthenaCommon.DetFlags import DetFlags      
+DetFlags.detdescr.all_setOn()
+
+
+include("RecExCommon/RecExCommon_topOptions.py")
+
diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/share/MMMonitorAlgorithm_oldCnf.py b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/share/MMMonitorAlgorithm_oldCnf.py
new file mode 100644
index 0000000000000000000000000000000000000000..76bf55240d95ba886dfa5ceba6a8c1d132f352b4
--- /dev/null
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/share/MMMonitorAlgorithm_oldCnf.py
@@ -0,0 +1,52 @@
+###### Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration ####### 
+
+from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
+athenaCommonFlags.FilesInput = ["/afs/cern.ch/user/b/bigliett/work/DQ/group.det-muon.DiMuon10_100GeV.ESD.rel213_2020-06-18T2149_R3S_uTPC_v01_EXT1/group.det-muon.21673283.EXT1._000037.ESD.pool.root"]
+
+include("MMRawDataMonitoring/MMMonRecOptions.py")
+
+from AthenaCommon.AlgSequence import AlgSequence
+topSequence = AlgSequence()
+
+from AthenaMonitoring.AthenaMonitoringConf import AthenaMonManager
+topSequence += AthenaMonManager("mmMonManager")
+
+from AthenaMonitoring.DQMonFlags import DQMonFlags
+DQMonFlags.useTrigger=False
+DQMonFlags.monManFileKey             = "MON"
+
+from AthenaCommon.AppMgr import ServiceMgr
+ServiceMgr.THistSvc.Output += [ DQMonFlags.monManFileKey()+" DATAFILE='monitoring.root' OPT='RECREATE'" ]
+
+mmMonMan = topSequence.mmMonManager
+
+from AthenaMonitoring import AthMonitorCfgHelperOld
+helper = AthMonitorCfgHelperOld(DQMonFlags,'MMAthMonitorCfg')
+
+from MMRawDataMonitoring.MMRawDataMonitoringConf import MMRawDataMonAlg
+mmMonAlg = helper.addAlgorithm(MMRawDataMonAlg,'MMMonAlg')
+
+mmMonAlg.TriggerChain = ''
+
+mmGroup = helper.addGroup(mmMonAlg,'mmMonitor','Muon/MuonRawDataMonitoring/MM/')
+
+mmGroup.defineHistogram('charge_all;Charge',  type='TH1F',
+                        title='Charge;Charge[ADC];Number of Entries',
+                        path='Overview',   xbins=20000, xmin=0., xmax=10000000.
+                       )
+mmGroup.defineHistogram('numberstrips;Number_of_strips',  type='TH1F',
+                        title='Number_of_strips;Number of strips;Number of Entries',
+                        path='Overview',   xbins=20, xmin=0., xmax=20.
+                       )
+mmGroup.defineHistogram('time_all;Time',  type='TH1F',
+                        title='Time;Time[ns];Number of Entries',
+                        path='Overview',   xbins=1000, xmin=0., xmax=100000.
+                       )
+mmGroup.defineHistogram('statEta,channel_mon;Channels_vs_StationEta',    type='TH2F',
+                            title='Channels vs Station Eta;; Channel;',
+                            path='Overview',   xbins=5, xmin=-2, xmax=3., xlabels=['#eta-2','#eta-1','','#eta1','#eta2'], ybins=5300, ymin=0., ymax=5300.
+                            )
+
+topSequence += helper.result()
+
+
diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/share/MMRaw_MonitoringOptions.py b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/share/MMRaw_MonitoringOptions.py
new file mode 100755
index 0000000000000000000000000000000000000000..b1292dab253e4c9b4b030edab19dfdc874aa44af
--- /dev/null
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/share/MMRaw_MonitoringOptions.py
@@ -0,0 +1,29 @@
+###### Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration #######
+
+from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
+isTier0Flag = not athenaCommonFlags.isOnline()
+
+if not 'MuonDQAFlags' in dir():
+    print("MuonDQAFlags.py: MuonDQAFlags not yet imported - I import them now")
+    from MuonDQAMonFlags.MuonDQAFlags import MuonDQAFlags as MuonDQAFlags
+
+mmRawMonMan = AthenaMonManager(name="MMRawMonManager",
+                                FileKey             = DQMonFlags.monManFileKey(),
+                                Environment         = DQMonFlags.monManEnvironment(),
+                                OutputLevel         = muonOutputLevel)
+
+############# MMRawDataValAlg #############
+from MMRawDataMonitoring.MMRawDataMonitoringConf import MMRawDataValAlg
+
+#This it the main tool w/ detailed histograms
+mmRawDataValAlg_main = MMRawDataValAlg(name='mmRawDataValAlg_main',
+                                       Title='MM',
+                                       OutputLevel = INFO
+                                       )
+
+mmRawMonMan.AthenaMonTools += [ mmRawDataValAlg_main ]
+
+
+topSequence += mmRawMonMan
+print mmRawMonMan
+##################################################################
diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/src/MMRawDataMonAlg.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/src/MMRawDataMonAlg.cxx
new file mode 100755
index 0000000000000000000000000000000000000000..f7c30ff74ee0096fee0c91a8db3ca1bcb70da339
--- /dev/null
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/src/MMRawDataMonAlg.cxx
@@ -0,0 +1,560 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+/////////////////////////////////////////////////////////////////////////////////////////////////////////////
+// Package : MMRawDataMonAlg
+// Authors:   M. Biglietti, E. Rossi (Roma Tre)
+// 
+//
+// DESCRIPTION:
+// Subject: MM-->Offline Muon Data Quality
+/////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+#include "MuonReadoutGeometry/MuonDetectorManager.h"
+#include "MuonReadoutGeometry/MuonStation.h"
+#include "MuonReadoutGeometry/MMReadoutElement.h"
+#include "MuonDQAUtils/MuonChamberNameConverter.h"
+#include "MuonDQAUtils/MuonChambersRange.h"
+#include "MuonCalibIdentifier/MuonFixedId.h"
+
+#include "MMRawDataMonitoring/MMRawDataMonAlg.h"
+
+#include "xAODTracking/TrackParticleContainer.h"
+#include "xAODTracking/TrackParticle.h"
+#include "xAODTracking/TrackingPrimitives.h"
+#include "MuonPrepRawData/MuonPrepDataContainer.h"
+#include "MuonRIO_OnTrack/MMClusterOnTrack.h"
+#include "AthenaMonitoring/AthenaMonManager.h"
+#include "MuonPrepRawData/MMPrepData.h"
+
+namespace {
+
+  static constexpr double const toDeg = 180/M_PI;
+
+  //1e=1.6X10-4 fC                                                                                          
+  static constexpr double conversion_charge=1.6E-04;
+
+  static const std::array<std::string,2> MM_Side = {"CSide", "ASide"};
+  static const std::array<std::string,2> MM_Sector = {"MMS", "MML"};
+  static const std::array<std::string,2> EtaSector = {"1","2"};
+
+
+  struct MMOverviewHistogramStruct {
+
+    std::vector<int> statEta_strip;
+    std::vector<int> charge_all;
+    std::vector<int> time_all;
+    std::vector<int> strip_number;
+    std::vector<int> numberofstrips_percluster;
+    std::vector<float> mu_TPC_angle;
+    std::vector<float> mu_TPC_chi2;
+    std::vector<float> R_mon;
+    std::vector<float> z_mon;
+    std::vector<float> x_mon;
+    std::vector<float> y_mon;
+    std::vector<int> stationPhi_ASide_eta1_ontrack;
+    std::vector<int> stationPhi_ASide_eta2_ontrack;
+    std::vector<int> stationPhi_CSide_eta1_ontrack;
+    std::vector<int> stationPhi_CSide_eta2_ontrack;
+    std::vector<int> sector_ASide_eta2_ontrack;
+    std::vector<int> sector_CSide_eta1_ontrack;
+    std::vector<int> sector_ASide_eta1_ontrack;
+    std::vector<int> sector_CSide_eta2_ontrack;
+    std::vector<int> sector_lb_ASide_eta1_ontrack;
+    std::vector<int> sector_lb_ASide_eta2_ontrack;
+    std::vector<int> sector_lb_CSide_eta1_ontrack;
+    std::vector<int> sector_lb_CSide_eta2_ontrack;
+    std::vector<int> stationPhi_ASide_eta1;
+    std::vector<int> stationPhi_ASide_eta2;
+    std::vector<int> stationPhi_CSide_eta1;
+    std::vector<int> stationPhi_CSide_eta2;
+    std::vector<int> sector_CSide_eta2;
+    std::vector<int> sector_ASide_eta2;
+    std::vector<int> sector_CSide_eta1;
+    std::vector<int> sector_ASide_eta1;
+    std::vector<int> sector_lb_ASide_eta1;
+    std::vector<int> sector_lb_ASide_eta2;
+    std::vector<int> sector_lb_CSide_eta1;
+    std::vector<int> sector_lb_CSide_eta2;
+
+  };
+
+  struct MMSummaryHistogramStruct {
+    
+    std::vector<int> strip_number;
+    std::vector<int> sector_strip;
+    std::vector<int> charge;
+    std::vector<float> mu_TPC_angle;
+    std::vector<float> x_ontrack;
+    std::vector<float> y_ontrack;
+  };
+
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// *********************************************************************
+// Public Methods
+// ********************************************************************* 
+
+MMRawDataMonAlg::MMRawDataMonAlg( const std::string& name, ISvcLocator* pSvcLocator )
+  :AthMonitorAlgorithm(name,pSvcLocator),
+   m_muonSelectionTool("CP::MuonSelectionTool/MuonSelectionTool"),
+   m_MMContainerKey("MM_Measurements")
+{
+  //Declare the property 
+  declareProperty("MMPrepDataContainerName",m_MMContainerKey);
+}
+
+/*---------------------------------------------------------*/
+StatusCode MMRawDataMonAlg::initialize()
+/*---------------------------------------------------------*/
+{   
+  // init message stream
+  ATH_MSG_DEBUG("initialize MMRawDataMonAlg" );
+  ATH_MSG_DEBUG("******************" );
+  ATH_MSG_DEBUG("doMMESD: " << m_doMMESD );
+  ATH_MSG_DEBUG("******************" );
+  
+  ATH_CHECK(AthMonitorAlgorithm::initialize());
+  ATH_CHECK(m_DetectorManagerKey.initialize());
+  ATH_CHECK(m_idHelperSvc.retrieve());
+
+  ATH_MSG_INFO(" Found the MuonIdHelperSvc " );
+  ATH_CHECK(m_muonKey.initialize());
+  ATH_CHECK(m_MMContainerKey.initialize() );
+  
+  ATH_MSG_DEBUG(" end of initialize " );
+  ATH_MSG_INFO("MMRawDataMonAlg initialization DONE " );
+
+  return StatusCode::SUCCESS;
+} 
+
+StatusCode MMRawDataMonAlg::fillHistograms(const EventContext& ctx) const
+{  
+  int lumiblock = -1;
+
+  lumiblock = GetEventInfo(ctx)->lumiBlock();
+
+  ATH_MSG_INFO("MMRawDataMonAlg::MM RawData Monitoring Histograms being filled" );
+
+  SG::ReadHandle<Muon::MMPrepDataContainer> mm_container(m_MMContainerKey,ctx);
+
+  ATH_MSG_INFO("****** mmContainer->size() : " << mm_container->size());
+
+  if (m_doMMESD) {
+    MMOverviewHistogramStruct overviewPlots;
+    MMSummaryHistogramStruct summaryPlots[2][2][8][2][2][4];
+
+  //loop in MMPrepDataContainer                                                                             
+         
+  for(const Muon::MMPrepDataCollection* coll : *mm_container) {
+
+    for (const Muon::MMPrepData* prd : *coll){
+
+      ATH_CHECK(fillMMOverviewVects(prd, overviewPlots));
+      ATH_CHECK(fillMMSummaryVects(prd, summaryPlots));
+      ATH_CHECK(fillMMHistograms(prd));
+    }
+  }
+
+  if (m_do_mm_overview) fillMMOverviewHistograms(overviewPlots,lumiblock);
+
+  ATH_CHECK( fillMMSummaryHistograms(summaryPlots) );
+
+  const xAOD::TrackParticleContainer* meTPContainer = nullptr;
+  ATH_CHECK(evtStore()->retrieve(meTPContainer,"ExtrapolatedMuonTrackParticles" ));
+  clusterFromTrack(meTPContainer,lumiblock);
+  
+  }
+
+ return StatusCode::SUCCESS;
+
+}
+
+StatusCode MMRawDataMonAlg::fillMMOverviewVects( const Muon::MMPrepData* prd, MMOverviewHistogramStruct& vects ) const {
+
+  Identifier Id = prd->identify();
+  const std::vector<Identifier>& stripIds = prd->rdoList();
+  unsigned int nStrips = stripIds.size();  // number of strips in this cluster (cluster size)               
+  const std::vector<uint16_t>& stripNumbers=prd->stripNumbers();
+ 
+  std::string stName   = m_idHelperSvc->mmIdHelper().stationNameString(m_idHelperSvc->mmIdHelper().stationName(Id));
+  int gas_gap          = m_idHelperSvc->mmIdHelper().gasGap(Id);
+  int stationNumber    = m_idHelperSvc->mmIdHelper().stationName(Id);
+  int stationEta       = m_idHelperSvc->mmIdHelper().stationEta(Id);
+  int stationPhi       = m_idHelperSvc->mmIdHelper().stationPhi(Id);
+  int multiplet        = m_idHelperSvc->mmIdHelper().multilayer(Id);
+  int channel          = m_idHelperSvc->mmIdHelper().channel(Id);
+   
+  // Returns the charge (number of electrons) converted in fC
+  int charge=prd->charge()*conversion_charge;
+  // Returns the time (in ns)
+  int drift_time=prd->time();
+  // Returns the microTPC angle (radians converted in degrees)
+  float mu_TPC_angle=prd->angle()*toDeg;
+  // Returns the microTPC chisq Prob.
+  float mu_TPC_chi2=prd->chisqProb();
+
+  Amg::Vector3D pos    = prd->globalPosition();
+  
+  float R=std::hypot(pos.x(),pos.y());
+
+  int PCB=get_PCB_from_channel(channel);
+
+  //MM gaps are back to back, so the direction of the drift (time) is different for the even and odd gaps -> flip for the even gaps
+
+  if (gas_gap % 2 == 0) { mu_TPC_angle = -mu_TPC_angle; } 
+  
+  vects.charge_all.push_back(charge);
+  vects.time_all.push_back(drift_time);
+  vects.numberofstrips_percluster.push_back(nStrips);
+  vects.mu_TPC_angle.push_back(mu_TPC_angle);
+  vects.mu_TPC_chi2.push_back(mu_TPC_chi2);
+  vects.x_mon.push_back(pos.x());
+  vects.y_mon.push_back(pos.y());
+  vects.z_mon.push_back(pos.z());
+  vects.R_mon.push_back(R);
+
+    
+  //MMS and MML phi sectors
+  int phisec=0;
+  if (stationNumber%2 == 0) phisec=1;
+    
+  //16 phi sectors, 8 stationPhi times 2 stName, MMS and MML
+  int sectorPhi=get_sectorPhi_from_stationPhi_stName(stationPhi,stName);  
+  
+  //Occupancy plots with PCB granularity further divided for each eta sector: -2, -1, 1, 2
+  
+  //Filling Vectors for stationEta=-2
+  if (stationEta==-2){
+    vects.sector_CSide_eta2.push_back(get_bin_for_occ_CSide_pcb_eta2_hist(stationEta,multiplet,gas_gap,PCB));
+    vects.stationPhi_CSide_eta2.push_back(sectorPhi);
+    vects.sector_lb_CSide_eta2.push_back(get_bin_for_occ_lb_CSide_pcb_eta2_hist(stationEta,multiplet,gas_gap,PCB,phisec));
+  }
+  //Filling Vectors for stationEta=-1
+  else if (stationEta==-1){
+    vects.sector_CSide_eta1.push_back(get_bin_for_occ_CSide_pcb_eta1_hist(stationEta,multiplet,gas_gap,PCB));
+    vects.stationPhi_CSide_eta1.push_back(sectorPhi);
+    vects.sector_lb_CSide_eta1.push_back(get_bin_for_occ_lb_CSide_pcb_eta1_hist(stationEta,multiplet,gas_gap,PCB,phisec));
+  }
+  //Filling Vectors for stationEta=1
+  else if (stationEta==1){
+    vects.sector_ASide_eta1.push_back(get_bin_for_occ_ASide_pcb_eta1_hist(stationEta,multiplet,gas_gap,PCB));
+    vects.stationPhi_ASide_eta1.push_back(sectorPhi);
+    vects.sector_lb_ASide_eta1.push_back(get_bin_for_occ_lb_ASide_pcb_eta1_hist(stationEta,multiplet,gas_gap,PCB,phisec));
+  }
+  //Filling Vectors for stationEta=2
+  else {
+    vects.sector_ASide_eta2.push_back(get_bin_for_occ_ASide_pcb_eta2_hist(stationEta,multiplet,gas_gap,PCB));
+    vects.stationPhi_ASide_eta2.push_back(sectorPhi);
+    vects.sector_lb_ASide_eta2.push_back(get_bin_for_occ_lb_ASide_pcb_eta2_hist(stationEta,multiplet,gas_gap,PCB,phisec));
+  }
+
+  //loop on each strip                                                                                       
+  
+  int sIdx = 0; // index-counter for the vector of Id's                                
+  for (const Identifier& id : stripIds){    
+    
+    std::string stName_strip   = m_idHelperSvc->mmIdHelper().stationNameString(m_idHelperSvc->mmIdHelper().stationName(id));
+    int stationEta_strip       = m_idHelperSvc->mmIdHelper().stationEta(id);
+
+    vects.statEta_strip.push_back(stationEta_strip);
+    vects.strip_number.push_back(stripNumbers[sIdx]);
+  }
+  return StatusCode::SUCCESS;
+}
+
+
+void MMRawDataMonAlg::fillMMOverviewHistograms( const MMOverviewHistogramStruct& vects, int lb ) const {
+
+  auto charge_all = Monitored::Collection("charge_all", vects.charge_all);
+  auto numberofstrips_percluster = Monitored::Collection("numberofstrips_percluster", vects.numberofstrips_percluster);
+  fill("mmMonitor",charge_all,numberofstrips_percluster);
+
+  auto time_all = Monitored::Collection("time_all", vects.time_all);
+  auto mu_TPC_angle=Monitored::Collection("mu_TPC_angle", vects.mu_TPC_angle);
+  auto mu_TPC_chi2=Monitored::Collection("mu_TPC_chi2", vects.mu_TPC_chi2);
+  auto strip_number = Monitored::Collection("strip_number", vects.strip_number);
+  auto statEta_strip = Monitored::Collection("statEta_strip", vects.statEta_strip);
+
+  fill("mmMonitor",time_all,mu_TPC_angle,mu_TPC_chi2,strip_number,statEta_strip);
+
+  auto x_mon = Monitored::Collection("x_mon", vects.x_mon);
+  auto y_mon = Monitored::Collection("y_mon", vects.y_mon);
+  auto z_mon = Monitored::Collection("z_mon", vects.z_mon);
+  auto R_mon = Monitored::Collection("R_mon", vects.R_mon);
+
+  fill("mmMonitor",x_mon,y_mon,z_mon,R_mon);
+    
+  auto lb_mon = Monitored::Scalar<int>("lb_mon", lb);
+    
+  auto sector_lb_CSide_eta2 = Monitored::Collection("sector_lb_CSide_eta2",vects.sector_lb_CSide_eta2);
+  auto sector_lb_CSide_eta1 = Monitored::Collection("sector_lb_CSide_eta1",vects.sector_lb_CSide_eta1);
+  auto sector_lb_ASide_eta2 = Monitored::Collection("sector_lb_ASide_eta2",vects.sector_lb_ASide_eta2);
+  auto sector_lb_ASide_eta1 = Monitored::Collection("sector_lb_ASide_eta1",vects.sector_lb_ASide_eta1);
+    
+  fill("mmMonitor",lb_mon,sector_lb_CSide_eta2,sector_lb_CSide_eta1,sector_lb_ASide_eta1,sector_lb_ASide_eta2);
+    
+  auto sector_CSide_eta2 = Monitored::Collection("sector_CSide_eta2",vects.sector_CSide_eta2);
+  auto sector_CSide_eta1 = Monitored::Collection("sector_CSide_eta1",vects.sector_CSide_eta1);
+  auto sector_ASide_eta1 = Monitored::Collection("sector_ASide_eta1",vects.sector_ASide_eta1);
+  auto sector_ASide_eta2 = Monitored::Collection("sector_ASide_eta2",vects.sector_ASide_eta2);
+  auto stationPhi_CSide_eta1 = Monitored::Collection("stationPhi_CSide_eta1",vects.stationPhi_CSide_eta1);
+  auto stationPhi_CSide_eta2 = Monitored::Collection("stationPhi_CSide_eta2",vects.stationPhi_CSide_eta2);
+  auto stationPhi_ASide_eta1 = Monitored::Collection("stationPhi_ASide_eta1",vects.stationPhi_ASide_eta1);
+  auto stationPhi_ASide_eta2 = Monitored::Collection("stationPhi_ASide_eta2",vects.stationPhi_ASide_eta2);
+  
+  fill("mmMonitor",sector_CSide_eta1,sector_CSide_eta2,sector_ASide_eta1,sector_ASide_eta2,stationPhi_CSide_eta1,stationPhi_CSide_eta2,stationPhi_ASide_eta1,stationPhi_ASide_eta2);
+    
+    
+
+}
+
+StatusCode MMRawDataMonAlg::fillMMSummaryVects( const Muon::MMPrepData* prd, MMSummaryHistogramStruct (&vects)[2][2][8][2][2][4]) const{
+
+  Identifier Id = prd->identify();
+  const std::vector<Identifier>& stripIds = prd->rdoList();
+
+  std::string stName   = m_idHelperSvc->mmIdHelper().stationNameString(m_idHelperSvc->mmIdHelper().stationName(Id));
+  int thisStationNumber    = m_idHelperSvc->mmIdHelper().stationName(Id);
+  int thisStationEta       = m_idHelperSvc->mmIdHelper().stationEta(Id);
+  int thisStationPhi       = m_idHelperSvc->mmIdHelper().stationPhi(Id);
+  int thisMultiplet        = m_idHelperSvc->mmIdHelper().multilayer(Id);
+  int thisGasgap          = m_idHelperSvc->mmIdHelper().gasGap(Id);
+  int thisCharge=prd->charge()*conversion_charge;
+
+  float thisMu_TPC_angle=prd->angle()*toDeg;
+    
+  if ( thisGasgap % 2 == 0 ) { thisMu_TPC_angle = - thisMu_TPC_angle; }
+    
+  //MMS and MML phi sectors
+  int phisec=0;
+  if (thisStationNumber%2 == 0) phisec=1;
+  
+  //CSide and ASide
+  int iside=0;
+  if(thisStationEta>0) iside=1;
+  
+  //2 eta sectors depending on Eta=+-1 (0) and +-2 (1)
+  int sectorEta=get_sectorEta_from_stationEta(thisStationEta);
+
+  auto& Vectors = vects[iside][phisec][thisStationPhi-1][sectorEta][thisMultiplet-1][thisGasgap-1];
+  
+  Vectors.mu_TPC_angle.push_back(thisMu_TPC_angle);
+  Vectors.charge.push_back(thisCharge);
+  
+  //loop on strips
+  int sIdx = 0;
+  const std::vector<uint16_t>& stripNumbers=prd->stripNumbers();
+  
+  for ( const Identifier& id : stripIds){
+    
+    int stationEta       = m_idHelperSvc->mmIdHelper().stationEta(id);
+    int gas_gap          = m_idHelperSvc->mmIdHelper().gasGap(Id);
+    int multiplet        = m_idHelperSvc->mmIdHelper().multilayer(Id); 
+
+    //    Filling Vectors for both sides, considering each strip  
+    Vectors.strip_number.push_back(stripNumbers[sIdx]);
+    Vectors.sector_strip.push_back(get_bin_for_occ_ASide_hist(stationEta,multiplet,gas_gap));
+    
+  }
+
+  return StatusCode::SUCCESS;
+}
+
+
+StatusCode MMRawDataMonAlg::fillMMSummaryHistograms( const MMSummaryHistogramStruct (&vects)[2][2][8][2][2][4]) const{
+  
+    
+  for (int iside=0;iside<2;iside++){
+    std::string MM_sideGroup = "MM_sideGroup"+MM_Side[iside];
+    
+    for (int isector=0;isector<2;isector++){
+      for( int statPhi=0; statPhi<8; statPhi++) {
+	for( int statEta=0; statEta<2; statEta++) {
+	  for( int multiplet=0; multiplet<2; multiplet++) {
+	    for( int gas_gap=0; gas_gap<4; gas_gap++) {
+	      
+	      auto& Vectors = vects[iside][isector][statPhi][statEta][multiplet][gas_gap];
+                          
+	      auto sector_strip=Monitored::Collection("sector_strip_"+MM_Side[iside]+"_"+MM_Sector[isector]+"_phi"+std::to_string(statPhi+1),Vectors.sector_strip);
+	      auto strip_number = Monitored::Collection("strip_number_"+MM_Side[iside]+"_"+MM_Sector[isector]+"_phi"+std::to_string(statPhi+1), Vectors.strip_number);
+	      
+	      fill(MM_sideGroup,strip_number,sector_strip);
+
+	      auto charge_perLayer = Monitored::Collection("charge_"+MM_Side[iside]+"_sector_"+MM_Sector[isector]+"_phi"+std::to_string(statPhi+1)+"_stationEta"+EtaSector[statEta]+"_multiplet"+std::to_string(multiplet+1)+"_gas_gap"+std::to_string(gas_gap+1), Vectors.charge);
+	      auto mu_TPC_angle_perLayer = Monitored::Collection("mu_TPC_angle_"+MM_Side[iside]+"_sector_"+MM_Sector[isector]+"_phi"+std::to_string(statPhi+1)+"_stationEta"+EtaSector[statEta]+"_multiplet"+std::to_string(multiplet+1)+"_gas_gap"+std::to_string(gas_gap+1),Vectors.mu_TPC_angle);
+
+	      fill(MM_sideGroup,charge_perLayer,mu_TPC_angle_perLayer);
+	      
+	    }
+	  }
+	}
+      }
+    }
+  }
+ 
+  return StatusCode::SUCCESS;
+    
+}
+
+StatusCode MMRawDataMonAlg::fillMMHistograms( const Muon::MMPrepData* ) const{
+
+  return StatusCode::SUCCESS;
+}
+
+                                                                                                           
+      
+void MMRawDataMonAlg::clusterFromTrack(const xAOD::TrackParticleContainer*  muonContainer, int lb) const{
+
+  MMSummaryHistogramStruct summaryPlots[2][2][4];
+  MMOverviewHistogramStruct overviewPlots;
+  int nmu=0;
+
+  for (const xAOD::TrackParticle* meTP  : *muonContainer){
+
+    if (meTP) {
+      nmu++;
+
+      // retrieve the original track                                                       
+      const Trk::Track* meTrack = meTP->track();
+      if (meTrack) {
+        // get the vector of measurements on track                                                           
+       
+	const DataVector<const Trk::MeasurementBase>* meas = meTrack->measurementsOnTrack();
+	
+	for(const Trk::MeasurementBase* it: *meas){
+	
+	  const Trk::RIO_OnTrack* rot = dynamic_cast<const Trk::RIO_OnTrack*>(it);
+	  
+	  if (rot) {
+	      
+	    Identifier rot_id = rot->identify();
+	    if (m_idHelperSvc->isMM(rot_id)) {
+	      const Muon::MMClusterOnTrack* cluster = dynamic_cast<const Muon::MMClusterOnTrack*>(rot);
+	      
+	      if (cluster) {
+		
+		std::string stName   = m_idHelperSvc->mmIdHelper().stationNameString(m_idHelperSvc->mmIdHelper().stationName(rot_id));
+		int stNumber    = m_idHelperSvc->mmIdHelper().stationName(rot_id);
+		int stEta= m_idHelperSvc->mmIdHelper().stationEta(rot_id);
+		int stPhi= m_idHelperSvc->mmIdHelper().stationPhi(rot_id);
+		int multi = m_idHelperSvc->mmIdHelper().multilayer(rot_id);
+		int gap=  m_idHelperSvc->mmIdHelper().gasGap(rot_id);
+		int ch=  m_idHelperSvc->mmIdHelper().channel(rot_id);
+                        
+		//MMS and MML phi sectors                                                                    
+		int phisec=0;
+		if (stNumber%2 == 0) phisec=1;
+		
+		int sectorPhi=get_sectorPhi_from_stationPhi_stName(stPhi,stName);
+		
+		int PCB=get_PCB_from_channel(ch);
+		
+		auto& vects=overviewPlots;
+		
+		//Occupancy plots with PCB granularity further divided for each eta sector: -2, -1, 1, 2  
+		//Filling Vectors for stationEta=-1 - cluster on track
+		if (stEta==-1){
+		  vects.stationPhi_CSide_eta1_ontrack.push_back(sectorPhi);
+		  vects.sector_CSide_eta1_ontrack.push_back(get_bin_for_occ_CSide_pcb_eta1_hist(stEta,multi,gap,PCB));
+		  vects.sector_lb_CSide_eta1_ontrack.push_back(get_bin_for_occ_lb_CSide_pcb_eta1_hist(stEta,multi,gap,PCB,phisec));
+		}
+		//Filling Vectors for stationEta=-2 - cluster on track 
+		else if (stEta==-2){
+		  vects.stationPhi_CSide_eta2_ontrack.push_back(sectorPhi);
+		  vects.sector_CSide_eta2_ontrack.push_back(get_bin_for_occ_CSide_pcb_eta2_hist(stEta,multi,gap,PCB));
+		  vects.sector_lb_CSide_eta2_ontrack.push_back(get_bin_for_occ_lb_CSide_pcb_eta2_hist(stEta,multi,gap,PCB,phisec));
+		}
+		//Filling Vectors for stationEta=1 - cluster on track 
+		else if (stEta==1){
+		  vects.stationPhi_ASide_eta1_ontrack.push_back(sectorPhi);
+		  vects.sector_ASide_eta1_ontrack.push_back(get_bin_for_occ_ASide_pcb_eta1_hist(stEta,multi,gap,PCB));
+		  vects.sector_lb_ASide_eta1_ontrack.push_back(get_bin_for_occ_lb_ASide_pcb_eta1_hist(stEta,multi,gap,PCB,phisec));
+		}
+		//Filling Vectors for stationEta=2 - cluster on track 
+		else {
+		  vects.stationPhi_ASide_eta2_ontrack.push_back(sectorPhi);
+		  vects.sector_ASide_eta2_ontrack.push_back(get_bin_for_occ_ASide_pcb_eta2_hist(stEta,multi,gap,PCB));
+		  vects.sector_lb_ASide_eta2_ontrack.push_back(get_bin_for_occ_lb_ASide_pcb_eta2_hist(stEta,multi,gap,PCB,phisec));
+		  
+		  }
+	                      
+	      } //if cluster
+	    } //isMM
+	  } // if rot
+	} // loop on meas
+	
+	for (const Trk::TrackStateOnSurface* trkState: *meTrack->trackStateOnSurfaces()) {
+	  
+	  if(!(trkState)) continue;
+	  Identifier surfaceId = (trkState)->surface().associatedDetectorElementIdentifier();
+	  if(!m_idHelperSvc->isMM(surfaceId)) continue;
+	  
+	  const Amg::Vector3D& pos    = (trkState)->trackParameters()->position();
+	  int stEta= m_idHelperSvc->mmIdHelper().stationEta(surfaceId);
+	  int multi = m_idHelperSvc->mmIdHelper().multilayer(surfaceId);
+	  int gap=  m_idHelperSvc->mmIdHelper().gasGap(surfaceId);
+
+	  //CSide and ASide                                                                                  
+	  int iside=0;
+	  if(stEta>0) iside=1;
+
+	  auto& Vectors = summaryPlots[iside][multi-1][gap-1];
+	  
+	  //Filling x-y position vectors using the trackStateonSurface 
+	    Vectors.x_ontrack.push_back(pos.x());
+	    Vectors.y_ontrack.push_back(pos.y());
+	
+	  
+	}
+      } // if meTrack
+    } // if muon
+  } //loop on muonContainer
+
+  auto& vects=overviewPlots;
+
+  auto stationPhi_CSide_eta1_ontrack = Monitored::Collection("stationPhi_CSide_eta1_ontrack",vects.stationPhi_CSide_eta1_ontrack);
+  auto stationPhi_CSide_eta2_ontrack = Monitored::Collection("stationPhi_CSide_eta2_ontrack",vects.stationPhi_CSide_eta2_ontrack);
+  auto stationPhi_ASide_eta1_ontrack = Monitored::Collection("stationPhi_ASide_eta1_ontrack",vects.stationPhi_ASide_eta1_ontrack);
+  auto stationPhi_ASide_eta2_ontrack = Monitored::Collection("stationPhi_ASide_eta2_ontrack",vects.stationPhi_ASide_eta2_ontrack);
+  auto sector_ASide_eta1_ontrack = Monitored::Collection("sector_ASide_eta1_ontrack",vects.sector_ASide_eta1_ontrack);
+  auto sector_ASide_eta2_ontrack = Monitored::Collection("sector_ASide_eta2_ontrack",vects.sector_ASide_eta2_ontrack);
+  auto sector_CSide_eta2_ontrack = Monitored::Collection("sector_CSide_eta2_ontrack",vects.sector_CSide_eta2_ontrack);                                                                                         
+  auto sector_CSide_eta1_ontrack = Monitored::Collection("sector_CSide_eta1_ontrack",vects.sector_CSide_eta1_ontrack);   
+
+  auto lb_ontrack = Monitored::Scalar<int>("lb_ontrack", lb);
+
+  auto sector_lb_CSide_eta2_ontrack = Monitored::Collection("sector_lb_CSide_eta2_ontrack",vects.sector_lb_CSide_eta2_ontrack);
+  auto sector_lb_CSide_eta1_ontrack = Monitored::Collection("sector_lb_CSide_eta1_ontrack",vects.sector_lb_CSide_eta1_ontrack);
+  auto sector_lb_ASide_eta2_ontrack = Monitored::Collection("sector_lb_ASide_eta2_ontrack",vects.sector_lb_ASide_eta2_ontrack);
+  auto sector_lb_ASide_eta1_ontrack = Monitored::Collection("sector_lb_ASide_eta1_ontrack",vects.sector_lb_ASide_eta1_ontrack);
+
+  fill("mmMonitor",stationPhi_CSide_eta1_ontrack,stationPhi_CSide_eta2_ontrack,stationPhi_ASide_eta1_ontrack,stationPhi_ASide_eta2_ontrack,sector_CSide_eta1_ontrack,sector_CSide_eta2_ontrack,sector_ASide_eta1_ontrack,sector_ASide_eta2_ontrack,sector_lb_CSide_eta2_ontrack,sector_lb_CSide_eta1_ontrack,sector_lb_ASide_eta2_ontrack,sector_lb_ASide_eta1_ontrack,lb_ontrack);
+    
+  for (int iside=0;iside<2;iside++){
+   std::string MM_sideGroup = "MM_sideGroup"+MM_Side[iside];
+   for( int multiplet=0; multiplet<2; multiplet++) {
+     for( int gas_gap=0; gas_gap<4; gas_gap++) {
+	      
+       auto& Vectors = summaryPlots[iside][multiplet][gas_gap];
+
+       auto x_ontrack = Monitored::Collection("x_"+MM_Side[iside]+"_multiplet"+std::to_string(multiplet+1)+"_gas_gap_"+std::to_string(gas_gap+1)+"_ontrack", Vectors.x_ontrack);
+       auto y_ontrack = Monitored::Collection("y_"+MM_Side[iside]+"_multiplet"+std::to_string(multiplet+1)+"_gas_gap_"+std::to_string(gas_gap+1)+"_ontrack", Vectors.y_ontrack);
+      
+       fill(MM_sideGroup,x_ontrack,y_ontrack);
+     }          
+   }
+  }
+           
+  
+}
+                                                                                                             
+        
+                                                                                                           
+         
+          
+        
+
+                                                                                                                      
+                                                                                                             
diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/src/MMRawDataUtils.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/src/MMRawDataUtils.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..1da4f3cf651d3a067b71705e4d9f1258a53c080c
--- /dev/null
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/src/MMRawDataUtils.cxx
@@ -0,0 +1,172 @@
+/*                                                                                                        
+													
+													  
+Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration                                   
+ 
+*/
+///////////////////////////////////////////////////////////////////////////                                  
+//Utils for the main MMRawDataMonAlg.cxx                                                                    
+        
+//Part of MMRawDataMonAlg.h                                                                                 
+         
+//Authors                                                                                                   
+         
+//   see MMRawDataMonAlg.cxx                                                                                
+        
+///////////////////////////////////////////////////////////////////////////                                 
+         
+
+#include "MMRawDataMonitoring/MMRawDataMonAlg.h"
+#include <string>
+#include <stdexcept>
+
+int MMRawDataMonAlg::get_PCB_from_channel(int channel) const {
+
+  if (channel>0 && channel<=1024) return 1;
+  if (channel>1024 && channel<=2048) return 2;
+  if (channel>2048 && channel<=3072) return 3;
+  if (channel>3072 && channel<=4096) return 4;
+  if (channel>4096 && channel<=5120) return 5;
+
+  throw std::invalid_argument( "channel is not valid!" );
+}
+
+int MMRawDataMonAlg::get_sectorPhi_from_stationPhi_stName(int stationPhi,const std::string & stName) const {
+  
+  if (stationPhi==1 && stName=="MMS") return 1;
+  if (stationPhi==1 && stName=="MML") return 2;
+  if (stationPhi==2 && stName=="MMS") return 3;
+  if (stationPhi==2 && stName=="MML") return 4;
+  if (stationPhi==3 && stName=="MMS") return 5;
+  if (stationPhi==3 && stName=="MML") return 6;
+  if (stationPhi==4 && stName=="MMS") return 7;
+  if (stationPhi==4 && stName=="MML") return 8;
+  if (stationPhi==5 && stName=="MMS") return 9;
+  if (stationPhi==5 && stName=="MML") return 10;
+  if (stationPhi==6 && stName=="MMS") return 11;
+  if (stationPhi==6 && stName=="MML") return 12;
+  if (stationPhi==7 && stName=="MMS") return 13;
+  if (stationPhi==7 && stName=="MML") return 14;
+  if (stationPhi==8 && stName=="MMS") return 15;
+  if (stationPhi==8 && stName=="MML") return 16;
+
+  throw std::invalid_argument( "stationPhi and stName are not valid!" );
+
+}
+
+int MMRawDataMonAlg::get_sectorEta_from_stationEta(int stationEta) const {
+ 
+  //  1<-0  0-> 1
+  if (std::abs(stationEta)==1) return 0;                                                            
+  if (std::abs(stationEta)==2) return 1;
+
+  return -1;
+
+}
+
+int MMRawDataMonAlg::get_bin_for_occ_CSide_hist(int stationEta, int multiplet, int gas_gap) const {
+
+  static const int max_gas_gap = 4;
+  static const int max_multiplet = 2;
+
+  return (stationEta+2)*(max_gas_gap*max_multiplet)+(multiplet-1)*max_gas_gap +(gas_gap-1);
+
+}
+
+int MMRawDataMonAlg::get_bin_for_occ_ASide_hist(int stationEta, int multiplet, int gas_gap) const {
+
+  static const int max_gas_gap = 4;
+  static const int max_multiplet = 2;
+
+  return (stationEta-1)*(max_gas_gap*max_multiplet)+(multiplet-1)*max_gas_gap +(gas_gap-1);
+
+}
+
+
+int MMRawDataMonAlg::get_bin_for_occ_CSide_pcb_eta2_hist(int stationEta, int multiplet, int gas_gap, int PCB) const {
+
+  static const int max_pcb = 3;
+  static const int max_gas_gap = 4;
+  if (stationEta != -2) return -1;
+
+  return  (multiplet-1)*max_gas_gap*max_pcb+ (gas_gap-1)*max_pcb + (PCB-1);
+
+}
+
+int MMRawDataMonAlg::get_bin_for_occ_CSide_pcb_eta1_hist(int stationEta, int multiplet, int gas_gap, int PCB) const {
+
+  static const int max_pcb = 5;
+  static const int max_gas_gap = 4;
+  if (stationEta != -1) return -1;
+
+  return  (multiplet-1)*max_gas_gap*max_pcb+ (gas_gap-1)*max_pcb + (PCB-1);
+
+}
+
+
+int MMRawDataMonAlg::get_bin_for_occ_ASide_pcb_eta2_hist(int stationEta, int multiplet, int gas_gap, int PCB) const {
+
+  static const int max_pcb = 3;
+  static const int max_gas_gap = 4;
+  if (stationEta != 2) return -1;
+
+  return  (multiplet-1)*max_gas_gap*max_pcb+ (gas_gap-1)*max_pcb + (PCB-1);
+
+}
+
+
+int MMRawDataMonAlg::get_bin_for_occ_ASide_pcb_eta1_hist(int stationEta, int multiplet, int gas_gap, int PCB) const {
+
+  static const int max_pcb = 5;
+  static const int max_gas_gap = 4;
+  if (stationEta != 1) return -1;
+
+  return  (multiplet-1)*max_gas_gap*max_pcb+ (gas_gap-1)*max_pcb + (PCB-1);
+}
+
+
+int MMRawDataMonAlg::get_bin_for_occ_lb_CSide_pcb_eta2_hist(int stationEta, int multiplet, int gas_gap, int PCB,int isector) const {
+
+  static const int max_pcb = 3;
+  static const int max_gas_gap = 4;
+  static const int max_isector = 2;
+  if (stationEta != -2) return -1;
+
+  return  (multiplet-1)*max_gas_gap*max_pcb*max_isector+ (gas_gap-1)*max_pcb*max_isector + isector*max_pcb+ (PCB-1);
+
+}
+
+
+int MMRawDataMonAlg::get_bin_for_occ_lb_CSide_pcb_eta1_hist(int stationEta, int multiplet, int gas_gap, int PCB,int isector) const {
+
+  static const int max_pcb = 5;
+  static const int max_gas_gap = 4;
+  static const int max_isector = 2;
+  if (stationEta != -1) return -1;
+
+  return  (multiplet-1)*max_gas_gap*max_pcb*max_isector+ (gas_gap-1)*max_pcb*max_isector + isector*max_pcb + (PCB-1);
+
+}
+
+int MMRawDataMonAlg::get_bin_for_occ_lb_ASide_pcb_eta1_hist(int stationEta, int multiplet, int gas_gap, int PCB,int isector) const {
+
+  static const int max_pcb = 5;
+  static const int max_gas_gap = 4;
+  static const int max_isector = 2;
+  if (stationEta != 1) return -1;
+
+  return  (multiplet-1)*max_gas_gap*max_pcb*max_isector+ (gas_gap-1)*max_pcb*max_isector + isector*max_pcb + (PCB-1);
+}
+
+
+int MMRawDataMonAlg::get_bin_for_occ_lb_ASide_pcb_eta2_hist(int stationEta, int multiplet, int gas_gap, int PCB,int isector) const {
+
+  static const int max_pcb = 3;
+  static const int max_gas_gap = 4;
+  static const int max_isector = 2;
+  if (stationEta != 2) return -1;
+
+  return  (multiplet-1)*max_gas_gap*max_pcb*max_isector+ (gas_gap-1)*max_pcb*max_isector + isector*max_pcb + (PCB-1);
+
+}
+
diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/src/components/MMRawDataMonitoring_entries.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/src/components/MMRawDataMonitoring_entries.cxx
new file mode 100755
index 0000000000000000000000000000000000000000..cbf926754cdbdd1ccea322919c055d74ec18ef05
--- /dev/null
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MMRawDataMonitoring/src/components/MMRawDataMonitoring_entries.cxx
@@ -0,0 +1,9 @@
+/*                                                                                                           
+Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration                                     
+*/
+//////////// MM ///////////////////////////////
+
+#include "MMRawDataMonitoring/MMRawDataMonAlg.h"
+
+DECLARE_COMPONENT( MMRawDataMonAlg )
+ 
diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/RpcRawDataMonitoring/RPCStandaloneTracksMon.h b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/RpcRawDataMonitoring/RPCStandaloneTracksMon.h
index 7be2ebd9963b7e6c66a76be1802669c7636fa4a1..369b985a1f3d891e197e00b05189868c8abafee8 100755
--- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/RpcRawDataMonitoring/RPCStandaloneTracksMon.h
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/RpcRawDataMonitoring/RPCStandaloneTracksMon.h
@@ -85,7 +85,6 @@ class RPCStandaloneTracksMon: public ManagedMonitorToolBase {
   
   ActiveStoreSvc* m_activeStore;
 
-  std::string m_muonSegmentsName;
   std::string m_muonTracksName;
   std::string m_msVertexCollection;
   std::string m_muonExtrapTracksName;
diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RPCStandaloneTracksMon.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RPCStandaloneTracksMon.cxx
index 9e120ac8ebddc38879a32c0f44e0d4cf9a2a150d..6f395b80a8302d2b6ecad5cf1f2bffbe45a8c146 100755
--- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RPCStandaloneTracksMon.cxx
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RPCStandaloneTracksMon.cxx
@@ -103,14 +103,11 @@ RPCStandaloneTracksMon::RPCStandaloneTracksMon( const std::string & type, const
   declareProperty("Muon_Trigger_Items",   m_muon_triggers);
   declareProperty("TriggerDecisionTool",  m_trigDecTool);
   
-  declareProperty("MuonSegmentCollection",	     m_muonSegmentsName     = "MuonSegments");
   declareProperty("MuonTrackCollection",	     m_muonTracksName	    = "MuonSpectrometerTrackParticles");
   declareProperty("MuonExtrapolatedTrackCollection", m_muonExtrapTracksName = "ExtrapolatedMuonTrackParticles");
   declareProperty("InDetTrackParticles",	     m_innerTracksName      = "InDetTrackParticles");
   declareProperty("MSVertexCollection",              m_msVertexCollection   = "MSDisplacedVertex");
   
-  
-  
   declareProperty("MuonDeltaRMatching"          , m_MuonDeltaRMatching         =   0.15 ); 
   declareProperty("requireMuonCombinedTight"    , m_requireMuonCombinedTight   = false  );
   declareProperty("StandAloneMatchedWithTrack"  , m_StandAloneMatchedWithTrack = true   );
@@ -289,26 +286,15 @@ StatusCode RPCStandaloneTracksMon::fillHistograms()
       }
   }
     
-   //Muon tracks
-     
-//       // retrieve containers
-//       const xAOD::MuonSegmentContainer*     MuonSegments = evtStore()->retrieve< const xAOD::MuonSegmentContainer >        (m_muonSegmentsName);       
-//       const xAOD::TrackParticleContainer*   tracksMS     = evtStore()->retrieve< const xAOD::TrackParticleContainer >        (m_muonTracksName);      
-         SG::ReadHandle<xAOD::MuonContainer> Muons(m_muonsName);
+   //Muon tracks   
+   SG::ReadHandle<xAOD::MuonContainer> Muons(m_muonsName);
 	 ATH_MSG_DEBUG ("Muon container with key: " << m_muonsName.key()<<" found");
-//       const xAOD::VertexContainer*	       MSVertices   = evtStore()->retrieve< const xAOD::VertexContainer >           (m_msVertexCollection);
-//       const xAOD::TrackParticleContainer*   METracks     = evtStore()->retrieve< const xAOD::TrackParticleContainer >( m_muonExtrapTracksName );
-//       const xAOD::TrackParticleContainer*   IDTracks     = evtStore()->retrieve< const xAOD::TrackParticleContainer >     ( m_innerTracksName );
-  
-      
-      
+
       SG::ReadHandle<Muon::RpcPrepDataContainer> rpc_container(m_key_rpc);
       ATH_MSG_DEBUG ( "RpcPrepDataContainer " << m_key_rpc.key() <<" found");
 
       SG::ReadHandle<xAOD::EventInfo> eventInfo(m_eventInfo);
 
-      //int RunNumber = eventInfo->runNumber();
-      //long int EventNumber = eventInfo->eventNumber();
       long int BCID   =  eventInfo->       bcid()  ;
       int lumiBlock   =  eventInfo->  lumiBlock()  ; 
       
diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/python/MuonTrackMonitorAlgorithm.py b/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/python/MuonTrackMonitorAlgorithm.py
index 17a556f53384d59e7ad59a9381badecf759662ca..7c7a3050f6504eb3d8b052d47dd947bd09c6b440 100644
--- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/python/MuonTrackMonitorAlgorithm.py
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/python/MuonTrackMonitorAlgorithm.py
@@ -16,7 +16,7 @@ def MuonTrackConfig(inputFlags, isOld=False):
 
     helper = AthMonitorCfgHelper(inputFlags, "MuonTrackMonitoringConfig")
 
-    muonTrackAlg = helper.addAlgorithm(MuonTrackMonitorAlgorithm, "MuonTrackMonitorAlgorithm")
+    muonTrackAlg = helper.addAlgorithm(MuonTrackMonitorAlgorithm, "MuonTrackMonitorAlg")
 
     myGroup = helper.addGroup(muonTrackAlg, "MuonTrackMonitorAlgorithm", "MuonPhysics/")
 
diff --git a/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonRecRTT/share/MuonRec_plot.C b/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonRecRTT/share/MuonRec_plot.C
index e247ee34482de0574d95c276bbf50e540feb534b..c1b03a4d699589d66125de99a42beaf684ac955b 100644
--- a/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonRecRTT/share/MuonRec_plot.C
+++ b/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonRecRTT/share/MuonRec_plot.C
@@ -76,60 +76,33 @@
 
 
   //c6 Canvas 
-//  int trmaxmboy = tree2->GetMaximum("MboyTrkVT_NTrk");
-//  int trbinmboy = trmaxmboy+1;
   TH1F *mboytracks = new TH1F("mboytracks"," Muonboy tracks per event", 10, 0, 10);
   TH1F *mboytracksqoverp = new TH1F("mboytracksqoverp"," Muonboy track q/p (1/MeV) ", 60, -150000., 150000.);
   TH1F *mboytrackspt = new TH1F("mboytrackspt"," Muonboy track pt (MeV)", 50, 0., 100000.);
   TH1F *mboytrackseta = new TH1F("mboytrackseta"," Muonboy track eta", 60, -3., 3.);
   TH1F *mboytracksphi = new TH1F("mboytracksphi"," Muonboy track phi", 60, -3.1416, 3.1416);
-
-  //TH1F *mboytrackseta = new TH1F("mboytrackseta"," Eta distribution of Muonboy Tracks per Event", 112, -2.7,2.7);
-  //TH1F *mboytracksphi = new TH1F("mboytracksphi"," Phi distribution of Muonboy Tracks per Event", 72, 0,3.5);
-  //TH1F *mboytracksimpa0 = new TH1F("mboytracksimpa0"," Impact parameter distribution (mm) in Rphi plane of extrapolated to the vertex Mboy Tracks ", 440, -11000, 11000);
-  //TH1F *mboytracksimpZ = new TH1F("mboytracksimpZ"," Impact parameter distribution (mm) in Z plane of extrapolated to the vertex Mboy Tracks ", 800, -20000, 20000);
-  //TH1F *mboytracksX =new TH1F("mboytracksX", " X at closest approach (mm) of extrapolated to the vertex Mboy Tracks", 440, -11000, 11000);
-  //TH1F *mboytracksY =new TH1F("mboytracksY", " Y at closest approach (mm) of extrapolated to the vertex Mboy Tracks", 440, -11000, 11000);
-  //TH1F *mboytracksZ =new TH1F("mboytracksZ", " Z at closest approach (mm) of extrapolated to the vertex Mboy Tracks", 800, -20000, 20000);
-
   //c61 Canvas
   TH1F *mboyhitsontracks = new TH1F("mboyhitsontracks"," Muonboy Hits on Track per Event", 50, 0,100);
   TH1F *mboyhitstech = new TH1F("mboyhitstech","Muonboy hits belong to MDT/RPC/TGC/CSC=1/2/3/4 ",8,0.,8);
   TH1F *mboytrackresiduals = new TH1F("mboytrackresiduals", " Muonboy MDT residuals on Track per Event", 50, -5, 5);
-  // TH1F *mboymdthitsontrack = new TH1F("mboymdthitsontrack", " Muonboy MDT hits on Track per Event", 50,0,50);
-  // TH1F *mboyrpchitsontrack = new TH1F("mboyrpchitsontrack", " Muonboy RPC hits on Track per Event", 50,0,50);
-  // TH1F *mboytgchitsontrack = new TH1F("mboytgchitsontrack", " Muonboy TGC hits on Track per Event", 50,0,50);
   TH1F *mboyhitsrpctime = new TH1F("mboyhitsrpctime", "Muonboy hits on Track time measured from RC",50,0,200);
   TH1F *mboyhitstgcchannel = new TH1F("mboyhitstgcchannel","Muonboy hits on Track TGC number of strip",500,0,500);
   TH1F *mboyhitscscwirelayer = new TH1F("mboyhitscscwirelayer","Muonboy hits on Track CSC wire layer ",4,0,4);
 
   //c62 Canvas 
-//  int segmaxmboy = tree2->GetMaximum("MboySeg_nseg");
-//  int segbinmboy = segmaxmboy+1;
   TH1F *mboyseg = new TH1F("mboyseg"," Muonboy Segments per Event", 100, 0, 100);
   TH1F *mboyhitsonseg = new TH1F("mboyhitsonseg"," Muonboy Total number of hits per Segment", 20, 0,20);
-  //TH1F *mboyhitsonsegX = new TH1F("mboyhitsonsegX", "Muonboy Segments X of crossing point (mm)",440, -11000, 11000);
-  //TH1F *mboyhitsonsegY =  new TH1F("mboyhitsonsegY",  "Muonboy Segments Y of crossing point (mm)",440, -11000, 11000);
-  //TH1F *mboyhitsonsegZ =  new TH1F("mboyhitsonsegZ",  "Muonboy Segments Z of crossing point (mm)",800, -20000, 20000); 
   TH1F *mboysegtheta = new TH1F("mboysegtheta"," Muonboy Segments Theta distribution ", 60,0,3.1416);
   TH1F *mboysegphi = new TH1F("mboysegphi"," Muonboy Segments Phi distribution ", 60, -3.1416, 3.1416);
 
 
  //c8 Canvas
-//  int trmaxmoore = tree2->GetMaximum("Moore_nmuon");
-//  int trbinmoore = trmaxmoore+1;
   TH1F *mooretracks = new TH1F("mooretracks"," Moore Tracks per Event", 10, 0, 10);
   TH1F *mooretracksqoverp = new TH1F("mooretracksqoverp"," Moore track q/p (1/MeV) ", 60, -150000., 150000.);
   TH1F *mooretrackspt = new TH1F("mooretrackspt"," Moore track pt (MeV)", 50, 0., 100000.);
   TH1F *mooretrackseta = new TH1F("mooretrackseta"," Moore track eta", 60, -3., 3.);
   TH1F *mooretracksphi = new TH1F("mooretracksphi"," Moore track phi", 60, -3.1416, 3.1416);
 
-  //TH1F *mooretracksimpa0 = new TH1F("mooretracksimpa0"," Impact parameter distribution (mm) in Rphi plane of Moore Tracks ", 440, -11000, 11000);
-  //TH1F *mooretracksimpZ = new TH1F("mooretracksimpZ"," Impact parameter distribution (mm) in Z plane of  Moore Tracks ", 800, -20000, 20000);
-  //TH1F *mooretracksX =new TH1F("mooretracksX", " X at closest approach (mm) of extrapolated to the vertex Moore Tracks", 440, -11000, 11000);
-  //TH1F *mooretracksY =new TH1F("mooretracksY", " Y at closest approach (mm) of extrapolated to the vertex Moore Tracks", 440, -11000, 11000);
-  //TH1F *mooretracksZ =new TH1F("mooretracksZ", " Z at closest approach (mm) of extrapolated to the vertex Moore Tracks", 800, -20000, 20000);
-
   //c81 Canvas
   TH1F *mooremdthitsontrack = new TH1F("mooremdthitsontrack"," Moore MDT hits on Track ", 50,0,50);
   TH1F *moorecscetahitsontrack = new TH1F("moorecscetahitsontrack"," Moore CSC eta hits on Track ", 10,0,10);
@@ -142,8 +115,6 @@
   TH1F *mooretgcphihitsontrack = new TH1F("mooretgcphihitsontrack"," Moore TGC phi hits on Track ", 10,0,10);
  
   //c85 Canvas
-//  int segmaxmoore = tree2->GetMaximum("MooreSegments_nseg");
-//  int segbinmoore = segmaxmoore+1;
   TH1F *mooreseg = new TH1F("mooreseg"," Moore Segments per Event", 100, 0, 100);
   TH1F *moorehitsonseg = new TH1F("moorehitsonseg"," Moore Hits per Segment", 20,0,20);
   TH1F *mooresegtheta = new TH1F("mooresegtheta"," Moore Segments Theta distribution ", 60,0,3.1416);
@@ -186,13 +157,6 @@
 
   //c6 Canvas
   tree2.Draw("MboyTrkVT_NTrk>>mboytracks");
-  //tree2.Draw("(-1.*log(tan(atan2(1.,MboyTrkVT_CotTh)/2.)))>>mboytrackseta");
-  //tree2.Draw("MboyTrkVT_Phi>>mboytracksphi");
-  //tree2.Draw("MboyTrkVT_A0>>mboytracksimpa0");
-  //tree2.Draw("MboyTrkVT_Z>>mboytracksimpZ");
-  //tree2.Draw("MboyTrkVT_Xpt>>mboytracksX");
-  //tree2.Draw("MboyTrkVT_Ypt>>mboytracksY");
-  //tree2.Draw("MboyTrkVT_Zpt>>mboytracksZ");
 
   tree1.Draw("1./trk_qOverP>>mboytracksqoverp","trk_author==100");
   tree1.Draw("sin(trk_theta)/abs(trk_qOverP)>>mboytrackspt","trk_author==100");
@@ -203,19 +167,12 @@
   tree2.Draw("MboyTrkVT_digits>>mboyhitsontracks");
   tree2.Draw("MboyTrkVT_TrHi_ChamberTech>>mboyhitstech");
   tree2.Draw("MboyTrkVT_TrHi_Rdigi-MboyTrkVT_TrHi_Rtrack>>mboytrackresiduals","MboyTrkVT_TrHi_ChamberTech==1");
-  //  tree2.Draw("MboyTrkVT_TrHi_hits>>mboymdthitsontrack","MboyTrkVT_TrHi_ChamberTech==1");
-  //  tree2.Draw("MboyTrkVT_TrHi_hits>>mboyrpchitsontrack","MboyTrkVT_TrHi_ChamberTech==2");
-  //  tree2.Draw("MboyTrkVT_TrHi_hits>>mboytgchitsontrack","MboyTrkVT_TrHi_ChamberTech==3");
   tree2.Draw("MboyTrkVT_TrHi_RpcTime>>mboyhitsrpctime");
   tree2.Draw("MboyTrkVT_TrHi_Channel>>mboyhitstgcchannel");
   tree2.Draw("MboyTrkVT_TrHi_ChamberLayer>>mboyhitscscwirelayer");
 
   //c72 Canvas
   tree2.Draw("MboySeg_nseg>>mboyseg"); 
-  //tree2.Draw("MboySeg_Ndigits>>mboyhitsonseg");
-  //tree2.Draw("MboySeg_Xpt>>mboyhitsonsegX");
-  //tree2.Draw("MboySeg_Ypt>>mboyhitsonsegY");
-  //tree2.Draw("MboySeg_Zpt>>mboyhitsonsegZ");
   tree1.Draw("seg_nHits>>mboyhitsonseg","seg_author==3");
   tree1.Draw("acos(seg_gDirZ)>>mboysegtheta","seg_author==3");
   tree1.Draw("atan2(seg_gDirY,seg_gDirX)>>mboysegphi","seg_author==3");
@@ -246,9 +203,6 @@
 
   //c85 Canvas
   tree2.Draw("MooreSegments_nseg>>mooreseg");
-  //tree2.Draw("MooreSegments_nhit>>moorehitsonseg");
-  //tree2.Draw("MooreSegments_theta>>mooresegtheta");
-  //tree2.Draw("MooreSegments_phi>>mooresegphi");
   tree1.Draw("seg_nHits>>moorehitsonseg","seg_author==4");
   tree1.Draw("acos(seg_gDirZ)>>mooresegtheta","seg_author==4");
   tree1.Draw("atan2(seg_gDirY,seg_gDirX)>>mooresegphi","seg_author==4");
@@ -257,8 +211,6 @@
   tree2.Draw("MooreSegments_nseg>>seg_nsegMoo");
   tree2.Draw("MboySeg_nseg>>seg_nsegMB");
 
-  //double eta = -1.*log(tan(atan2(double(1.),double(MboyTrkVT_CotTh))/double(2.)));
-
 //Prepare canvas with plots 
 
   //c1:MDT part I raw info 
@@ -377,22 +329,6 @@
   mboytracksphi.SetMinimum(0);
   mboytracksphi.SetFillColor(2);
   mboytracksphi.Draw();
-  //c6.cd(4);
-  //mboytracksimpa0.SetFillColor(2);
-  //mboytracksimpa0.Draw();
-  //c6.cd(5);
-  //mboytracksimpZ.SetFillColor(2);
-  //mboytracksimpZ.Draw();
-  //c6.cd(6);
-  //c6.cd(7);
-  //mboytracksX.SetFillColor(2);
-  //mboytracksX.Draw();
-  //c6.cd(8);
-  //mboytracksY.SetFillColor(2);
-  //mboytracksY.Draw();
-  //c6.cd(9);
-  //mboytracksZ.SetFillColor(2);
-  //mboytracksZ.Draw();
   c6.Update();
   c6.SaveAs("AAN_mboytracks.gif");
 
@@ -430,16 +366,6 @@
   c62.cd(2);
   mboyhitsonseg.SetFillColor(2);
   mboyhitsonseg.Draw();
-  //c62.cd(3);
-  //c62.cd(4);
-  //mboyhitsonsegX.SetFillColor(2);
-  //mboyhitsonsegX.Draw();
-  //c62.cd(5);
-  //mboyhitsonsegY.SetFillColor(2);
-  //mboyhitsonsegY.Draw();
-  //c62.cd(6);
-  //mboyhitsonsegZ.SetFillColor(2);
-  //mboyhitsonsegZ.Draw();
   c62.cd(3);
   mboysegtheta.SetFillColor(2);
   mboysegtheta.Draw();
@@ -460,27 +386,16 @@
   c8.cd(2);
   mooretracksqoverp.SetFillColor(2);
   mooretracksqoverp.Draw();
-  //mooretracksimpa0.SetFillColor(2);
-  //mooretracksimpa0.Draw();
   c8.cd(3);
   mooretrackspt.SetFillColor(2);
   mooretrackspt.Draw();
-  //mooretracksimpZ.SetFillColor(2);
-  //mooretracksimpZ.Draw();
   c8.cd(4);
   mooretrackseta.SetFillColor(2);
   mooretrackseta.Draw();
-  //mooretracksX.SetFillColor(2);
-  //mooretracksX.Draw();
   c8.cd(5);
   mooretracksphi.SetMinimum(0);
   mooretracksphi.SetFillColor(2);
   mooretracksphi.Draw();
-  //mooretracksY.SetFillColor(2);
-  //mooretracksY.Draw();
-  //c8.cd(6);
-  //mooretracksZ.SetFillColor(2);
-  //mooretracksZ.Draw();
   c8.Update();
   c8.SaveAs("AAN_mooretracks.gif");
 
diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/CMakeLists.txt b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/CMakeLists.txt
index f27b528157a0c569915581c592db61c313a95e0c..8ab33ccf6cefe857566efb8ed1459b15f5445341 100644
--- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/CMakeLists.txt
+++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/CMakeLists.txt
@@ -4,40 +4,13 @@
 
 atlas_subdir( AsgAnalysisAlgorithms )
 
-atlas_depends_on_subdirs(
-   PUBLIC
-   Control/AthContainers
-   Control/AthContainersInterfaces
-   Control/AthToolSupport/AsgTools
-   Event/xAOD/xAODBase
-   Event/xAOD/xAODCutFlow
-   Event/xAOD/xAODEventInfo
-   Event/xAOD/xAODMetaData
-   PhysicsAnalysis/Algorithms/SelectionHelpers
-   PhysicsAnalysis/Algorithms/SystematicsHandles
-   PhysicsAnalysis/AnalysisCommon/PATCore
-   PhysicsAnalysis/AnalysisCommon/PATInterfaces
-   PhysicsAnalysis/AnalysisCommon/IsolationSelection
-   PhysicsAnalysis/D3PDTools/AnaAlgorithm
-   PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces
-   PhysicsAnalysis/Interfaces/PMGAnalysisInterfaces
-   PRIVATE
-   Event/xAOD/xAODCore
-   Event/xAOD/xAODJet
-   Event/xAOD/xAODMuon
-   Event/xAOD/xAODTau
-   Event/xAOD/xAODEgamma
-   Event/xAOD/xAODTracking
-   Event/xAOD/xAODTruth
-   PhysicsAnalysis/D3PDTools/RootCoreUtils )
-
 atlas_add_library( AsgAnalysisAlgorithmsLib
    AsgAnalysisAlgorithms/*.h AsgAnalysisAlgorithms/*.icc Root/*.cxx
    PUBLIC_HEADERS AsgAnalysisAlgorithms
    LINK_LIBRARIES AthContainers AthContainersInterfaces AsgTools xAODBase
      xAODEventInfo SelectionHelpersLib SystematicsHandlesLib PATCoreLib
      PATInterfaces AnaAlgorithmLib AsgAnalysisInterfaces AssociationUtilsLib
-     IsolationSelectionLib
+     IsolationSelectionLib PMGAnalysisInterfacesLib
    PRIVATE_LINK_LIBRARIES xAODCore xAODCutFlow xAODMetaData xAODJet xAODMuon xAODTau xAODEgamma xAODTracking xAODTruth
      RootCoreUtils )
 
diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/EventAlgorithmsTest_eljob.py b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/EventAlgorithmsTest_eljob.py
index efd9a38e6f085e11fe37c43afbd85b069226766a..a7edaae820884110b5d45313255184a7b1b72a46 100755
--- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/EventAlgorithmsTest_eljob.py
+++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/EventAlgorithmsTest_eljob.py
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 #
 # @author Tadej Novak
 
@@ -24,6 +24,11 @@ parser.add_option( '-u', '--unit-test', dest='unit_test',
 import ROOT
 ROOT.xAOD.Init().ignore()
 
+# Force-load some xAOD dictionaries. To avoid issues from ROOT-10940.
+ROOT.xAOD.CaloClusterContainer()
+ROOT.xAOD.MuonContainer()
+ROOT.xAOD.TauJetContainer()
+
 # ideally we'd run over all of them, but we don't have a mechanism to
 # configure per-sample right now
 
@@ -53,7 +58,7 @@ job.options().setDouble( ROOT.EL.Job.optMaxEvents, 500 )
 
 from AsgAnalysisAlgorithms.AsgAnalysisAlgorithmsTest import makeEventAlgorithmsSequence
 algSeq = makeEventAlgorithmsSequence (dataType)
-print algSeq # For debugging
+print( algSeq ) # For debugging
 for alg in algSeq:
     job.algsAdd( alg )
     pass
diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/EventAlgorithmsTest_jobOptions.py b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/EventAlgorithmsTest_jobOptions.py
index 348981c7f08479e492930eaedd2fd99c565ecdf7..6fd7280dd7e3aa9d5025957cb8cf76e5696a6427 100644
--- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/EventAlgorithmsTest_jobOptions.py
+++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/EventAlgorithmsTest_jobOptions.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
 #
 # @author Tadej Novak
 
@@ -29,7 +29,7 @@ svcMgr.EventSelector.InputCollections = [testFile]
 
 from AsgAnalysisAlgorithms.AsgAnalysisAlgorithmsTest import makeEventAlgorithmsSequence
 algSeq = makeEventAlgorithmsSequence (dataType)
-print algSeq # For debugging
+print( algSeq ) # For debugging
 
 # Add all algorithms from the sequence to the job.
 athAlgSeq += algSeq
diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/GeneratorAlgorithmsTest_eljob.py b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/GeneratorAlgorithmsTest_eljob.py
index 2fff23fdec478b3167b3b0ead5892173ec57ce78..b1821c6bd1d444c5e10faf217bca4d3b90aabd26 100755
--- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/GeneratorAlgorithmsTest_eljob.py
+++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/GeneratorAlgorithmsTest_eljob.py
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 #
 # @author Tadej Novak
 
@@ -52,7 +52,7 @@ job.options().setDouble( ROOT.EL.Job.optMaxEvents, 500 )
 
 from AsgAnalysisAlgorithms.AsgAnalysisAlgorithmsTest import makeGeneratorAlgorithmsSequence
 algSeq = makeGeneratorAlgorithmsSequence (dataType)
-print algSeq # For debugging
+print( algSeq ) # For debugging
 for alg in algSeq:
     job.algsAdd( alg )
     pass
diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/GeneratorAlgorithmsTest_jobOptions.py b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/GeneratorAlgorithmsTest_jobOptions.py
index f1c19a2b1063fb4dfac78a1721bcc8c5a0293b98..bae994afbe052c6f5d68d2b823096e6b3a2e2b56 100644
--- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/GeneratorAlgorithmsTest_jobOptions.py
+++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/GeneratorAlgorithmsTest_jobOptions.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
 #
 # @author Tadej Novak
 
@@ -28,7 +28,7 @@ svcMgr.EventSelector.InputCollections = [testFile]
 
 from AsgAnalysisAlgorithms.AsgAnalysisAlgorithmsTest import makeGeneratorAlgorithmsSequence
 algSeq = makeGeneratorAlgorithmsSequence (dataType)
-print algSeq # For debugging
+print( algSeq ) # For debugging
 
 # Add all algorithms from the sequence to the job.
 athAlgSeq += algSeq
diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/OverlapAlgorithmsTest_eljob.py b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/OverlapAlgorithmsTest_eljob.py
index a213be63996c107fb5039dd723c5701a854ca331..b9fd75d8836620fbd94b41fc0473efa89ea86805 100755
--- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/OverlapAlgorithmsTest_eljob.py
+++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/OverlapAlgorithmsTest_eljob.py
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 #
 # @author Nils Krumnack
 
@@ -53,7 +53,7 @@ job.options().setDouble( ROOT.EL.Job.optMaxEvents, 500 )
 
 from AsgAnalysisAlgorithms.AsgAnalysisAlgorithmsTest import makeOverlapSequence
 algSeq = makeOverlapSequence (dataType)
-print algSeq # For debugging
+print( algSeq ) # For debugging
 for alg in algSeq :
     job.algsAdd( alg )
     pass
diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/OverlapAlgorithmsTest_jobOptions.py b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/OverlapAlgorithmsTest_jobOptions.py
index 4e753b0d13576c1254c1e9c9eb84720854d8d647..607ba7885078694ae82c31f5ff87df886f7a275e 100644
--- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/OverlapAlgorithmsTest_jobOptions.py
+++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/OverlapAlgorithmsTest_jobOptions.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
 #
 # @author Nils Krumnack
 
@@ -15,7 +15,7 @@ dataType = athArgs.data_type
 if not dataType in ["data", "mc", "afii"] :
     raise Exception ("invalid data type: " + dataType)
 
-print("Running on data type: " + dataType)
+print("Running on data type: %s" % str(dataType))
 
 inputfile = {"data": 'ASG_TEST_FILE_DATA',
              "mc":   'ASG_TEST_FILE_MC',
@@ -29,7 +29,7 @@ svcMgr.EventSelector.InputCollections = [testFile]
 
 from AsgAnalysisAlgorithms.AsgAnalysisAlgorithmsTest import makeOverlapSequence
 algSeq = makeOverlapSequence (dataType)
-print algSeq # For debugging
+print( algSeq ) # For debugging
 
 # Add all algorithms from the sequence to the job.
 athAlgSeq += algSeq
diff --git a/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/CMakeLists.txt b/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/CMakeLists.txt
index d9f908147e5f1176fbf11218b422362f2753268d..a0366cf2cc08f2beb10f1c5c7313dcb1dada73e6 100644
--- a/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/CMakeLists.txt
+++ b/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/CMakeLists.txt
@@ -6,17 +6,6 @@
 # The name of the package:
 atlas_subdir( EgammaAnalysisAlgorithms )
 
-# The package's dependencies:
-atlas_depends_on_subdirs(
-   PUBLIC
-   Event/xAOD/xAODEgamma
-   PhysicsAnalysis/Algorithms/SelectionHelpers
-   PhysicsAnalysis/Algorithms/SystematicsHandles
-   PhysicsAnalysis/AnalysisCommon/IsolationSelection
-   PhysicsAnalysis/D3PDTools/AnaAlgorithm
-   PhysicsAnalysis/ElectronPhotonID/IsolationCorrections
-   PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces )
-
 atlas_add_library( EgammaAnalysisAlgorithmsLib
    EgammaAnalysisAlgorithms/*.h EgammaAnalysisAlgorithms/*.icc Root/*.cxx
    PUBLIC_HEADERS EgammaAnalysisAlgorithms
diff --git a/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/python/ElectronAnalysisSequence.py b/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/python/ElectronAnalysisSequence.py
index aa66052b64292258b2b2b743131939ed95d2b097..049d0cd4bbb4e0e137117c52941de45bbfff1b46 100644
--- a/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/python/ElectronAnalysisSequence.py
+++ b/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/python/ElectronAnalysisSequence.py
@@ -10,6 +10,8 @@ from AnaAlgorithm.DualUseConfig import createAlgorithm, addPrivateTool
 # E/gamma import(s).
 from xAODEgamma.xAODEgammaParameters import xAOD
 
+import PATCore.ParticleDataType
+
 def makeElectronAnalysisSequence( dataType, workingPoint,
                                   deepCopyOutput = False,
                                   shallowViewOutput = True,
@@ -260,10 +262,10 @@ def makeElectronAnalysisSequence( dataType, workingPoint,
     alg.efficiencyCorrectionTool.CorrelationModel = "TOTAL"
     if dataType == 'afii':
         alg.efficiencyCorrectionTool.ForceDataType = \
-          ROOT.PATCore.ParticleDataType.Fast
+          PATCore.ParticleDataType.Fast
     elif dataType == 'mc':
         alg.efficiencyCorrectionTool.ForceDataType = \
-          ROOT.PATCore.ParticleDataType.Full
+          PATCore.ParticleDataType.Full
         pass
     alg.outOfValidity = 2 #silent
     alg.outOfValidityDeco = 'bad_eff' + postfix
diff --git a/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/python/PhotonAnalysisSequence.py b/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/python/PhotonAnalysisSequence.py
index 377aaadb2b8d7afface081305fdec760ea26849e..9c9826c5cd9d50164b8bb753c94135be5c7d000e 100644
--- a/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/python/PhotonAnalysisSequence.py
+++ b/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/python/PhotonAnalysisSequence.py
@@ -10,6 +10,8 @@ from AnaAlgorithm.DualUseConfig import createAlgorithm, addPrivateTool
 # E/gamma import(s).
 from xAODEgamma.xAODEgammaParameters import xAOD
 
+import PATCore.ParticleDataType
+
 def makePhotonAnalysisSequence( dataType, workingPoint,
                                 deepCopyOutput = False,
                                 postfix = '',
@@ -167,10 +169,10 @@ def makePhotonAnalysisSequence( dataType, workingPoint,
         'PhotonEfficiencyCorrection/2015_2017/rel21.2/Winter2018_Prerec_v1/map0.txt'
     if dataType == 'afii':
         alg.efficiencyCorrectionTool.ForceDataType = \
-          ROOT.PATCore.ParticleDataType.Fast
+          PATCore.ParticleDataType.Fast
     elif dataType == 'mc':
         alg.efficiencyCorrectionTool.ForceDataType = \
-          ROOT.PATCore.ParticleDataType.Full
+          PATCore.ParticleDataType.Full
         pass
     alg.outOfValidity = 2 #silent
     alg.outOfValidityDeco = 'bad_eff' + postfix
diff --git a/PhysicsAnalysis/Algorithms/FTagAnalysisAlgorithms/CMakeLists.txt b/PhysicsAnalysis/Algorithms/FTagAnalysisAlgorithms/CMakeLists.txt
index b2c5d14bf3d333abd4b40a4bd7e0992d1c1692d2..bab42b461ce314450b34f264a3357393bfd4dec7 100644
--- a/PhysicsAnalysis/Algorithms/FTagAnalysisAlgorithms/CMakeLists.txt
+++ b/PhysicsAnalysis/Algorithms/FTagAnalysisAlgorithms/CMakeLists.txt
@@ -6,14 +6,6 @@
 # The name of the package:
 atlas_subdir( FTagAnalysisAlgorithms )
 
-atlas_depends_on_subdirs(
-    PUBLIC
-    Event/xAOD/xAODJet
-    PhysicsAnalysis/Algorithms/SelectionHelpers
-    PhysicsAnalysis/Algorithms/SystematicsHandles
-    PhysicsAnalysis/D3PDTools/AnaAlgorithm
-    PhysicsAnalysis/Interfaces/FTagAnalysisInterfaces )
-
 atlas_add_library( FTagAnalysisAlgorithmsLib
    FTagAnalysisAlgorithms/*.h FTagAnalysisAlgorithms/*.icc Root/*.cxx
    PUBLIC_HEADERS FTagAnalysisAlgorithms
diff --git a/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/share/MuonAnalysisAlgorithmsTest_eljob.py b/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/share/MuonAnalysisAlgorithmsTest_eljob.py
index 70d19f314de8a487a024e8600523f713172360e7..e1f700beb12b2afbdd5b7197bfd8d78e8152d007 100755
--- a/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/share/MuonAnalysisAlgorithmsTest_eljob.py
+++ b/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/share/MuonAnalysisAlgorithmsTest_eljob.py
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020  CERN for the benefit of the ATLAS collaboration
 #
 # @author Nils Krumnack
 
@@ -24,6 +24,9 @@ parser.add_option( '-u', '--unit-test', dest='unit_test',
 import ROOT
 ROOT.xAOD.Init().ignore()
 
+# Force-load some xAOD dictionaries. To avoid issues from ROOT-10940.
+ROOT.xAOD.TauJetContainer()
+
 # ideally we'd run over all of them, but we don't have a mechanism to
 # configure per-sample right now
 
@@ -58,7 +61,7 @@ job.options().setDouble( ROOT.EL.Job.optMaxEvents, 500 )
 
 from MuonAnalysisAlgorithms.MuonAnalysisAlgorithmsTest import makeSequence
 algSeq = makeSequence (dataType)
-print algSeq # For debugging
+print( algSeq ) # For debugging
 for alg in algSeq:
     job.algsAdd( alg )
     pass
diff --git a/PhysicsAnalysis/Algorithms/SelectionHelpers/CMakeLists.txt b/PhysicsAnalysis/Algorithms/SelectionHelpers/CMakeLists.txt
index 2b7655fb9e8cffb998a5b7966f175fa7eb8b9981..94a83a8e72ab32638adb52538fa7955d2ab01134 100644
--- a/PhysicsAnalysis/Algorithms/SelectionHelpers/CMakeLists.txt
+++ b/PhysicsAnalysis/Algorithms/SelectionHelpers/CMakeLists.txt
@@ -5,18 +5,6 @@
 
 atlas_subdir( SelectionHelpers )
 
-atlas_depends_on_subdirs(
-   PUBLIC
-   Control/AthContainers
-   Control/AthToolSupport/AsgTools
-   Event/xAOD/xAODBase
-   PhysicsAnalysis/D3PDTools/AnaAlgorithm
-   PRIVATE
-   Control/AthToolSupport/AsgTesting
-   Event/xAOD/xAODJet
-   PhysicsAnalysis/AnalysisCommon/PATCore
-   PhysicsAnalysis/AnalysisCommon/PATInterfaces )
-
 atlas_add_library( SelectionHelpersLib
    SelectionHelpers/*.h SelectionHelpers/*.icc Root/*.cxx
    PUBLIC_HEADERS SelectionHelpers
diff --git a/PhysicsAnalysis/Algorithms/StandaloneAnalysisAlgorithms/CMakeLists.txt b/PhysicsAnalysis/Algorithms/StandaloneAnalysisAlgorithms/CMakeLists.txt
index ff41deca6757173eaef0d86abb266ac79bf563c7..35c2dcf694b5a9c5f339b7f3097607346bbbeea4 100644
--- a/PhysicsAnalysis/Algorithms/StandaloneAnalysisAlgorithms/CMakeLists.txt
+++ b/PhysicsAnalysis/Algorithms/StandaloneAnalysisAlgorithms/CMakeLists.txt
@@ -8,16 +8,6 @@ if( NOT XAOD_STANDALONE )
    return()
 endif()
 
-# Set the package's dependencies:
-atlas_depends_on_subdirs(
-   PUBLIC
-   Control/xAODRootAccess
-   PhysicsAnalysis/Algorithms/SystematicsHandles
-   PhysicsAnalysis/D3PDTools/AnaAlgorithm
-   PRIVATE
-   Control/AthContainers
-   PhysicsAnalysis/D3PDTools/EventLoop )
-
 # External(s):
 find_package( ROOT COMPONENTS Core RIO )
 
diff --git a/PhysicsAnalysis/Algorithms/SystematicsHandles/CMakeLists.txt b/PhysicsAnalysis/Algorithms/SystematicsHandles/CMakeLists.txt
index f9a7839aeb65a057abba5a92d8ee8b6b6646a95c..d787b1012767c3529fec6179e38a0d359bd79ffb 100644
--- a/PhysicsAnalysis/Algorithms/SystematicsHandles/CMakeLists.txt
+++ b/PhysicsAnalysis/Algorithms/SystematicsHandles/CMakeLists.txt
@@ -5,23 +5,6 @@
 
 atlas_subdir( SystematicsHandles )
 
-atlas_depends_on_subdirs(
-   PUBLIC
-   Control/AthContainers
-   Control/AthToolSupport/AsgTools
-   PhysicsAnalysis/AnalysisCommon/PATInterfaces
-   PhysicsAnalysis/D3PDTools/AnaAlgorithm
-   Event/xAOD/xAODBase
-   Event/xAOD/xAODCore
-   Event/xAOD/xAODEventInfo
-   PRIVATE
-   Control/xAODRootAccess
-   Event/xAOD/xAODJet
-   Event/xAOD/xAODMuon
-   Event/xAOD/xAODEgamma
-   Event/xAOD/xAODTau
-   PhysicsAnalysis/D3PDTools/RootCoreUtils )
-
 atlas_add_library( SystematicsHandlesLib
    SystematicsHandles/*.h SystematicsHandles/*.icc Root/*.cxx
    PUBLIC_HEADERS SystematicsHandles
diff --git a/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/CMakeLists.txt b/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/CMakeLists.txt
index 94f341d66482b632c54bdb878e5e16403cec7fb8..f9e3e98448df02cc3ba627edec40730950e01cc7 100644
--- a/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/CMakeLists.txt
+++ b/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/CMakeLists.txt
@@ -6,15 +6,6 @@
 # The name of the package:
 atlas_subdir( TauAnalysisAlgorithms )
 
-# The package's dependencies:
-atlas_depends_on_subdirs(
-   PUBLIC
-   Event/xAOD/xAODTau
-   PhysicsAnalysis/Algorithms/SelectionHelpers
-   PhysicsAnalysis/Algorithms/SystematicsHandles
-   PhysicsAnalysis/D3PDTools/AnaAlgorithm
-   PhysicsAnalysis/TauID/TauAnalysisTools )
-
 atlas_add_library( TauAnalysisAlgorithmsLib
    TauAnalysisAlgorithms/*.h TauAnalysisAlgorithms/*.icc Root/*.cxx
    PUBLIC_HEADERS TauAnalysisAlgorithms
diff --git a/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/share/TauAnalysisAlgorithmsTest_eljob.py b/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/share/TauAnalysisAlgorithmsTest_eljob.py
index 0b1755dd1058de72bf62c41d341da48ec2301d72..ffb0a0087737b585e08ab7623ddab3878fe61bdb 100755
--- a/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/share/TauAnalysisAlgorithmsTest_eljob.py
+++ b/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/share/TauAnalysisAlgorithmsTest_eljob.py
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 #
 # @author Nils Krumnack
 
@@ -24,10 +24,11 @@ parser.add_option( '-u', '--unit-test', dest='unit_test',
 import ROOT
 ROOT.xAOD.Init().ignore()
 
-# this forces the tau algorithms dictionary to be loaded before
-# anything else, which works around some strange dictionary issues I
-# don't understand.
-ROOT.CP.TauSmearingAlg ("dummy", None)
+# Force-load some xAOD dictionaries. To avoid issues from ROOT-10940.
+ROOT.xAOD.CaloClusterContainer()
+ROOT.xAOD.MuonContainer()
+ROOT.xAOD.TauJetContainer()
+ROOT.xAOD.ParticleContainer()
 
 # ideally we'd run over all of them, but we don't have a mechanism to
 # configure per-sample right now
@@ -62,7 +63,7 @@ job.options().setDouble( ROOT.EL.Job.optMaxEvents, 500 )
 
 from TauAnalysisAlgorithms.TauAnalysisAlgorithmsTest import makeSequence
 algSeq = makeSequence (dataType)
-print algSeq # For debugging
+print( algSeq ) # For debugging
 for alg in algSeq:
     job.algsAdd( alg )
     pass
diff --git a/PhysicsAnalysis/Algorithms/TrackingAnalysisAlgorithms/CMakeLists.txt b/PhysicsAnalysis/Algorithms/TrackingAnalysisAlgorithms/CMakeLists.txt
index 70e73676e4d5941da8e471cf143a53ef17d5b471..5866e557426a110e0d67f6ac62f3ed7410cd1aa7 100644
--- a/PhysicsAnalysis/Algorithms/TrackingAnalysisAlgorithms/CMakeLists.txt
+++ b/PhysicsAnalysis/Algorithms/TrackingAnalysisAlgorithms/CMakeLists.txt
@@ -3,13 +3,6 @@
 # The name of the package:
 atlas_subdir( TrackingAnalysisAlgorithms )
 
-# The package's dependencies:
-atlas_depends_on_subdirs(
-   PUBLIC
-   PhysicsAnalysis/D3PDTools/AnaAlgorithm
-   PRIVATE
-   Event/xAOD/xAODTracking )
-
 # Components in the package:
 atlas_add_library( TrackingAnalysisAlgorithmsLib
    TrackingAnalysisAlgorithms/*.h Root/*.cxx
diff --git a/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/CMakeLists.txt b/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/CMakeLists.txt
index 73816a792040e7cd137d3e4bda9707fd165e08cf..25126a762396acb1aaf9d156ad217444026464a6 100644
--- a/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/CMakeLists.txt
+++ b/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/CMakeLists.txt
@@ -4,22 +4,11 @@
 
 atlas_subdir( TriggerAnalysisAlgorithms )
 
-atlas_depends_on_subdirs(
-   PUBLIC
-   Event/xAOD/xAODEventInfo
-   PhysicsAnalysis/Algorithms/SelectionHelpers
-   PhysicsAnalysis/Algorithms/SystematicsHandles
-   PhysicsAnalysis/D3PDTools/AnaAlgorithm
-   PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces
-   Trigger/TrigEvent/TrigDecisionInterface
-   PRIVATE
-   PhysicsAnalysis/D3PDTools/RootCoreUtils )
-
 atlas_add_library( TriggerAnalysisAlgorithmsLib
    TriggerAnalysisAlgorithms/*.h TriggerAnalysisAlgorithms/*.icc Root/*.cxx
    PUBLIC_HEADERS TriggerAnalysisAlgorithms
    LINK_LIBRARIES xAODEventInfo SelectionHelpersLib SystematicsHandlesLib
-      AnaAlgorithmLib AsgAnalysisInterfaces
+      AnaAlgorithmLib AsgAnalysisInterfaces TrigDecisionInterface
    PRIVATE_LINK_LIBRARIES RootCoreUtils )
 
 atlas_add_dictionary( TriggerAnalysisAlgorithmsDict
@@ -41,15 +30,15 @@ if( XAOD_STANDALONE )
   # FIX ME: temporarily disabled as part of the migration of AnalysisBase
   #         to master
 
-  # atlas_add_test( TriggerAlgorithmsTestJobData
-  #    SCRIPT TriggerAlgorithmsTest_eljob.py --data-type data --unit-test
-  #    PROPERTIES TIMEOUT 600 )
-  # atlas_add_test( TriggerAlgorithmsTestJobFullSim
-  #    SCRIPT TriggerAlgorithmsTest_eljob.py --data-type mc --unit-test
-  #    PROPERTIES TIMEOUT 600 )
-  # atlas_add_test( TriggerAlgorithmsTestJobFastSim
-  #    SCRIPT TriggerAlgorithmsTest_eljob.py --data-type afii --unit-test
-  #    PROPERTIES TIMEOUT 600 )
+  atlas_add_test( TriggerAlgorithmsTestJobData
+     SCRIPT TriggerAlgorithmsTest_eljob.py --data-type data --unit-test
+     PROPERTIES TIMEOUT 600 )
+  atlas_add_test( TriggerAlgorithmsTestJobFullSim
+     SCRIPT TriggerAlgorithmsTest_eljob.py --data-type mc --unit-test
+     PROPERTIES TIMEOUT 600 )
+  atlas_add_test( TriggerAlgorithmsTestJobFastSim
+     SCRIPT TriggerAlgorithmsTest_eljob.py --data-type afii --unit-test
+     PROPERTIES TIMEOUT 600 )
 else()
    atlas_add_test( TriggerAlgorithmsTestJobData
       SCRIPT athena.py
diff --git a/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/share/TriggerAlgorithmsTest_eljob.py b/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/share/TriggerAlgorithmsTest_eljob.py
index ffcf2f3e48d094cfd01f7a222259706ee2cfa53c..4ac99cd0b355a9b992f3f3080329de19f92a7fe9 100755
--- a/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/share/TriggerAlgorithmsTest_eljob.py
+++ b/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/share/TriggerAlgorithmsTest_eljob.py
@@ -54,7 +54,7 @@ job.options().setString( ROOT.EL.Job.optSubmitDirMode, "unique" )
 
 from TriggerAnalysisAlgorithms.TriggerAnalysisAlgorithmsTest import makeSequence
 algSeq = makeSequence (dataType)
-print algSeq # For debugging
+print(algSeq) # For debugging
 for alg in algSeq:
     job.algsAdd( alg )
     pass
diff --git a/PhysicsAnalysis/AnalysisCommon/AssociationUtils/test/ut_assocUtilsDict.py b/PhysicsAnalysis/AnalysisCommon/AssociationUtils/test/ut_assocUtilsDict.py
index 03dd766b26fd6e55fb86f420bf39cbc418839ff2..f7737faace2351eccb7a7c4acf50eec2d9657ff5 100755
--- a/PhysicsAnalysis/AnalysisCommon/AssociationUtils/test/ut_assocUtilsDict.py
+++ b/PhysicsAnalysis/AnalysisCommon/AssociationUtils/test/ut_assocUtilsDict.py
@@ -1,17 +1,13 @@
 #!/usr/bin/env python
-
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
+#
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+#
 # Test the reflex dictionary usage in PyROOT to
 # instantiate and configure the overlap removal tool(s).
 
 import sys
 sys.argv.append('-b')
 
-# Setup libs
-from ROOT import gROOT
-gROOT.Macro('$ROOTCOREDIR/scripts/load_packages.C')
-
 # Import using the PyROOT bindings and reflex dictionary
 from ROOT import ORUtils
 
@@ -25,11 +21,11 @@ def test_sc(statuscode):
 def test_tool_init(tool_type, verbose=False):
     """Performs simple construction and default initialization of a tool"""
     if verbose:
-        print 'Initializing tool', tool_type.__name__
+        print( 'Initializing tool %s' % tool_type.__name__ )
     tool = tool_type(tool_type.__name__)
     test_sc(tool.initialize())
     if verbose:
-        print '  => Success'
+        print( '  => Success' )
     return tool
 
 # Configure the new master tool
diff --git a/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/CMakeLists.txt b/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/CMakeLists.txt
deleted file mode 100644
index 64a102198686e2c74fb52f6e90c30879b5cfc582..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/CMakeLists.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-################################################################################
-# Package: TrigCostD3PDMaker
-################################################################################
-
-# Declare the package name:
-atlas_subdir( TrigCostD3PDMaker )
-
-# Component(s) in the package:
-atlas_add_library( TrigCostD3PDMakerLib
-                   src/*.cxx
-                   NO_PUBLIC_HEADERS
-                   LINK_LIBRARIES StoreGateLib SGtests
-                   PRIVATE_LINK_LIBRARIES AthenaBaseComps AthenaKernel GaudiKernel TrigConfHLTData TrigConfL1Data TrigMonitoringEvent D3PDMakerInterfaces TrigConfInterfaces )
-
-atlas_add_component( TrigCostD3PDMaker
-                     src/components/*.cxx
-                     LINK_LIBRARIES AthenaBaseComps AthenaKernel StoreGateLib SGtests GaudiKernel TrigConfHLTData TrigConfL1Data TrigMonitoringEvent TrigCostD3PDMakerLib D3PDMakerInterfaces TrigConfInterfaces )
-
-# Install files from the package:
-atlas_install_python_modules( python/*.py )
-atlas_install_joboptions( share/*.py )
-
diff --git a/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/python/TrigCostConfMetadata.py b/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/python/TrigCostConfMetadata.py
deleted file mode 100644
index e6d11edbef3676d92b1e9d1739441f380d8a5a83..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/python/TrigCostConfMetadata.py
+++ /dev/null
@@ -1,84 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-# $Id: TrigConfMetadata.py 618376 2014-09-24 15:33:35Z tamartin $
-#
-# This module holds the code that should be used to add trigger configuration
-# metadata to the D3PD.
-#
-
-def addTrigCostConfMetadata( d3pdalg = None, doCostL2 = False, doCostEF = False, doCostHLT = False, tuplePath = "" ):
-
-    """Helper function that adds the necessary tool(s) and service(s) to the
-       job to save the trigger configuration metadata to the output D3PD
-       file.
-
-        Arguments:
-          d3pdalg: The D3PD::MakerAlg that is creating the D3PD. If not specified,
-                   the configuration is saved in a file called TrigConfig.root
-          useTrigConfEventSummaries:	Set true when running in AtlasP1HLT or trigger BS
-                   to gather detailed configuration from TrigConfEvent
-                   summary objects (TrigCost running). 
-    """
-
-    # Create a logger for the function:
-    if "logger" in dir(): orig_logger = logger
-    from AthenaCommon.Logging import logging
-    logger = logging.getLogger( "addTrigConfMetadata" )
-
-    # Let the user know what we're doing:
-    logger.info( "Adding trigger configuration metadata to the D3PD" )
-
-    # The tool needs a special D3PDSvc in which the indexing is turned off
-    # for the TTree-s:
-    _d3pdSvcName = "TrigConfD3PDSvc"
-    from AthenaCommon.AppMgr import ServiceMgr
-    if not hasattr( ServiceMgr, _d3pdSvcName ):
-        from D3PDMakerRoot.D3PDMakerRootConf import D3PD__RootD3PDSvc
-        ServiceMgr += D3PD__RootD3PDSvc( _d3pdSvcName )
-        ServiceMgr.TrigConfD3PDSvc.MasterTree = ""
-        ServiceMgr.TrigConfD3PDSvc.IndexMajor = ""
-    else:
-        logger.info( "The private D3PDSvc for the metadata TTree already exists" )
-    _d3pdSvc = getattr( ServiceMgr, _d3pdSvcName )
-
-    # If no D3PD::MakerAlg has been provided, create a dummy one:
-    if d3pdalg == None:
-        logger.warning( "No D3PD MakerAlg given to function!" )
-        logger.warning( "The trigger configuration will be saved into file: " +
-                        "\"TrigConfig.root\"" )
-        from AthenaCommon.AlgSequence import AlgSequence
-        theJob = AlgSequence()
-        import D3PDMakerCoreComps
-        d3pdalg = D3PDMakerCoreComps.MakerAlg( "trigConf", theJob, file = "TrigConfig.root",
-                                               D3PDSvc = _d3pdSvc )
-
-    # Add the metadata tool:
-    _d3pdToolName = "TrigCostConfMetadataTool"
-    if not _d3pdToolName in [ t.name() for t in d3pdalg.MetadataTools ]:
-        import TrigCostD3PDMaker
-        if (tuplePath == ""):
-          tuplePath = d3pdalg.TuplePath
-        _trigConfTool = TrigCostD3PDMaker.TrigCostConfMetadataTool( _d3pdToolName,
-                                                                   D3PDSvc = _d3pdSvc,
-                                                                   ConfigDir = tuplePath + "Meta" )
-        # Figure out if old or new style HLT if using CostMon to get correct storegate key
-        # Old key fomat was HLT_OPI_HLT_monitoring_config
-        if (doCostL2 == True or doCostEF == True or doCostHLT == True):
-          logger.info( "TrigCostConfMetadataTool will use passed arguments [L2="+str(doCostL2)+",EF="+str(doCostEF)+",HLT="+str(doCostHLT)+"]" )
-          if (doCostL2 == True or doCostEF == True):
-            _trigConfTool.keyConfig = "HLT_TrigMonConfigCollection_OPI_EF_monitoring_config"
-          elif (doCostHLT == True):
-            _trigConfTool.keyConfig = "HLT_TrigMonConfigCollection_OPI_HLT_monitoring_config"
-        else: 
-          logger.info( "TrigCostConfMetadataTool will use TriggerFlags flags for config" )
-          from TriggerJobOpts.TriggerFlags import TriggerFlags
-          if TriggerFlags.doHLT() and not (TriggerFlags.doEF() or TriggerFlags.doLVL2()):
-            _trigConfTool.keyConfig = "HLT_TrigMonConfigCollection_OPI_HLT_monitoring_config"
-          elif TriggerFlags.doEF() or TriggerFlags.doLVL2():
-            _trigConfTool.keyConfig = "HLT_TrigMonConfigCollection_OPI_EF_monitoring_config"
-        logger.info( "TrigConfMetadataTool will use the StoreGate key " + _trigConfTool.keyConfig )
-        d3pdalg.MetadataTools += [ _trigConfTool ]
-    else:
-      logger.info( "TrigCostConfMetadataTool was already added to the D3PD::MakerAlg" )
-
-    return
diff --git a/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/python/__init__.py b/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/python/__init__.py
deleted file mode 100644
index 1cb74541566b7993be87dc69a4e2685ca7cc34ba..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/python/__init__.py
+++ /dev/null
@@ -1,23 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-# $Id$
-#
-# @file TriggerD3PDMaker/python/__init__.py
-# @author scott snyder <snyder@bnl.gov>
-# @date Sep, 2009
-# @brief Define shortcuts for referencing configurables in this package.
-#
-# With this, instead of writing
-#
-#   TrigCostD3PDMaker.TrigCostD3PDMakerConf.D3PD__FourMomFillerTool
-#
-# we can write
-#
-#   TrigCostD3PDMaker.FourMomFillerTool
-#
-
-import TrigCostD3PDMaker.TrigCostD3PDMakerConf
-for k, v in TrigCostD3PDMakerConf.__dict__.items():
-    if k.startswith ('D3PD__'):
-        globals()[k[6:]] = v
-
diff --git a/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/python/addTrigCostData.py b/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/python/addTrigCostData.py
deleted file mode 100644
index bfff78e7939a055c42c17f67c9b2fbcad8689782..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/python/addTrigCostData.py
+++ /dev/null
@@ -1,63 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-# $Id: addTrigCostD3PD.py tamartin
-#
-# Add a trig cost D3PD output stream
-
-def addTrigCostData(mode = "COST", fileName = "trig_cost.root", costConfigL2 = False, costConfigEF = False, costConfigHLT = True):
-
-    # Set up a logger:
-    from AthenaCommon.Logging import logging
-    addTrigCostData_msg = logging.getLogger( 'addTrigCostData' )
-
-    # Construct the stream and file names for the Trigger D3PD:
-    streamName = "StreamNTUP_TRIG" + mode
-    addTrigCostData_msg.info( "Configuring Trigger Cost D3PD from bytestream with streamName '%s' and fileName '%s'" % ( streamName, fileName ) )
-
-    # Create the D3PD stream(s):
-    # We dont actually use the default stream! 
-    from OutputStreamAthenaPool.MultipleStreamManager import MSMgr
-    d3pdalg = MSMgr.NewRootStream( streamName, fileName, "dummy" )
-      
-    # As we are running from bytestream, need to disable data headers.
-    from AthenaCommon.AlgSequence import AlgSequence
-    theJob = AlgSequence()
-    fullStreamName = "StreamNTUP_TRIG" + mode + "AANTStream"
-    if hasattr(theJob, fullStreamName):
-        streamRef = getattr( theJob, fullStreamName )
-        streamRef.ExistDataHeader = False
-        streamRef.WriteInputDataHeader = False
-
-    # The tool needs a special D3PDSvc in which the indexing is turned off for the TTree-s:
-    _costD3PDSvcName = "TrigCostD3PDSvc_" + mode
-    from AthenaCommon.AppMgr import ServiceMgr
-    if not hasattr( ServiceMgr, _costD3PDSvcName ):
-        from D3PDMakerRoot.D3PDMakerRootConf import D3PD__RootD3PDSvc
-        ServiceMgr += D3PD__RootD3PDSvc( _costD3PDSvcName )
-    else:
-        addTrigCostData_msg.info( "The private D3PDSvc for the cost monitoring TTree already exists" )
-    _costD3PDSvc = getattr( ServiceMgr, _costD3PDSvcName )
-    _costD3PDSvc.MasterTree = ""
-    _costD3PDSvc.IndexMajor = ""
-
-    # Add the tool:
-    _costD3PDToolName = "TrigCostD3PDMakerTool_" + mode
-    _tuplePath = "/StreamNTUP_TRIG" + mode + "/trig_cost"
-    if not _costD3PDToolName in [ t.name() for t in d3pdalg.MetadataTools ]:
-        import TrigCostD3PDMaker
-        _trigCostTool = TrigCostD3PDMaker.TrigCostD3PDMakerTool( _costD3PDToolName, D3PDSvc = _costD3PDSvc, dir = _tuplePath )
-        _trigCostTool.mode = mode
-        if (costConfigL2 == True):
-            _trigCostTool.keyEvent = "HLT_TrigMonEventCollection_OPI_L2_monitoring_event"
-            _trigCostTool.prefix = "TrigCostL2_"
-        elif (costConfigEF == True):
-            _trigCostTool.keyEvent = "HLT_TrigMonEventCollection_OPI_EF_monitoring_event"
-            _trigCostTool.prefix = "TrigCostEF_"
-        elif (costConfigHLT == True):
-            _trigCostTool.keyEvent = "HLT_TrigMonEventCollection_OPI_HLT_monitoring_event"
-            _trigCostTool.prefix = "TrigCostHLT_"
-        d3pdalg.MetadataTools += [ _trigCostTool ]
-
-    if (mode != "EBWEIGHT"):
-      from TrigCostD3PDMaker.TrigCostConfMetadata import addTrigCostConfMetadata
-      addTrigCostConfMetadata( d3pdalg, costConfigL2, costConfigEF, costConfigHLT, _tuplePath )
diff --git a/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/share/TrigCostD3PDMaker_prodJobOFragment.py b/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/share/TrigCostD3PDMaker_prodJobOFragment.py
deleted file mode 100644
index 224ac76003a47032163fc162e0a186edfc96a340..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/share/TrigCostD3PDMaker_prodJobOFragment.py
+++ /dev/null
@@ -1,27 +0,0 @@
-# $Id: TrigCostD3PD_prodJobOFragment.py tamartin
-#
-# Top jobO fragment setting up the common Trig Cost (NTUP_TRIG_COST).
-
-# This jobO should not be included more than once:
-include.block( "TrigCost3PDMaker/TrigCostD3PDMaker_prodJobOFragment.py" )
-
-from AthenaCommon.Logging import logging
-TrigCostD3PDStream_msg = logging.getLogger( 'TrigCostD3PDMaker_prodJobOFragment' )
-
-costConfigL2 = False
-costConfigEF = False
-costConfigHLT = False
-if ('costD3PD_doL2' in dir() or 'costD3PD_doEF' in dir() or 'costD3PD_doHLT' in dir()):
-    TrigCostD3PDStream_msg.info( "Configuring via cosD3PD flags" );
-    if ('costD3PD_doL2' in dir() and bool(costD3PD_doL2) == True):   costConfigL2 = True
-    if ('costD3PD_doEF' in dir() and bool(costD3PD_doEF) == True):   costConfigEF = True
-    if ('costD3PD_doHLT' in dir() and bool(costD3PD_doHLT) == True): costConfigHLT = True
-else:
-    TrigCostD3PDStream_msg.info( "Configuring via TriggerFlags" );
-    from TriggerJobOpts.TriggerFlags import TriggerFlags
-    if TriggerFlags.doLVL2(): costConfigL2 = True
-    if TriggerFlags.doEF():   costConfigEF = True
-    if TriggerFlags.doHLT():  costConfigHLT = True
-
-from TrigCostD3PDMaker.addTrigCostData import addTrigCostData
-addTrigCostData("COST", "trig_cost.root", costConfigL2, costConfigEF, costConfigHLT);
\ No newline at end of file
diff --git a/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/share/TrigEBWeightD3PDMaker_prodJobOFragment.py b/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/share/TrigEBWeightD3PDMaker_prodJobOFragment.py
deleted file mode 100644
index 52c81eb68ec8fd28138e627ccec6964ea7f9645e..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/share/TrigEBWeightD3PDMaker_prodJobOFragment.py
+++ /dev/null
@@ -1,27 +0,0 @@
-# $Id: TrigCostD3PD_prodJobOFragment.py tamartin
-#
-# Top jobO fragment setting up the common Trig Cost (NTUP_TRIG_COST).
-
-# This jobO should not be included more than once:
-include.block( "TrigCost3PDMaker/TrigEBWeightD3PDMaker_prodJobOFragment.py" )
-
-from AthenaCommon.Logging import logging
-TrigEBWeightD3PDStream_msg = logging.getLogger( 'TrigEBWeightD3PDMaker_prodJobOFragment' )
-
-costConfigL2 = False
-costConfigEF = False
-costConfigHLT = False
-if ('costD3PD_doL2' in dir() or 'costD3PD_doEF' in dir() or 'costD3PD_doHLT' in dir()):
-    TrigEBWeightD3PDStream_msg.info( "Configuring via cosD3PD flags" );
-    if ('costD3PD_doL2' in dir() and bool(costD3PD_doL2) == True):   costConfigL2 = True
-    if ('costD3PD_doEF' in dir() and bool(costD3PD_doEF) == True):   costConfigEF = True
-    if ('costD3PD_doHLT' in dir() and bool(costD3PD_doHLT) == True): costConfigHLT = True
-else:
-    TrigEBWeightD3PDStream_msg.info( "Configuring via TriggerFlags" );
-    from TriggerJobOpts.TriggerFlags import TriggerFlags
-    if TriggerFlags.doLVL2(): costConfigL2 = True
-    if TriggerFlags.doEF():   costConfigEF = True
-    if TriggerFlags.doHLT():  costConfigHLT = True
-
-from TrigCostD3PDMaker.addTrigCostData import addTrigCostData
-addTrigCostData("EBWEIGHT", "trig_ebweight.root", costConfigL2, costConfigEF, costConfigHLT);
\ No newline at end of file
diff --git a/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/share/TrigRateD3PDMaker_prodJobOFragment.py b/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/share/TrigRateD3PDMaker_prodJobOFragment.py
deleted file mode 100644
index cc0f28d2514722aec91a373e4636d9d20f7346a1..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/share/TrigRateD3PDMaker_prodJobOFragment.py
+++ /dev/null
@@ -1,27 +0,0 @@
-# $Id: TrigCostD3PD_prodJobOFragment.py tamartin
-#
-# Top jobO fragment setting up the common Trig Cost (NTUP_TRIG_COST).
-
-# This jobO should not be included more than once:
-include.block( "TrigCost3PDMaker/TrigRateD3PDMaker_prodJobOFragment.py" )
-
-from AthenaCommon.Logging import logging
-TrigRateD3PDStream_msg = logging.getLogger( 'TrigRateD3PDMaker_prodJobOFragment' )
-
-costConfigL2 = False
-costConfigEF = False
-costConfigHLT = False
-if ('costD3PD_doL2' in dir() or 'costD3PD_doEF' in dir() or 'costD3PD_doHLT' in dir()):
-    TrigRateD3PDStream_msg.info( "Configuring via cosD3PD flags" );
-    if ('costD3PD_doL2' in dir() and bool(costD3PD_doL2) == True):   costConfigL2 = True
-    if ('costD3PD_doEF' in dir() and bool(costD3PD_doEF) == True):   costConfigEF = True
-    if ('costD3PD_doHLT' in dir() and bool(costD3PD_doHLT) == True): costConfigHLT = True
-else:
-    TrigRateD3PDStream_msg.info( "Configuring via TriggerFlags" );
-    from TriggerJobOpts.TriggerFlags import TriggerFlags
-    if TriggerFlags.doLVL2(): costConfigL2 = True
-    if TriggerFlags.doEF():   costConfigEF = True
-    if TriggerFlags.doHLT():  costConfigHLT = True
-
-from TrigCostD3PDMaker.addTrigCostData import addTrigCostData
-addTrigCostData("RATE", "trig_rate.root", costConfigL2, costConfigEF, costConfigHLT);
\ No newline at end of file
diff --git a/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/src/TrigCostConfMetadataTool.cxx b/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/src/TrigCostConfMetadataTool.cxx
deleted file mode 100644
index d58388207065d6eef70b3ec85ededf0e948f0978..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/src/TrigCostConfMetadataTool.cxx
+++ /dev/null
@@ -1,510 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: TrigConfMetadataTool.cxx 729020 2016-03-10 17:55:29Z tamartin $
-
-// Athena/Gaudi include(s):
-#include "AthenaKernel/errorcheck.h"
-
-// STL include(s):
-#include "limits.h"
-
-// Trigger configuration include(s):
-#include "TrigConfL1Data/CTPConfig.h"
-#include "TrigConfL1Data/Menu.h"
-#include "TrigConfL1Data/TriggerItem.h"
-#include "TrigConfL1Data/PrescaleSet.h"
-#include "TrigConfHLTData/HLTChainList.h"
-#include "TrigConfHLTData/HLTChain.h"
-
-// Trigger [TrigMonConfig] data include(s):
-#include "TrigMonitoringEvent/TrigMonConfigCollection.h"
-#include "TrigMonitoringEvent/TrigMonEventCollection.h"
-#include "TrigMonitoringEvent/TrigConfChain.h"
-#include "TrigMonitoringEvent/TrigConfSeq.h"
-#include "TrigMonitoringEvent/TrigConfSig.h"
-#include "TrigMonitoringEvent/TrigConfAlg.h"
-
-// D3PDMaker include(s):
-#include "D3PDMakerInterfaces/ID3PD.h"
-
-// Local include(s):
-#include "TrigCostConfMetadataTool.h"
-
-namespace D3PD {
-
-   TrigCostConfMetadataTool::TrigCostConfMetadataTool( const std::string& type,
-                                               const std::string& name,
-                                               const IInterface* parent )
-      : AthAlgTool( type, name, parent ),
-        m_configDir( "" ),
-        m_trigConfSvc( "TrigConf::TrigConfigSvc/TrigConfigSvc", name ),
-        m_incidentSvc( "IncidentSvc", name ),
-        m_d3pdSvc( "D3PD::RootD3PDSvc/TrigConfD3PDSvc", name ),
-        m_storeGate( "StoreGateSvc", name),
-        m_configKeyCache(),
-        m_configTree( 0 ), m_smk( 0 ), m_l1psk( 0 ), m_hltpsk( 0 ),
-        m_lvl1ConfigNameMap( 0 ), m_lvl1ConfigPSKMap( 0 ),
-        m_hltConfigNameMap( 0 ), m_hltConfigPSKMap( 0 ),
-        m_hltConfigRPSKMap( 0 ), m_hltConfigPTMap( 0 ),
-        m_hltConfigLowerChainNameMap( 0 ),
-
-        m_chainN (nullptr),
-        m_chainID (nullptr),
-        m_chainCounter (nullptr),
-        m_chainName (nullptr),
-        m_chainLowerID (nullptr),
-        m_chainLowerIDs (nullptr),
-        m_chainLowerName (nullptr),
-        m_chainLowerCounter (nullptr),
-        m_chainLevel (nullptr),
-        m_chainPrescale (nullptr),
-        m_chainPassthrough (nullptr),
-        m_chainStreamNames (nullptr),
-        m_chainStreamPrescales (nullptr),
-        m_chainGroupNames (nullptr),
-        m_chainEBHypoNames (nullptr),
-        m_chainSigN (nullptr),
-        m_chainSigCounter (nullptr),
-        m_chainSigLogic (nullptr),
-        m_chainSigLabel (nullptr),
-        m_chainSigOutputTEn (nullptr),
-        m_chainSigOutputTEIndex (nullptr),
-        m_chainSigOutputTEs (nullptr),
-        m_seqN (nullptr),
-        m_seqID (nullptr),
-        m_seqIndex (nullptr),
-        m_seqName (nullptr),
-        m_seqTopoTEID (nullptr),
-        m_seqInputTEs (nullptr),
-        m_seqAlgN (nullptr),
-        m_seqAlgIndex (nullptr),
-        m_seqAlgPosition (nullptr),
-        m_seqAlgNameID (nullptr),
-        m_seqAlgTypeID (nullptr),
-        m_seqAlgName (nullptr),
-        m_seqAlgTypeName (nullptr),
-        m_confVarKey (nullptr),
-        m_confVarVal (nullptr),
-        m_confStringKey (nullptr),
-        m_confStringVal (nullptr)
-   {
-
-      declareProperty( "ConfigDir", m_configDir = "/D3PD/d3pdMeta" );
-      declareProperty( "TrigConfigSvc", m_trigConfSvc );
-      declareProperty( "IncidentSvc", m_incidentSvc );
-      declareProperty( "D3PDSvc", m_d3pdSvc );
-      declareProperty( "keyConfig", m_keyConfig = "HLT_OPI_HLT_monitoring_config"); ///< [TrigMonConfig] Name of TrigerConfigurationObject
-   }
-
-   StatusCode TrigCostConfMetadataTool::initialize() {
-
-      ATH_MSG_INFO( "Initializing. Package version: " << PACKAGE_VERSION );
-
-      // Retrieve the needed services:
-      CHECK( m_trigConfSvc.retrieve() );
-      CHECK( m_incidentSvc.retrieve() );
-      CHECK( m_d3pdSvc.retrieve() );
-      CHECK( m_storeGate.retrieve() );
-
-      // Set up the tool to listen to a few incidents:
-       m_incidentSvc->addListener( this, IncidentType::EndEvent );
-
-      // Create the configuration objects through the D3PD service:
-      CHECK( m_d3pdSvc->make( m_configDir + "/TrigConfTree", m_configTree ) );
-
-      // Add the variables to the configuration "tree":
-      CHECK( m_configTree->addVariable( "SMK",    m_smk,
-                                        "Super Master Key" ) );
-      CHECK( m_configTree->addVariable( "L1PSK",  m_l1psk,
-                                        "LVL1 PreScale Key" ) );
-      CHECK( m_configTree->addVariable( "HLTPSK", m_hltpsk,
-                                        "HLT PreScale Key" ) );
-
-      CHECK( m_configTree->addVariable( "LVL1NameMap", m_lvl1ConfigNameMap,
-                                        "LVL1 item name -> CTP ID mapping" ) );
-      CHECK( m_configTree->addVariable( "LVL1PrescaleMap", m_lvl1ConfigPSKMap,
-                                        "LVL1 item name -> Prescale value mapping" ) );
-      CHECK( m_configTree->addVariable( "HLTNameMap", m_hltConfigNameMap,
-                                        "HLT chain name -> Chain ID mapping" ) );
-      CHECK( m_configTree->addVariable( "HLTPrescaleMap", m_hltConfigPSKMap,
-                                        "HLT chain name -> Prescale value mapping" ) );
-      CHECK( m_configTree->addVariable( "HLTRerunPrescaleMap", m_hltConfigRPSKMap,
-                                        "HLT chain name -> Re-run prescale value mapping" ) );
-      CHECK( m_configTree->addVariable( "HLTPassthroughMap", m_hltConfigPTMap,
-                                        "HLT chain name -> Passthrough value mapping" ) );
-      CHECK( m_configTree->addVariable( "HLTLowerChainNameMap",
-                                        m_hltConfigLowerChainNameMap,
-                                        "HLT chain name -> Lower chain/item name mapping" ) );
-                                        
-      // variables for CHAIN
-      CHECK( m_configTree->addVariable( "chainConfig_n", m_chainN, "Number of chains (including L1)" ) );
-      CHECK( m_configTree->addVariable( "chainConfig_ID", m_chainID, "Hash value of chain name" ) );
-      CHECK( m_configTree->addVariable( "chainConfig_counter", m_chainCounter, "HLT chain counter or L1 CTPID" ) );
-      CHECK( m_configTree->addVariable( "chainConfig_name", m_chainName, "Chain name" ) );
-      CHECK( m_configTree->addVariable( "chainConfig_lowerID", m_chainLowerID, "Hash of lower seeding chain name" ) );
-      CHECK( m_configTree->addVariable( "chainConfig_lowerChainIDs", m_chainLowerIDs, "Vector of hashes of lower seeding chain names for multi-seeded chains" ) );
-      CHECK( m_configTree->addVariable( "chainConfig_lowerName", m_chainLowerName, "Name of lower seeding chain(s), comma separated" ) );
-      CHECK( m_configTree->addVariable( "chainConfig_lowerCounter", m_chainLowerCounter, "Counter of lower seeding chain" ) );
-      CHECK( m_configTree->addVariable( "chainConfig_level", m_chainLevel, "Level of chain (1,2,3)" ) );
-      CHECK( m_configTree->addVariable( "chainConfig_prescale", m_chainPrescale, "Chain prescale setting" ) );
-      CHECK( m_configTree->addVariable( "chainConfig_passthrough", m_chainPassthrough, "Chain passthrough setting" ) );
-      CHECK( m_configTree->addVariable( "chainConfig_streamNames", m_chainStreamNames, "Vector of chain stream names" ) );
-      CHECK( m_configTree->addVariable( "chainConfig_streamPrescales", m_chainStreamPrescales, "Vector of stream prescales for chain" ) );
-      CHECK( m_configTree->addVariable( "chainConfig_groupNames", m_chainGroupNames, "Vector of group names for chain" ) );
-      CHECK( m_configTree->addVariable( "chainConfig_EBHypoNames", m_chainEBHypoNames, "Vector of L1 items from EB Hypo" ) );
-      // variables for CHAIN -> SIGNATURE
-      CHECK( m_configTree->addVariable( "chainConfig_sig_n", m_chainSigN, "Number of signatures in chain" ) );
-      CHECK( m_configTree->addVariable( "chainConfig_sig_counter", m_chainSigCounter, "Signature position in chain" ) );
-      CHECK( m_configTree->addVariable( "chainConfig_sig_logic", m_chainSigLogic, "Singmature logic" ) );
-      CHECK( m_configTree->addVariable( "chainConfig_sig_label", m_chainSigLabel, "Singature label" ) );
-      CHECK( m_configTree->addVariable( "chainConfig_sig_outputTE_n", m_chainSigOutputTEn, "Number of output Trigger Elements from signature" ) );
-      CHECK( m_configTree->addVariable( "chainConfig_sig_outputTE_index", m_chainSigOutputTEIndex, "Index in vector containing Trigger Element outputs" ) );
-      CHECK( m_configTree->addVariable( "chainConfig_sigOutputTEs", m_chainSigOutputTEs, "Vector of vector<TE_Outputs>, use outputTE_index to locate the correct entry" ) );
-                                   
-      // variables for SEQUENCE
-      CHECK( m_configTree->addVariable( "seqConfig_n", m_seqN, "Number of sequences in configuration" ) );
-      CHECK( m_configTree->addVariable( "seqConfig_outputTEID", m_seqID, "ID of trigger element output" ) );
-      CHECK( m_configTree->addVariable( "seqConfig_outputTEIndex", m_seqIndex, "Index of output TE" ) );
-      CHECK( m_configTree->addVariable( "seqConfig_outputTEName", m_seqName, "Name of output TE" ) );
-      CHECK( m_configTree->addVariable( "seqConfig_topoTEID", m_seqTopoTEID, "ID of topo start TE" ) );
-      CHECK( m_configTree->addVariable( "seqConfig_inputTEs", m_seqInputTEs, "Vector of input TE IDs" ) );
-      // variables for SEQUENCE -> ALG
-      CHECK( m_configTree->addVariable( "seqConfig_alg_n", m_seqAlgN, "Number of algorithms in sequence" ) );
-      CHECK( m_configTree->addVariable( "seqConfig_alg_index", m_seqAlgIndex, "Unique algorithm index in current configuration" ) );
-      CHECK( m_configTree->addVariable( "seqConfig_alg_position", m_seqAlgPosition, "Position of algorithm in sequence" ) );
-      CHECK( m_configTree->addVariable( "seqConfig_alg_nameID", m_seqAlgNameID, "Hash of alg name" ) );
-      CHECK( m_configTree->addVariable( "seqConfig_alg_typeID", m_seqAlgTypeID, "Hash of class name" ) );
-      CHECK( m_configTree->addVariable( "seqConfig_alg_name", m_seqAlgName, "Algorithm instance name" ) );
-      CHECK( m_configTree->addVariable( "seqConfig_alg_typeName", m_seqAlgTypeName, "Algorithm base class name" ) );
-      // variables for misc other config data
-      CHECK( m_configTree->addVariable( "config_miscVarKey", m_confVarKey, "Key to misc additional config int payload" ) );
-      CHECK( m_configTree->addVariable( "config_miscVarVal", m_confVarVal, "Value of additional config int payload" ) );
-      CHECK( m_configTree->addVariable( "config_miscStringKey", m_confStringKey, "Key to misc additional config string payload" ) );
-      CHECK( m_configTree->addVariable( "config_miscStringVal", m_confStringVal, "alue of additional config string payload" ) );
-            
-      // Clear the cache, just to be sure:
-      m_configKeyCache.clear();
-
-      return StatusCode::SUCCESS;
-   }
-
-   StatusCode TrigCostConfMetadataTool::queryInterface( const InterfaceID& riid,
-                                                    void** ppvIf ) {
-
-      if( riid == IMetadataTool::interfaceID() ) {
-         *ppvIf = static_cast< IMetadataTool* >( this );
-         addRef();
-         return StatusCode::SUCCESS;
-      } else if( riid == IIncidentListener::interfaceID() ) {
-         *ppvIf = static_cast< IIncidentListener* >( this );
-         addRef();
-         return StatusCode::SUCCESS;
-      }
-
-      return AthAlgTool::queryInterface( riid, ppvIf );
-   }
-
-   /**
-    * The function is actually empty. The metadata should already be in the output
-    * file at this point...
-    */
-   StatusCode TrigCostConfMetadataTool::writeMetadata( ID3PD* ) {
-
-      ATH_MSG_INFO( "Trigger configuration available in the D3PD in directory: \""
-                    << m_configDir << "\"" );
-
-      return StatusCode::SUCCESS;
-   }
-
-   /**
-    * This function is called whenever an incident happens that the tool
-    * was set up to listen to. The function has to decide what kind of
-    * incident it was, and the call the appropriate internal function to
-    * handle that incident.
-    *
-    * @param inc The incident that happened
-    */
-   void TrigCostConfMetadataTool::handle( const Incident& inc ) {
-
-      //
-      // Handle trigger configuration change incidents:
-      //
-      if( inc.type() == IncidentType::EndEvent ) { 
-         handleNewTrigConfFromDataStore( inc );
-         return;
-      }
-
-      ATH_MSG_WARNING( "Received incident not recognised" );
-      return;
-   }
-   
-   
-    /**
-    * This function translates a *full* trigger configuration into a ROOT 
-    * native format, instead of Oracle - it uses TrigConfEvent objects
-    * from the trigger cost monitor as its source of summarised trigger
-    * configuration data.
-    *
-    * To get this full summary, set UseTrigConfEventSummaries=True and
-    * ensure that the cost monitoring infrastructure is enabled.
-    */
-   void TrigCostConfMetadataTool::handleNewTrigConfFromDataStore( const Incident& ) {
-      
-      const TrigMonConfigCollection *configCol = 0;
- 
-      if( !m_storeGate->contains<TrigMonConfigCollection>(m_keyConfig) ) {
-         ATH_MSG_DEBUG( "No TrigMonConfigCollection in this event Key:" << m_keyConfig );
-         return;
-      } else {
-         ATH_MSG_INFO( "TrigMonConfigCollection in this event Key:" << m_keyConfig << ". The configs will be saved." );
-      }
-   
-      if( m_storeGate->retrieve(configCol, m_keyConfig).isFailure() || !configCol) {
-         ATH_MSG_WARNING( "TrigMonConfigCollection present, however failed to retrieve from SG. Key:" << m_keyConfig );
-         return;
-      }
-      
-      ATH_MSG_DEBUG( "Got TrigMonConfigCollection: " << m_keyConfig << " Size:" << configCol->size() );
-
-      for( TrigMonConfigCollection::const_iterator it = configCol->begin(); it != configCol->end(); ++it) {
-         const TrigMonConfig* tmc = *it;
-         if(!tmc) continue;
-
-         Keys config_keys;
-
-         // Find out if the configuration that's just been loaded by the
-         // configuration service, has been already translated in this job.
-         // In that case there's no reason to translate it again.
-         // TimM - now use the info from the object
-         config_keys.first = tmc->getMasterKey();
-         config_keys.second.first = tmc->getLV1PrescaleKey();
-         config_keys.second.second = tmc->getHLTPrescaleKey();
-         if( m_configKeyCache.find( config_keys ) != m_configKeyCache.end() ) {
-            ATH_MSG_INFO( "Configuration with keys from triggerKeyTool SMK: "
-                           << config_keys.first << ", L1PSK: "
-                           << config_keys.second.first
-                           << ", HLT PSK: "
-                           << config_keys.second.second
-                           << " already translated" );
-            continue;
-         }
-
-         // Let the user know what we're doing:
-         // Use keys from tool as keys stored in object appear to be wrong
-         // Object keys are tmc->getMasterKey(), tmc->getLV1PrescaleKey(), mc->getHLTPrescaleKey()
-         ATH_MSG_INFO( "Translating trigger configuration from TrigMonConfig source" );
-         ATH_MSG_INFO( "  SMK: " << config_keys.first
-                    << ", L1 PSK: " << config_keys.second.first
-                    << ", HLT PSK: " << config_keys.second.second ); 
-  
-         /// Save detailed Sequence and Algorithm details
-         const std::vector<TrigConfSeq> configSeqs   = tmc->getVec<TrigConfSeq>();
-         *m_seqN          = configSeqs.size();
-         // variables for SEQUENCE
-         m_seqID          ->clear();
-         m_seqIndex       ->clear();
-         m_seqName        ->clear();
-         m_seqTopoTEID    ->clear();
-         m_seqInputTEs    ->clear();
-         //
-         m_seqID          ->resize( configSeqs.size() );
-         m_seqIndex       ->resize( configSeqs.size() );
-         m_seqName        ->resize( configSeqs.size() );
-         m_seqTopoTEID    ->resize( configSeqs.size() );
-         m_seqInputTEs    ->resize( configSeqs.size() );
-         // variables for SEQUENCE -> ALG
-         m_seqAlgN        ->clear();
-         m_seqAlgIndex    ->clear();
-         m_seqAlgPosition ->clear();
-         m_seqAlgNameID   ->clear();
-         m_seqAlgTypeID   ->clear();
-         m_seqAlgName     ->clear();
-         m_seqAlgTypeName ->clear();
-         //
-         m_seqAlgN        ->resize( configSeqs.size() );
-         m_seqAlgIndex    ->resize( configSeqs.size() );
-         m_seqAlgPosition ->resize( configSeqs.size() );
-         m_seqAlgNameID   ->resize( configSeqs.size() );
-         m_seqAlgTypeID   ->resize( configSeqs.size() );
-         m_seqAlgName     ->resize( configSeqs.size() );
-         m_seqAlgTypeName ->resize( configSeqs.size() );
-         for(unsigned int i = 0; i < configSeqs.size(); ++i) {
-            m_seqID       ->at(i) = configSeqs.at(i).getId();
-            m_seqIndex    ->at(i) = configSeqs.at(i).getIndex();
-            m_seqName     ->at(i) = configSeqs.at(i).getName();
-            m_seqTopoTEID ->at(i) = configSeqs.at(i).getTopoTE();
-            m_seqInputTEs ->at(i) = configSeqs.at(i).getInputTEs(); //Direct fetch vector
-            // Loop over Alg items
-            const std::vector<TrigConfAlg> configSeqAlgs = configSeqs.at(i).getAlg();
-            m_seqAlgN         ->at(i)  = configSeqAlgs.size();
-            (m_seqAlgIndex    ->at(i)).resize( configSeqAlgs.size() );
-            (m_seqAlgPosition ->at(i)).resize( configSeqAlgs.size() );
-            (m_seqAlgNameID   ->at(i)).resize( configSeqAlgs.size() );
-            (m_seqAlgTypeID   ->at(i)).resize( configSeqAlgs.size() );
-            (m_seqAlgName     ->at(i)).resize( configSeqAlgs.size() );
-            (m_seqAlgTypeName ->at(i)).resize( configSeqAlgs.size() );
-            for (unsigned int j = 0; j < configSeqAlgs.size(); ++j) {
-               (m_seqAlgIndex    ->at(i)).at(j) = configSeqAlgs.at(j).getIndex();    
-               (m_seqAlgPosition ->at(i)).at(j) = configSeqAlgs.at(j).getPosition();
-               (m_seqAlgNameID   ->at(i)).at(j) = configSeqAlgs.at(j).getNameId();
-               (m_seqAlgTypeID   ->at(i)).at(j) = configSeqAlgs.at(j).getTypeId();
-               (m_seqAlgName     ->at(i)).at(j) = configSeqAlgs.at(j).getName();
-               (m_seqAlgTypeName ->at(i)).at(j) = configSeqAlgs.at(j).getType();
-            }
-         }
-         
-         /// Save Chain and Sig details
-         int TEIndex = 0;
-         const std::vector<TrigConfChain> configChains = tmc->getVec<TrigConfChain>();
-         *m_chainN               = configChains.size();
-         /// variables for CHAIN
-         m_chainID               ->clear();
-         m_chainCounter          ->clear();
-         m_chainName             ->clear();
-         m_chainLowerID          ->clear();
-         m_chainLowerIDs         ->clear();
-         m_chainLowerName        ->clear();
-         m_chainLowerCounter     ->clear();
-         m_chainLevel            ->clear();
-         m_chainPrescale         ->clear();
-         m_chainPassthrough      ->clear();
-         m_chainStreamNames      ->clear();
-         m_chainStreamPrescales  ->clear();
-         m_chainGroupNames       ->clear();
-         m_chainEBHypoNames      ->clear();
-         //
-         m_chainID               ->resize( configChains.size() );
-         m_chainCounter          ->resize( configChains.size() );
-         m_chainName             ->resize( configChains.size() );
-         m_chainLowerID          ->resize( configChains.size() );
-         m_chainLowerIDs         ->resize( configChains.size() );
-         m_chainLowerName        ->resize( configChains.size() );
-         m_chainLowerCounter     ->resize( configChains.size() );
-         m_chainLevel            ->resize( configChains.size() );
-         m_chainPrescale         ->resize( configChains.size() );
-         m_chainPassthrough      ->resize( configChains.size() );
-         m_chainStreamNames      ->resize( configChains.size() );
-         m_chainStreamPrescales  ->resize( configChains.size() );
-         m_chainGroupNames       ->resize( configChains.size() );
-         m_chainEBHypoNames      ->resize( configChains.size() );
-         /// variables for CHAIN -> SIGNATURE
-         m_chainSigN             ->clear();
-         m_chainSigCounter       ->clear();
-         m_chainSigLogic         ->clear();
-         m_chainSigLabel         ->clear();
-         m_chainSigOutputTEn     ->clear();
-         m_chainSigOutputTEIndex ->clear(); 
-         m_chainSigOutputTEs     ->clear();
-         //
-         m_chainSigN             ->resize( configChains.size() );
-         m_chainSigCounter       ->resize( configChains.size() );
-         m_chainSigLogic         ->resize( configChains.size() );
-         m_chainSigLabel         ->resize( configChains.size() );
-         m_chainSigOutputTEn     ->resize( configChains.size() );
-         m_chainSigOutputTEIndex ->resize( configChains.size() );
-         // We cannot resize m_chainSigOutputTEs as we don't know a priori how big it'll be.
-         for(unsigned int i = 0; i < configChains.size(); ++i) {
-            m_chainID             ->at(i) = configChains.at(i).getId();
-            m_chainCounter        ->at(i) = configChains.at(i).getCounter();
-            m_chainName           ->at(i) = configChains.at(i).getChainName();
-            m_chainLowerID        ->at(i) = configChains.at(i).getLowerId();
-            m_chainLowerIDs       ->at(i) = configChains.at(i).getLowerIds(); //Direct vector fetch
-            m_chainLowerName      ->at(i) = configChains.at(i).getLowerName();
-            m_chainLowerCounter   ->at(i) = configChains.at(i).getLowerCounter();
-            m_chainLevel          ->at(i) = configChains.at(i).getLevelId();
-            m_chainPrescale       ->at(i) = configChains.at(i).getPrescale();
-            m_chainPassthrough    ->at(i) = configChains.at(i).getPassThrough();
-            m_chainStreamNames    ->at(i) = configChains.at(i).getStream();
-            //m_chainStreamPrescales->at(i) = configChains.at(i).getStreamPS();
-            m_chainGroupNames     ->at(i) = configChains.at(i).getGroup();
-            m_chainEBHypoNames    ->at(i) = configChains.at(i).getEBHypo();
-            // Loop over Sig items
-            const std::vector<TrigConfSig> configChainSigs = configChains.at(i).getSignature();
-            m_chainSigN->at(i)       = configChainSigs.size();
-            (m_chainSigCounter       ->at(i)).resize( configChainSigs.size() );
-            (m_chainSigLogic         ->at(i)).resize( configChainSigs.size() );
-            (m_chainSigLabel         ->at(i)).resize( configChainSigs.size() );
-            (m_chainSigOutputTEn     ->at(i)).resize( configChainSigs.size() );
-            (m_chainSigOutputTEIndex ->at(i)).resize( configChainSigs.size() );
-            for (unsigned int j = 0; j < configChainSigs.size(); ++j) {
-               (m_chainSigCounter         ->at(i)).at(j) = configChainSigs.at(j).getCounter();
-               (m_chainSigLogic           ->at(i)).at(j) = configChainSigs.at(j).getLogic();
-               (m_chainSigLabel           ->at(i)).at(j) = configChainSigs.at(j).getLabel();
-               // We shall not go deeper than vector<vector<int> >, so store this vector<int> "up one level"
-               // and make a note of its position in the branch (TEIndex)
-               (m_chainSigOutputTEn       ->at(i)).at(j) = configChainSigs.at(j).getOutputTEs().size();
-               (m_chainSigOutputTEIndex   ->at(i)).at(j) = TEIndex++;
-               m_chainSigOutputTEs        ->push_back( configChainSigs.at(j).getOutputTEs() ); //Direct vector fetch
-            }      
-         }
-
-         // Save misc data
-         m_confVarKey   ->clear();
-         m_confVarVal   ->clear();
-         m_confStringKey->clear();
-         m_confStringVal->clear();
-         m_confVarKey    ->assign( tmc->getVarName().begin(),tmc->getVarName().end() );
-         m_confVarVal    ->assign( tmc->getVarId().begin()  ,tmc->getVarId().end()   );
-         m_confStringKey ->assign( tmc->getPairKey().begin(),tmc->getPairKey().end() );
-         m_confStringVal ->assign( tmc->getPairVal().begin(),tmc->getPairVal().end() );
- 
-         // Fill the information into the "classic" map format for compatability with other tools which utilise this data
-         *m_smk    = config_keys.first;
-         *m_l1psk  = config_keys.second.first;
-         *m_hltpsk = config_keys.second.second;
-
-         // Fill the LVL1 maps:
-         ATH_MSG_DEBUG( "Filling config maps" );
-         m_lvl1ConfigNameMap->clear();
-         m_lvl1ConfigPSKMap->clear();
-         // Fill the HLT maps:
-         m_hltConfigNameMap->clear();
-         m_hltConfigPSKMap->clear();
-         m_hltConfigRPSKMap->clear();
-         m_hltConfigPTMap->clear();
-         m_hltConfigLowerChainNameMap->clear();
-         for(unsigned int i = 0; i < configChains.size(); ++i) {
-            if( configChains.at(i).getLevelId() == 1 ) {
-
-               ( *m_lvl1ConfigNameMap )[ configChains.at(i).getChainName() ] = configChains.at(i).getCounter();
-               ( *m_lvl1ConfigPSKMap )[ configChains.at(i).getChainName() ] = configChains.at(i).getPrescale();
-
-                REPORT_MESSAGE( MSG::VERBOSE )
-                   << "   \"" << configChains.at(i).getChainName()
-                   << "\" CTP id = " << configChains.at(i).getCounter()
-                   << ", prescale = "
-                   << configChains.at(i).getPrescale();
-            } else {
-
-               // "classic" tool maps
-               ( *m_hltConfigNameMap )[ configChains.at(i).getChainName() ]           = configChains.at(i).getCounter();
-               ( *m_hltConfigPSKMap )[ configChains.at(i).getChainName() ]            = configChains.at(i).getPrescale();
-               ( *m_hltConfigRPSKMap )[ configChains.at(i).getChainName() ]           = 0; // This information is not present in the summary
-               ( *m_hltConfigPTMap )[ configChains.at(i).getChainName() ]             = configChains.at(i).getPassThrough();
-               ( *m_hltConfigLowerChainNameMap )[ configChains.at(i).getChainName() ] = configChains.at(i).getLowerName();
-
-               REPORT_MESSAGE( MSG::VERBOSE )
-                  << "   \"" << configChains.at(i).getChainName()
-                  << "\" Chain counter = "
-                  << configChains.at(i).getCounter()
-                  << ", prescale = "
-                  << configChains.at(i).getPrescale();
-            }
-         }
-       
-         // Fill the configuration into the output:
-         if( m_configTree->capture().isFailure() ) {
-            ATH_MSG_ERROR( "Couldn't save the configuration." );
-            return;
-         } else {
-            ATH_MSG_INFO( "Trigger configuration from TrigMonConfig source successfully saved." );
-         }
-
-         // Update the book-keeping variable:
-         m_configKeyCache.insert( config_keys );
-      }   
-   }
-
-} // namespace D3PD
diff --git a/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/src/TrigCostConfMetadataTool.h b/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/src/TrigCostConfMetadataTool.h
deleted file mode 100644
index 946afbbece5cd0feafbfc87219df353c150ee919..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/src/TrigCostConfMetadataTool.h
+++ /dev/null
@@ -1,168 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: TrigConfMetadataTool.h 603620 2014-06-25 17:55:37Z tamartin $
-#ifndef TRIGGERD3PDMAKER_TRIGCOSTCONFMETADATATOOL_H
-#define TRIGGERD3PDMAKER_TRIGCOSTCONFMETADATATOOL_H
-
-// STL include(s):
-#include <map>
-#include <string>
-#include <set>
-
-// Gaudi/Athena include(s):
-#include "GaudiKernel/IIncidentListener.h"
-#include "GaudiKernel/IIncidentSvc.h"
-#include "GaudiKernel/ServiceHandle.h"
-#include "GaudiKernel/ToolHandle.h"
-#include "AthenaBaseComps/AthAlgTool.h"
-#include "StoreGate/StoreGateSvc.h"
-
-// Trigger configuration include(s):
-#include "TrigConfInterfaces/ITrigConfigSvc.h"
-
-// D3PDMaker include(s):
-#include "D3PDMakerInterfaces/IMetadataTool.h"
-#include "D3PDMakerInterfaces/ID3PDSvc.h"
-
-namespace D3PD {
-
-   // Forward declaration(s):
-   class ID3PD;
-
-   /**
-    *  @short Tool for dumping trigger configuration information into D3PDs
-    *
-    *         This tool can be used to save the trigger configuration information
-    *         into D3PDs. It collects the information that may be needed to analyze
-    *         the events that are processed during the job, and saves this information
-    *         gradually during the job.
-    *
-    *         The tool implements two interfaces. It is a D3PD::IMetadataTool to
-    *         be able to add it to the D3PD::MakerAlg as a metadata tool, and it's
-    *         also an IIncidentListener. This latter interface allows it to listen
-    *         to various "incidents" during the job. This is how the tool keeps
-    *         track of which configurations were used during the job, and of which
-    *         luminosity blocks are described by which configuration.
-    *
-    * @author Attila Krasznahorkay Jr.
-    *
-    * $Revision: 603620 $
-    * $Date: 2014-06-25 19:55:37 +0200 (Wed, 25 Jun 2014) $
-    */
-   class TrigCostConfMetadataTool : public AthAlgTool,
-                                public IMetadataTool,
-                                public IIncidentListener {
-
-   public:
-      /// Regular AlgTool constructor
-      TrigCostConfMetadataTool( const std::string& type, const std::string& name,
-                            const IInterface* parent );
-
-      /// AlgTool initialization function
-      virtual StatusCode initialize();
-      /// Gaudi function describing which interfaces the tool implements
-      virtual StatusCode queryInterface( const InterfaceID& riid, void** ppvIf );
-
-      /// Function writing the configuration information to the D3PD
-      virtual StatusCode writeMetadata( ID3PD* d3pd );
-
-      /// Function called when a relevant incident happened
-      virtual void handle( const Incident& inc );
-
-   private:
-      
-      /// Function handling new trigger configurations using [TrigMonConfig] summary objects
-      void handleNewTrigConfFromDataStore( const Incident& inc );
-
-      /// Directory in which to store the configuration
-      std::string m_configDir;
-
-      /// Handle for the trigger configuration service
-      ServiceHandle< TrigConf::ITrigConfigSvc > m_trigConfSvc;
-      /// Handle for the incident service
-      ServiceHandle< IIncidentSvc > m_incidentSvc;
-      /// Handle for the D3PDSvc:
-      ServiceHandle< ID3PDSvc > m_d3pdSvc;
-      /// Handle for the StoreGate service used by [TrigMonConfig]:
-      ServiceHandle< StoreGateSvc > m_storeGate;  
-      
-      /// Storegate key for [TrigMonConfig] trigger configuration summary
-      std::string m_keyConfig;
-      
-      /// Cache of which trigger configurations have been "translated"
-      typedef std::pair<int, std::pair<int, int> > Keys;
-      std::set<Keys> m_configKeyCache;
-
-      //
-      // The configuration variables:
-      //
-      ID3PD* m_configTree; ///< D3PD object holding the configuration description
-      int* m_smk; ///< Super Master Key
-      int* m_l1psk; ///< LVL1 Prescale Key
-      int* m_hltpsk; ///< HLT Prescale key
-      std::map< std::string, int >*   m_lvl1ConfigNameMap; ///< LVL1 name -> CTP ID map
-      std::map< std::string, float >* m_lvl1ConfigPSKMap; ///< LVL1 name -> prescale map
-      std::map< std::string, int >*   m_hltConfigNameMap; ///< HLT name -> counter map
-      std::map< std::string, float >* m_hltConfigPSKMap; ///< HLT name -> prescale map
-      std::map< std::string, float >* m_hltConfigRPSKMap; ///< HLT name -> rerun prescale map
-      std::map< std::string, float >* m_hltConfigPTMap; ///< HLT name -> passthrough map
-      std::map< std::string, std::string >* m_hltConfigLowerChainNameMap; ///< HLT name -> seed name map
-      
-      //
-      // The detailed configuration variables [TrigMonConfig]:  
-      //     
-      // variables for CHAIN
-      uint16_t*                                  m_chainN;
-      std::vector< uint32_t >*                   m_chainID;
-      std::vector< uint16_t >*                   m_chainCounter;
-      std::vector< std::string >*                m_chainName;
-      std::vector< uint32_t >*                   m_chainLowerID;
-      std::vector< std::vector< uint32_t > >*    m_chainLowerIDs;
-      std::vector< std::string >*                m_chainLowerName;
-      std::vector< uint16_t >*                   m_chainLowerCounter;
-      std::vector< uint8_t >*                    m_chainLevel;
-      std::vector< float >*                      m_chainPrescale;
-      std::vector< float >*                      m_chainPassthrough;
-      std::vector< std::vector< std::string > >* m_chainStreamNames;
-      std::vector< std::vector< float > >*       m_chainStreamPrescales;
-      std::vector< std::vector< std::string > >* m_chainGroupNames;
-      std::vector< std::vector< std::string > >* m_chainEBHypoNames;
-      // variables for CHAIN -> SIGNATURE
-      std::vector< uint16_t >*                   m_chainSigN;
-      std::vector< std::vector< uint32_t > >*    m_chainSigCounter;
-      std::vector< std::vector< uint32_t > >*    m_chainSigLogic;
-      std::vector< std::vector< std::string > >* m_chainSigLabel;
-      std::vector< std::vector< uint16_t > >*    m_chainSigOutputTEn;
-      std::vector< std::vector< uint32_t > >*    m_chainSigOutputTEIndex;
-      std::vector< std::vector< uint32_t > >*    m_chainSigOutputTEs;
-      // variables for SEQUENCE
-      uint16_t* m_seqN;
-      std::vector< uint32_t >*                   m_seqID;
-      std::vector< uint16_t >*                   m_seqIndex;
-      std::vector< std::string >*                m_seqName;
-      std::vector< uint32_t >*                   m_seqTopoTEID;
-      std::vector< std::vector< uint32_t > >*    m_seqInputTEs;
-      // variables for SEQUENCE -> ALG
-      std::vector< uint16_t >*                   m_seqAlgN;
-      std::vector< std::vector< uint16_t > >*    m_seqAlgIndex;
-      std::vector< std::vector< uint8_t > >*     m_seqAlgPosition;
-      std::vector< std::vector< uint32_t > >*    m_seqAlgNameID;
-      std::vector< std::vector< uint32_t > >*    m_seqAlgTypeID;
-      std::vector< std::vector< std::string > >* m_seqAlgName;
-      std::vector< std::vector< std::string > >* m_seqAlgTypeName;
-      // variables for additional configuration data
-      std::vector<std::string>*                  m_confVarKey;
-      std::vector<uint32_t>*                     m_confVarVal;
-      std::vector<std::string>*                  m_confStringKey;
-      std::vector<std::string>*                  m_confStringVal;
-
-
-   }; // class TrigConfMetadataTool
-
-} // namespace D3PD
-
-#endif // TRIGGERD3PDMAKER_TRIGCOSTCONFMETADATATOOL_H
diff --git a/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/src/TrigCostD3PDMakerTool.cxx b/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/src/TrigCostD3PDMakerTool.cxx
deleted file mode 100644
index f8da8a29ee06dbe472e7a75e98a03541eb9fb964..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/src/TrigCostD3PDMakerTool.cxx
+++ /dev/null
@@ -1,1214 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: TrigCostD3PDMakerTool.cxx 2014-09-23 12:48:32Z tamartin $
-
-// Athena/Gaudi include(s):
-#include "AthenaKernel/errorcheck.h"
-
-// STL include(s):
-#include "limits.h"
-
-// Trigger [TrigMonConfig] data include(s):
-#include "TrigMonitoringEvent/TrigMonEventCollection.h"
-#include "TrigMonitoringEvent/TrigMonEvent.h"
-
-// D3PDMaker include(s):
-#include "D3PDMakerInterfaces/ID3PD.h"
-
-// Local include(s):
-#include "TrigCostD3PDMakerTool.h"
-
-namespace D3PD {
-
-  TrigCostD3PDMakerTool::TrigCostD3PDMakerTool( const std::string& type,
-                                                const std::string& name,
-                                                const IInterface* parent )
-    : AthAlgTool( type, name, parent ),
-      m_dir( "" ),
-      m_incidentSvc( "IncidentSvc", name ),
-      m_d3pdSvc( "D3PD::RootD3PDSvc/TrigConfD3PDSvc", name ),
-      m_tree( nullptr ),
-      m_onlySaveCostEvents( true ),
-      m_doBasic (false),
-      m_doExtra (false),
-      m_doChain (false),
-      m_doL1 (false),
-      m_doROS (false),
-      m_doROSSum (false),
-      m_doRoI (false),
-      m_doSeq (false),
-      m_doTE (false),
-      m_doDBKey (false),
-      m_doEB (false),
-
-      m_event (nullptr),
-      m_lumi (nullptr),
-      m_lumiLength (nullptr),
-      m_bunch_id (nullptr),
-      m_run (nullptr),
-      m_sec (nullptr),
-      m_nsec (nullptr),
-      m_timer (nullptr),
-      m_ebWeight (nullptr),
-      m_ebWeightBG (nullptr),
-      m_ebUnbiased (nullptr),
-      m_ranScaleTools(nullptr),
-      m_appId (nullptr),
-      m_chainN (nullptr),
-      m_chainCounter (nullptr),
-      m_chainLevel (nullptr),
-      m_chainTimer (nullptr),
-      m_chainIsPassed (nullptr),
-      m_chainIsPassedRaw (nullptr),
-      m_chainIsPassthrough (nullptr),
-      m_chainIsResurrected (nullptr),
-      m_chainIsPrescaled (nullptr),
-      m_chainWasL1AfterVeto (nullptr),
-      m_chainWasL1BeforePrescale (nullptr),
-      m_chainWasL1AfterPrescale (nullptr),
-      m_chainIsExpressStream (nullptr),
-      m_timerTrigCost (nullptr),
-      m_timerEndSteer (nullptr),
-      m_timerChainProcess (nullptr),
-      m_timerResultBuilder (nullptr),
-      m_timerMon (nullptr),
-      m_costEvent (nullptr),
-      m_costRunSec (nullptr),
-      m_costRunNsec (nullptr),
-      m_l1N (nullptr),
-      m_l1CtpId (nullptr),
-      m_l1PassedBeforePrescale (nullptr),
-      m_l1PassedAfterPrescale (nullptr),
-      m_l1PassedAfterVeto (nullptr),
-      m_l1Passed (nullptr),
-      m_l1Prescaled (nullptr),
-      m_l1Vetoed (nullptr),
-      m_robN (nullptr),
-      m_robRequestorId (nullptr),
-      m_robTimer (nullptr),
-      m_robTimeStartSec (nullptr),
-      m_robTimeStartMicroSec (nullptr),
-      m_robTimeStopSec (nullptr),
-      m_robTimeStopMicroSec (nullptr),
-      m_robDataN (nullptr),
-      m_robDataRobId (nullptr),
-      m_robDataRobSize (nullptr),
-      m_robDataIsUnclassified (nullptr),
-      m_robDataIsCached (nullptr),
-      m_robDataIsRetrieved (nullptr),
-      m_robDataIsIgnored (nullptr),
-      m_robDataIsDisabled (nullptr),
-      m_robDataIsStatusOk (nullptr),
-      m_robDataIsPrefetched (nullptr),
-      m_robSumDataN (nullptr),
-      m_robSumDataSize (nullptr),
-      m_robSumDataNRob (nullptr),
-      m_robSumDataSubDet (nullptr),
-      m_robSumDataIsUnclassified (nullptr),
-      m_robSumDataIsCached (nullptr),
-      m_robSumDataIsRetrieved (nullptr),
-      m_robSumDataIsIgnored (nullptr),
-      m_robSumDataIsDisabled (nullptr),
-      m_roiN (nullptr),
-      m_roiIsNoneType (nullptr),
-      m_roiIsMuonType (nullptr),
-      m_roiIsEmTauType (nullptr),
-      m_roiIsTau (nullptr),
-      m_roiIsJetType (nullptr),
-      m_roiIsJetEtType (nullptr),
-      m_roiIsEnergyType (nullptr),
-      m_roiId (nullptr),
-      m_roiNL1thresholds (nullptr),
-      m_roiEta (nullptr),
-      m_roiPhi (nullptr),
-      m_roiArea (nullptr),
-      m_roiEt (nullptr),
-      m_roiEtLarge (nullptr),
-      m_roiMuCharge (nullptr),
-      m_roiIsolationBits (nullptr),
-      m_roiVectorEX (nullptr),
-      m_roiVectorEY (nullptr),
-      m_roiOverflowEX (nullptr),
-      m_roiOverflowEY (nullptr),
-      m_roiOverflowET (nullptr),
-      m_seqN (nullptr),
-      m_seqIsInitial (nullptr),
-      m_seqIsExecuted (nullptr),
-      m_seqIsAlreadyExecuted (nullptr),
-      m_seqIsPrevious (nullptr),
-      m_seqLevel (nullptr),
-      m_seqChannelCounter (nullptr),
-      m_seqIndex (nullptr),
-      m_seqSequenceTimer (nullptr),
-      m_seqAlgTimerTot (nullptr),
-      m_seqAlgN (nullptr),
-      m_seqAlgPosition (nullptr),
-      m_seqAlgNRoIs (nullptr),
-      m_seqAlgRoIIndex (nullptr),
-      m_seqRoI (nullptr),
-      m_seqAlgIsCached (nullptr),
-      m_seqAlgIsCalled (nullptr),
-      m_seqAlgTimer (nullptr),
-      m_seqAlgTimeStartSec (nullptr),
-      m_seqAlgTimeStartMicroSec (nullptr),
-      m_seqAlgTimeStopSec (nullptr),
-      m_seqAlgTimeStopMicroSec (nullptr),
-      m_teN (nullptr),
-      m_teId (nullptr),
-      m_teIndex (nullptr),
-      m_teIsRegularTE (nullptr),
-      m_teIsInitialTE (nullptr),
-      m_teIsRoITE (nullptr),
-      m_teIsL1ThreshTE (nullptr),
-      m_teActiveState (nullptr),
-      m_teErrorState (nullptr),
-      m_teIsTerminalNode (nullptr),
-      m_teIsOutputL2Node (nullptr),
-      m_teIsOutputEFNode (nullptr),
-      m_teIsTopologicalTE (nullptr),
-      m_teChildIndex (nullptr),
-      m_teParentIndex (nullptr),
-      m_teRoiId (nullptr),
-      m_teClid (nullptr),
-      m_DB_SMK (nullptr),
-      m_DB_L1PSK (nullptr),
-      m_DB_HLTPSK (nullptr)
-  {
-
-    declareProperty( "dir", m_dir = "/StreamNTUP_TRIGCOST/trig_cost" );
-    declareProperty( "IncidentSvc", m_incidentSvc );
-    declareProperty( "D3PDSvc", m_d3pdSvc );
-    declareProperty( "prefix", m_prefix = "TrigCostHLT_" );
-    declareProperty( "keyEvent", m_keyEvent = "HLT_TrigMonEventCollection_OPI_HLT_monitoring_event");
-    declareProperty( "mode", m_writeMode = "COST");
-    declareProperty( "onlySaveCostEvents", m_onlySaveCostEvents = true, "Export only events which ran the full suite of Cost tools online"); 
-  }
-
-  StatusCode TrigCostD3PDMakerTool::initialize() {
-
-    ATH_MSG_INFO( "Initializing. Package version: " << PACKAGE_VERSION );
-
-    // Retrieve the needed services:
-    CHECK( m_incidentSvc.retrieve() );
-    CHECK( m_d3pdSvc.retrieve() );
-
-    // Set up the tool to listen to a few incidents:
-    m_incidentSvc->addListener( this, IncidentType::EndEvent );
-
-    // Create the configuration objects through the D3PD service:
-    CHECK( m_d3pdSvc->make( m_dir, m_tree ) );
-
-    if (m_writeMode == "COST") {
-      m_doBasic = true;
-      m_doExtra = true;
-      m_doChain = true;
-      m_doL1    = true;
-      m_doROS   = true;
-      m_doROSSum= false;
-      m_doRoI   = true;
-      m_doSeq   = true;
-      m_doTE    = true;
-      m_doDBKey = true;
-      m_doEB    = false;
-    } else if (m_writeMode == "RATE") {
-      m_doBasic = true;
-      m_doExtra = false;
-      m_doChain = true;
-      m_doL1    = true;
-      m_doROS   = false;
-      m_doROSSum= false;
-      m_doRoI   = true;
-      m_doSeq   = false;
-      m_doTE    = false;
-      m_doDBKey = true;
-      m_doEB    = false;
-    } else if (m_writeMode == "EBWEIGHT") {
-      m_doBasic = false;
-      m_doExtra = false;
-      m_doChain = false;
-      m_doL1    = false;
-      m_doROS   = false;
-      m_doROSSum= false;
-      m_doRoI   = false;
-      m_doSeq   = false;
-      m_doTE    = false;
-      m_doDBKey = false;
-      m_doEB    = true;
-    } else {
-      ATH_MSG_ERROR("Unrecognised write mode " << m_writeMode << " given. Options are COST, RATE or EBWEIGHT.");
-    }
-
-    //////////////
-    //BASIC DATA//
-    //////////////
-    if (m_doBasic) {
-      CHECK( m_tree->addVariable( m_prefix + "eventNumber", m_event, "Event number" ) );
-      CHECK( m_tree->addVariable( m_prefix + "lumi", m_lumi, "Lumi block number for this event" ) );
-      CHECK( m_tree->addVariable( m_prefix + "lumiLength", m_lumiLength, "Length in s of this lumi block" ) );
-      CHECK( m_tree->addVariable( m_prefix + "bunchCrossingId", m_bunch_id, "BCID for this event" ) );
-      CHECK( m_tree->addVariable( m_prefix + "runNumber", m_run, "Run number for this event" ) );
-      CHECK( m_tree->addVariable( m_prefix + "seconds", m_sec, "Start of the event in seconds" ) );
-      CHECK( m_tree->addVariable( m_prefix + "nanoSeconds", m_nsec, "Start of the event nanoseconds" ) );
-      CHECK( m_tree->addVariable( m_prefix + "timer", m_timer, "Nominal time for this event" ) );
-      CHECK( m_tree->addVariable( m_prefix + "appId", m_appId, "Hash of AppId of the XPU node processing this event." ) );
-      CHECK( m_tree->addVariable( m_prefix + "ranScaleTools", m_ranScaleTools, "If this was a monitored event (did we run the scale tools online)" ) );
-      CHECK( m_tree->addVariable( m_prefix + "costRunSec", m_costRunSec, "Second the data were saved by CostMon" ) );
-      CHECK( m_tree->addVariable( m_prefix + "costRunNsec", m_costRunNsec, "Nanosecond the data were saved by CostMon" ) );
-      CHECK( m_tree->addVariable( m_prefix + "costEvent", m_costEvent, "Sequential number of cost events processed" ) );
-    }
-
-    if (m_doEB && !m_doBasic) {
-      CHECK( m_tree->addVariable( m_prefix + "eventNumber", m_event, "Event number" ) );
-      CHECK( m_tree->addVariable( m_prefix + "ebWeight", m_ebWeight, "Enhanced bias weighting factor." ) );
-      CHECK( m_tree->addVariable( m_prefix + "ebWeightBG", m_ebWeightBG, "Enhanced bias bunch group identifier." ) );
-      CHECK( m_tree->addVariable( m_prefix + "ebUnbiased", m_ebUnbiased, "If EB event was unbiased online." ) );
-    }
-
-    //////////////
-    //EXTRA DATA//
-    //////////////
-    if (m_doExtra) {
-      CHECK( m_tree->addVariable( m_prefix + "timerTrigCost", m_timerTrigCost, "Detailed: Time to run the OPI trig cost tools" ) );
-      CHECK( m_tree->addVariable( m_prefix + "timerEndSteer", m_timerEndSteer, "Detailed: Time to end of steering" ) );
-      CHECK( m_tree->addVariable( m_prefix + "timerChainProcess", m_timerChainProcess, "Detailed: Time of chain execution" ) );
-      CHECK( m_tree->addVariable( m_prefix + "timerResultBuilder", m_timerResultBuilder, "Detailed: Time of ResultBuilder tool execution" ) );
-      CHECK( m_tree->addVariable( m_prefix + "timerMon", m_timerMon, "Detailed: Total time of monitoring tool(s) execution" ) );
-    }
-
-    //////////////
-    //CHAIN DATA//
-    //////////////
-    if (m_doChain) {
-      CHECK( m_tree->addVariable( m_prefix + "chain_n", m_chainN, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "chain_counter", m_chainCounter, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "chain_level", m_chainLevel, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "chain_timer", m_chainTimer, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "chain_isPassed", m_chainIsPassed, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "chain_isPassedRaw", m_chainIsPassedRaw, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "chain_isPassthrough", m_chainIsPassthrough, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "chain_isResurrected", m_chainIsResurrected, "" ) ); 
-      CHECK( m_tree->addVariable( m_prefix + "chain_isPrescaled", m_chainIsPrescaled, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "chain_wasL1AfterVeto", m_chainWasL1AfterVeto, "" ) );     
-      CHECK( m_tree->addVariable( m_prefix + "chain_wasL1BeforePrescale", m_chainWasL1BeforePrescale, "" ) );  
-      CHECK( m_tree->addVariable( m_prefix + "chain_wasL1AfterPrescale", m_chainWasL1AfterPrescale, "" ) );  
-      CHECK( m_tree->addVariable( m_prefix + "chain_isExpressStream", m_chainIsExpressStream, "" ) );
-    }
-
-    ///////////
-    //L1 DATA//
-    ///////////
-    if (m_doL1) {
-      CHECK( m_tree->addVariable( m_prefix + "l1_n", m_l1N, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "l1_ctpId", m_l1CtpId, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "l1_passedBeforePrescale", m_l1PassedBeforePrescale, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "l1_passedAfterPrescale", m_l1PassedAfterPrescale, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "l1_passedAfterVeto", m_l1PassedAfterVeto, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "l1_passed", m_l1Passed, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "l1_isPrescaled", m_l1Prescaled, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "l1_isVetoed", m_l1Vetoed, "" ) ); 
-    }
-
-    ////////////
-    //ROS DATA//
-    ////////////
-    if (m_doROS) {
-      CHECK( m_tree->addVariable( m_prefix + "rob_n", m_robN, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "rob_requestorId", m_robRequestorId, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "rob_timer", m_robTimer, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "rob_timeStartSec", m_robTimeStartSec, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "rob_timeStartMicroSec", m_robTimeStartMicroSec, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "rob_timeStopSec", m_robTimeStopSec, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "rob_timeStopMicroSec", m_robTimeStopMicroSec, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "rob_data_n", m_robDataN, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "rob_data_id", m_robDataRobId, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "rob_data_size", m_robDataRobSize, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "rob_data_isUnclassified", m_robDataIsUnclassified, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "rob_data_isCached", m_robDataIsCached, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "rob_data_isRetrieved", m_robDataIsRetrieved, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "rob_data_isIgnored", m_robDataIsIgnored, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "rob_data_isDisabled", m_robDataIsDisabled, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "rob_data_isStatusOk", m_robDataIsStatusOk, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "rob_data_isStatusPrefetched", m_robDataIsPrefetched, "" ) );
-    }
-
-    ////////////////
-    //ROS SUM DATA//
-    ////////////////
-    if (m_doROSSum) {
-      CHECK( m_tree->addVariable( m_prefix + "rob_sum_n", m_robSumDataN, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "rob_sum_size", m_robSumDataSize, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "rob_sum_nRob", m_robSumDataNRob, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "rob_sum_subDet", m_robSumDataSubDet, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "rob_sum_isUnclassified", m_robSumDataIsUnclassified, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "rob_sum_isCached", m_robSumDataIsCached, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "rob_sum_isRetrieved", m_robSumDataIsRetrieved, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "rob_sum_isIgnored", m_robSumDataIsIgnored, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "rob_sum_isDisabled", m_robSumDataIsDisabled, "" ) );
-    }
-
-
-    ////////////
-    //RoI DATA//
-    ////////////
-    if (m_doRoI) {
-      CHECK( m_tree->addVariable( m_prefix + "roi_n", m_roiN, "Number of L1 RoI" ) );
-      CHECK( m_tree->addVariable( m_prefix + "roi_isTypeNone", m_roiIsNoneType, "Flag RoI has no type" ) );
-      CHECK( m_tree->addVariable( m_prefix + "roi_isTypeMuon", m_roiIsMuonType, "Flag RoI was MUON" ) );
-      CHECK( m_tree->addVariable( m_prefix + "roi_isTypeEmTau", m_roiIsEmTauType, "Flag RoI was EMTAU (see isTau)" ) );
-      CHECK( m_tree->addVariable( m_prefix + "roi_isTau", m_roiIsTau, "Flag, disambiguity between EM and TAU" ) );
-      CHECK( m_tree->addVariable( m_prefix + "roi_isTypeJet", m_roiIsJetType, "Flag RoI was Jet" ) );
-      CHECK( m_tree->addVariable( m_prefix + "roi_isTypeJetEt", m_roiIsJetEtType, "Floag RoI was JetET" ) );
-      CHECK( m_tree->addVariable( m_prefix + "roi_isTypeEnergy", m_roiIsEnergyType, "Flag RoI was Energy" ) );
-      CHECK( m_tree->addVariable( m_prefix + "roi_id", m_roiId, "RoI ID for matching to algorithms" ) );
-      CHECK( m_tree->addVariable( m_prefix + "roi_nL1Thresholds", m_roiNL1thresholds, "Number of thresholds passed, depends on config" ) );
-      CHECK( m_tree->addVariable( m_prefix + "roi_eta", m_roiEta, "RoI eta coordinate" ) );
-      CHECK( m_tree->addVariable( m_prefix + "roi_phi", m_roiPhi, "RoI phi coordinate" ) );
-      CHECK( m_tree->addVariable( m_prefix + "roi_area", m_roiArea, "RoI area in eta x phi" ) ); 
-      // Extra RoI
-      CHECK( m_tree->addVariable( m_prefix + "roi_et", m_roiEt, "RoI ET for EMTAU, ETSmall for Jet, pT for muon, scalar sum ET for ENERGY" ) ); 
-      CHECK( m_tree->addVariable( m_prefix + "roi_etLarge", m_roiEtLarge, "RoI ET Large for jets only" ) ); 
-      CHECK( m_tree->addVariable( m_prefix + "roi_muCharge", m_roiMuCharge, "RoI muon charge, muons only" ) ); 
-      CHECK( m_tree->addVariable( m_prefix + "roi_isoBits", m_roiIsolationBits, "RoI isolation bits, EMTAU only" ) ); 
-      CHECK( m_tree->addVariable( m_prefix + "roi_vectorEX", m_roiVectorEX, "RoI signed vector sum ET in X, ENERGY only" ) ); 
-      CHECK( m_tree->addVariable( m_prefix + "roi_vectorEY", m_roiVectorEY, "RoI signed vector sum ET in Y, ENEGY only" ) ); 
-      CHECK( m_tree->addVariable( m_prefix + "roi_overflowEX", m_roiOverflowEX, "RoI vector sum ET X overflow bit" ) ); 
-      CHECK( m_tree->addVariable( m_prefix + "roi_overflowEY", m_roiOverflowEY, "RoI vector sum ET Y overflow bit" ) ); 
-      CHECK( m_tree->addVariable( m_prefix + "roi_overflowET", m_roiOverflowET, "RoI scalar sum ET overflow bit" ) ); 
-    }
-
-    ////////////////
-    //SEQ/ALG DATA//
-    ////////////////
-    if (m_doSeq) {
-      CHECK( m_tree->addVariable( m_prefix + "seq_n", m_seqN, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "seq_level", m_seqLevel, "" ) ); 
-      CHECK( m_tree->addVariable( m_prefix + "seq_isInitial", m_seqIsInitial, "" ) ); 
-      CHECK( m_tree->addVariable( m_prefix + "seq_isExecuted", m_seqIsExecuted, "" ) ); 
-      CHECK( m_tree->addVariable( m_prefix + "seq_isAlreadyExecuted", m_seqIsAlreadyExecuted, "" ) ); 
-      CHECK( m_tree->addVariable( m_prefix + "seq_isPrevious", m_seqIsPrevious, "" ) ); 
-      CHECK( m_tree->addVariable( m_prefix + "seq_channelCounter", m_seqChannelCounter, "" ) );         
-      CHECK( m_tree->addVariable( m_prefix + "seq_index", m_seqIndex, "" ) );         
-      CHECK( m_tree->addVariable( m_prefix + "seq_timer", m_seqSequenceTimer, "" ) );         
-      CHECK( m_tree->addVariable( m_prefix + "seq_algTotalTime", m_seqAlgTimerTot, "" ) );         
-      CHECK( m_tree->addVariable( m_prefix + "seq_alg_n", m_seqAlgN, "" ) );         
-      CHECK( m_tree->addVariable( m_prefix + "seq_alg_position", m_seqAlgPosition, "" ) );  
-      CHECK( m_tree->addVariable( m_prefix + "seq_alg_roi_n", m_seqAlgNRoIs, "How many RoIs this alg has." ) );   
-      CHECK( m_tree->addVariable( m_prefix + "seq_alg_roi_index", m_seqAlgRoIIndex, "Index where to find these RoI IDs" ) );
-      CHECK( m_tree->addVariable( m_prefix + "seq_roi", m_seqRoI, "Look at this index to get the vector<RoI ID>" ) ); 
-      CHECK( m_tree->addVariable( m_prefix + "seq_alg_isCached", m_seqAlgIsCached, "" ) );       
-      CHECK( m_tree->addVariable( m_prefix + "seq_alg_isCalled", m_seqAlgIsCalled, "" ) );       
-      CHECK( m_tree->addVariable( m_prefix + "seq_alg_timer", m_seqAlgTimer, "" ) );    
-      CHECK( m_tree->addVariable( m_prefix + "seq_alg_timeStartSec", m_seqAlgTimeStartSec, "" ) );  
-      CHECK( m_tree->addVariable( m_prefix + "seq_alg_timeStartMicroSec", m_seqAlgTimeStartMicroSec, "" ) );  
-      CHECK( m_tree->addVariable( m_prefix + "seq_alg_timeStopSec", m_seqAlgTimeStopSec, "" ) );  
-      CHECK( m_tree->addVariable( m_prefix + "seq_alg_timeStopMicroSec", m_seqAlgTimeStopMicroSec, "" ) ); 
-    }
-
-    ///////////
-    //TE DATA//
-    ///////////
-    if (m_doTE) {
-      CHECK( m_tree->addVariable( m_prefix + "te_n", m_teN, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "te_id", m_teId, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "te_index", m_teIndex, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "te_isRegularTe", m_teIsRegularTE, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "te_isInitialTe", m_teIsInitialTE, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "te_isRoITe", m_teIsRoITE, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "te_isL1ThresholdTe", m_teIsL1ThreshTE, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "te_isActiveState", m_teActiveState, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "te_isErrorState", m_teErrorState, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "te_isTerminalNode", m_teIsTerminalNode, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "te_isOutputL2Node", m_teIsOutputL2Node, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "te_isOutputEFNode", m_teIsOutputEFNode, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "te_isTopologicalTe", m_teIsTopologicalTE, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "te_childIndex", m_teChildIndex, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "te_parentIndex", m_teParentIndex, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "te_roiId", m_teRoiId, "" ) );
-      CHECK( m_tree->addVariable( m_prefix + "te_clid", m_teClid, "" ) );  
-    }
-
-    ///////////
-    //DB DATA//
-    ///////////
-    if (m_doDBKey) {
-      CHECK( m_tree->addVariable( "trig_DB_SMK", m_DB_SMK, "" ) );
-      CHECK( m_tree->addVariable( "trig_DB_L1PSK", m_DB_L1PSK, "" ) );
-      CHECK( m_tree->addVariable( "trig_DB_HLTPSK", m_DB_HLTPSK, "" ) );
-    }
-
-    return StatusCode::SUCCESS;
-  }
-
-  StatusCode TrigCostD3PDMakerTool::queryInterface( const InterfaceID& riid,
-                                                    void** ppvIf ) {
-
-    if( riid == IMetadataTool::interfaceID() ) {
-       *ppvIf = static_cast< IMetadataTool* >( this );
-       addRef();
-       return StatusCode::SUCCESS;
-    } else if( riid == IIncidentListener::interfaceID() ) {
-       *ppvIf = static_cast< IIncidentListener* >( this );
-       addRef();
-       return StatusCode::SUCCESS;
-    }
-
-    return AthAlgTool::queryInterface( riid, ppvIf );
-  }
-
-   /**
-    * The function is actually empty. The metadata should already be in the output
-    * file at this point...
-    */
-  StatusCode TrigCostD3PDMakerTool::writeMetadata( ID3PD* ) {
-
-    ATH_MSG_INFO( "Trig cost information available in the D3PD in directory: \""
-                  << m_dir << "\"" );
-
-    return StatusCode::SUCCESS;
-  }
-
-   /**
-    * This function is called whenever an incident happens that the tool
-    * was set up to listen to. The function has to decide what kind of
-    * incident it was, and the call the appropriate internal function to
-    * handle that incident.
-    *
-    * @param inc The incident that happened
-    */
-  void TrigCostD3PDMakerTool::handle( const Incident& inc ) {
-    //
-    // Handle trigger configuration change incidents:
-    //
-    if( inc.type() == IncidentType::EndEvent ) { 
-       handleNewEvent( inc );
-       return;
-    }
-
-    ATH_MSG_WARNING( "Received incident not recognised" );
-    return;
-  }
-   
-   
-  /**
-  * Save all events in the TrigMonEventCollection to the D3PD
-  * Note magic numbers come from TrigMonVar.h
-  */
-  void TrigCostD3PDMakerTool::handleNewEvent( const Incident& ) {
-      
-    const TrigMonEventCollection *eventCol = 0;
- 
-    if( !evtStore()->contains<TrigMonEventCollection>(m_keyEvent) ) {
-      ATH_MSG_DEBUG( "No TrigMonEventCollection in this event Key:" << m_keyEvent );
-      return;
-    } else {
-      ATH_MSG_DEBUG( "TrigMonEventCollection in this event Key:" << m_keyEvent << ". Exporting to D3PD." );
-    }
-   
-    if( evtStore()->retrieve(eventCol, m_keyEvent).isFailure() || !eventCol) {
-      ATH_MSG_WARNING( "TrigMonEventCollection present, however failed to retrieve from SG. Key:" << m_keyEvent );
-      return;
-    }
-      
-    ATH_MSG_DEBUG( "Got TrigMonEventCollection: " << m_keyEvent << " Size:" << eventCol->size() );
-
-    for( TrigMonEventCollection::const_iterator it = eventCol->begin(); it != eventCol->end(); ++it) {
-      const TrigMonEvent* event = *it;
-      if(!event) {
-        ATH_MSG_WARNING( "Could not resolve TrigMonEvent pointer." );
-        continue;
-      }
-
-      // Do we want to save this event?
-      if (m_onlySaveCostEvents == true) {
-        float result = 0.;
-        event->getVar(Trig::kIsCostEvent, result); // 47, is the magic number in this case. 
-        // Bool stored as float. Test for 0
-        if (result < 0.5) {
-          ATH_MSG_DEBUG( "Not a Cost Event (scale tools were not run, but L1 result info still there). Skipping event due to m_onlySaveCostEvents == true" );
-          continue;
-        }
-      }
-
-      // Zero before new event
-      clear();
-	
-      //////////////
-      //BASIC DATA//
-      //////////////
-      if (m_doBasic) {
-        *m_event    = event->getEvent();
-        *m_lumi     = event->getLumi();
-        *m_bunch_id = event->getBunchId();
-        *m_run      = event->getRun();
-        *m_sec      = event->getSec();
-        *m_nsec     = event->getNanoSec();
-        *m_timer    = event->getTimer();
-
-        for (unsigned i=0; i < event->getWord().size(); ++i) {
-          switch (i) {
-            case 0:
-              *m_costRunSec = event->getWord().at(i);
-              break;
-            case 1:
-              *m_costRunNsec = event->getWord().at(i);
-              break;
-            case 2:
-              *m_appId = event->getWord().at(i);
-              break;
-            default:
-              break;
-          }
-        }  
-        for (unsigned i=0; i < event->getVarKey().size(); ++i) {
-          switch (event->getVarKey().at(i)) {
-            case Trig::kIsCostEvent:
-              *m_ranScaleTools = (uint8_t) event->getVarVal().at(i);
-              break;
-            case Trig::kEventLumiBlockLength:
-              *m_lumiLength = event->getVarVal().at(i);
-              break;
-            case Trig::kEventNumber:
-              *m_costEvent = event->getVarVal().at(i);
-              break;
-            default:
-              break;
-          }
-        }
-      }
-
-      //////////////
-      //EXTRA DATA//
-      //////////////
-      if (m_doExtra) {
-        // Check and save additonal payload relating to the event
-        if ( event->getVarKey().size() != event->getVarVal().size() ) {
-          REPORT_MESSAGE( MSG::WARNING ) << "Trigger cost monitor additional integer payload size different to key size, skipping.";
-        } else {
-          for (unsigned i=0; i < event->getVarKey().size(); ++i) {
-            switch (event->getVarKey().at(i)) {
-              case Trig::kTimeCostMonitoring:
-                *m_timerTrigCost = event->getVarVal().at(i);
-                break;
-              case Trig::kTimeExec:
-                *m_timerEndSteer = event->getVarVal().at(i);
-                break;
-              case Trig::kTimeProc:
-                *m_timerChainProcess = event->getVarVal().at(i);
-                break;
-              case Trig::kTimeRes:
-                *m_timerResultBuilder = event->getVarVal().at(i);
-                break;
-              case Trig::kTimeMon:
-                *m_timerMon = event->getVarVal().at(i);
-                break;
-              default:
-                break;
-            } // Switch
-          } // Key loop
-        } // Size check
-      } // m_doExtra
-
-      ///////////
-      //EB DATA//
-      ///////////
-      if (m_doEB && !m_doBasic) {
-        *m_event = event->getEvent();
-        for (unsigned i=0; i < event->getVarKey().size(); ++i) {
-          switch (event->getVarKey().at(i)) {
-            case Trig::kEBWeight:
-              *m_ebWeight = event->getVarVal().at(i);
-              break;
-            case Trig::kEBBunchGroup:
-              *m_ebWeightBG = (uint32_t) event->getVarVal().at(i);
-              break;
-            case Trig::kEBIsUnbiasedFlag:
-              *m_ebUnbiased = (uint8_t) event->getVarVal().at(i);
-              break;
-            default:
-              break;
-          }
-        }
-      }
-
-      //////////////
-      //CHAIN DATA//
-      //////////////
-      const std::vector<TrigMonChain> eventChains = event->getChains();
-      if (m_doChain && eventChains.size() > 0) {
-        *m_chainN = eventChains.size();
-        //Save details about the chain
-        m_chainCounter            ->resize( eventChains.size() );
-        m_chainLevel              ->resize( eventChains.size() );         
-        m_chainTimer              ->resize( eventChains.size() );         
-        m_chainIsPassed           ->resize( eventChains.size() );
-        m_chainIsPassedRaw        ->resize( eventChains.size() );
-        m_chainIsPassthrough      ->resize( eventChains.size() );    
-        m_chainIsResurrected      ->resize( eventChains.size() );
-        m_chainIsPrescaled        ->resize( eventChains.size() );
-        m_chainWasL1AfterVeto     ->resize( eventChains.size() );
-        m_chainWasL1BeforePrescale->resize( eventChains.size() );
-        m_chainWasL1AfterPrescale ->resize( eventChains.size() );
-        m_chainIsExpressStream    ->resize( eventChains.size() );
-        for(unsigned int i = 0; i < eventChains.size(); ++i) {
-          m_chainCounter            ->at(i) = eventChains.at(i).getCounter();     
-          m_chainLevel              ->at(i) = eventChains.at(i).getLevel();
-          m_chainTimer              ->at(i) = eventChains.at(i).getTimer();
-          m_chainIsPassed           ->at(i) = (uint8_t) eventChains.at(i).isPassed( TrigMonChain::kPassed );
-          m_chainIsPassedRaw        ->at(i) = (uint8_t) eventChains.at(i).isPassed( TrigMonChain::kPassedRaw );
-          m_chainIsPassthrough      ->at(i) = (uint8_t) eventChains.at(i).isPassed( TrigMonChain::kPassedThrough );
-          m_chainIsResurrected      ->at(i) = (uint8_t) eventChains.at(i).isPassed( TrigMonChain::kResurrected );
-          m_chainIsPrescaled        ->at(i) = (uint8_t) eventChains.at(i).isPassed( TrigMonChain::kPrescaled );
-          m_chainWasL1AfterVeto     ->at(i) = (uint8_t) eventChains.at(i).isPassed( TrigMonChain::kL1AfterVeto );
-          m_chainWasL1BeforePrescale->at(i) = (uint8_t) eventChains.at(i).isPassed( TrigMonChain::kL1BeforePrescale );
-          m_chainWasL1AfterPrescale ->at(i) = (uint8_t) eventChains.at(i).isPassed( TrigMonChain::kL1AfterPrescale );
-          m_chainIsExpressStream    ->at(i) = (uint8_t) eventChains.at(i).isPassed( TrigMonChain::kExpressStream );
-
-          // Check and save additonal payload 
-          if ( eventChains.at(i).getVarKey().size() != eventChains.at(i).getVarVal().size() ) {
-            REPORT_MESSAGE( MSG::WARNING ) << "Trigger chain float payload size different to key size, skipping.";
-          } else {
-            for (unsigned j=0; j < eventChains.at(i).getVarKey().size(); ++j) {
-              REPORT_MESSAGE( MSG::DEBUG ) << "Got a CHAIN["<<i<<"] int=>float pair. Currently not saved. " << eventChains.at(i).getVarKey().at(j) << " => " << eventChains.at(i).getVarVal().at(j);
-            }
-          }  
-        }
-      }
-
-      ///////////
-      //L1 DATA//
-      ///////////
-      const std::vector<TrigMonL1Item> eventL1Items = event->getL1Items();
-      if (m_doL1 && eventL1Items.size() > 0) {
-        *m_l1N = eventL1Items.size();
-        m_l1CtpId               ->resize( eventL1Items.size() );
-        m_l1PassedBeforePrescale->resize( eventL1Items.size() );    
-        m_l1PassedAfterPrescale ->resize( eventL1Items.size() );    
-        m_l1PassedAfterVeto     ->resize( eventL1Items.size() );
-        m_l1Passed              ->resize( eventL1Items.size() );
-        m_l1Prescaled           ->resize( eventL1Items.size() );
-        m_l1Vetoed              ->resize( eventL1Items.size() );  
-        for (unsigned int i = 0; i < eventL1Items.size(); ++i) {
-          m_l1CtpId               ->at(i) = eventL1Items.at(i).getCtpId();
-          m_l1PassedBeforePrescale->at(i) = (uint8_t) eventL1Items.at(i).isPassedBeforePrescale();
-          m_l1PassedAfterPrescale ->at(i) = (uint8_t) eventL1Items.at(i).isPassedAfterPrescale();
-          m_l1PassedAfterVeto     ->at(i) = (uint8_t) eventL1Items.at(i).isPassedAfterVeto();
-          m_l1Passed              ->at(i) = (uint8_t) eventL1Items.at(i).isPassed();
-          m_l1Prescaled           ->at(i) = (uint8_t) eventL1Items.at(i).isPrescaled();
-          m_l1Vetoed              ->at(i) = (uint8_t) eventL1Items.at(i).isVeto();
-        }
-      }
-
-      ////////////
-      //ROS DATA//
-      ////////////
-      const std::vector<TrigMonROB> eventROBs = event->getVec<TrigMonROB>();
-      if (m_doROS && eventROBs.size() > 0) {
-        *m_robN = eventROBs.size();
-        m_robRequestorId          ->resize( eventROBs.size() );
-        m_robTimer                ->resize( eventROBs.size() ); 
-        m_robTimeStartSec         ->resize( eventROBs.size() );
-        m_robTimeStartMicroSec    ->resize( eventROBs.size() );
-        m_robTimeStopSec           ->resize( eventROBs.size() );
-        m_robTimeStopMicroSec      ->resize( eventROBs.size() );
-        m_robDataN                ->resize( eventROBs.size() );
-        m_robDataRobId            ->resize( eventROBs.size() );
-        m_robDataRobSize          ->resize( eventROBs.size() );
-        m_robDataIsUnclassified   ->resize( eventROBs.size() );
-        m_robDataIsCached         ->resize( eventROBs.size() );
-        m_robDataIsRetrieved      ->resize( eventROBs.size() );
-        m_robDataIsIgnored        ->resize( eventROBs.size() );
-        m_robDataIsDisabled       ->resize( eventROBs.size() );
-        m_robDataIsStatusOk       ->resize( eventROBs.size() );
-        m_robDataIsPrefetched     ->resize( eventROBs.size() );   
-        for(unsigned int i = 0; i < eventROBs.size(); ++i) { 
-          m_robRequestorId      ->at(i) = eventROBs.at(i).getRequestorId();
-          m_robTimer            ->at(i) = eventROBs.at(i).getTimer();
-          m_robTimeStartSec     ->at(i) = eventROBs.at(i).start().getSec();
-          m_robTimeStartMicroSec->at(i) = eventROBs.at(i).start().getMicroSec();
-          m_robTimeStopSec      ->at(i) = eventROBs.at(i).stop().getSec();
-          m_robTimeStopMicroSec ->at(i) = eventROBs.at(i).stop().getMicroSec();
-          //Loop over ROB data items
-          const std::vector<TrigMonROBData> robData = eventROBs.at(i).getData(); 
-          m_robDataN->at(i) = robData.size();
-          (m_robDataRobId         ->at(i)).resize( robData.size() );
-          (m_robDataRobSize       ->at(i)).resize( robData.size() );
-          (m_robDataIsUnclassified->at(i)).resize( robData.size() );
-          (m_robDataIsCached      ->at(i)).resize( robData.size() );
-          (m_robDataIsRetrieved   ->at(i)).resize( robData.size() );
-          (m_robDataIsIgnored     ->at(i)).resize( robData.size() );
-          (m_robDataIsDisabled    ->at(i)).resize( robData.size() );
-          (m_robDataIsStatusOk    ->at(i)).resize( robData.size() );
-          (m_robDataIsPrefetched  ->at(i)).resize( robData.size() ); 
-          for (unsigned int j = 0; j < robData.size(); ++j) {
-            (m_robDataRobId         ->at(i)).at(j) = robData.at(j).getROBId();
-            (m_robDataRobSize       ->at(i)).at(j) = robData.at(j).getROBSize();
-            (m_robDataIsUnclassified->at(i)).at(j) = (uint8_t) robData.at(j).isUnclassified();
-            (m_robDataIsCached      ->at(i)).at(j) = (uint8_t) robData.at(j).isCached();
-            (m_robDataIsRetrieved   ->at(i)).at(j) = (uint8_t) robData.at(j).isRetrieved();
-            (m_robDataIsIgnored     ->at(i)).at(j) = (uint8_t) robData.at(j).isIgnored();
-            (m_robDataIsDisabled    ->at(i)).at(j) = (uint8_t) robData.at(j).isDisabled();
-            (m_robDataIsStatusOk    ->at(i)).at(j) = (uint8_t) robData.at(j).isStatusOk();
-            (m_robDataIsPrefetched  ->at(i)).at(j) = (uint8_t) robData.at(j).isStatusPrefetched(); 
-          }
-        }
-      }
-
-      ////////////////
-      //ROS SUM DATA//
-      ////////////////
-      if (m_doROSSum && eventROBs.size() > 0) {
-        m_robSumDataN             ->resize( eventROBs.size() );
-        m_robSumDataSize          ->resize( eventROBs.size() );
-        m_robSumDataNRob          ->resize( eventROBs.size() );
-        m_robSumDataSubDet        ->resize( eventROBs.size() );   
-        m_robSumDataIsUnclassified->resize( eventROBs.size() );
-        m_robSumDataIsCached      ->resize( eventROBs.size() );
-        m_robSumDataIsRetrieved   ->resize( eventROBs.size() );
-        m_robSumDataIsIgnored     ->resize( eventROBs.size() );
-        m_robSumDataIsDisabled    ->resize( eventROBs.size() );
-        for(unsigned int i = 0; i < eventROBs.size(); ++i) { 
-          //Loop over ROB SUM data items
-          const std::vector<TrigMonROBSum> robSum = eventROBs.at(i).getSum();
-          m_robSumDataN->at(i) = robSum.size();
-          (m_robSumDataSize          ->at(i)).resize( robSum.size() );
-          (m_robSumDataNRob          ->at(i)).resize( robSum.size() );
-          (m_robSumDataSubDet        ->at(i)).resize( robSum.size() );   
-          (m_robSumDataIsUnclassified->at(i)).resize( robSum.size() );
-          (m_robSumDataIsCached      ->at(i)).resize( robSum.size() );
-          (m_robSumDataIsRetrieved   ->at(i)).resize( robSum.size() );
-          (m_robSumDataIsIgnored     ->at(i)).resize( robSum.size() );
-          (m_robSumDataIsDisabled    ->at(i)).resize( robSum.size() );
-          for (unsigned int j = 0; j < robSum.size(); ++j) {
-            (m_robSumDataSize          ->at(i)).at(j) = robSum.at(j).getSize();
-            (m_robSumDataNRob          ->at(i)).at(j) = robSum.at(j).getNROB();
-            (m_robSumDataSubDet        ->at(i)).at(j) = robSum.at(j).getSubDet();
-            (m_robSumDataIsUnclassified->at(i)).at(j) = (uint8_t) (robSum.at(j).getHistory() == TrigMonROBData::kUNCLASSIFIED);
-            (m_robSumDataIsCached      ->at(i)).at(j) = (uint8_t) (robSum.at(j).getHistory() == TrigMonROBData::kCACHED);
-            (m_robSumDataIsRetrieved   ->at(i)).at(j) = (uint8_t) (robSum.at(j).getHistory() == TrigMonROBData::kRETRIEVED);
-            (m_robSumDataIsIgnored     ->at(i)).at(j) = (uint8_t) (robSum.at(j).getHistory() == TrigMonROBData::kIGNORED);
-            (m_robSumDataIsDisabled    ->at(i)).at(j) = (uint8_t) (robSum.at(j).getHistory() == TrigMonROBData::kDISABLED);
-          }
-        }
-      }
-
-      ////////////
-      //RoI DATA//
-      ////////////
-      const std::vector<TrigMonRoi> eventRoIs = event->getVec<TrigMonRoi>();
-      if (m_doRoI && eventRoIs.size() > 0) {
-        *m_roiN = eventRoIs.size();
-        m_roiIsNoneType     ->resize( eventRoIs.size() );
-        m_roiIsMuonType     ->resize( eventRoIs.size() );
-        m_roiIsEmTauType    ->resize( eventRoIs.size() );
-        m_roiIsTau          ->resize( eventRoIs.size() );
-        m_roiIsJetType      ->resize( eventRoIs.size() );
-        m_roiIsJetEtType    ->resize( eventRoIs.size() );
-        m_roiIsEnergyType   ->resize( eventRoIs.size() );
-        m_roiId             ->resize( eventRoIs.size() );
-        m_roiNL1thresholds  ->resize( eventRoIs.size() );
-        m_roiEta            ->resize( eventRoIs.size() );
-        m_roiPhi            ->resize( eventRoIs.size() );
-        m_roiArea           ->resize( eventRoIs.size() );
-        m_roiEt             ->resize( eventRoIs.size() );
-        m_roiEtLarge        ->resize( eventRoIs.size() );
-        m_roiMuCharge       ->resize( eventRoIs.size() );
-        m_roiIsolationBits  ->resize( eventRoIs.size() );
-        m_roiVectorEX       ->resize( eventRoIs.size() );
-        m_roiVectorEY       ->resize( eventRoIs.size() );
-        m_roiOverflowEX     ->resize( eventRoIs.size() );
-        m_roiOverflowEY     ->resize( eventRoIs.size() );
-        m_roiOverflowET     ->resize( eventRoIs.size() );
-        for(unsigned int i = 0; i < eventRoIs.size(); ++i) {
-          m_roiIsNoneType   ->at(i) = (uint8_t) (eventRoIs.at(i).getRoiType() == TrigMonRoi::kNone);
-          m_roiIsMuonType   ->at(i) = (uint8_t) (eventRoIs.at(i).getRoiType() == TrigMonRoi::kMuon);
-          m_roiIsEmTauType  ->at(i) = (uint8_t) (eventRoIs.at(i).getRoiType() == TrigMonRoi::kEmTau);
-          m_roiIsTau        ->at(i) = (uint8_t) (eventRoIs.at(i).getVarVal(Trig::kRoIIsTau)); // Resolve ambiguity
-          m_roiIsJetType    ->at(i) = (uint8_t) (eventRoIs.at(i).getRoiType() == TrigMonRoi::kJet);
-          m_roiIsJetEtType  ->at(i) = (uint8_t) (eventRoIs.at(i).getRoiType() == TrigMonRoi::kJetEt);
-          m_roiIsEnergyType ->at(i) = (uint8_t) (eventRoIs.at(i).getRoiType() == TrigMonRoi::kEnergy);
-          m_roiId           ->at(i) = eventRoIs.at(i).getRoiId();
-          m_roiNL1thresholds->at(i) = eventRoIs.at(i).getNL1th();
-          m_roiEta          ->at(i) = eventRoIs.at(i).getEta();
-          m_roiPhi          ->at(i) = eventRoIs.at(i).getPhi();
-          m_roiArea         ->at(i) = eventRoIs.at(i).getRoIArea();
-          m_roiEt           ->at(i) = eventRoIs.at(i).getVarVal(Trig::kRoIET); //EMTAU=ET, muon=pT, jet=ETSmall, energy=scaler total energy
-          m_roiEtLarge      ->at(i) = eventRoIs.at(i).getVarVal(Trig::kRoIETLarge); //Only for jets
-          m_roiMuCharge     ->at(i) = (uint8_t) eventRoIs.at(i).getVarVal(Trig::kRoIMuonCharge); //Only for muons
-          m_roiIsolationBits->at(i) = (uint32_t) eventRoIs.at(i).getVarVal(Trig::kRoIIsolationBits); //Only for EMTAU
-          m_roiVectorEX     ->at(i) = eventRoIs.at(i).getVarVal(Trig::kRoIEnergyVectorX); //Only for ENERGY
-          m_roiVectorEY     ->at(i) = eventRoIs.at(i).getVarVal(Trig::kRoIEnergyVectorY); //Only for ENERGY
-          m_roiOverflowEX   ->at(i) = (uint8_t) eventRoIs.at(i).getVarVal(Trig::kRoIEnergyOverflowX); //Only for ENERGY
-          m_roiOverflowEY   ->at(i) = (uint8_t) eventRoIs.at(i).getVarVal(Trig::kRoIEnergyOverflowY); //Only for ENERGY
-          m_roiOverflowET   ->at(i) = (uint8_t) eventRoIs.at(i).getVarVal(Trig::kRoIEnergyOverflowT); //Only for ENERGY
-        }
-      }
-
-      ////////////////
-      //SEQ/ALG DATA//
-      ////////////////
-      const std::vector<TrigMonSeq> eventSeqs = event->getVec<TrigMonSeq>();
-      if (m_doSeq && eventSeqs.size() > 0) {
-        int RoIIndex = 0;
-        *m_seqN = eventSeqs.size();
-        
-        m_seqLevel               ->resize( eventSeqs.size() );
-        m_seqIsInitial           ->resize( eventSeqs.size() );
-        m_seqIsExecuted          ->resize( eventSeqs.size() );
-        m_seqIsAlreadyExecuted   ->resize( eventSeqs.size() );
-        m_seqIsPrevious          ->resize( eventSeqs.size() );
-        m_seqChannelCounter      ->resize( eventSeqs.size() ); 
-        m_seqIndex               ->resize( eventSeqs.size() );
-        m_seqSequenceTimer       ->resize( eventSeqs.size() ); 
-        m_seqAlgTimerTot         ->resize( eventSeqs.size() );
-        m_seqAlgN                ->resize( eventSeqs.size() ); 
-        m_seqAlgPosition         ->resize( eventSeqs.size() );
-        m_seqAlgNRoIs            ->resize( eventSeqs.size() );
-        m_seqAlgRoIIndex         ->resize( eventSeqs.size() );
-        // We do not resize m_seqRoI as we don't yet know how big it will be
-        m_seqAlgIsCached         ->resize( eventSeqs.size() );
-        m_seqAlgIsCalled         ->resize( eventSeqs.size() );
-        m_seqAlgTimer            ->resize( eventSeqs.size() );
-        m_seqAlgTimeStartSec     ->resize( eventSeqs.size() );
-        m_seqAlgTimeStartMicroSec->resize( eventSeqs.size() );
-        m_seqAlgTimeStopSec      ->resize( eventSeqs.size() );
-        m_seqAlgTimeStopMicroSec ->resize( eventSeqs.size() ); 
-        
-        for(unsigned int i = 0; i < eventSeqs.size(); ++i) {
-          m_seqLevel            ->at(i) = eventSeqs.at(i).getLevel();
-          m_seqIsInitial        ->at(i) = (uint8_t) eventSeqs.at(i).isInitial();
-          m_seqIsExecuted       ->at(i) = (uint8_t) eventSeqs.at(i).isExecuted();
-          m_seqIsAlreadyExecuted->at(i) = (uint8_t) eventSeqs.at(i).isAlreadyExecuted();
-          m_seqIsPrevious       ->at(i) = (uint8_t) eventSeqs.at(i).isPrevious();
-          m_seqChannelCounter   ->at(i) = eventSeqs.at(i).getChnCounter();
-          m_seqIndex            ->at(i) = eventSeqs.at(i).getSeqIndex();
-          m_seqSequenceTimer    ->at(i) = eventSeqs.at(i).getSeqTimer();
-          m_seqAlgTimerTot      ->at(i) = eventSeqs.at(i).getAlgTimer();
-          //Loop over sequence algorithms
-          const std::vector<TrigMonAlg> seqAlgs = eventSeqs.at(i).getAlg();
-          m_seqAlgN->at(i) = seqAlgs.size();
-          (m_seqAlgPosition         ->at(i)).resize( seqAlgs.size() );
-          (m_seqAlgNRoIs            ->at(i)).resize( seqAlgs.size() );
-          (m_seqAlgRoIIndex         ->at(i)).resize( seqAlgs.size() );
-          (m_seqAlgIsCached         ->at(i)).resize( seqAlgs.size() );
-          (m_seqAlgIsCalled         ->at(i)).resize( seqAlgs.size() );
-          (m_seqAlgTimer            ->at(i)).resize( seqAlgs.size() );
-          (m_seqAlgTimeStartSec     ->at(i)).resize( seqAlgs.size() );
-          (m_seqAlgTimeStartMicroSec->at(i)).resize( seqAlgs.size() );
-          (m_seqAlgTimeStopSec      ->at(i)).resize( seqAlgs.size() );
-          (m_seqAlgTimeStopMicroSec ->at(i)).resize( seqAlgs.size() );
-          for (unsigned int j = 0; j < seqAlgs.size(); ++j) {
-            (m_seqAlgPosition   ->at(i)).at(j) = seqAlgs.at(j).getPosition();
-            // We shall not go deeper than vector<vector< bla > >, so store this vector<uint8_t> "up one level"
-            (m_seqAlgNRoIs            ->at(i)).at(j) = seqAlgs.at(j).getNRoi();
-            (m_seqAlgRoIIndex         ->at(i)).at(j) = RoIIndex++;
-            // We need to go via a vector, but this class gives us a set. Need to convert
-            std::vector< uint8_t > RoIIdSet;
-            RoIIdSet.clear();
-            RoIIdSet.resize( seqAlgs.at(j).getNRoi() );
-            for (unsigned int roi = 0; roi < seqAlgs.at(j).getNRoi(); ++roi) {
-              RoIIdSet.at(roi) = seqAlgs.at(j).getRoiId( roi );
-            }
-            m_seqRoI                  ->push_back( RoIIdSet );
-            (m_seqAlgIsCached         ->at(i)).at(j) = (uint8_t) seqAlgs.at(j).isCached();
-            (m_seqAlgIsCalled         ->at(i)).at(j) = (uint8_t) seqAlgs.at(j).isCalled();
-            (m_seqAlgTimer            ->at(i)).at(j) = seqAlgs.at(j).getTimer();
-            (m_seqAlgTimeStartSec     ->at(i)).at(j) = seqAlgs.at(j).start().getSec();
-            (m_seqAlgTimeStartMicroSec->at(i)).at(j) = seqAlgs.at(j).start().getMicroSec();
-            (m_seqAlgTimeStopSec      ->at(i)).at(j) = seqAlgs.at(j).stop().getSec();
-            (m_seqAlgTimeStopMicroSec ->at(i)).at(j) = seqAlgs.at(j).stop().getMicroSec();
-          }
-
-          // Check for additonal payload 
-          if ( eventSeqs.at(i).getVarKey().size() != eventSeqs.at(i).getVarVal().size() ) {
-            REPORT_MESSAGE( MSG::WARNING ) << "Trigger sequences additional float payload size different to key size, skipping.";
-          } else {
-            for (unsigned j=0; j < eventSeqs.at(i).getVarKey().size(); ++j) {
-              REPORT_MESSAGE( MSG::DEBUG ) << "Got a SEQ["<<i<<"] int=>float pair. " << eventSeqs.at(i).getVarKey().at(j) << " => " << eventSeqs.at(i).getVarVal().at(j);
-            }
-          }  
-        }
-      }
-
-      ///////////
-      //TE DATA//
-      ///////////
-      const std::vector<TrigMonTE> eventTEs = event->getVec<TrigMonTE>();
-      if (m_doTE && eventTEs.size() > 0) {  
-        *m_teN = eventTEs.size();
-        m_teId             ->resize( eventTEs.size() );
-        m_teIndex          ->resize( eventTEs.size() );
-        m_teIsRegularTE    ->resize( eventTEs.size() );
-        m_teIsInitialTE    ->resize( eventTEs.size() );
-        m_teIsRoITE        ->resize( eventTEs.size() );
-        m_teIsL1ThreshTE   ->resize( eventTEs.size() );
-        m_teActiveState    ->resize( eventTEs.size() );
-        m_teErrorState     ->resize( eventTEs.size() );
-        m_teIsTerminalNode ->resize( eventTEs.size() );
-        m_teIsOutputL2Node ->resize( eventTEs.size() );
-        m_teIsOutputEFNode ->resize( eventTEs.size() );
-        m_teIsTopologicalTE->resize( eventTEs.size() );
-        m_teChildIndex     ->resize( eventTEs.size() ); 
-        m_teParentIndex    ->resize( eventTEs.size() );
-        m_teRoiId          ->resize( eventTEs.size() );
-        m_teClid           ->resize( eventTEs.size() ); 
-        for(unsigned int i = 0; i < eventTEs.size(); ++i) {
-          m_teId             ->at(i) = eventTEs.at(i).getId();
-          m_teIndex          ->at(i) = eventTEs.at(i).getIndex();
-          m_teIsRegularTE    ->at(i) = (uint8_t) (eventTEs.at(i).getType() == TrigMonTE::kELEM);
-          m_teIsInitialTE    ->at(i) = (uint8_t) (eventTEs.at(i).getType() == TrigMonTE::kINIT);
-          m_teIsRoITE        ->at(i) = (uint8_t) (eventTEs.at(i).getType() == TrigMonTE::kROI);
-          m_teIsL1ThreshTE   ->at(i) = (uint8_t) (eventTEs.at(i).getType() == TrigMonTE::kL1TH);
-          m_teActiveState    ->at(i) = (uint8_t) eventTEs.at(i).getActiveState();
-          m_teErrorState     ->at(i) = (uint8_t) eventTEs.at(i).getErrorState();
-          m_teIsTerminalNode ->at(i) = (uint8_t) eventTEs.at(i).isTerminalNode();
-          m_teIsOutputL2Node ->at(i) = (uint8_t) eventTEs.at(i).isOutputL2Node();
-          m_teIsOutputEFNode ->at(i) = (uint8_t) eventTEs.at(i).isOutputEFNode();
-          m_teIsTopologicalTE->at(i) = (uint8_t) eventTEs.at(i).isTopologicalTE();
-          //Get inner vectors direct from the TE
-          m_teChildIndex ->at(i) = eventTEs.at(i).getChildIndex();
-          m_teParentIndex->at(i) = eventTEs.at(i).getParentIndex();
-          m_teRoiId      ->at(i) = eventTEs.at(i).getRoiId();
-          m_teClid       ->at(i) = eventTEs.at(i).getClid();
-
-          // Check additonal payload 
-          if ( eventTEs.at(i).getVarKey().size() != eventTEs.at(i).getVarVal().size() ) {
-            REPORT_MESSAGE( MSG::WARNING ) << "Trigger TE additional float payload size different to key size, skipping.";
-          } else {
-            for (unsigned j=0; j < eventTEs.at(i).getVarKey().size(); ++j) {
-              REPORT_MESSAGE( MSG::DEBUG ) << "Got a TE["<<i<<"] int=>float pair. " << eventTEs.at(i).getVarKey().at(j) << " => " << eventTEs.at(i).getVarVal().at(j);
-            }
-          }  
-        }
-      }
-
-      ///////////
-      //DB DATA//
-      ///////////
-      if (m_doDBKey) {
-        for (unsigned i=0; i < event->getVarKey().size(); ++i) {
-          switch (event->getVarKey().at(i)) {
-            case Trig::kSMK:
-              *m_DB_SMK = event->getVarVal().at(i);
-              break;
-            case Trig::kL1PSK:
-              *m_DB_L1PSK = event->getVarVal().at(i);
-              break;
-            case Trig::kHLTPSK:
-              *m_DB_HLTPSK = event->getVarVal().at(i);
-              break;
-            default:
-              break;
-          } // Switch
-        }
-      } 
-
-      if( m_tree->capture().isFailure() ) {
-        ATH_MSG_ERROR( "Couldn't save the TrigMonEvent." );
-        return;
-      } else {
-        ATH_MSG_DEBUG( "Trigger monitoring event from TrigMonEvent source successfully saved." );
-      }
-
-    } // Loop over TrigMonEventCollection DataVector
-  } // TrigCostD3PDMakerTool::handleNewEvent
-
-  void TrigCostD3PDMakerTool::clear() {
-    if (m_doBasic) {
-      *m_event = 0;
-      *m_lumi = 0;
-      *m_lumiLength = 0;
-      *m_bunch_id = 0;
-      *m_run = 0;
-      *m_sec = 0;
-      *m_nsec = 0;
-      *m_timer = 0;
-      *m_ranScaleTools= 0;
-      *m_appId = 0;
-      *m_costEvent = 0;
-      *m_costRunSec = 0;
-      *m_costRunNsec = 0;
-    }
-
-    if (m_doEB && !m_doBasic) {
-      *m_event = 0;
-      *m_ebWeight = 0;
-      *m_ebWeightBG = 0;
-      *m_ebUnbiased = 0;
-    }
-
-    //////////////
-    //EXTRA DATA//
-    //////////////
-    if (m_doExtra) {
-      *m_timerTrigCost = 0;
-      *m_timerEndSteer = 0;
-      *m_timerChainProcess = 0;
-      *m_timerResultBuilder = 0;
-      *m_timerMon = 0;
-    }
-
-    //////////////
-    //CHAIN DATA//
-    //////////////
-    if (m_doChain) {
-      *m_chainN = 0;
-      m_chainCounter->clear();
-      m_chainLevel->clear();
-      m_chainTimer->clear();
-      m_chainIsPassed->clear();
-      m_chainIsPassedRaw->clear();
-      m_chainIsPassthrough->clear();
-      m_chainIsResurrected->clear();
-      m_chainIsPrescaled->clear();
-      m_chainWasL1AfterVeto->clear();
-      m_chainWasL1BeforePrescale->clear();
-      m_chainWasL1AfterPrescale->clear();
-      m_chainIsExpressStream->clear();
-    }
-
-    ///////////
-    //L1 DATA//
-    ///////////
-    if (m_doL1) {
-      *m_l1N = 0;
-      m_l1CtpId ->clear();
-      m_l1PassedBeforePrescale ->clear();
-      m_l1PassedAfterPrescale->clear();
-      m_l1PassedAfterVeto->clear();
-      m_l1Passed->clear();
-      m_l1Prescaled->clear();
-      m_l1Vetoed->clear();
-    }
-
-    ////////////
-    //ROS DATA//
-    ////////////
-    if (m_doROS) {
-      *m_robN = 0;
-      m_robRequestorId->clear();
-      m_robTimer->clear();
-      m_robTimeStartSec->clear();
-      m_robTimeStartMicroSec->clear();
-      m_robTimeStopSec->clear();
-      m_robTimeStopMicroSec->clear();
-      m_robDataN->clear();
-      m_robDataRobId->clear();
-      m_robDataRobSize->clear();
-      m_robDataIsUnclassified->clear();
-      m_robDataIsCached->clear();
-      m_robDataIsRetrieved->clear();
-      m_robDataIsIgnored->clear();
-      m_robDataIsDisabled->clear();
-      m_robDataIsStatusOk->clear();
-      m_robDataIsPrefetched->clear();
-    }
-
-    ////////////////
-    //ROS SUM DATA//
-    ////////////////
-    if (m_doROSSum) {
-      m_robSumDataN->clear();
-      m_robSumDataSize->clear();
-      m_robSumDataNRob->clear();
-      m_robSumDataSubDet->clear();
-      m_robSumDataIsUnclassified->clear();
-      m_robSumDataIsCached->clear();
-      m_robSumDataIsRetrieved->clear();
-      m_robSumDataIsIgnored->clear();
-      m_robSumDataIsDisabled->clear();
-    }
-
-
-    ////////////
-    //RoI DATA//
-    ////////////
-    if (m_doRoI) {
-      *m_roiN = 0;
-      m_roiIsNoneType->clear();
-      m_roiIsMuonType->clear();
-      m_roiIsEmTauType->clear();
-      m_roiIsTau->clear();
-      m_roiIsJetType->clear();
-      m_roiIsJetEtType->clear();
-      m_roiIsEnergyType->clear();
-      m_roiId->clear();
-      m_roiNL1thresholds->clear();
-      m_roiEta->clear();
-      m_roiPhi->clear();
-      m_roiArea->clear();
-      //
-      m_roiEt->clear();
-      m_roiEtLarge->clear();
-      m_roiMuCharge->clear();
-      m_roiIsolationBits->clear();
-      m_roiVectorEX->clear();
-      m_roiVectorEY->clear();
-      m_roiOverflowEX->clear();
-      m_roiOverflowEY->clear();
-      m_roiOverflowET->clear();
-    }
-
-    ////////////////
-    //SEQ/ALG DATA//
-    ////////////////
-    if (m_doSeq) {
-      *m_seqN = 0;
-      m_seqIsInitial->clear();
-      m_seqIsExecuted->clear();
-      m_seqIsAlreadyExecuted->clear();
-      m_seqIsPrevious->clear();
-      m_seqLevel->clear();
-      m_seqChannelCounter->clear();
-      m_seqIndex->clear();
-      m_seqSequenceTimer->clear();
-      m_seqAlgTimerTot->clear();
-      m_seqAlgN->clear();
-      m_seqAlgPosition->clear();
-      m_seqAlgNRoIs->clear();
-      m_seqAlgRoIIndex->clear();
-      m_seqRoI->clear();
-      m_seqAlgIsCached->clear();
-      m_seqAlgIsCalled->clear();
-      m_seqAlgTimer->clear();
-      m_seqAlgTimeStartSec->clear();
-      m_seqAlgTimeStartMicroSec->clear();
-      m_seqAlgTimeStopSec->clear();
-      m_seqAlgTimeStopMicroSec->clear();
-    }
-
-    ///////////
-    //TE DATA//
-    ///////////
-    if (m_doTE) {
-      *m_teN = 0;
-      m_teId->clear();
-      m_teIndex->clear();
-      m_teIsRegularTE->clear();
-      m_teIsInitialTE->clear();
-      m_teIsRoITE->clear();
-      m_teIsL1ThreshTE->clear();
-      m_teActiveState->clear();
-      m_teErrorState->clear();
-      m_teIsTerminalNode->clear();
-      m_teIsOutputL2Node->clear();
-      m_teIsOutputEFNode->clear();
-      m_teIsTopologicalTE->clear();
-      m_teChildIndex->clear();
-      m_teParentIndex->clear();
-      m_teRoiId->clear();
-      m_teClid->clear(); 
-    }
-
-    ///////////
-    //DB DATA//
-    ///////////
-    if (m_doDBKey) {
-      *m_DB_SMK = 0;
-      *m_DB_L1PSK = 0;
-      *m_DB_HLTPSK = 0;
-    }
-  }
-
-} // namespace D3PD
diff --git a/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/src/TrigCostD3PDMakerTool.h b/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/src/TrigCostD3PDMakerTool.h
deleted file mode 100644
index 4913a1470b62aa10d0825c8bc038d3b92694315f..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/src/TrigCostD3PDMakerTool.h
+++ /dev/null
@@ -1,272 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: TrigCostD3PDMakerTool.h 603620 2014-06-25 17:55:37Z tamartin $
-#ifndef TRIGGERD3PDMAKER_TRIGCOSTD3PDMAKERTOOL_H
-#define TRIGGERD3PDMAKER_TRIGCOSTD3PDMAKERTOOL_H
-
-// STL include(s):
-#include <map>
-#include <string>
-#include <set>
-
-// Gaudi/Athena include(s):
-#include "GaudiKernel/IIncidentListener.h"
-#include "GaudiKernel/IIncidentSvc.h"
-#include "GaudiKernel/ServiceHandle.h"
-#include "GaudiKernel/ToolHandle.h"
-#include "AthenaBaseComps/AthAlgTool.h"
-#include "StoreGate/StoreGateSvc.h"
-
-// D3PDMaker include(s):
-#include "D3PDMakerInterfaces/IMetadataTool.h"
-#include "D3PDMakerInterfaces/ID3PDSvc.h"
-
-namespace D3PD {
-
-    // Forward declaration(s):
-    class ID3PD;
-
-    /**
-    * @short D3PDMaker package to write out TrigMonEvent objects to flat ntuple.
-    * As these are written out to the bytestream en-bulk, have to use tricks from the 
-    * TrigConfMetadata writer and manually write out the TTree with the D3PD metadata tools
-    * rather than using a standard D3PDMaker alg.
-    *
-    * Hence we do not get one entry per event, we get one entry for every TrigMonEvent object 
-    * (represnets an event in the HLT).
-    */
-    class TrigCostD3PDMakerTool : public AthAlgTool,
-                                  public IMetadataTool,
-                                  public IIncidentListener {
-
-      public:
-        /// Regular AlgTool constructor
-        TrigCostD3PDMakerTool( const std::string& type, const std::string& name,
-        const IInterface* parent );
-
-        /// AlgTool initialization function
-        virtual StatusCode initialize();
-        /// Gaudi function describing which interfaces the tool implements
-        virtual StatusCode queryInterface( const InterfaceID& riid, void** ppvIf );
-
-        /// Function writing the configuration information to the D3PD
-        virtual StatusCode writeMetadata( ID3PD* d3pd );
-
-        /// Function called when a relevant incident happened
-        virtual void handle( const Incident& inc );
-
-      private:
-        /// Function handling new trigger configurations
-        void handleNewEvent( const Incident& inc );
-
-        void clear();
-
-        /// Directory in which to store the data
-        std::string m_dir;
-
-        /// Handle for the incident service
-        ServiceHandle< IIncidentSvc > m_incidentSvc;
-        /// Handle for the D3PDSvc:
-        ServiceHandle< ID3PDSvc > m_d3pdSvc;
-
-        /// Storegate key for TrigMonEvent objects
-        std::string m_keyEvent;
-        /// D3PD prefix
-        std::string m_prefix;
-
-        //
-        // The configuration variables:
-        //
-        ID3PD* m_tree; ///< D3PD object holding the configuration description
-        bool m_onlySaveCostEvents; //!< Export non cost events?
-        std::string m_writeMode; //!< What to export
-        bool m_doBasic;
-        bool m_doExtra;
-        bool m_doChain;
-        bool m_doL1;
-        bool m_doROS;
-        bool m_doROSSum;
-        bool m_doRoI;
-        bool m_doSeq;
-        bool m_doTE;
-        bool m_doDBKey;
-        bool m_doEB;
-
-        //////////////
-        //BASIC DATA//
-        //////////////
-        uint32_t* m_event;              // Event number
-        uint32_t* m_lumi;               // Lumi block (low 16 bits of TrigMonEvent.m_lumi) 
-        float*    m_lumiLength;         // Lumi block length in seconds
-        uint32_t* m_bunch_id;           // bunch crossing id (high 16 bits of TrigMonEvent.m_lumi)
-        uint32_t* m_run;                // Run number
-        uint32_t* m_sec;                // Event second
-        uint32_t* m_nsec;               // Event ns
-        float*    m_timer;              // Event timer
-        float*    m_ebWeight;           // Enhanced bias weighting factor
-        uint32_t* m_ebWeightBG;         // Enhanced bias weight bunch group
-        uint8_t*  m_ebUnbiased;         // Enhanced Bias flag for unbiased online events
-        uint8_t*  m_ranScaleTools;      // If this was a monitoring event
-        uint32_t* m_appId;              // Application ID - hash of trigger XPU node
-
-        //////////////
-        //CHAIN DATA//
-        //////////////
-        uint16_t*                m_chainN; 
-        std::vector< uint16_t >* m_chainCounter;
-        std::vector< uint16_t >* m_chainLevel;    
-        std::vector< float >*    m_chainTimer;         
-        std::vector< uint8_t >*  m_chainIsPassed;   
-        std::vector< uint8_t >*  m_chainIsPassedRaw;
-        std::vector< uint8_t >*  m_chainIsPassthrough;
-        std::vector< uint8_t >*  m_chainIsResurrected;
-        std::vector< uint8_t >*  m_chainIsPrescaled;
-        std::vector< uint8_t >*  m_chainWasL1AfterVeto;
-        std::vector< uint8_t >*  m_chainWasL1BeforePrescale;
-        std::vector< uint8_t >*  m_chainWasL1AfterPrescale;
-        std::vector< uint8_t >*  m_chainIsExpressStream;
-
-        //////////////
-        //EXTRA DATA//
-        //////////////
-        float*    m_timerTrigCost;      // Detailed time - Time to process TrigCost OPI tools
-        float*    m_timerEndSteer;      // Detailed time - End of OPI steering
-        float*    m_timerChainProcess;  // Detailed time - chain processing
-        float*    m_timerResultBuilder; // Detailed time - result building
-        float*    m_timerMon;           // Detailed time - monitoring 
-        float*    m_costEvent;          // Sequential cost event number
-        uint32_t* m_costRunSec;         // Cost processing time second
-        uint32_t* m_costRunNsec;        // Cost processing time ns
-
-        ///////////
-        //L1 DATA//
-        ///////////
-        uint16_t*                m_l1N; 
-        std::vector< uint16_t >* m_l1CtpId;
-        std::vector< uint8_t >*  m_l1PassedBeforePrescale;    
-        std::vector< uint8_t >*  m_l1PassedAfterPrescale;    
-        std::vector< uint8_t >*  m_l1PassedAfterVeto;
-        std::vector< uint8_t >*  m_l1Passed;
-        std::vector< uint8_t >*  m_l1Prescaled;
-        std::vector< uint8_t >*  m_l1Vetoed; 
-
-        ////////////
-        //ROS DATA//
-        ////////////
-        uint16_t*                               m_robN;
-        std::vector< uint32_t >*                m_robRequestorId;
-        std::vector< double >*                  m_robTimer;
-        std::vector< uint32_t >*                m_robTimeStartSec;
-        std::vector< uint32_t >*                m_robTimeStartMicroSec;
-        std::vector< uint32_t >*                m_robTimeStopSec;
-        std::vector< uint32_t >*                m_robTimeStopMicroSec;
-        std::vector< uint16_t >*                m_robDataN;
-        std::vector< std::vector< uint32_t > >* m_robDataRobId;
-        std::vector< std::vector< uint32_t > >* m_robDataRobSize;
-        std::vector< std::vector< uint8_t > >*  m_robDataIsUnclassified;
-        std::vector< std::vector< uint8_t > >*  m_robDataIsCached;
-        std::vector< std::vector< uint8_t > >*  m_robDataIsRetrieved;
-        std::vector< std::vector< uint8_t > >*  m_robDataIsIgnored;
-        std::vector< std::vector< uint8_t > >*  m_robDataIsDisabled;
-        std::vector< std::vector< uint8_t > >*  m_robDataIsStatusOk;
-        std::vector< std::vector< uint8_t > >*  m_robDataIsPrefetched;   
-        std::vector< uint16_t >*                m_robSumDataN;
-        std::vector< std::vector< uint32_t > >* m_robSumDataSize;
-        std::vector< std::vector< uint32_t > >* m_robSumDataNRob;
-        std::vector< std::vector< uint32_t > >* m_robSumDataSubDet;  
-        std::vector< std::vector< uint8_t > >*  m_robSumDataIsUnclassified; 
-        std::vector< std::vector< uint8_t > >*  m_robSumDataIsCached;
-        std::vector< std::vector< uint8_t > >*  m_robSumDataIsRetrieved;
-        std::vector< std::vector< uint8_t > >*  m_robSumDataIsIgnored;
-        std::vector< std::vector< uint8_t > >*  m_robSumDataIsDisabled;
-
-        ////////////
-        //RoI DATA//
-        ////////////
-        uint16_t*                 m_roiN;
-        std::vector< uint8_t >*   m_roiIsNoneType;
-        std::vector< uint8_t >*   m_roiIsMuonType;
-        std::vector< uint8_t >*   m_roiIsEmTauType;
-        std::vector< uint8_t >*   m_roiIsTau;
-        std::vector< uint8_t >*   m_roiIsJetType;
-        std::vector< uint8_t >*   m_roiIsJetEtType;
-        std::vector< uint8_t >*   m_roiIsEnergyType;
-        std::vector< uint32_t >*  m_roiId;
-        std::vector< uint8_t >*   m_roiNL1thresholds;
-        std::vector< float >*     m_roiEta;
-        std::vector< float >*     m_roiPhi;
-        std::vector< float >*     m_roiArea;
-        //
-        std::vector< float >*     m_roiEt;
-        std::vector< float >*     m_roiEtLarge;
-        std::vector< uint8_t >*   m_roiMuCharge;
-        std::vector< uint32_t >*  m_roiIsolationBits;
-        std::vector< float >*     m_roiVectorEX;
-        std::vector< float >*     m_roiVectorEY;
-        std::vector< uint8_t >*   m_roiOverflowEX;
-        std::vector< uint8_t >*   m_roiOverflowEY;
-        std::vector< uint8_t >*   m_roiOverflowET;
-
-        ////////////////
-        //SEQ/ALG DATA//
-        ////////////////
-        uint16_t*                               m_seqN;
-        std::vector< uint8_t >*                 m_seqIsInitial;
-        std::vector< uint8_t >*                 m_seqIsExecuted;
-        std::vector< uint8_t >*                 m_seqIsAlreadyExecuted;
-        std::vector< uint8_t >*                 m_seqIsPrevious;
-        std::vector< uint16_t >*                m_seqLevel;
-        std::vector< uint16_t >*                m_seqChannelCounter;
-        std::vector< uint16_t >*                m_seqIndex; 
-        std::vector< float >*                   m_seqSequenceTimer; 
-        std::vector< double >*                  m_seqAlgTimerTot; 
-        std::vector< uint16_t >*                m_seqAlgN; 
-        std::vector< std::vector< uint8_t > >*  m_seqAlgPosition; 
-        std::vector< std::vector< uint8_t > >*  m_seqAlgNRoIs; // RoI's are held in another varaible
-        std::vector< std::vector< uint32_t > >* m_seqAlgRoIIndex;
-        std::vector< std::vector< uint8_t > >*  m_seqRoI; // Hold the RoI data
-        std::vector< std::vector< uint8_t > >*  m_seqAlgIsCached;
-        std::vector< std::vector< uint8_t > >*  m_seqAlgIsCalled;
-        std::vector< std::vector< double > >*   m_seqAlgTimer; 
-        std::vector< std::vector< uint32_t > >* m_seqAlgTimeStartSec; 
-        std::vector< std::vector< uint32_t > >* m_seqAlgTimeStartMicroSec; 
-        std::vector< std::vector< uint32_t > >* m_seqAlgTimeStopSec; 
-        std::vector< std::vector< uint32_t > >* m_seqAlgTimeStopMicroSec; 
-
-        ///////////
-        //TE DATA//
-        ///////////
-        uint16_t*                                 m_teN; 
-        std::vector< uint16_t >*                  m_teId;
-        std::vector< uint16_t >*                  m_teIndex;
-        std::vector< uint8_t >*                   m_teIsRegularTE;
-        std::vector< uint8_t >*                   m_teIsInitialTE;
-        std::vector< uint8_t >*                   m_teIsRoITE;
-        std::vector< uint8_t >*                   m_teIsL1ThreshTE;
-        std::vector< uint8_t >*                   m_teActiveState;
-        std::vector< uint8_t >*                   m_teErrorState;
-        std::vector< uint8_t >*                   m_teIsTerminalNode;
-        std::vector< uint8_t >*                   m_teIsOutputL2Node;
-        std::vector< uint8_t >*                   m_teIsOutputEFNode;
-        std::vector< uint8_t >*                   m_teIsTopologicalTE;
-        std::vector< std::vector< uint16_t > >*   m_teChildIndex;
-        std::vector< std::vector< uint16_t > >*   m_teParentIndex;
-        std::vector< std::vector< uint8_t > >*    m_teRoiId;
-        std::vector< std::vector< uint32_t > >*   m_teClid;
-
-        ///////////
-        //DB DATA//
-        ///////////
-        uint32_t* m_DB_SMK;
-        uint32_t* m_DB_L1PSK;
-        uint32_t* m_DB_HLTPSK;
-
-    }; // class TrigCostD3PDMakerTool
-
-} // namespace D3PD
-
-#endif // TRIGGERD3PDMAKER_TRIGCOSTD3PDMAKERTOOL_H
diff --git a/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/src/components/TrigCostD3PDMaker_entries.cxx b/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/src/components/TrigCostD3PDMaker_entries.cxx
deleted file mode 100644
index 86fcac335e115c8ec38e1b8e080e7bd5c69b6088..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker/src/components/TrigCostD3PDMaker_entries.cxx
+++ /dev/null
@@ -1,6 +0,0 @@
-#include "../TrigCostD3PDMakerTool.h"
-#include "../TrigCostConfMetadataTool.h"
-
-DECLARE_COMPONENT( D3PD::TrigCostD3PDMakerTool )
-DECLARE_COMPONENT( D3PD::TrigCostConfMetadataTool )
-
diff --git a/PhysicsAnalysis/D3PDTools/AnaAlgorithm/AnaAlgorithm/AnaAlgorithmConfig.h b/PhysicsAnalysis/D3PDTools/AnaAlgorithm/AnaAlgorithm/AnaAlgorithmConfig.h
index 0f3686b309073904616a9005e85014a5c0a71d9e..44d6bf50984f703ebe5a06d1063ddd9711b76d4f 100644
--- a/PhysicsAnalysis/D3PDTools/AnaAlgorithm/AnaAlgorithm/AnaAlgorithmConfig.h
+++ b/PhysicsAnalysis/D3PDTools/AnaAlgorithm/AnaAlgorithm/AnaAlgorithmConfig.h
@@ -54,6 +54,15 @@ namespace EL
     explicit AnaAlgorithmConfig (const std::string& val_typeAndName);
 
 
+    /// \brief Virtual destructor, to make PyROOT happy
+    ///
+    /// Without it ROOT 6.22+ does not allow Python classes to inherit from this
+    /// type.
+    ///
+  public:
+    virtual ~AnaAlgorithmConfig() = default;
+
+
     /// \brief whether we use XAODs
     /// \par Guarantee
     ///   no-fail
diff --git a/PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/AlgSequence.py b/PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/AlgSequence.py
index 29e8588e50cfe94379f0bcf9dabac498dbdd0644..97826fab142ee14716f22a371e02852882985bc8 100644
--- a/PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/AlgSequence.py
+++ b/PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/AlgSequence.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Check if we have the Athena package available. If yes, just use that code.
 try:
@@ -241,7 +241,7 @@ except ImportError:
             """
             return self
 
-        def next( self ):
+        def __next__( self ):
             """Function implementing the recursive iteration over an AlgSequence
 
             This is where most of the logic is. The iterator loops over the
@@ -263,14 +263,14 @@ except ImportError:
             # sub-sequence.
             if self._iterator:
                 try:
-                    return self._iterator.next()
+                    return self._iterator.__next__()
                 except StopIteration:
                     # If the sub-sequence is exhaused, then switch to the
                     # next element in our sequence, and call this function
                     # recursively.
                     self._index += 1
                     self._iterator = None
-                    return self.next()
+                    return self.__next__()
                 pass
 
             # If we are not iterating over a sub-sequence at the moment, let's
@@ -281,7 +281,7 @@ except ImportError:
             # iterating mode", and call this function recursively in that mode.
             if isinstance( element, AlgSequence ):
                 self._iterator = AlgSequenceIterator( element )
-                return self.next()
+                return self.__next__()
 
             # Apparently it's an algorithm we found. So update the internal
             # index, and simply return the algorithm.
diff --git a/PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/AnaAlgSequence.py b/PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/AnaAlgSequence.py
index 31090b947d176e654de4cf4933ea770e82571ad1..0c6b6663b2a52cfae9791e538af7e44a0fd9d193 100644
--- a/PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/AnaAlgSequence.py
+++ b/PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/AnaAlgSequence.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
 
 # System import(s):
 import copy
@@ -152,7 +152,7 @@ class AnaAlgSequence( AlgSequence ):
                 continue
 
             # Set the input name(s):
-            for inputLabel, inputPropName in meta.inputPropName.iteritems():
+            for inputLabel, inputPropName in meta.inputPropName.items():
                 if not inputLabel in currentInputs.keys():
                     continue
                 setattr( alg, inputPropName, currentInputs[ inputLabel ] )
@@ -174,7 +174,7 @@ class AnaAlgSequence( AlgSequence ):
                   copy.deepcopy( affectingSystematics )
 
                 # Loop over the outputs of the algorithm.
-                for outputLabel, outputPropName in meta.outputPropName.iteritems():
+                for outputLabel, outputPropName in meta.outputPropName.items():
                     if outputLabel not in tmpIndex.keys():
                         tmpIndex[ outputLabel ] = 1
                         pass
@@ -241,7 +241,7 @@ class AnaAlgSequence( AlgSequence ):
         # Set the output name(s) of the last algorithm (that provides output)
         # to the requested value:
         currentOutputs = copy.deepcopy( outputNameDict )
-        for alg, meta in reversed( zip( self, self._algorithmMeta ) ):
+        for alg, meta in reversed( list( zip( self, self._algorithmMeta ) ) ):
 
             # Stop the loop if we're already done.
             if len( currentOutputs ) == 0:
@@ -250,7 +250,7 @@ class AnaAlgSequence( AlgSequence ):
             # If the algorithm has (an) output(s), set them up appropriately.
             # Remembering which "final" output still needs to be set.
             if meta.outputPropName:
-                for outputLabel, outputKey in meta.outputPropName.iteritems():
+                for outputLabel, outputKey in meta.outputPropName.items():
                     if outputLabel in currentOutputs.keys():
                         setattr( alg, outputKey, currentOutputs[ outputLabel ] )
                         del currentOutputs[ outputLabel ]
@@ -260,7 +260,7 @@ class AnaAlgSequence( AlgSequence ):
 
             # Set up the input name(s) of the algorithm correctly, in case this
             # is needed...
-            for inputLabel, inputKey in meta.inputPropName.iteritems():
+            for inputLabel, inputKey in meta.inputPropName.items():
                 if inputLabel in currentOutputs.keys():
                     setattr( alg, inputKey, currentOutputs[ inputLabel ] )
                     pass
@@ -377,7 +377,7 @@ class AnaAlgSequence( AlgSequence ):
         if algIndex == -1:
             raise AttributeError( 'Algorithm/sequence with name "%s" was not ' \
                                   'found' % name )
-        
+
         # Remove the element from the base class:
         super( AnaAlgSequence, self ).__delattr__( name )
 
@@ -587,14 +587,14 @@ class TestAnaAlgSeqMultiInputContainer( unittest.TestCase ):
         self.assertEqual( self.seq.ZCombiner.container2Regex,
                           '(^$)|(^MU_.*)' )
         self.assertEqual( self.seq.ZCalibrator.inputRegex,
-                          '(^$)|(^MU_.*)|(^EL_.*)|(^EG_.*)' )
+                          '(^$)|(^EL_.*)|(^EG_.*)|(^MU_.*)' )
         return
 
     ## Test that the correct value is returned for the users for the affecting
     ## systematics.
     def test_affectingSystematics( self ):
         self.assertEqual( self.seq.affectingSystematics(),
-                          '(^$)|(^MU_.*)|(^EL_.*)|(^EG_.*)' )
+                          '(^$)|(^EL_.*)|(^EG_.*)|(^MU_.*)' )
         return
 
 ## Test case for a sequence starting from a single container, producing
diff --git a/PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/AnaAlgorithmConfig.py b/PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/AnaAlgorithmConfig.py
index b2cbd4afd9934f046e932458dd59ad434599b978..ef1e29c8070de30590753c6b92d962eb2abaeb8c 100644
--- a/PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/AnaAlgorithmConfig.py
+++ b/PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/AnaAlgorithmConfig.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Import(s):
 import ROOT
@@ -15,7 +15,7 @@ class AnaAlgorithmConfig( ROOT.EL.AnaAlgorithmConfig ):
 
     An example of using it in configuring an EventLoop job could look like:
 
-       job = ROOT.EL.Job() 
+       job = ROOT.EL.Job()
        ...
        from AnaAlgorithm.AnaAlgorithmConfig import AnaAlgorithmConfig
        alg = AnaAlgorithmConfig( "EL::UnitTestAlg2/TestAlg",
@@ -45,14 +45,16 @@ class AnaAlgorithmConfig( ROOT.EL.AnaAlgorithmConfig ):
                                      property = 1.23 )
         """
 
-        # Call the base class's constructor:
-        super( AnaAlgorithmConfig, self ).__init__( typeAndName )
+        # Call the base class's constructor. Use the default constructor instead
+        # of the one receiving the type and name, to avoid ROOT-10872.
+        super( AnaAlgorithmConfig, self ).__init__()
+        self.setTypeAndName( typeAndName )
 
         # Initialise the properties of the algorihm:
         self._props = {}
 
         # Set the properties on the object:
-        for key, value in kwargs.iteritems():
+        for key, value in kwargs.items():
             self.setPropertyFromString( key, stringPropValue( value ) )
             self._props[ key ] = copy.deepcopy( value )
             pass
@@ -160,7 +162,7 @@ class AnaAlgorithmConfig( ROOT.EL.AnaAlgorithmConfig ):
             pass
         result = AnaAlgorithmConfig._printHeader( name )
         result += '\n'
-        for key, value in sorted( self._props.iteritems() ):
+        for key, value in sorted( self._props.items() ):
             if isinstance( value, str ):
                 printedValue = "'%s'" % value
             else:
@@ -330,7 +332,7 @@ class PrivateToolConfig( object ):
         result = ' \n'
         result += AnaAlgorithmConfig._printHeader( name )
         result += '\n'
-        for key, value in sorted( self._props.iteritems() ):
+        for key, value in sorted( self._props.items() ):
             if isinstance( value, str ):
                 printedValue = "'%s'" % value
             else:
diff --git a/PhysicsAnalysis/D3PDTools/EventLoop/Root/Worker.cxx b/PhysicsAnalysis/D3PDTools/EventLoop/Root/Worker.cxx
index 77ccd7bf2a1369fe2cfd81e7d6a5a19b8649e20d..dc962a7957b86d7e6f4af04b2700211d768e8bb7 100644
--- a/PhysicsAnalysis/D3PDTools/EventLoop/Root/Worker.cxx
+++ b/PhysicsAnalysis/D3PDTools/EventLoop/Root/Worker.cxx
@@ -1,8 +1,8 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
-//          
+//
 // Distributed under the Boost Software License, Version 1.0.
 //    (See accompanying file LICENSE_1_0.txt or copy at
 //          http://www.boost.org/LICENSE_1_0.txt)
@@ -50,6 +50,7 @@
 #include <TROOT.h>
 #include <TSystem.h>
 #include <TTree.h>
+#include <TObjString.h>
 #include <fstream>
 #include <memory>
 
@@ -400,7 +401,7 @@ namespace EL
 
     for (auto& module : m_modules)
       ANA_CHECK (module->preInitialize (*this));
-    
+
     return ::StatusCode::SUCCESS;
   }
 
@@ -967,7 +968,7 @@ namespace EL
     addModule (std::make_unique<Detail::GridReportingModule> ());
     ANA_CHECK (initialize());
 
-    std::vector<std::string> fileList; 
+    std::vector<std::string> fileList;
     {
       std::ifstream infile("input.txt");
       while (infile) {
@@ -980,7 +981,7 @@ namespace EL
           fileList.push_back(sFile);
         }
       }
-    } 
+    }
     if (fileList.size() == 0) {
       ANA_MSG_ERROR ("no input files provided");
       //User was expecting input after all.
@@ -1018,12 +1019,12 @@ namespace EL
       summaryfile << "Files read: " << nFiles << std::endl;
       for (unsigned int i = 0; i < nFiles; i++) {
         summaryfile << "  " << fileList.at(i) << std::endl;
-      }      
+      }
       summaryfile << "Events Read:    " << eventsProcessed << std::endl;
       summaryfile.close();
     }
     else {
       //cout << "Failed to write summary file.\n";
-    } 
+    }
   }
 }
diff --git a/PhysicsAnalysis/D3PDTools/EventLoopTest/Root/UnitTestAlg.cxx b/PhysicsAnalysis/D3PDTools/EventLoopTest/Root/UnitTestAlg.cxx
index f101b028e792acc98090e33c4613b1416e3b4cb8..d92256a3d118f12f9875a2878a87b930d1dde45f 100644
--- a/PhysicsAnalysis/D3PDTools/EventLoopTest/Root/UnitTestAlg.cxx
+++ b/PhysicsAnalysis/D3PDTools/EventLoopTest/Root/UnitTestAlg.cxx
@@ -1,8 +1,8 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
-//          
+//
 // Distributed under the Boost Software License, Version 1.0.
 //    (See accompanying file LICENSE_1_0.txt or copy at
 //          http://www.boost.org/LICENSE_1_0.txt)
@@ -25,6 +25,7 @@
 #include <TFile.h>
 #include <TH1.h>
 #include <TTree.h>
+#include <TObjString.h>
 
 #include <AsgTools/MsgStream.h>
 #include <AsgTools/MsgStreamMacros.h>
diff --git a/PhysicsAnalysis/D3PDTools/EventLoopTest/Root/UnitTestAlg1.cxx b/PhysicsAnalysis/D3PDTools/EventLoopTest/Root/UnitTestAlg1.cxx
index d5a5b72d8dbd5ed3a354778559439c73c86d384b..e44d142c08e416f820e127148389f2326be6df76 100644
--- a/PhysicsAnalysis/D3PDTools/EventLoopTest/Root/UnitTestAlg1.cxx
+++ b/PhysicsAnalysis/D3PDTools/EventLoopTest/Root/UnitTestAlg1.cxx
@@ -1,8 +1,8 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
-//          
+//
 // Distributed under the Boost Software License, Version 1.0.
 //    (See accompanying file LICENSE_1_0.txt or copy at
 //          http://www.boost.org/LICENSE_1_0.txt)
@@ -25,6 +25,7 @@
 #include <TFile.h>
 #include <TH1.h>
 #include <TTree.h>
+#include <TObjString.h>
 
 #include <AsgTools/MsgStream.h>
 #include <AsgTools/MsgStreamMacros.h>
diff --git a/PhysicsAnalysis/D3PDTools/EventLoopTest/Root/UnitTestAlg2.cxx b/PhysicsAnalysis/D3PDTools/EventLoopTest/Root/UnitTestAlg2.cxx
index dd94437076fb325bedea0fb2928231c3bdfd0f79..5746aeff0f5888c92e4840686ab9f50efc52ca0c 100644
--- a/PhysicsAnalysis/D3PDTools/EventLoopTest/Root/UnitTestAlg2.cxx
+++ b/PhysicsAnalysis/D3PDTools/EventLoopTest/Root/UnitTestAlg2.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
 */
 
 //          Copyright Nils Krumnack 2011.
@@ -25,6 +25,7 @@
 #include <TFile.h>
 #include <TH1.h>
 #include <TTree.h>
+#include <TObjString.h>
 
 #include <AsgTools/MsgStream.h>
 #include <AsgTools/MsgStreamMacros.h>
@@ -46,7 +47,7 @@ namespace EL
 
 
   UnitTestAlg2 ::
-  UnitTestAlg2 (const std::string& name, 
+  UnitTestAlg2 (const std::string& name,
                 ISvcLocator* pSvcLocator)
     : AnaAlgorithm (name, pSvcLocator),
       makeOutput (true),
diff --git a/PhysicsAnalysis/D3PDTools/EventLoopTest/test/gt_DirectDriver.cxx b/PhysicsAnalysis/D3PDTools/EventLoopTest/test/gt_DirectDriver.cxx
index cd1b17e2f7fd6bffb4d4ffe43bd42d2b9ef42160..505a3db852c523051b8c84075eab9e2fa76d22d7 100644
--- a/PhysicsAnalysis/D3PDTools/EventLoopTest/test/gt_DirectDriver.cxx
+++ b/PhysicsAnalysis/D3PDTools/EventLoopTest/test/gt_DirectDriver.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 /// @author Nils Krumnack
@@ -39,8 +39,8 @@ struct MyUnitTestConfig : public EL::UnitTestConfig
 
 namespace EL
 {
-  INSTANTIATE_TEST_CASE_P(DirectDriverTest, UnitTestFixture,
-			  ::testing::Values(MyUnitTestConfig()),);
+  INSTANTIATE_TEST_SUITE_P(DirectDriverTest, UnitTestFixture,
+                           ::testing::Values(MyUnitTestConfig()));
 }
 
 int main (int argc, char **argv)
diff --git a/PhysicsAnalysis/D3PDTools/EventLoopTest/test/gt_LSFDriver_EOS.cxx b/PhysicsAnalysis/D3PDTools/EventLoopTest/test/gt_LSFDriver_EOS.cxx
index f4e456e0913590504317b20a681955fba2ab441e..3b1cbfed930ad115a07c541541b1a0ea21d7dd89 100644
--- a/PhysicsAnalysis/D3PDTools/EventLoopTest/test/gt_LSFDriver_EOS.cxx
+++ b/PhysicsAnalysis/D3PDTools/EventLoopTest/test/gt_LSFDriver_EOS.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 /// @author Nils Krumnack
@@ -65,8 +65,8 @@ namespace EL
 {
   // this has to be SLOW, since it requires the entire release to have
   // been build for it to work
-  INSTANTIATE_TEST_CASE_P(MANUAL_LSFDriverTest, UnitTestFixture,
-			  ::testing::Values(MyUnitTestConfig()),);
+  INSTANTIATE_TEST_SUITE_P(MANUAL_LSFDriverTest, UnitTestFixture,
+                           ::testing::Values(MyUnitTestConfig()));
 }
 
 int main (int argc, char **argv)
diff --git a/PhysicsAnalysis/D3PDTools/EventLoopTest/test/gt_LeakChecks.cxx b/PhysicsAnalysis/D3PDTools/EventLoopTest/test/gt_LeakChecks.cxx
index 10efb6ebe993efa1c407686fd34feaef8278c00c..d0c53e0188b26c6846caf43af005f5bf0726c122 100644
--- a/PhysicsAnalysis/D3PDTools/EventLoopTest/test/gt_LeakChecks.cxx
+++ b/PhysicsAnalysis/D3PDTools/EventLoopTest/test/gt_LeakChecks.cxx
@@ -112,15 +112,15 @@ TEST_P( LeakCheckTests, batch ) {
 }
 
 // Perform the test with a number of different settings.
-INSTANTIATE_TEST_CASE_P( AllLeakCheckTests, LeakCheckTests,
-                         ::testing::Values( TestParams{ 0, 0 },
-                                            TestParams{ 1000, 0 },
-                                            TestParams{ 5000, 0 },
-                                            TestParams{ 20000, 0 },
-                                            TestParams{ 0, 1 },
-                                            TestParams{ 1000, 1 },
-                                            TestParams{ 5000, 1 },
-                                            TestParams{ 20000, 1 } ), );
+INSTANTIATE_TEST_SUITE_P( AllLeakCheckTests, LeakCheckTests,
+                          ::testing::Values( TestParams{ 0, 0 },
+                                             TestParams{ 1000, 0 },
+                                             TestParams{ 5000, 0 },
+                                             TestParams{ 20000, 0 },
+                                             TestParams{ 0, 1 },
+                                             TestParams{ 1000, 1 },
+                                             TestParams{ 5000, 1 },
+                                             TestParams{ 20000, 1 } ) );
 
 // Declare the main() function.
 ATLAS_GOOGLE_TEST_MAIN
diff --git a/PhysicsAnalysis/D3PDTools/EventLoopTest/test/gt_LocalDriver.cxx b/PhysicsAnalysis/D3PDTools/EventLoopTest/test/gt_LocalDriver.cxx
index 0ab803abeefb8c636053483427f398ae0e411ccc..0abd349b2141ff53f0691e09984bce820f3e8085 100644
--- a/PhysicsAnalysis/D3PDTools/EventLoopTest/test/gt_LocalDriver.cxx
+++ b/PhysicsAnalysis/D3PDTools/EventLoopTest/test/gt_LocalDriver.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 /// @author Nils Krumnack
@@ -41,8 +41,8 @@ namespace EL
 {
   // this has to be SLOW, since it requires the entire release to have
   // been build for it to work
-  INSTANTIATE_TEST_CASE_P(SLOW_LocalDriverTest, UnitTestFixture,
-			  ::testing::Values(MyUnitTestConfig()),);
+  INSTANTIATE_TEST_SUITE_P(SLOW_LocalDriverTest, UnitTestFixture,
+                           ::testing::Values(MyUnitTestConfig()));
 }
 
 int main (int argc, char **argv)
diff --git a/PhysicsAnalysis/D3PDTools/SampleHandler/CMakeLists.txt b/PhysicsAnalysis/D3PDTools/SampleHandler/CMakeLists.txt
index 0ac4d2322377d42e7ebc7be445235195b47182d1..b06dd71880fee83de9633347c0750d9478f57232 100644
--- a/PhysicsAnalysis/D3PDTools/SampleHandler/CMakeLists.txt
+++ b/PhysicsAnalysis/D3PDTools/SampleHandler/CMakeLists.txt
@@ -1,7 +1,4 @@
-# $Id: CMakeLists.txt 786914 2016-11-28 14:58:47Z krumnack $
-################################################################################
-# Package: SampleHandler
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( SampleHandler )
@@ -15,7 +12,7 @@ atlas_depends_on_subdirs(
    Control/AthToolSupport/AsgTesting )
 
 # External dependencies:
-find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO PyROOT Proof )
+find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO ROOTTPython Proof )
 find_package( GTest )
 
 # Component(s) in the package:
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/ElectronEfficiencyCorrection/IAsgElectronEfficiencyCorrectionTool.h b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/ElectronEfficiencyCorrection/IAsgElectronEfficiencyCorrectionTool.h
deleted file mode 100644
index ea8aeb75e81543ebe1d7c4f5a3a8da1861687e7b..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/ElectronEfficiencyCorrection/IAsgElectronEfficiencyCorrectionTool.h
+++ /dev/null
@@ -1,12 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-//IAsgElectronEfficiencyCorrection.h to be used in the tool.
-#ifndef __IASGELECTRONEFFICIENCYCORRECTION__
-#define __IASGELECTRONEFFICIENCYCORRECTION__
-
-#include "EgammaAnalysisInterfaces/IAsgElectronEfficiencyCorrectionTool.h"
-#pragma message "In the process of moving the Interface part under PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces"
-
-#endif
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/src/EleChargeAlg.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/src/EleChargeAlg.cxx
deleted file mode 100644
index 3ccf4efa02c9de89e0014dbbe0ddf3d6fd287116..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/src/EleChargeAlg.cxx
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
-  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
-*/
-
-// ElectronChargeCorrection includes
-#include "EleChargeAlg.h"
-#include "xAODEventInfo/EventInfo.h"
-#include "xAODEgamma/ElectronContainer.h"
-// #include "xAODTruth/TruthEventContainer.h"
-// #include "xAODTruth/TruthVertex.h"
-// #include "xAODEgamma/EgammaTruthxAODHelpers.h"
-#include "GaudiKernel/ITHistSvc.h"
-#include "PATInterfaces/ISystematicsTool.h"
-
-#include "EgammaAnalysisInterfaces/IAsgElectronEfficiencyCorrectionTool.h"
-
-
-
-EleChargeAlg::EleChargeAlg( const std::string& name, ISvcLocator* pSvcLocator ) :
-  AthAlgorithm( name, pSvcLocator ),
-  m_syst(),
-  m_eccTool("CP::ElectronChargeEfficiencyCorrectionTool/ElectronChargeEfficiencyCorrectionTool", this),
-  m_eleContName("Electrons")
-{
-  declareProperty("ElectronChargeEfficiencyCorrectionTool",  m_eccTool, "The private ElectronChargeEfficiencyCorrectionTool" );
-  declareProperty("ElectronContainerName",         m_eleContName, "The name of the input electron container");
-}
-
-
-EleChargeAlg::~EleChargeAlg() {}
-
-
-StatusCode EleChargeAlg::initialize() {
-
-  ATH_MSG_INFO ("Initializing " << name() << "...");
-  ATH_CHECK( m_eccTool.retrieve() );
-  m_syst = m_eccTool->affectingSystematics();
-  for( const auto& variation : m_syst ) {
-    ATH_MSG_INFO(" Affecting systematics: " << variation.name());
-  }
-  return StatusCode::SUCCESS;
-}
-
-StatusCode EleChargeAlg::finalize() {
-  ATH_MSG_INFO ("Finalizing " << name() << "...");
-  ATH_CHECK( m_eccTool.release() );
-
-  return StatusCode::SUCCESS;
-}
-
-StatusCode EleChargeAlg::execute() {
-
-  //----------------------------
-  // Event information
-  //---------------------------
-
-  const xAOD::EventInfo* eventInfo = nullptr; //NOTE: Everything that comes from the storegate direct from the input files is const!
-
-  // ask the event store to retrieve the xAOD EventInfo container
-
-  CHECK( evtStore()->retrieve( eventInfo) );
-  // if there is only one container of that type in the xAOD (as with the EventInfo container), you do not need to pass
-  // the key name, the default will be taken as the only key name in the xAOD
-
-  // check if data or MC
-  if(!eventInfo->eventType(xAOD::EventInfo::IS_SIMULATION ) ){
-    ATH_MSG_DEBUG( "DATA. Will stop processing this algorithm for the current event.");
-    return StatusCode::SUCCESS; // stop this algorithms execute() for this event, here only interested in MC
-  }
-
-
-  //---------
-  // electrons
-  //---------
-
-  const xAOD::ElectronContainer* electrons = nullptr;
-  CHECK( evtStore()->retrieve( electrons, m_eleContName.value() ) );
-
-  ATH_MSG_VERBOSE ("Executing " << name() << "... in event with: " << electrons->size() << " electrons");
-
-  // Loop over all electrons in this container
-  for ( const auto* electron : *electrons ) {
-
-    if ( electron->pt() < 25000 ) continue;
-    if ( std::abs(electron->eta()) > 2.5 ) continue;
-
-    ATH_MSG_DEBUG("-------------------------------------------------------------------" );
-    ATH_MSG_DEBUG(" ...  electron with pt = " << electron->pt() << " , eta: " << fabs(electron->eta()) );
-
-    double sf=-999;
-    //float rate=-999;
-    CP::SystematicSet syst_set;
-
-    CP::SystematicCode tmpSysResult = m_eccTool->applySystematicVariation(syst_set);
-    ATH_MSG_DEBUG("applySystematicVariation returned CP::SystematicCode = " << tmpSysResult);
-    if ( tmpSysResult != CP::SystematicCode::Ok ) {
-      ATH_MSG_ERROR("ElectronChargeEfficiencyCorrectionTool did NOT report a CP::SystematicCode::Ok when calling applySystematicVariation");
-      return StatusCode::FAILURE;
-    }
-
-    CP::CorrectionCode tmpResult = m_eccTool->getEfficiencyScaleFactor(*electron,sf);
-    ATH_MSG_DEBUG("Nominal value SF = " << sf << " and CP::CorrectionCode = " << tmpResult);
-    if ( tmpResult == CP::CorrectionCode::Error ) {
-      ATH_MSG_ERROR("ElectronChargeEfficiencyCorrectionTool reported a CP::CorrectionCode::Error");
-      return StatusCode::FAILURE;
-    }
-
-    for( const auto& variation : m_syst ) {
-      double tmpSF=0;
-      ///float tmprate=0;
-      CP::SystematicSet syst_set1;
-      syst_set1.insert( variation );
-
-      tmpSysResult = m_eccTool->applySystematicVariation(syst_set1);
-      ATH_MSG_DEBUG("applySystematicVariation (second time) returned CP::SystematicCode = " << tmpSysResult);
-      if ( tmpSysResult != CP::SystematicCode::Ok ) {
-        ATH_MSG_ERROR("ElectronChargeEfficiencyCorrectionTool did NOT report a CP::SystematicCode::Ok when calling applySystematicVariation");
-        return StatusCode::FAILURE;
-      }
-      tmpResult = m_eccTool->getEfficiencyScaleFactor(*electron, tmpSF);
-      ATH_MSG_DEBUG("getEfficiencyScaleFactor returned CP::CorrectionCode = " << tmpResult);
-      if ( tmpResult == CP::CorrectionCode::Error ) {
-        ATH_MSG_ERROR("ElectronChargeEfficiencyCorrectionTool reported a CP::CorrectionCode::Error when calling getEfficiencyScaleFactor");
-        return StatusCode::FAILURE;
-      }
-      //   //m_eccTool->getDataEfficiency(*electron, tmprate);
-      ATH_MSG_DEBUG("   Systematic "<< variation.name() << ":" << " SF-> " << tmpSF);
-      //   //ATH_MSG_DEBUG("Systematic "<< variation.name() << ":" << " data rate-> " << tmprate);
-    }
-
-
-  } // end for loop over electrons
-
-
-  return StatusCode::SUCCESS;
-
-} //-------end of execute
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/src/EleChargeAlg.h b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/src/EleChargeAlg.h
deleted file mode 100644
index adf091bf941ce47ce3bf4eefd5b3325b89ef3bdd..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/src/EleChargeAlg.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef ELECTRONCHARGECORRECTION_ELECHARGEALG_H
-#define ELECTRONCHARGECORRECTION_ELECHARGEALG_H 1
-
-#include "AthenaBaseComps/AthAlgorithm.h"
-#include "GaudiKernel/ToolHandle.h"
-// #include "xAODTruth/TruthParticle.h"
-
-#include "TTree.h"
-#include "TLorentzVector.h"
-
-#include <vector>
-
-// #include "MCTruthClassifier/IMCTruthClassifier.h"
-#include "PATInterfaces/SystematicSet.h"
-
-class IAsgElectronEfficiencyCorrectionTool;
-
-class EleChargeAlg: public ::AthAlgorithm {
- public:
-  EleChargeAlg( const std::string& name, ISvcLocator* pSvcLocator);
-
-  virtual ~EleChargeAlg();
-
-  virtual StatusCode  initialize();
-  virtual StatusCode  execute();
-  virtual StatusCode  finalize();
-
-
- private:
-  /// The systematics set that will contain all the systematic variations
-  CP::SystematicSet m_syst;
-
-  /// The handle to the charge-misid scale-factor tool
-  ToolHandle<IAsgElectronEfficiencyCorrectionTool> m_eccTool;
-
-  /// The name of the input electron container
-  StringProperty m_eleContName;
-};
-
-#endif //> !ELECTRONCHARGECORRECTION_ELECHARGEALG_H
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/src/components/ElectronEfficiencyCorrection_entries.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/src/components/ElectronEfficiencyCorrection_entries.cxx
index ec72b97a27778b834f7474ad3a0fa35bff89cc51..13672c9891b52b18d10f4bd62da52fe3ff668852 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/src/components/ElectronEfficiencyCorrection_entries.cxx
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/src/components/ElectronEfficiencyCorrection_entries.cxx
@@ -1,9 +1,5 @@
 #include "ElectronEfficiencyCorrection/AsgElectronEfficiencyCorrectionTool.h"
 #include "ElectronEfficiencyCorrection/ElectronChargeEfficiencyCorrectionTool.h"
-#include "../testAthenaElectronAlg.h"
 
 DECLARE_COMPONENT( AsgElectronEfficiencyCorrectionTool )
 DECLARE_COMPONENT( CP::ElectronChargeEfficiencyCorrectionTool )
-
-DECLARE_COMPONENT( testAthenaElectronAlg )
-
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/src/testAthenaElectronAlg.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/src/testAthenaElectronAlg.cxx
deleted file mode 100644
index 2d0318c8fd86db230940dacafc8fb457af34c0df..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/src/testAthenaElectronAlg.cxx
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
-  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
-*/
-
-// ElectronEfficiencyCorrection includes
-#include "testAthenaElectronAlg.h"
-
-#include "xAODEventInfo/EventInfo.h"
-#include "xAODEgamma/ElectronContainer.h"
-#include "xAODEgamma/ElectronAuxContainer.h"
-#include "xAODCore/ShallowCopy.h"
-#include "PATInterfaces/SystematicsTool.h"
-#include "EgammaAnalysisInterfaces/IAsgElectronEfficiencyCorrectionTool.h"
-
-testAthenaElectronAlg::testAthenaElectronAlg( const std::string& name, ISvcLocator* pSvcLocator ) : 
-  AthAlgorithm( name, pSvcLocator ),  
-  m_electronSF("AsgElectronEfficiencyCorrectionTool/AsgElectronEfficiencyCorrectionTool",this){
-  //declareProperty( "Property", m_nProperty ); //example property declaration
-  declareProperty( "ElectronEfficiencyCorrectionTool", m_electronSF );
-}
-//
-testAthenaElectronAlg::~testAthenaElectronAlg() {}
-
-
-StatusCode testAthenaElectronAlg::initialize() {
-  ATH_MSG_INFO ("Initializing " << name() << "...");
-  // Retrieve the tool
-  ATH_CHECK( m_electronSF.retrieve() );
-  return StatusCode::SUCCESS;
-}
-
-StatusCode testAthenaElectronAlg::finalize() {
-  ATH_MSG_INFO ("Finalizing " << name() << "...");
-  // Clean up
-  ATH_CHECK( m_electronSF.release() );
-  return StatusCode::SUCCESS;
-}
-
-StatusCode testAthenaElectronAlg::execute() {  
-  ATH_MSG_DEBUG ("Executing " << name() << "...");
-
-  //----------------------------
-  // Event information
-  //--------------------------- 
-  const xAOD::EventInfo* eventInfo = nullptr; //NOTE: Everything that comes from the storegate direct from the input files is const!
-
-  // ask the event store to retrieve the xAOD EventInfo container
-  //ATH_CHECK( evtStore()->retrieve( eventInfo, "EventInfo") );  // the second argument ("EventInfo") is the key name
-  ATH_CHECK( evtStore()->retrieve( eventInfo) );
-  // if there is only one container of that type in the xAOD (as with the EventInfo container), you do not need to pass
-  // the key name, the default will be taken as the only key name in the xAOD 
- 
-  //---------
-  // electrons
-  //---------
-  const xAOD::ElectronContainer* electrons = nullptr;
-  ATH_CHECK( evtStore()->retrieve( electrons, "Electrons") );
- 
-  // Let's create a shallow copy of the const electron container, and decorate it with the obtained SF
-  auto inContShallowCopy = xAOD::shallowCopyContainer( *electrons );
-
-  //creates a new electron container to hold the subset as well as the needed auxiliary container
-  xAOD::ElectronContainer* myelectrons = new xAOD::ElectronContainer;
-  xAOD::ElectronAuxContainer* myelectronsAux = new xAOD::ElectronAuxContainer;
-  // You need to tell the jet container in which auxiliary container it should write its member variables
-  myelectrons->setStore( myelectronsAux ); //gives it a new associated aux container
-  // Also record to storegate: you must record both the container and the auxcontainer.
-  // Note that storegate takes ownership of these objects, i.e., you must not try to delete them yourself.
-  ATH_CHECK( evtStore()->record(myelectrons,  "MyElectrons" ) );
-  ATH_CHECK( evtStore()->record(myelectronsAux, "MyElectronsAux" ) );
-
-  // Loop over all Electrons in the shallow-copy container, decorate it with SF, and store in new xAOD file, in addition print out all SF (with get* function)
-
-  CP::SystematicSet mySysSet;
-  //mySysSet.insert(CP::SystematicVariation("EL_EFF_UncorrUncertainty", 1));
-  m_electronSF->applySystematicVariation(mySysSet);
-
-  for ( xAOD::Electron* el : *(inContShallowCopy.first) ) {
-
-    if ( el->pt()<7000. ) continue;
-    ATH_MSG_DEBUG( "  electron pt = " << el->pt() <<", electron eta = " << el->eta() );
-
-    double SF; // for electron SF 
-    if( m_electronSF->getEfficiencyScaleFactor(*el,SF) != CP::CorrectionCode::Ok){
-      ATH_MSG_WARNING( "Couldn't get electron scale factor!" );
-      continue;
-    }
-
-    if ( m_electronSF->applyEfficiencyScaleFactor(*el) == CP::CorrectionCode::Error ) {
-      ATH_MSG_ERROR("ElectronEfficiencyCorrectionTool reported a CP::CorrectionCode::Error");
-      return StatusCode::FAILURE;
-    }
-
-    //m_electronSF->applyEfficiencyScaleFactor(*el);
-    ATH_MSG_DEBUG( "  electron SF, from get function = " << SF <<", electron SF from apply function " << el->auxdata< float >("SF") );
-    
-    myelectrons->push_back(el); // add it to a new electron container which will be writed to a new file
-  }// and loop on electrons
- 
-  return StatusCode::SUCCESS;
-}
-
-
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/src/testAthenaElectronAlg.h b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/src/testAthenaElectronAlg.h
deleted file mode 100644
index 85b2b800425557c19bd667f7dd7cd460ca84d00f..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/src/testAthenaElectronAlg.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef ELECTRONEFFICIENCYCORRECTION_TESTATHENAELECTRONALG_H
-#define ELECTRONEFFICIENCYCORRECTION_TESTATHENAELECTRONALG_H 
-
-#include "AthenaBaseComps/AthAlgorithm.h"
-#include "GaudiKernel/ToolHandle.h"
-
-// forward declarations
-class IAsgElectronEfficiencyCorrectionTool;
-
-class testAthenaElectronAlg: public ::AthAlgorithm { 
- public: 
-  testAthenaElectronAlg( const std::string& name, ISvcLocator* pSvcLocator );
-  virtual ~testAthenaElectronAlg(); 
-
-  virtual StatusCode  initialize();
-  virtual StatusCode  execute();
-  virtual StatusCode  finalize();
-
- private: 
- /// The tool handles our electron efficiency corrections
- ToolHandle< IAsgElectronEfficiencyCorrectionTool > m_electronSF;
-}; 
-
-#endif //> !ELECTRONEFFICIENCYCORRECTION_TESTATHENAELECTRONALG_H
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/util/EgEfficiencyCorr_testFixedInput.py b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/util/EgEfficiencyCorr_testFixedInput.py
index 0e2384ed33022dbea019ee3d4771499a47a3215f..32e7613fd7928104d508dd27c607256662121924 100755
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/util/EgEfficiencyCorr_testFixedInput.py
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/util/EgEfficiencyCorr_testFixedInput.py
@@ -1,9 +1,9 @@
 #! /usr/bin/env python
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 import subprocess
 
 if __name__ == "__main__":
-	
+
 	recFile="ElectronEfficiencyCorrection/2015_2017/rel21.2/Summer2017_Prerec_v1/offline/efficiencySF.offline.LooseAndBLayerLLH_d0z0_v13.root"
 	models=["FULL","COMBMCTOYS"]
 	etas=["-2.469","0.0","2.469"]
@@ -12,9 +12,9 @@ if __name__ == "__main__":
 	for runnumber in runnumbers:
 		for model in models:
 			for eta in etas:
-				for pt in pts:	
-					cmdopts = ["EgEfficiencyCorr_testEgEfficiencyCorrWithoutFile", 
-							"-f" + recFile, 
+				for pt in pts:
+					cmdopts = ["EgEfficiencyCorr_testEgEfficiencyCorrWithoutFile",
+							"-f" + recFile,
 							"-tFullSim",
 							"-c"+model,
 							"-r"+ runnumber,
@@ -22,4 +22,4 @@ if __name__ == "__main__":
 							"-p" +pt ]
 					rawoutput=subprocess.check_output(cmdopts,universal_newlines=True)
 					maplines=rawoutput.split('\n')
-					print maplines[1]
+					print(str(maplines[1]))
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronIsEMSelector.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronIsEMSelector.h
index 97044e4e07a5d41bf62ffd55a4cdcbcebccf4055..b964df708a5ae78cd1da4f92a8776f7367d2fe18 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronIsEMSelector.h
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronIsEMSelector.h
@@ -39,7 +39,7 @@ class AsgElectronIsEMSelector :  public asg::AsgTool,
 {
 
   ASG_TOOL_CLASS3(AsgElectronIsEMSelector, IAsgElectronIsEMSelector,
-		  IAsgEGammaIsEMSelector, CP::ISelectionTool)
+		  IAsgEGammaIsEMSelector, IAsgSelectionTool)
 
   public:
   /** Standard constructor */
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronLikelihoodTool.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronLikelihoodTool.h
index 5cedcbe49b91434d72ebbc8dead8515e2899126e..09b86500901ee33fd527edd92fead1d2ed82a602 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronLikelihoodTool.h
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronLikelihoodTool.h
@@ -27,7 +27,7 @@ namespace Root{
 class AsgElectronLikelihoodTool : public asg::AsgTool, 
 				  virtual public IAsgElectronLikelihoodTool
 {
-  ASG_TOOL_CLASS2(AsgElectronLikelihoodTool, IAsgElectronLikelihoodTool, CP::ISelectionTool)
+  ASG_TOOL_CLASS2(AsgElectronLikelihoodTool, IAsgElectronLikelihoodTool, IAsgSelectionTool)
 
 public:
   /** Standard constructor */
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgForwardElectronIsEMSelector.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgForwardElectronIsEMSelector.h
index 9dcc1f33bc552b5fe919b9bc0286d7ecd29d8550..2bb1a3a9bb22b9fac53a432b9a3a4474e2f56263 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgForwardElectronIsEMSelector.h
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgForwardElectronIsEMSelector.h
@@ -42,7 +42,7 @@ class AsgForwardElectronIsEMSelector : public asg::AsgTool,
 {
 
   ASG_TOOL_CLASS3(AsgForwardElectronIsEMSelector, IAsgForwardElectronIsEMSelector,
-		  IAsgEGammaIsEMSelector, CP::ISelectionTool)
+		  IAsgEGammaIsEMSelector, IAsgSelectionTool)
 
   public:
   /** Standard constructor */
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgPhotonIsEMSelector.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgPhotonIsEMSelector.h
index 24d90cbdb3fb42096f66777b627a0dd7e38c12c1..e6bed435ecaf8659080ef5e03027849f423c06e0 100755
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgPhotonIsEMSelector.h
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgPhotonIsEMSelector.h
@@ -39,7 +39,7 @@ class AsgPhotonIsEMSelector : public asg::AsgTool,
 
 {
   ASG_TOOL_CLASS3(AsgPhotonIsEMSelector, IAsgPhotonIsEMSelector,
-		  IAsgEGammaIsEMSelector, CP::ISelectionTool)
+		  IAsgEGammaIsEMSelector, IAsgSelectionTool)
 
   public:
 
diff --git a/PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces/AsgAnalysisInterfaces/AsgAnalysisInterfacesDict.h b/PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces/AsgAnalysisInterfaces/AsgAnalysisInterfacesDict.h
index 441fcfa14dc51604afae4c913e6b9c9cab3f33ee..21f21bd13040f03d5c1a6cfd8f138e5f93bac3f8 100644
--- a/PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces/AsgAnalysisInterfaces/AsgAnalysisInterfacesDict.h
+++ b/PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces/AsgAnalysisInterfaces/AsgAnalysisInterfacesDict.h
@@ -11,7 +11,6 @@
 // Local include(s):
 #include "AsgAnalysisInterfaces/IClassificationTool.h"
 #include "AsgAnalysisInterfaces/IEfficiencyScaleFactorTool.h"
-#include "AsgAnalysisInterfaces/ISelectionTool.h"
 #include "AsgAnalysisInterfaces/IGoodRunsListSelectionTool.h"
 #include "AsgAnalysisInterfaces/IObservableTool.h"
 #include "AsgAnalysisInterfaces/IPileupReweightingTool.h"
diff --git a/PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces/AsgAnalysisInterfaces/ISelectionTool.h b/PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces/AsgAnalysisInterfaces/ISelectionTool.h
deleted file mode 100644
index cff312a53a75908e8c1c457ac024278b98ddd8a4..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces/AsgAnalysisInterfaces/ISelectionTool.h
+++ /dev/null
@@ -1,66 +0,0 @@
-///////////////////////// -*- C++ -*- /////////////////////////////
-
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// IAsgSelectionTool.h 
-// Header file for class IAsgSelectionTool
-// Author: Karsten Koeneke <karsten.koeneke@cern.ch>
-/////////////////////////////////////////////////////////////////// 
-#ifndef ASGANALYSISINTERFACES_IASGMTSELECTIONTOOL_H
-#define ASGANALYSISINTERFACES_IASGMTSELECTIONTOOL_H
-
-// STL includes
-
-
-// FrameWork includes
-#include <AsgTools/IAsgTool.h>
-
-namespace asg {
-  class AcceptInfo;
-  class AcceptData;
-}
-
-// Forward declaration
-namespace xAOD{
-  class IParticle;
-}
-
-namespace CP {
-
-  class ISelectionTool
-    : virtual public asg::IAsgTool
-  { 
-    /// Declare the interface ID for this pure-virtual interface class to the Athena framework
-    ASG_TOOL_INTERFACE(ISelectionTool)
-
-
-    /////////////////////////////////////////////////////////////////// 
-    // Public methods: 
-    /////////////////////////////////////////////////////////////////// 
-    public: 
-
-    /////////////////////////////////////////////////////////////////// 
-    // Const methods: 
-    ///////////////////////////////////////////////////////////////////
-
-    /** 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. */
-    virtual const asg::AcceptInfo& getAcceptInfo() const = 0;
-
-    /** Backward compatibility method */
-    [[deprecated("please use getAcceptInfo() instead")]]
-    inline const asg::AcceptInfo& getTAccept () const {
-      return getAcceptInfo();};
-
-    /** The main accept method: the actual cuts are applied here */
-    virtual asg::AcceptData accept( const xAOD::IParticle* /*part*/ ) const = 0;
-
-
-  }; 
-}
-
-#endif //> !PATCORE_IASGSELECTIONTOOL_H
diff --git a/PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces/AsgAnalysisInterfaces/selection.xml b/PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces/AsgAnalysisInterfaces/selection.xml
index dd85df090701f832862bb1a9e20204aaedf7c564..4272830e0d79a4f1632a6675a83d74027977d1df 100644
--- a/PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces/AsgAnalysisInterfaces/selection.xml
+++ b/PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces/AsgAnalysisInterfaces/selection.xml
@@ -3,7 +3,6 @@
   <namespace name="CP"/>
   <class name="CP::IClassificationTool" />
   <class name="CP::IEfficiencyScaleFactorTool" />
-  <class name="CP::ISelectionTool" />
   <class name="CP::IPileupReweightingTool" />
   <class name="IGoodRunsListSelectionTool" />
   <class name="IObservableTool" />
diff --git a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgEGammaIsEMSelector.h b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgEGammaIsEMSelector.h
index b1da503644a391c6a9afc798eff1a69fc8817c24..949abe831a1005e196b4bd4bb5e9bdeb911ff241 100644
--- a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgEGammaIsEMSelector.h
+++ b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgEGammaIsEMSelector.h
@@ -18,24 +18,24 @@
 */
 
 // Include the interfaces
-#include "AsgAnalysisInterfaces/ISelectionTool.h"
+#include "PATCore/IAsgSelectionTool.h"
 #include "xAODEgamma/EgammaFwd.h"
 #include "xAODEgamma/PhotonFwd.h"
 #include "xAODEgamma/ElectronFwd.h"
 
 class EventContext;
 
-class IAsgEGammaIsEMSelector : virtual public CP::ISelectionTool
+class IAsgEGammaIsEMSelector : virtual public IAsgSelectionTool
 {
 
   ASG_TOOL_INTERFACE(IAsgEGammaIsEMSelector)
 
 public:
 
-  /// @name IAsgEGammaIsEMSelector methods in Addition to the ISelectionTool
+  /// @name IAsgEGammaIsEMSelector methods in Addition to the IAsgSelectionTool
   /// @{
 
-  /// accept with pointer to  IParticle  so as to not hide the ISelectionTool one
+  /// accept with pointer to  IParticle  so as to not hide the IAsgSelectionTool one
   virtual asg::AcceptData accept( const xAOD::IParticle* part ) const = 0;
   virtual asg::AcceptData accept( const EventContext& ctx, const xAOD::IParticle* part ) const = 0;
 
diff --git a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgElectronChargeIDSelectorTool.h b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgElectronChargeIDSelectorTool.h
index d39775c815e8abea599a3a602d70581208cd6ac5..da1817cb6778ced9a14d77640d97e7496642802d 100644
--- a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgElectronChargeIDSelectorTool.h
+++ b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgElectronChargeIDSelectorTool.h
@@ -14,23 +14,23 @@
 */
 
 // Include the interfaces
-#include "AsgAnalysisInterfaces/ISelectionTool.h"
+#include "PATCore/IAsgSelectionTool.h"
 #include "xAODEgamma/ElectronFwd.h"
 #include "xAODEgamma/EgammaFwd.h"
 #include "GaudiKernel/EventContext.h"
 
-class IAsgElectronChargeIDSelectorTool : virtual public CP::ISelectionTool
+class IAsgElectronChargeIDSelectorTool : virtual public IAsgSelectionTool
 {
 
   ASG_TOOL_INTERFACE(IAsgElectronChargeIDSelectorTool)
 
  public:
 
-  /// @name IAsgElectronChargeIDSelectorTool  methods in Addition to the ISelectionTool ones
+  /// @name IAsgElectronChargeIDSelectorTool  methods in Addition to the IAsgSelectionTool ones
   /// Some are there to mainly support the calls done from the online/Trigger side 
   /// @{
 
-  /// accept with pointer to  IParticle  so as to not hide the ISelectionTool one
+  /// accept with pointer to  IParticle  so as to not hide the IAsgSelectionTool one
   virtual asg::AcceptData accept( const xAOD::IParticle* part ) const = 0;
   /// accept method with pointer to electron 
   virtual asg::AcceptData accept( const xAOD::Electron* part ) const = 0;
diff --git a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgElectronLikelihoodTool.h b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgElectronLikelihoodTool.h
index 541d726d71a16eebf78d8cca45fc95b962e0b9f8..384ae2e083187e606fe7c8654e53b229bdc34021 100644
--- a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgElectronLikelihoodTool.h
+++ b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgElectronLikelihoodTool.h
@@ -15,24 +15,24 @@
 */
 
 // Include the interfaces
-#include "AsgAnalysisInterfaces/ISelectionTool.h"
+#include "PATCore/IAsgSelectionTool.h"
 #include "xAODEgamma/ElectronFwd.h"
 #include "xAODEgamma/EgammaFwd.h"
 
 class EventContext;
 
-class IAsgElectronLikelihoodTool : virtual public CP::ISelectionTool
+class IAsgElectronLikelihoodTool : virtual public IAsgSelectionTool
 {
 
   ASG_TOOL_INTERFACE(IAsgElectronLikelihoodTool)
 
  public:
 
-  /// @name IAsgElectronLikelihoodTool  methods in Addition to the ISelectionTool ones
+  /// @name IAsgElectronLikelihoodTool  methods in Addition to the IAsgSelectionTool ones
   /// Some are there to mainly support the calls done from the online/Trigger side 
   /// @{
 
-  /// accept with pointer to  IParticle  so as to not hide the ISelectionTool one
+  /// accept with pointer to  IParticle  so as to not hide the IAsgSelectionTool one
   virtual asg::AcceptData accept( const xAOD::IParticle* part ) const = 0;
   virtual asg::AcceptData accept( const EventContext& ctx, const xAOD::IParticle* part ) const = 0;
   /// accept method with pointer to electron 
diff --git a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgElectronMultiLeptonSelector.h b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgElectronMultiLeptonSelector.h
index 2cf4643eaa5b23081aae5ed85d2d1ca7ce2fa9ae..1a0fd9ff7b594a023336e21cbec0f9fe88a83b44 100644
--- a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgElectronMultiLeptonSelector.h
+++ b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgElectronMultiLeptonSelector.h
@@ -13,20 +13,20 @@
 
 */
 // Include the interfaces
-#include "AsgAnalysisInterfaces/ISelectionTool.h"
+#include "PATCore/IAsgSelectionTool.h"
 #include "xAODEgamma/ElectronFwd.h"
 
-class IAsgElectronMultiLeptonSelector : virtual public CP::ISelectionTool
+class IAsgElectronMultiLeptonSelector : virtual public IAsgSelectionTool
 {
 
   ASG_TOOL_INTERFACE(IAsgElectronMultiLeptonSelector)
 
 public:
 
-  /// @name IAsgElectronMultiLeptonSelector methods in addition to the ISelectionTool ones
+  /// @name IAsgElectronMultiLeptonSelector methods in addition to the IAsgSelectionTool ones
   ///{@
 
-  /// accept with pointer to  IParticle  so as to not hide the ISelectionTool one
+  /// accept with pointer to  IParticle  so as to not hide the IAsgSelectionTool one
   virtual asg::AcceptData accept( const xAOD::IParticle* part ) const = 0;
 
   /// accept method with pointer to electron */
diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/CMakeLists.txt b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/CMakeLists.txt
index 15d5161eb53fdc0983cd7fe33af1dacd00a4e4f2..0cf8ec9ebb0c0a1e492da90a5017563007568938 100644
--- a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/CMakeLists.txt
+++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/CMakeLists.txt
@@ -32,7 +32,7 @@ atlas_depends_on_subdirs(
 # Build a shared library:
 atlas_add_library( FlavorTagDiscriminants
   Root/BTagJetAugmenter.cxx
-  Root/BTagTrackAugmenter.cxx
+  Root/BTagTrackIpAccessor.cxx
   Root/BTagAugmenterTool.cxx
   Root/BTagMuonAugmenter.cxx
   Root/BTagMuonAugmenterTool.cxx
diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/BTagMuonAugmenter.h b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/BTagMuonAugmenter.h
index 03f43afaffececf6828dab16845c445186987b54..fe60ee7d813211018d35ffe61c3e5a1e328185f5 100644
--- a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/BTagMuonAugmenter.h
+++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/BTagMuonAugmenter.h
@@ -10,7 +10,7 @@
 #include "xAODMuon/MuonContainer.h"
 #include "xAODEventInfo/EventInfo.h"
 #include "FlavorTagDiscriminants/FlipTagEnums.h"
-#include "FlavorTagDiscriminants/BTagTrackAugmenter.h"
+#include "FlavorTagDiscriminants/BTagTrackIpAccessor.h"
 
 namespace FlavorTagDiscriminants {
 
@@ -31,7 +31,7 @@ namespace FlavorTagDiscriminants {
     void augment(const xAOD::Jet& jet) const;
   private:
     // You'll probably have to add some accessors here
-    BTagTrackAugmenter m_btag_track_aug;
+    BTagTrackIpAccessor m_btag_track_aug;
     std::string m_muonAssociationName;
     float m_muonMinDR;
     float m_muonMinpT;
diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/BTagTrackAugmenter.h b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/BTagTrackIpAccessor.h
similarity index 85%
rename from PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/BTagTrackAugmenter.h
rename to PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/BTagTrackIpAccessor.h
index 81d2812f122e99a296ae235befcf537023d492ff..c60760faad901aa3fa978f8440155941d4806915 100644
--- a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/BTagTrackAugmenter.h
+++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/BTagTrackIpAccessor.h
@@ -3,8 +3,8 @@
 */
 
 
-#ifndef BTAG_TRACK_AUGMENTER_HH
-#define BTAG_TRACK_AUGMENTER_HH
+#ifndef BTAG_TRACK_IP_ACCESSOR_HH
+#define BTAG_TRACK_IP_ACCESSOR_HH
 
 
 #include <vector>
@@ -26,9 +26,9 @@ struct BTagSignedIP {
   double ip3d_grade;
 };
 
-class BTagTrackAugmenter {
+class BTagTrackIpAccessor {
 public:
-  BTagTrackAugmenter(const std::string& prefix = "btagIp_" );
+  BTagTrackIpAccessor(const std::string& prefix = "btagIp_" );
   void augment(const xAOD::TrackParticle &track, const xAOD::Jet &jet);
 
   // NOTE: this should be called in the derivations if possible,
@@ -41,20 +41,18 @@ public:
   // imediately afterword: it is only valid for the jet it is
   // assigned to!
   //
-  // Better advice: don't use this at all, use get_signed_ip() instead
+  // Better advice: don't use this at all, use getSignedIp() instead
   void augment_with_ip(const xAOD::TrackParticle &track, const xAOD::Jet &jet);
   double d0(const xAOD::TrackParticle &track) const;
   double d0Uncertainty(const xAOD::TrackParticle &track) const;
   double z0SinTheta(const xAOD::TrackParticle &track) const;
   double z0SinThetaUncertainty(const xAOD::TrackParticle &track) const;
 
-  BTagSignedIP get_signed_ip(const xAOD::TrackParticle &track, const xAOD::Jet &jet) const;
+  BTagSignedIP getSignedIp(const xAOD::TrackParticle &track, const xAOD::Jet &jet) const;
   std::set<std::string> getTrackIpDataDependencyNames() const;
 private:
   typedef SG::AuxElement AE;
 
-  AE::ConstAccessor<float> m_ip_d0;
-  AE::ConstAccessor<float> m_ip_z0;
   AE::ConstAccessor<float> m_ip_d0_sigma;
   AE::ConstAccessor<float> m_ip_z0_sigma;
   AE::ConstAccessor<std::vector<float> > m_track_displacement;
diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/BTagMuonAugmenter.cxx b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/BTagMuonAugmenter.cxx
index 8c52554153b8dc6cc99b07d52e15e085f28dcde7..cb56e99eedfb2b8a983bc1f0381b22fd8a857004 100644
--- a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/BTagMuonAugmenter.cxx
+++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/BTagMuonAugmenter.cxx
@@ -5,7 +5,7 @@
 #include "xAODMuon/Muon.h"
 #include "xAODMuon/MuonContainer.h"
 #include "FlavorTagDiscriminants/BTagMuonAugmenter.h"
-#include "FlavorTagDiscriminants/BTagTrackAugmenter.h"
+#include "FlavorTagDiscriminants/BTagTrackIpAccessor.h"
 
 namespace FlavorTagDiscriminants {
 
@@ -32,7 +32,7 @@ namespace FlavorTagDiscriminants {
   {
     // you probably have to initialize something here
     using namespace FlavorTagDiscriminants;
-    m_btag_track_aug = BTagTrackAugmenter();
+    m_btag_track_aug = BTagTrackIpAccessor();
     m_muonAssociationName = muonAssociationName;
     m_muonMinDR = muonMinDR;
     m_muonMinpT = muonMinpT;
@@ -130,7 +130,7 @@ namespace FlavorTagDiscriminants {
         muon_pTrel = myjet.Vect().Perp(mymu.Vect()); // VD: everything MUST be in MeV
 
         //Muon ID track IP information
-        muon_ip = m_btag_track_aug.get_signed_ip(*IDMuTrack, jet);
+        muon_ip = m_btag_track_aug.getSignedIp(*IDMuTrack, jet);
         muon_ip3d_d0 = muon_ip.ip3d_signed_d0;
         muon_ip3d_z0 = muon_ip.ip3d_signed_z0;
         muon_ip3d_d0_significance = muon_ip.ip3d_signed_d0_significance;
diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/BTagTrackAugmenter.cxx b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/BTagTrackIpAccessor.cxx
similarity index 69%
rename from PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/BTagTrackAugmenter.cxx
rename to PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/BTagTrackIpAccessor.cxx
index 3035543edf0a4182e2ee3224e9a225082b5ee1a2..95a76bc481c1171df47641435f888b717af2af87 100644
--- a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/BTagTrackAugmenter.cxx
+++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/BTagTrackIpAccessor.cxx
@@ -2,23 +2,19 @@
   Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
-#include "FlavorTagDiscriminants/BTagTrackAugmenter.h"
+#include "FlavorTagDiscriminants/BTagTrackIpAccessor.h"
 
 #include <cmath>
 #include <cstddef>
 
 namespace str {
-  const std::string d0 = "d0";
-  const std::string z0SinTheta = "z0SinTheta";
   const std::string d0Uncertainty = "d0Uncertainty";
   const std::string z0SinThetaUncertainty = "z0SinThetaUncertainty";
   const std::string trackDisplacement = "trackDisplacement";
   const std::string trackMomentum = "trackMomentum";
 }
 
-BTagTrackAugmenter::BTagTrackAugmenter(const std::string& prefix):
-  m_ip_d0(prefix + str::d0),
-  m_ip_z0(prefix + str::z0SinTheta),
+BTagTrackIpAccessor::BTagTrackIpAccessor(const std::string& prefix):
   m_ip_d0_sigma(prefix + str::d0Uncertainty),
   m_ip_z0_sigma(prefix + str::z0SinThetaUncertainty),
   m_track_displacement(prefix + str::trackDisplacement),
@@ -49,54 +45,61 @@ namespace {
   }
 }
 
-void BTagTrackAugmenter::augment(const xAOD::TrackParticle &track, const xAOD::Jet &jet) {
+void BTagTrackIpAccessor::augment(const xAOD::TrackParticle &track, const xAOD::Jet &jet) {
   augment_with_grades(track, jet);
   augment_with_ip(track, jet);
 }
 
-BTagSignedIP BTagTrackAugmenter::get_signed_ip(const xAOD::TrackParticle &track, const xAOD::Jet &jet) const {
+BTagSignedIP BTagTrackIpAccessor::getSignedIp(const xAOD::TrackParticle &track, const xAOD::Jet &jet) const {
   const TLorentzVector jet_fourVector = jet.p4();
   const Amg::Vector3D jet_threeVector(jet_fourVector.X(),jet_fourVector.Y(),jet_fourVector.Z());
   const Amg::Vector3D track_displacement = get_vector3d(m_track_displacement(track));
   const Amg::Vector3D track_momentum = get_vector3d(m_track_momentum(track));
 
   BTagSignedIP ip;
-  const double ip_d0 = m_ip_d0(track);
+  const double ip_d0 = d0(track);
   ip.ip2d_signed_d0 = std::copysign(ip_d0, std::sin(jet_threeVector.phi() - track_momentum.phi()) * ip_d0);
   const double ip3d_signed_d0 = std::copysign(ip_d0, jet_threeVector.cross(track_momentum).dot(track_momentum.cross(-track_displacement)));
   ip.ip3d_signed_d0 = ip3d_signed_d0;
   ip.ip3d_signed_d0_significance = ip3d_signed_d0 / m_ip_d0_sigma(track);
 
-  const double ip_z0 = m_ip_z0(track);
+  const double ip_z0 = z0SinTheta(track);
   const double signed_z0 = std::copysign(ip_z0, (jet_threeVector.eta() - track_momentum.eta()) * ip_z0);
   ip.ip3d_signed_z0 = signed_z0;
   ip.ip3d_signed_z0_significance = signed_z0 / m_ip_z0_sigma(track);
   return ip;
 }
 
-double BTagTrackAugmenter::d0(const xAOD::TrackParticle &track) const {
-  return m_ip_d0(track);
+double BTagTrackIpAccessor::d0(const xAOD::TrackParticle &track) const {
+  const Amg::Vector3D track_displacement = get_vector3d(m_track_displacement(track));
+  const Amg::Vector3D track_momentum = get_vector3d(m_track_momentum(track));
+  return std::copysign(
+    std::hypot(track_displacement[Amg::x], track_displacement[Amg::y]),
+    track_momentum.cross(track_displacement)[Amg::z]);
 }
-double BTagTrackAugmenter::d0Uncertainty(const xAOD::TrackParticle &track)
+double BTagTrackIpAccessor::d0Uncertainty(const xAOD::TrackParticle &track)
   const {
   return m_ip_d0_sigma(track);
 }
-double BTagTrackAugmenter::z0SinTheta(const xAOD::TrackParticle &track) const {
-  return m_ip_z0(track);
+double BTagTrackIpAccessor::z0SinTheta(const xAOD::TrackParticle &track) const {
+  const Amg::Vector3D track_displacement = get_vector3d(m_track_displacement(track));
+  const Amg::Vector3D track_momentum = get_vector3d(m_track_momentum(track));
+  return track_displacement[Amg::z] * std::sqrt(
+    1 - std::pow(track_momentum[Amg::z],2) / track_momentum.squaredNorm());
 }
-double BTagTrackAugmenter::z0SinThetaUncertainty(const xAOD::TrackParticle &track) const {
-  return m_ip_z0(track);
+double BTagTrackIpAccessor::z0SinThetaUncertainty(const xAOD::TrackParticle &track) const {
+  return m_ip_z0_sigma(track);
 }
 
-void BTagTrackAugmenter::augment_with_ip(const xAOD::TrackParticle &track, const xAOD::Jet &jet) {
-  BTagSignedIP ip = get_signed_ip(track, jet);
+void BTagTrackIpAccessor::augment_with_ip(const xAOD::TrackParticle &track, const xAOD::Jet &jet) {
+  BTagSignedIP ip = getSignedIp(track, jet);
   m_ip2d_signed_d0(track) = ip.ip2d_signed_d0;
   m_ip3d_signed_d0(track) = ip.ip3d_signed_d0;
   m_ip3d_signed_d0_significance(track) = ip.ip3d_signed_d0_significance;
   m_ip3d_signed_z0(track) = ip.ip3d_signed_z0;
   m_ip3d_signed_z0_significance(track) = ip.ip3d_signed_z0_significance;
 }
-void BTagTrackAugmenter::augment_with_grades(const xAOD::TrackParticle &track, const xAOD::Jet &jet) {
+void BTagTrackIpAccessor::augment_with_grades(const xAOD::TrackParticle &track, const xAOD::Jet &jet) {
   int ip3d_grade = -1;
   const xAOD::BTagging &btagging = *jet.btagging();
   const std::vector<ElementLink<xAOD::TrackParticleContainer> > ip3d_tracks = m_ip3d_trackParticleLinks(btagging);
@@ -119,11 +122,9 @@ void BTagTrackAugmenter::augment_with_grades(const xAOD::TrackParticle &track, c
   m_ip2d_grade(track) = ip2d_grade;
 }
 
-std::set<std::string> BTagTrackAugmenter::getTrackIpDataDependencyNames() const
+std::set<std::string> BTagTrackIpAccessor::getTrackIpDataDependencyNames() const
 {
   return {
-    m_prefix + str::d0,
-    m_prefix + str::z0SinTheta,
     m_prefix + str::d0Uncertainty,
     m_prefix + str::z0SinThetaUncertainty,
     m_prefix + str::trackDisplacement,
diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/DL2.cxx b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/DL2.cxx
index fe2da2cdbb217f4bf4ed1f6994dab7125314cfdb..c1ea9db0120bc4cc1f32270148cf319965b287bc 100644
--- a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/DL2.cxx
+++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/DL2.cxx
@@ -3,7 +3,7 @@
 */
 
 #include "FlavorTagDiscriminants/DL2.h"
-#include "FlavorTagDiscriminants/BTagTrackAugmenter.h"
+#include "FlavorTagDiscriminants/BTagTrackIpAccessor.h"
 #include "lwtnn/LightweightGraph.hh"
 #include "lwtnn/NanReplacer.hh"
 
@@ -255,7 +255,7 @@ namespace FlavorTagDiscriminants {
       TrackSortVar trackSortVar(SortOrder order) {
         typedef xAOD::TrackParticle Tp;
         typedef xAOD::Jet Jet;
-        BTagTrackAugmenter aug;
+        BTagTrackIpAccessor aug;
         switch(order) {
         case SortOrder::ABS_D0_SIGNIFICANCE_DESCENDING:
           return [aug](const Tp* tp, const Jet&) {
@@ -263,7 +263,7 @@ namespace FlavorTagDiscriminants {
                  };
         case SortOrder::D0_SIGNIFICANCE_DESCENDING:
           return [aug](const Tp* tp, const Jet& j) {
-                   return aug.get_signed_ip(*tp, j).ip3d_signed_d0_significance;
+                   return aug.getSignedIp(*tp, j).ip3d_signed_d0_significance;
                  };
         case SortOrder::PT_DESCENDING:
           return [](const Tp* tp, const Jet&) {return tp->pt();};
@@ -280,7 +280,7 @@ namespace FlavorTagDiscriminants {
 
         typedef xAOD::TrackParticle Tp;
         typedef SG::AuxElement AE;
-        BTagTrackAugmenter aug;
+        BTagTrackIpAccessor aug;
         auto data_deps = aug.getTrackIpDataDependencyNames();
 
         // make sure we record accessors as data dependencies
@@ -344,7 +344,7 @@ namespace FlavorTagDiscriminants {
           };
         case EDMType::CUSTOM_GETTER: return {
             customNamedSeqGetter(cfg.name),
-            BTagTrackAugmenter().getTrackIpDataDependencyNames()
+            BTagTrackIpAccessor().getTrackIpDataDependencyNames()
           };
         default: {
           throw std::logic_error("Unknown EDM type");
@@ -357,7 +357,7 @@ namespace FlavorTagDiscriminants {
       // start by defining the raw functions, there's a factory
       // function below to convert the configuration enums to a
       // std::function
-      Tracks negativeIpOnly(BTagTrackAugmenter& aug,
+      Tracks negativeIpOnly(BTagTrackIpAccessor& aug,
                             const Tracks& tracks,
                             const xAOD::Jet& j) {
         Tracks filtered;
@@ -365,7 +365,7 @@ namespace FlavorTagDiscriminants {
         // flipping
         for (auto ti = tracks.crbegin(); ti != tracks.crend(); ti++) {
           const xAOD::TrackParticle* tp = *ti;
-          double sip = aug.get_signed_ip(*tp, j).ip3d_signed_d0_significance;
+          double sip = aug.getSignedIp(*tp, j).ip3d_signed_d0_significance;
           if (sip < 0) filtered.push_back(tp);
         }
         return filtered;
@@ -376,7 +376,7 @@ namespace FlavorTagDiscriminants {
         FlipTagConfig cfg)
       {
         namespace ph = std::placeholders;  // for _1, _2, _3
-        BTagTrackAugmenter aug;
+        BTagTrackIpAccessor aug;
         switch(cfg) {
         case FlipTagConfig::NEGATIVE_IP_ONLY:
           // flips order and removes tracks with negative IP
diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/customGetter.cxx b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/customGetter.cxx
index 800a1d54da7ed607b1e0a62cfd1568f59137062d..c2267e0966118ccf1986f9a70ddd4c3a0f6a38e6 100644
--- a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/customGetter.cxx
+++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/customGetter.cxx
@@ -2,7 +2,7 @@
   Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 #include "FlavorTagDiscriminants/customGetter.h"
-#include "FlavorTagDiscriminants/BTagTrackAugmenter.h"
+#include "FlavorTagDiscriminants/BTagTrackIpAccessor.h"
 
 namespace {
   // ______________________________________________________________________
@@ -31,7 +31,7 @@ namespace {
   class SignedD0SequenceGetter
   {
   private:
-    BTagTrackAugmenter m_augmenter;
+    BTagTrackIpAccessor m_augmenter;
   public:
     SignedD0SequenceGetter():
       m_augmenter()
@@ -42,7 +42,7 @@ namespace {
       std::vector<double> signed_d0;
       for (const auto* track: tracks) {
         signed_d0.push_back(
-          m_augmenter.get_signed_ip(*track, jet).ip3d_signed_d0_significance);
+          m_augmenter.getSignedIp(*track, jet).ip3d_signed_d0_significance);
       }
       return signed_d0;
     }
@@ -50,7 +50,7 @@ namespace {
   class SignedZ0SequenceGetter
   {
   private:
-    BTagTrackAugmenter m_augmenter;
+    BTagTrackIpAccessor m_augmenter;
   public:
     SignedZ0SequenceGetter():
       m_augmenter()
@@ -61,7 +61,7 @@ namespace {
       std::vector<double> signed_z0;
       for (const auto* track: tracks) {
         signed_z0.push_back(
-          m_augmenter.get_signed_ip(*track, jet).ip3d_signed_z0_significance);
+          m_augmenter.getSignedIp(*track, jet).ip3d_signed_z0_significance);
       }
       return signed_z0;
     }
diff --git a/PhysicsAnalysis/JetTagging/JetTagMonitoring/python/JetTagMonitorAlgorithm.py b/PhysicsAnalysis/JetTagging/JetTagMonitoring/python/JetTagMonitorAlgorithm.py
index 3b53019c7f02f38a5f44f0c2d9b64a75c17e8063..bfcb72281de758f7230cb5ddf14af94be970524b 100644
--- a/PhysicsAnalysis/JetTagging/JetTagMonitoring/python/JetTagMonitorAlgorithm.py
+++ b/PhysicsAnalysis/JetTagging/JetTagMonitoring/python/JetTagMonitorAlgorithm.py
@@ -16,8 +16,12 @@ def JetTagMonitorConfig(inputFlags):
     ### STEP 1 ###
     # Define one top-level monitoring algorithm. The new configuration 
     # framework uses a component accumulator.
-    #from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
-    #result = ComponentAccumulator()
+    from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+    result = ComponentAccumulator()
+
+    # do not run monitoring in RAWtoESD
+    if inputFlags.DQ.Environment == 'tier0Raw':
+        return result
 
     # The following class will make a sequence, configure algorithms, and link
     # them to GenericMonitoringTools
@@ -307,7 +311,8 @@ def JetTagMonitorConfig(inputFlags):
     # and the sequence containing the created algorithms. If we haven't called
     # any configuration other than the AthMonitorCfgHelper here, then we can 
     # just return directly (and not create "result" above)
-    return helper.result()
+    result.merge(helper.result())
+    return result
     
     # # Otherwise, merge with result object and return
     # acc, seq = helper.result()
diff --git a/PhysicsAnalysis/UpgradePhys/SmearingFunctions/UpgradePerformanceFunctions/Root/MissingETPerformanceFunctions.cxx b/PhysicsAnalysis/UpgradePhys/SmearingFunctions/UpgradePerformanceFunctions/Root/MissingETPerformanceFunctions.cxx
index 37946741c888727b5ab32e1b50fd93dc5566599c..33f7074ba6f03d5540a7a8de5379a7244400bde2 100644
--- a/PhysicsAnalysis/UpgradePhys/SmearingFunctions/UpgradePerformanceFunctions/Root/MissingETPerformanceFunctions.cxx
+++ b/PhysicsAnalysis/UpgradePhys/SmearingFunctions/UpgradePerformanceFunctions/Root/MissingETPerformanceFunctions.cxx
@@ -135,7 +135,7 @@ float UpgradePerformanceFunctions::getMETResolution(float sumEtMeV, METSyst syst
 //  /*Transition*/
 //  else if (sumEtGeV<m_highsumet[PUcondition]) 
 //    METPUresoNom=m_Ress[PUcondition]->Eval(m_lowsumet[PUcondition])+((sumEtGeV-m_lowsumet[PUcondition])*(m_par1[PUcondition]+m_par2[PUcondition]*sqrt(m_highsumet[PUcondition])-m_Ress[PUcondition]->Eval(m_lowsumet[PUcondition]))/(m_highsumet[PUcondition]-m_lowsumet[PUcondition]));
-//  /*Z´ fit*/   
+//  /*Z' fit*/   
 //  else METPUresoNom=m_par1[PUcondition]+m_par2[PUcondition]*sqrt(sumEtGeV);
 //  
 //  //5% systematics sample dependence, and extrapolation at low sumET wiht the fit
diff --git a/Projects/AnalysisBase/build_externals.sh b/Projects/AnalysisBase/build_externals.sh
index 6a7361bf9c66c3bb131f5b33f99dbded4b458c7b..081074ee028a714ee67378639158b08bc53e935b 100755
--- a/Projects/AnalysisBase/build_externals.sh
+++ b/Projects/AnalysisBase/build_externals.sh
@@ -84,9 +84,11 @@ fi
 
 # Get the version of AnalysisBase for the build.
 version=`cat ${thisdir}/version.txt`
+# Generate hash of any extra cmake arguments.
+cmakehash=`echo -n "${EXTRACMAKE}" | openssl md5 | awk '{print $2}'`
 
 # Check if previous externals build can be reused:
-externals_stamp=${BUILDDIR}/build/AnalysisBaseExternals/externals-${version}.stamp
+externals_stamp=${BUILDDIR}/build/AnalysisBaseExternals/externals-${version}-${cmakehash}.stamp
 if [ -f ${externals_stamp} ]; then
     if diff -q ${externals_stamp} ${thisdir}/externals.txt; then
         echo "Correct version of externals already available in ${BUILDDIR}"
diff --git a/Projects/AnalysisBase/cmake/AnalysisBaseReleaseEnvironmentConfig.cmake b/Projects/AnalysisBase/cmake/AnalysisBaseReleaseEnvironmentConfig.cmake
index e5c10d01cad56fb01b98eeaee005122f5408d53e..e2396d665b7eccbba0efbcb51f87a694ddae36bf 100644
--- a/Projects/AnalysisBase/cmake/AnalysisBaseReleaseEnvironmentConfig.cmake
+++ b/Projects/AnalysisBase/cmake/AnalysisBaseReleaseEnvironmentConfig.cmake
@@ -22,11 +22,12 @@ set( AnalysisBaseReleaseEnvironment_ENVIRONMENT
    SET ROOTCOREDIR \${AnalysisBase_DIR}
    SET ROOTCOREBIN \${AnalysisBase_DIR} )
 
-# Since this project may be built on platforms that provide Python 3
-# out of the box, let's explicitly stick to Python 2 (coming from the
-# externals project) for now.
-set( ATLAS_FORCE_PYTHON2 TRUE CACHE BOOL
-   "Force the usage of Python 2 in the AnalysisBase project" )
+# Find the first "acceptable" Python version according to our search path, and
+# don't search for the absolute newest. (Which could result in picking up
+# Python from /usr on modern OS-es.)
+set( Python_FIND_STRATEGY "LOCATION" CACHE STRING
+   "Search mode for FindPython.cmake" )
+mark_as_advanced( Python_FIND_STRATEGY )
 
 # Do not use Boost's CMake code when building AnalysisBase.
 set( Boost_NO_BOOST_CMAKE TRUE CACHE BOOL
diff --git a/Projects/AnalysisBase/externals.txt b/Projects/AnalysisBase/externals.txt
index da4a5823bdee13d0b95804710a8e307e6c45c3a1..042f340bf18b8af525eeaecc7d293a0ff82af286 100644
--- a/Projects/AnalysisBase/externals.txt
+++ b/Projects/AnalysisBase/externals.txt
@@ -6,4 +6,4 @@
 # forbidden.
 
 # The version of atlas/atlasexternals to use:
-AnalysisBaseExternalsVersion = 2.0.75
+AnalysisBaseExternalsVersion = 2.0.78
diff --git a/Projects/AnalysisBase/version.txt b/Projects/AnalysisBase/version.txt
index 3c1b7f674146fd6e433fa11215110b1411c85eef..c0b885324f71e1eac612d6a61c4f01370140ddca 100644
--- a/Projects/AnalysisBase/version.txt
+++ b/Projects/AnalysisBase/version.txt
@@ -1 +1 @@
-22.0.17
+22.0.18
diff --git a/Projects/AthDataQuality/CMakeLists.txt b/Projects/AthDataQuality/CMakeLists.txt
index bb85aab942e7bb68eaaede759b3ff51a03b5f9a0..69d278c0814e79fca21b7621a2f37c4a7ff34e13 100644
--- a/Projects/AthDataQuality/CMakeLists.txt
+++ b/Projects/AthDataQuality/CMakeLists.txt
@@ -18,9 +18,9 @@ set( TDAQ-COMMON_ATROOT
 find_package( AtlasCMake REQUIRED )
 
 # Build the project against LCG:
-set( LCG_VERSION_POSTFIX "a_ATLAS_1"
+set( LCG_VERSION_POSTFIX "python3"
    CACHE STRING "Version postfix for the LCG release to use" )
-set( LCG_VERSION_NUMBER 97
+set( LCG_VERSION_NUMBER 98
    CACHE STRING "Version number for the LCG release to use" )
 find_package( LCG ${LCG_VERSION_NUMBER} EXACT REQUIRED )
 
diff --git a/Projects/AthDataQuality/build_externals.sh b/Projects/AthDataQuality/build_externals.sh
index 848619a66d1594a8898491e5e87890c831b98b11..e0eb7dc0b8c2dde583be142c049617487c7c6341 100755
--- a/Projects/AthDataQuality/build_externals.sh
+++ b/Projects/AthDataQuality/build_externals.sh
@@ -22,7 +22,6 @@ BUILDDIR=""
 BUILDTYPE="RelWithDebInfo"
 FORCE=""
 CI=""
-EXTRACMAKE=(-DLCG_VERSION_NUMBER=98 -DLCG_VERSION_POSTFIX="python3")
 while getopts ":t:b:fch" opt; do
     case $opt in
         t)
@@ -101,4 +100,4 @@ AtlasExternalsVersion=$(awk '/^AtlasExternalsVersion/{print $3}' ${thisdir}/exte
 # Check out AthenaExternals from the right branch/tag:
 ${scriptsdir}/checkout_atlasexternals.sh \
     -t ${AtlasExternalsVersion} \
-    -s ${BUILDDIR}/src/atlasexternals 2>&1 | tee ${BUILDDIR}/src/checkout.atlasexternals.log 
+    -s ${BUILDDIR}/src/atlasexternals 2>&1 | tee ${BUILDDIR}/src/checkout.atlasexternals.log
diff --git a/Projects/AthDataQuality/externals.txt b/Projects/AthDataQuality/externals.txt
index 30f3dcbbc1575c40da02384d1b4d040a45c61409..d94fd24c8789a0c18e1805194484772a1ec2be21 100644
--- a/Projects/AthDataQuality/externals.txt
+++ b/Projects/AthDataQuality/externals.txt
@@ -5,4 +5,4 @@
 # an "origin/" prefix before it. For tags however this is explicitly
 # forbidden.
 
-AtlasExternalsVersion = 2.0.75
+AtlasExternalsVersion = 2.0.78
diff --git a/Projects/AthDataQuality/version.txt b/Projects/AthDataQuality/version.txt
index 3c1b7f674146fd6e433fa11215110b1411c85eef..c0b885324f71e1eac612d6a61c4f01370140ddca 100644
--- a/Projects/AthDataQuality/version.txt
+++ b/Projects/AthDataQuality/version.txt
@@ -1 +1 @@
-22.0.17
+22.0.18
diff --git a/Projects/AthGeneration/build_externals.sh b/Projects/AthGeneration/build_externals.sh
index 91b6fd9b743f36b3ea8e28a3f937eebb28d39581..1273378fd15f735a589ac3659f01e04e03db4b3a 100755
--- a/Projects/AthGeneration/build_externals.sh
+++ b/Projects/AthGeneration/build_externals.sh
@@ -97,9 +97,11 @@ fi
 
 # Get the version of AthGeneration for the build.
 version=`cat ${thisdir}/version.txt`
+# Generate hash of any extra cmake arguments.
+cmakehash=`echo -n "${EXTRACMAKE}" | openssl md5 | awk '{print $2}'`
 
 # Check if previous externals build can be reused:
-externals_stamp=${BUILDDIR}/build/AthGenerationExternals/externals-${version}.stamp
+externals_stamp=${BUILDDIR}/build/AthGenerationExternals/externals-${version}-${cmakehash}.stamp
 if [ -f ${externals_stamp} ]; then
     if diff -q ${externals_stamp} ${thisdir}/externals.txt; then
         echo "Correct version of externals already available in ${BUILDDIR}"
diff --git a/Projects/AthGeneration/externals.txt b/Projects/AthGeneration/externals.txt
index f24529601a85d8212636fa9b1de8b0de1c4c65cf..9e3fc448673e196c76123f63660a76eb7c81e22d 100644
--- a/Projects/AthGeneration/externals.txt
+++ b/Projects/AthGeneration/externals.txt
@@ -6,7 +6,7 @@
 # forbidden.
 
 # The version of atlas/atlasexternals to use:
-AthGenerationExternalsVersion = 2.0.75
+AthGenerationExternalsVersion = 2.0.78
 
 # The version of atlas/Gaudi to use:
 GaudiVersion = v34r0.004
diff --git a/Projects/AthGeneration/version.txt b/Projects/AthGeneration/version.txt
index 3c1b7f674146fd6e433fa11215110b1411c85eef..c0b885324f71e1eac612d6a61c4f01370140ddca 100644
--- a/Projects/AthGeneration/version.txt
+++ b/Projects/AthGeneration/version.txt
@@ -1 +1 @@
-22.0.17
+22.0.18
diff --git a/Projects/AthSimulation/build_externals.sh b/Projects/AthSimulation/build_externals.sh
index 96ec95ad708cb938716fb73a6f51d432321c0366..e6467a5ff31fc6c2c19d8036c1db9b6bd357ffd0 100755
--- a/Projects/AthSimulation/build_externals.sh
+++ b/Projects/AthSimulation/build_externals.sh
@@ -89,9 +89,11 @@ fi
 
 # Get the version of AthSimulation for the build.
 version=`cat ${thisdir}/version.txt`
+# Generate hash of any extra cmake arguments.
+cmakehash=`echo -n "${EXTRACMAKE}" | openssl md5 | awk '{print $2}'`
 
 # Check if previous externals build can be reused:
-externals_stamp=${BUILDDIR}/build/AthSimulationExternals/externals-${version}.stamp
+externals_stamp=${BUILDDIR}/build/AthSimulationExternals/externals-${version}-${cmakehash}.stamp
 if [ -f ${externals_stamp} ]; then
     if diff -q ${externals_stamp} ${thisdir}/externals.txt; then
         echo "Correct version of externals already available in ${BUILDDIR}"
diff --git a/Projects/AthSimulation/externals.txt b/Projects/AthSimulation/externals.txt
index 2e95ca67549a4e0ea815964d9face7feac500aba..cc1aa0a4b08c847adeea2bd5f11f4035b750cc5a 100644
--- a/Projects/AthSimulation/externals.txt
+++ b/Projects/AthSimulation/externals.txt
@@ -6,7 +6,7 @@
 # forbidden.
 
 # The version of atlas/atlasexternals to use:
-AthSimulationExternalsVersion = 2.0.75
+AthSimulationExternalsVersion = 2.0.78
 
 # The version of atlas/Gaudi to use:
 GaudiVersion = v34r0.004
diff --git a/Projects/AthSimulation/version.txt b/Projects/AthSimulation/version.txt
index 3c1b7f674146fd6e433fa11215110b1411c85eef..c0b885324f71e1eac612d6a61c4f01370140ddca 100644
--- a/Projects/AthSimulation/version.txt
+++ b/Projects/AthSimulation/version.txt
@@ -1 +1 @@
-22.0.17
+22.0.18
diff --git a/Projects/Athena/build_externals.sh b/Projects/Athena/build_externals.sh
index 8cbe9cb809a151fdfba71bbc8ec44edff031c2c2..20771cdb68c2420b3870e42aa4f861877a9c4a0e 100755
--- a/Projects/Athena/build_externals.sh
+++ b/Projects/Athena/build_externals.sh
@@ -97,9 +97,11 @@ fi
 
 # Get the version of Athena for the build.
 version=`cat ${thisdir}/version.txt`
+# Generate hash of any extra cmake arguments.
+cmakehash=`echo -n "${EXTRACMAKE}" | openssl md5 | awk '{print $2}'`
 
 # Check if previous externals build can be reused:
-externals_stamp=${BUILDDIR}/build/AthenaExternals/externals-${version}.stamp
+externals_stamp=${BUILDDIR}/build/AthenaExternals/externals-${version}-${cmakehash}.stamp
 if [ -f ${externals_stamp} ]; then
     if diff -q ${externals_stamp} ${thisdir}/externals.txt; then
         echo "Correct version of externals already available in ${BUILDDIR}"
diff --git a/Projects/Athena/externals.txt b/Projects/Athena/externals.txt
index fdc05b490d5ff2c18ecac2934e87297d884fd747..7955b584ecacbf2f3a4b1c076dd37ae7af813849 100644
--- a/Projects/Athena/externals.txt
+++ b/Projects/Athena/externals.txt
@@ -6,7 +6,7 @@
 # forbidden.
 
 # The version of atlas/atlasexternals to use:
-AthenaExternalsVersion = 2.0.75
+AthenaExternalsVersion = 2.0.78
 
 # The version of atlas/Gaudi to use:
 GaudiVersion = v34r0.004
diff --git a/Projects/VP1Light/externals.txt b/Projects/VP1Light/externals.txt
index 0ab152fc7e5c90ebc12899c09d1ecb49c9400cff..52c304c08b24d3e66e59e3e191e71fba3b576148 100644
--- a/Projects/VP1Light/externals.txt
+++ b/Projects/VP1Light/externals.txt
@@ -6,4 +6,4 @@
 # forbidden.
 
 # The version of atlas/atlasexternals to use:
-VP1LightExternalsVersion = 2.0.75
+VP1LightExternalsVersion = 2.0.78
diff --git a/Projects/VP1Light/version.txt b/Projects/VP1Light/version.txt
index 3c1b7f674146fd6e433fa11215110b1411c85eef..c0b885324f71e1eac612d6a61c4f01370140ddca 100644
--- a/Projects/VP1Light/version.txt
+++ b/Projects/VP1Light/version.txt
@@ -1 +1 @@
-22.0.17
+22.0.18
diff --git a/Reconstruction/HeavyIonRec/HIJetRec/Root/HIJetConstituentModifierTool.cxx b/Reconstruction/HeavyIonRec/HIJetRec/Root/HIJetConstituentModifierTool.cxx
index 42848551542859073c24ff846a1821752edb52aa..45dc644a0b41ae53f5ffcc38ca031fb230db69fa 100644
--- a/Reconstruction/HeavyIonRec/HIJetRec/Root/HIJetConstituentModifierTool.cxx
+++ b/Reconstruction/HeavyIonRec/HIJetRec/Root/HIJetConstituentModifierTool.cxx
@@ -45,7 +45,7 @@ int HIJetConstituentModifierTool::modifyJet(xAOD::Jet& jet) const {
    if( constituentAcc.isAvailable(jet) ) constituentAcc( jet ).resize(0);
    if( constituentWeightAcc.isAvailable(jet) ) constituentWeightAcc( jet ).resize(0);
 
-   //save unsubtracted kinematics as moment if they don’t exist already...
+   //save unsubtracted kinematics as moment if they don't exist already...
    xAOD::IParticle::FourMom_t unsubtractedP4;
    unsubtractedP4 = jet.p4();
    jet.setJetP4(HIJetRec::unsubtractedJetState(),jet.jetP4());
diff --git a/Reconstruction/HeavyIonRec/HIJetRec/python/HIJetRecUtils.py b/Reconstruction/HeavyIonRec/HIJetRec/python/HIJetRecUtils.py
index d2c57793ad4637e640dadf86354dab0962978f9d..81a1276ab39618a80a51bfcd682d3d0d59670cb0 100644
--- a/Reconstruction/HeavyIonRec/HIJetRec/python/HIJetRecUtils.py
+++ b/Reconstruction/HeavyIonRec/HIJetRec/python/HIJetRecUtils.py
@@ -84,14 +84,14 @@ def AddPtAssociationTools(R, doTracks=True) :
         tname='hitrackassoc_04'
         if tname not in jtm.tools:
             JetPtAssociationTool=CompFactory.JetPtAssociationTool
-            jtm.add(JetPtAssociationTool(tname, InputContainer=cname, AssociationName="GhostTrack"))
+            jtm.add(JetPtAssociationTool(tname, JetContainer=cname, AssociationName="GhostTrack"))
         tlist += [ jtm.tools[tname] ]
     if jetFlags.useTruth():
         cname='AntiKt%dTruthJets' % int(10*R)
         tname='truthassoc_0%d' % int(10*R)
         if tname not in jtm.tools:
             JetPtAssociationTool=CompFactory.JetPtAssociationTool
-            jtm.add(JetPtAssociationTool(tname, InputContainer=cname, AssociationName="GhostTruth"))
+            jtm.add(JetPtAssociationTool(tname, JetContainer=cname, AssociationName="GhostTruth"))
         tlist += [ jtm.tools[tname] ]
     return tlist
 
diff --git a/Reconstruction/Jet/JetCalibTools/python/JetCalibToolsConfig.py b/Reconstruction/Jet/JetCalibTools/python/JetCalibToolsConfig.py
index bbdba4c998b64ef6aebb506c0310826048ad4a56..8d419d0281c61eab7d2594460e0abbbdc53ded7c 100644
--- a/Reconstruction/Jet/JetCalibTools/python/JetCalibToolsConfig.py
+++ b/Reconstruction/Jet/JetCalibTools/python/JetCalibToolsConfig.py
@@ -48,6 +48,7 @@ fatjetcontexts = {
     "TAMass":        ("JES_MC16recommendation_FatJet_JMS_TA_29Nov2017.config","00-04-81","EtaJES_JMS"),
     "TrigUngroomed": ("JES_Full2012dataset_Rscan_June2014.config","00-04-77","JetArea_EtaJES"),
     "TrigTrimmed":   ("JES_MC15recommendation_FatJet_June2015.config","00-04-77","EtaJES_JMS"),
+    "TrigSoftDrop":  ("JES_MC16recommendation_R10_UFO_CSSK_SoftDrop_JMS_01April2020.config","00-04-82","EtaJES_JMS"),
 }
 
 # List AFII config files separately, to avoid needing to specify a different context
@@ -65,6 +66,8 @@ calibcontexts = {
     "AntiKt10LCTopo":fatjetcontexts,
     # Standard trimmed
     "AntiKt10LCTopoTrimmedPtFrac5SmallR20":fatjetcontexts,
+    # Large-R PFlow Soft Drop CSSK
+    "AntiKt10EMPFlowCSSKSoftDropBeta100Zcut10":fatjetcontexts,
     # R-Scan
     "AntiKt2LCTopo":rscanlc2,
     "AntiKt6LCTopo":rscanlc6,
@@ -77,10 +80,6 @@ hasInSitu = ["AntiKt4LCTopo", "AntiKt4EMTopo", "AntiKt4EMPFlow", "TrigAntiKt4EMT
 # then forwards the configuration to defineJetCalibTool, returning the output.
 # At present the interface allows for the calibseq to be chosen freely, other
 # than checking that the data source is data for the in situ correction.
-# The calibarea could be made configurable as well, but then might need to be
-# added to the tool name to ensure uniqueness.
-# Due to the hackiness of DualUseConfig public tool handling, we need to pass
-# an AlgSequence...
 def getJetCalibTool(jetcollection, context, data_type, calibseq = "", rhoname = "", pvname = "PrimaryVertices", gscdepth = "auto"):
     # In principle we could autoconfigure
     if data_type not in ['data','mc','afii']:
@@ -119,7 +118,11 @@ def getJetCalibTool(jetcollection, context, data_type, calibseq = "", rhoname =
         _pvname = ""
         if "Residual" in _calibseq or "GSC" in _calibseq and gscdepth!="EM3":
             _pvname = pvname
-        return defineJetCalibTool(jetcollection, _configfile, calibarea, _calibseq, _data_type, rhoname, _pvname, gscdepth)
+        # HACK: For testing while we don't have finalised calibrations for trigger PF jets
+        _jetcollection = jetcollection
+        if "PFlow" in jetcollection and context=="TrigSoftDrop":
+            _jetcollection = jetcollection.replace("EMPFlow","UFO")
+        return defineJetCalibTool(_jetcollection, _configfile, calibarea, _calibseq, _data_type, rhoname, _pvname, gscdepth)
     except KeyError as e:
         jetcaliblog.error("Context '{0}' not found for jet collection '{1}'".format(context,jetcollection))
         jetcaliblog.error("Options are '{0}".format(','.join(jetcontexts.keys())))
@@ -151,6 +154,7 @@ def getJetCalibToolPrereqs(modspec,jetdef):
     calibcontext, data_type, calibseq, rhoname, pvname, gscdepth = getCalibSpecsFromString(modspec)
     if calibseq=="":
         cfg, calibarea, calibseq = calibcontexts[jetdef.basename][calibcontext]
+
     # For now, only dependent on calibseq -- can ignore Insitu, which is
     # added when getting the concrete tool
     prereqs = []
diff --git a/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetMonitoringAlg.h b/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetMonitoringAlg.h
index bab697afa22e0b80a7cafcad5e8a54006cc90755..0a058ed241d4eeb1d61b18e9fec20decace28194 100644
--- a/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetMonitoringAlg.h
+++ b/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetMonitoringAlg.h
@@ -39,6 +39,7 @@ private:
   ToolHandleArray<IJetHistoFiller> m_jetFillerTools;
 
   bool m_failureOnMissingContainer;
-  
+  bool m_onlyPassingJets;
+
 };
 #endif
diff --git a/Reconstruction/Jet/JetMonitoring/python/JetMonitoringConfig.py b/Reconstruction/Jet/JetMonitoring/python/JetMonitoringConfig.py
index 3fcd54da34b19dd3936dac6dad4488b1e4b8eb36..df7a618cb4f3fd57c57342cf309a139359aa2cbb 100644
--- a/Reconstruction/Jet/JetMonitoring/python/JetMonitoringConfig.py
+++ b/Reconstruction/Jet/JetMonitoring/python/JetMonitoringConfig.py
@@ -515,6 +515,7 @@ class JetMonAlgSpec(ConfigDict):
         args.setdefault('topLevelDir', 'Jets/')
         args.setdefault('bottomLevelDir', '')
         args.setdefault('failureOnMissingContainer', True)
+        args.setdefault('onlyPassingJets', True)
         ConfigDict.__init__(self, defaultPath=defaultPath, TriggerChain=TriggerChain, **args)
         tmpL = self.FillerTools
         self.FillerTools = []
@@ -530,6 +531,7 @@ class JetMonAlgSpec(ConfigDict):
         alg.TriggerChain = self.TriggerChain
         alg.JetContainerName = self.JetContainerName
         alg.FailureOnMissingContainer = self.failureOnMissingContainer
+        alg.OnlyPassingJets = self.onlyPassingJets
         
         path = self.defaultPath
         tools = []
diff --git a/Reconstruction/Jet/JetMonitoring/python/JetMonitoringStandard.py b/Reconstruction/Jet/JetMonitoring/python/JetMonitoringStandard.py
index c04cef28d225b778b017dd8bcc6071acdd4a9a59..6378161ce16afee25dc0e8a566f8a5e85a61b31a 100644
--- a/Reconstruction/Jet/JetMonitoring/python/JetMonitoringStandard.py
+++ b/Reconstruction/Jet/JetMonitoring/python/JetMonitoringStandard.py
@@ -9,7 +9,7 @@
 '''
 
 from __future__ import print_function
-from JetMonitoring.JetMonitoringConfig import JetMonAlgSpec, HistoSpec,  SelectSpec, ToolSpec
+from JetMonitoring.JetMonitoringConfig import JetMonAlgSpec, HistoSpec,  SelectSpec
 
 
 # *********************************************
@@ -145,6 +145,13 @@ def standardJetMonitoring(inputFlags):
     Details of what goes into jet monitoring is implemented by dedicated functions such as jetMonAlgConfig().
     """
 
+    from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+    rv = ComponentAccumulator()
+
+    # do not run monitoring in RAWtoESD
+    if inputFlags.DQ.Environment == 'tier0Raw':
+        return rv
+
     from AthenaMonitoring import AthMonitorCfgHelper
     helper = AthMonitorCfgHelper(inputFlags,'JetMonitoring')
 
@@ -161,4 +168,5 @@ def standardJetMonitoring(inputFlags):
     for conf in jetAlgConfs:        
         conf.toAlg(helper) # adds the conf as a JetMonitoringAlg to the helper
     
-    return helper.result() # the AthMonitorCfgHelper returns an accumulator to be used by the general configuration system.
+    rv.merge(helper.result())  # the AthMonitorCfgHelper returns an accumulator to be used by the general configuration system.
+    return rv
diff --git a/Reconstruction/Jet/JetMonitoring/python/JetStandardHistoSpecs.py b/Reconstruction/Jet/JetMonitoring/python/JetStandardHistoSpecs.py
index 9f9702635b916a266b8c9f1e394de13848b8b19f..59b2cbcafb19d740cd36c83df8ab5de89697a6cb 100644
--- a/Reconstruction/Jet/JetMonitoring/python/JetStandardHistoSpecs.py
+++ b/Reconstruction/Jet/JetMonitoring/python/JetStandardHistoSpecs.py
@@ -32,7 +32,15 @@ knownEventVar = dict(
     njetsPt50 = ToolSpec('NumJetVarTool', 'njetsPt50', PtCut=50.),
     njetsEt20 = ToolSpec('NumJetVarTool', 'njetsEt20', EtCut=20.),
     njetsEt50 = ToolSpec('NumJetVarTool', 'njetsEt50', EtCut=50.),
-    njetsEt40Eta1_2 = ToolSpec('NumJetVarTool', 'njetsEt40Eta1_2', EtCut=50., EtaMin=1., EtaMax=2.),
+    njetsEt20Eta0_32 = ToolSpec('NumJetVarTool', 'njetsEt20Eta0_32', EtCut=20., EtaMin=0., EtaMax=3.2),
+    njetsEt50Eta0_32 = ToolSpec('NumJetVarTool', 'njetsEt50Eta0_32', EtCut=50., EtaMin=0., EtaMax=3.2),
+    njetsEt70Eta0_24 = ToolSpec('NumJetVarTool', 'njetsEt70Eta0_24', EtCut=70., EtaMin=0., EtaMax=2.4),
+    njetsEt60Eta0_32 = ToolSpec('NumJetVarTool', 'njetsEt60Eta0_32', EtCut=60., EtaMin=0., EtaMax=3.2),
+    njetsEt100Eta0_32 = ToolSpec('NumJetVarTool', 'njetsEt100Eta0_32', EtCut=100., EtaMin=0., EtaMax=3.2),
+    njetsEt260Eta32_49 = ToolSpec('NumJetVarTool', 'njetsEt260Eta32_49', EtCut=260., EtaMin=3.2, EtaMax=4.9),
+    njetsEt200Eta0_32 = ToolSpec('NumJetVarTool', 'njetsEt200Eta0_32', EtCut=200., EtaMin=0., EtaMax=3.2),
+    njetsEt330Eta0_32 = ToolSpec('NumJetVarTool', 'njetsEt330Eta0_32', EtCut=330., EtaMin=0., EtaMax=3.2),
+
 )
 
 # ***************************************
@@ -50,9 +58,9 @@ _knownHistos = [
     HistoSpec( 'eta',  (50,-5,5) , title='#eta;#eta;Entries'),
     HistoSpec( 'phi',  (50,-3.3,3.3) , title='#phi;#phi;Entries'),
     # Same but we indicate that the variable is to be plotted in GeV by appending ':GeV'
-    HistoSpec( 'pt:GeV',  (100,0,200) , title='p_{T};p_{T} [GeV];'),    
+    HistoSpec( 'pt:GeV',  (100,0,750) , title='p_{T};p_{T} [GeV];'),    
     HistoSpec( 'm:GeV',  (100,0,300) , title='mass;mass [GeV];'),
-    HistoSpec( 'e:GeV',  (100,0,500) , title='E;E [GeV];'),    
+    HistoSpec( 'e:GeV',  (100,0,750) , title='E;E [GeV];'),    
     HistoSpec( 'et:GeV', (100,0,750), title='E_{T};E_{T} [GeV],'),
 
     # We want an other pT histo, with different bins.
@@ -61,22 +69,22 @@ _knownHistos = [
 
     #EventHistoSpec( 'njets', (30,0,30), title='Jet Multiplicity;Njets;Entries' ),
     # When the jet variable is not a simple float, use the xvar argument to refer to a detailed variable spec in 'knownVar'
-    HistoSpec( 'JVF',  (100,0,1.2) , title='Jet Vtx Frac;JVF;', xvar='JVF'),    
+    HistoSpec( 'JVF',  (100,0,1.2) , title='Jet Vtx Frac;JVF;Entries', xvar='JVF'),    
     # if the var name contains '[N]' the system will assume the variable is a vector<float> and setup tools accordingly (so we don't need to specify 'xvar')
-    HistoSpec( 'JVF[0]',  (100,0,1.2) , title='JVF for vtx 0;JVF[0];', ), 
-    HistoSpec( 'JVF[1]',  (100,0,1.2) , title='JVF for vtx 1;JVF[1];', ),
+    HistoSpec( 'JVF[0]',  (100,0,1.2) , title='JVF for vtx 0;JVF[0];Entries', ), 
+    HistoSpec( 'JVF[1]',  (100,0,1.2) , title='JVF for vtx 1;JVF[1];Entries', ),
 
 
     # full list
     HistoSpec('ptN', (250, 0.0, 5000.0), title='Jet Pt;Pt [GeV];', xvar='pt:GeV'),
 
-    HistoSpec('EMFrac', (50, -0.1, 1.4), title='EM Fraction;EM fraction;', ),
-    HistoSpec('LArQuality', (50, -0.4, 1.2), title='LAr quality;Energy;', ),
-    HistoSpec('HECQuality', (50, -0.1, 1.4), title='HEC Quality;HEC Quality;', ),
-    HistoSpec('HECFrac', (50, -0.1, 1.4), title='HEC Fraction;HEC fraction;', ),
-    HistoSpec('AverageLArQF', (100, 0, 65535), title='Average LAr QF;AverageLArQF;', ),
-    HistoSpec('FracSamplingMaxIndex', (24, 0, 24), title='FracSamplingMaxIndex; FracSamplingMaxIndex;', xvar=VarSpec('FracSamplingMaxIndex','int')),
-    HistoSpec('FracSamplingMax', (50, -0.1, 1.2), title='FracSamplingMax; FracSamplingMax;', ),
+    HistoSpec('EMFrac', (50, -0.1, 1.4), title='EM Fraction;EM Fraction;Entries', ),
+    HistoSpec('LArQuality', (50, -0.4, 1.2), title='LAr quality;Energy;Entries', ),
+    HistoSpec('HECQuality', (50, -0.1, 1.4), title='HEC Quality;HEC Quality;Entries', ),
+    HistoSpec('HECFrac', (50, -0.1, 1.4), title='HEC Fraction;HEC Fraction;Entries', ),
+    HistoSpec('AverageLArQF', (100, 0, 65535), title='Average LAr QF;AverageLArQF;Entries', ),
+    HistoSpec('FracSamplingMaxIndex', (24, 0, 24), title='FracSamplingMaxIndex; FracSamplingMaxIndex;Entries', xvar=VarSpec('FracSamplingMaxIndex','int')),
+    HistoSpec('FracSamplingMax', (50, -0.1, 1.2), title='FracSamplingMax; FracSamplingMax;Entries', ),
     HistoSpec('Timing', (40, -20, 20), title='Jet Time info;Time;', ),
 
     
@@ -85,9 +93,9 @@ _knownHistos = [
     HistoSpec('OotFracClusters5', (50, -0.1, 1.2), title='OotFracClusters5; OotFracClusters5;', ),
     HistoSpec('OotFracClusters10', (50, -0.1, 1.2), title='OotFracClusters10; OotFracClusters10;', ),
     
-    HistoSpec('Jvt', (70, -0.2, 1.2), title='Jet JVT;JVT;',  ),
-    HistoSpec('JVFCorr', (120, -1.2, 1.2), title='Jet JVT; JVFCorr;', ),
-    HistoSpec('JvtRpt', (75, 0, 1.5), title='Jet JVT Rpt; JVTRpt;', ),
+    HistoSpec('Jvt', (70, -0.2, 1.2), title='Jet JVT;JVT;Entries',  ),
+    HistoSpec('JVFCorr', (120, -1.2, 1.2), title='Jet JVT; JVFCorr;Entries', ),
+    HistoSpec('JvtRpt', (75, 0, 1.5), title='Jet JVT Rpt; JVTRpt;Entries', ),
     HistoSpec('EM3Frac', (50,-0.1,1.0), title="EM3 fraction;EM3 fraction;Entries"),
     HistoSpec('Tile0Frac', (50,-0.1,1.0), title="Tile0 fraction;Tile0 fraction;Entries"),
 
@@ -178,8 +186,9 @@ _knownHistos = [
 
     HistoSpec('Charge', (100, -2, 2), title='Charge;Charge;', ),
 
-    HistoSpec('ActiveArea', (80, 0, 0.8), title='Active Area;Area;', ),
-    HistoSpec('ActiveArea15', (80, 0, 1.5), title='Active Area;Area;', xvar='ActiveArea'),
+    HistoSpec('DetectorEta', (100,-5,5), title="DetectorEta;Detector #eta;Entries" ), 
+    HistoSpec('ActiveArea', (80,0,0.8), title="ActiveArea;Active Area;Entries" ), 
+    HistoSpec('ActiveArea15', (80, 0, 1.5), title='Active Area;Active Area;Entries', xvar='ActiveArea'),
 
     HistoSpec('PullPhi', (100, -6.3, 6.3), title='PullPhi;PullPhi;', ),
     HistoSpec('PullMag', (100, 0, 100), title='PullMag;PullMag;', ),
@@ -300,3 +309,4 @@ for h in _knownHistos:
 knownSelector = dict(
     LooseBad = ToolSpec('JetCleaningTool' ,  "LooseBadJets" , CutLevel = "LooseBad")
 )
+
diff --git a/Reconstruction/Jet/JetMonitoring/src/JetMonitoringAlg.cxx b/Reconstruction/Jet/JetMonitoring/src/JetMonitoringAlg.cxx
index f46b43c076999e88359f9169397b6c463aaf8c5e..7d4f2ef4ab7b28251dee4f1be06fdbb879787cd3 100644
--- a/Reconstruction/Jet/JetMonitoring/src/JetMonitoringAlg.cxx
+++ b/Reconstruction/Jet/JetMonitoring/src/JetMonitoringAlg.cxx
@@ -6,15 +6,14 @@
 
 #include "xAODJet/Jet.h"
 
-
 JetMonitoringAlg::JetMonitoringAlg( const std::string& name, ISvcLocator* pSvcLocator )
 :AthMonitorAlgorithm(name,pSvcLocator)
-,m_jetContainerKey("AntiKt4LCTopoJets"), m_jetFillerTools(this), m_failureOnMissingContainer(true)
+,m_jetContainerKey("AntiKt4LCTopoJets"), m_jetFillerTools(this), m_failureOnMissingContainer(true), m_onlyPassingJets(true)
 {
-
     declareProperty("JetContainerName",m_jetContainerKey);
     declareProperty("FillerTools", m_jetFillerTools);
     declareProperty("FailureOnMissingContainer", m_failureOnMissingContainer);
+    declareProperty("OnlyPassingJets", m_onlyPassingJets);
 }
 
 
@@ -28,7 +27,7 @@ StatusCode JetMonitoringAlg::initialize() {
   ATH_CHECK( m_jetFillerTools.retrieve() );
 
   // print out what we have 
-  ATH_MSG_INFO( " Scheduled Histo fillers/selectors : ");
+  ATH_MSG_INFO( "Scheduled Histo fillers/selectors : ");
   for(const auto& t: m_jetFillerTools){
     ATH_MSG_INFO( "--> "<< t->name() );
   }
@@ -40,6 +39,33 @@ StatusCode JetMonitoringAlg::initialize() {
 
 StatusCode JetMonitoringAlg::fillHistograms( const EventContext& ctx ) const {
 
+  if (m_triggerChainString != "" && m_onlyPassingJets) {
+    ATH_MSG_DEBUG("JetMonitoringAlg::fillHistograms(const EventContext&) -> enter triggerChainString = "<<m_triggerChainString);
+    std::list<const xAOD::Jet*> tmpList;
+    const std::vector< TrigCompositeUtils::LinkInfo<xAOD::JetContainer> > fc = getTrigDecisionTool()->features<xAOD::JetContainer>( m_triggerChainString );
+    for(const auto& jetLinkInfo : fc) {
+      if (!jetLinkInfo.isValid()) {
+        ATH_MSG_ERROR("Invalid ElementLink to online jet");
+        continue;
+      }
+      ElementLink<xAOD::JetContainer> j = jetLinkInfo.link;
+      const xAOD::Jet *trigjet = dynamic_cast<const xAOD::Jet*>(*j);
+      tmpList.push_back( trigjet );
+    }
+    auto sort = [this] (const xAOD::Jet * j1, const xAOD::Jet * j2) {return j1->p4().Et() > j2->p4().Et(); } ;
+    tmpList.sort( sort );
+    ConstDataVector< xAOD::JetContainer > tmpCont(SG::VIEW_ELEMENTS);
+    for(const xAOD::Jet* jet : tmpList ) tmpCont.push_back(jet);
+    const xAOD::JetContainer * trigJetsCont = tmpCont.asDataVector();
+    if (trigJetsCont->empty()) {
+      ATH_MSG_WARNING("Empty trigger jet container for chain "<<m_triggerChainString);
+      return StatusCode::SUCCESS;
+    }
+    for(const auto& t: m_jetFillerTools){
+      ATH_MSG_DEBUG( " now run "<< t->name() );
+      ATH_CHECK( t->processJetContainer(*this, *trigJetsCont, ctx) );
+    }
+  } else {
   // retrieve the jet container
   SG::ReadHandle<xAOD::JetContainer> jets(m_jetContainerKey, ctx);    
   if (! jets.isValid() ) {
@@ -51,13 +77,13 @@ StatusCode JetMonitoringAlg::fillHistograms( const EventContext& ctx ) const {
       return StatusCode::SUCCESS;
     }
   }
-
+ 
   // call each histograming tool on the container
   for(const auto& t: m_jetFillerTools){
     ATH_MSG_DEBUG( " now run "<< t->name() );
     ATH_CHECK( t->processJetContainer(*this, *jets, ctx) );
   }
-  
+ }
   return StatusCode::SUCCESS;
 }
 
diff --git a/Reconstruction/Jet/JetMonitoring/src/NumJetVarTool.cxx b/Reconstruction/Jet/JetMonitoring/src/NumJetVarTool.cxx
index 86d189d2c3bb79fa3e24e4a8f052cf5c72766e2e..a586839c7aaa8501bf0d9b5ba34fc99faae0f450 100644
--- a/Reconstruction/Jet/JetMonitoring/src/NumJetVarTool.cxx
+++ b/Reconstruction/Jet/JetMonitoring/src/NumJetVarTool.cxx
@@ -30,7 +30,7 @@ float NumJetVarTool::value(const xAOD::EventInfo & /*eventinfo not used in this
       ATH_MSG_ERROR("Input JetContainer could not be found or is empty");
       return 0.;
     } else {
-      ATH_MSG_WARNING("Input JetContainer could not be found or is empty");
+      ATH_MSG_DEBUG("Input JetContainer could not be found or is empty");
       return 0.;
     }
   }
diff --git a/Reconstruction/Jet/JetRec/share/ExtractorUnitTests.ref b/Reconstruction/Jet/JetRec/share/ExtractorUnitTests.ref
index ed9f8df82646843002fb1db7feb874f068995375..87ac93dbad548ca22b803ab283329c3bd2141829 100644
--- a/Reconstruction/Jet/JetRec/share/ExtractorUnitTests.ref
+++ b/Reconstruction/Jet/JetRec/share/ExtractorUnitTests.ref
@@ -1,10 +1,10 @@
-[==========] Running 1 test from 1 test case.
+[==========] Running 1 test from 1 test suite.
 [----------] Global test environment set-up.
 [----------] 1 test from ExtractorTest
 [ RUN      ] ExtractorTest.addJet
 [       OK ] ExtractorTest.addJet (0 ms)
-[----------] 1 test from ExtractorTest (1 ms total)
+[----------] 1 test from ExtractorTest (0 ms total)
 
 [----------] Global test environment tear-down
-[==========] 1 test from 1 test case ran. (1 ms total)
+[==========] 1 test from 1 test suite ran. (0 ms total)
 [  PASSED  ] 1 test.
diff --git a/Reconstruction/Jet/JetRec/share/TestTests.ref b/Reconstruction/Jet/JetRec/share/TestTests.ref
index a3d707bd886ff2a7585894e16cb6b706e4d8a846..68570117588012035eed45a40fb878c14f9690d2 100644
--- a/Reconstruction/Jet/JetRec/share/TestTests.ref
+++ b/Reconstruction/Jet/JetRec/share/TestTests.ref
@@ -1,4 +1,4 @@
-[==========] Running 1 test from 1 test case.
+[==========] Running 1 test from 1 test suite.
 [----------] Global test environment set-up.
 [----------] 1 test from TestTest
 [ RUN      ] TestTest.test
@@ -6,5 +6,5 @@
 [----------] 1 test from TestTest (0 ms total)
 
 [----------] Global test environment tear-down
-[==========] 1 test from 1 test case ran. (0 ms total)
+[==========] 1 test from 1 test suite ran. (0 ms total)
 [  PASSED  ] 1 test.
diff --git a/Reconstruction/Jet/JetRecCalo/src/MissingCellListTool.cxx b/Reconstruction/Jet/JetRecCalo/src/MissingCellListTool.cxx
index dc24774d67eca4cff18cd4a717b4bace673025fb..b24ff83d2ff26df7c9f489e8dbd97aa8a8357132 100644
--- a/Reconstruction/Jet/JetRecCalo/src/MissingCellListTool.cxx
+++ b/Reconstruction/Jet/JetRecCalo/src/MissingCellListTool.cxx
@@ -226,7 +226,7 @@ int MissingCellListTool::execute() const {
 //    if (inc.type()=="BeginEvent") {
 //      ATH_MSG(DEBUG) << " got begining event" << endmsg;
 //      m_needSetup = true;
-//      //if(prepareCellList().isFailure()) ATH_MSG(ERROR)<< " Couldń t build missing cell list !!"<<endmsg;
+//      //if(prepareCellList().isFailure()) ATH_MSG(ERROR)<< " Could not build missing cell list !!"<<endmsg;
 //    }
    
 //  }
diff --git a/Reconstruction/Jet/JetRecTools/JetRecTools/ConstituentSubtractorTool.h b/Reconstruction/Jet/JetRecTools/JetRecTools/ConstituentSubtractorTool.h
index de414b56a7035448347ab2ed827383d489e1e6a7..84ffc633a302af572d215886e819fcb7ea1cc193 100644
--- a/Reconstruction/Jet/JetRecTools/JetRecTools/ConstituentSubtractorTool.h
+++ b/Reconstruction/Jet/JetRecTools/JetRecTools/ConstituentSubtractorTool.h
@@ -35,6 +35,7 @@ private:
 
   float m_maxDeltaR;
   float m_alpha;
+  float m_ghostArea;
   float m_maxEta;
   bool m_ignoreChargedPFOs;
 
diff --git a/Reconstruction/Jet/JetRecTools/Root/ConstituentSubtractorTool.cxx b/Reconstruction/Jet/JetRecTools/Root/ConstituentSubtractorTool.cxx
index 857d9f1f908e3b338bd31f1e822f8f8e9c8db977..63f69e7f8abb82d3ab58055f37caff8de2c69f53 100644
--- a/Reconstruction/Jet/JetRecTools/Root/ConstituentSubtractorTool.cxx
+++ b/Reconstruction/Jet/JetRecTools/Root/ConstituentSubtractorTool.cxx
@@ -20,6 +20,7 @@ ConstituentSubtractorTool::ConstituentSubtractorTool(const std::string & name):
 
   declareProperty("MaxDeltaR", m_maxDeltaR=0.25);
   declareProperty("Alpha", m_alpha=0.);
+  declareProperty("GhostArea", m_ghostArea=0.01);
   declareProperty("MaxEta", m_maxEta=2.5);
 
   // Option to disregard cPFOs in the weight calculation
@@ -51,7 +52,7 @@ StatusCode ConstituentSubtractorTool::process_impl(xAOD::IParticleContainer* con
   contrib::ConstituentSubtractor subtractor;
   subtractor.set_max_standardDeltaR(m_maxDeltaR); // free parameter for the maximal allowed distance sqrt((y_i-y_k)^2+(phi_i-phi_k)^2) between particle i and ghost k
   subtractor.set_alpha(m_alpha);  // free parameter for the distance measure (the exponent of particle pt). The larger the parameter alpha, the more are favoured the lower pt particles in the subtraction process
-  subtractor.set_ghost_area(0.01); // free parameter for the density of ghosts. The smaller, the better - but also the computation is slower.
+  subtractor.set_ghost_area(m_ghostArea); // free parameter for the density of ghosts. The smaller, the better - but also the computation is slower.
 
   // prepare PseudoJet input from
   std::vector<PseudoJet>  full_event; full_event.reserve( cont->size() );
diff --git a/Reconstruction/MissingETMonitoring/python/METMonitorAlgorithm.py b/Reconstruction/MissingETMonitoring/python/METMonitorAlgorithm.py
index 934393e2f38623a8878f63308fcdb26f7257fe4d..a01eac977871d09fdb9b3cf0d212325fda98dac9 100644
--- a/Reconstruction/MissingETMonitoring/python/METMonitorAlgorithm.py
+++ b/Reconstruction/MissingETMonitoring/python/METMonitorAlgorithm.py
@@ -49,8 +49,12 @@ def defineHistogramsCalo(monAlg, group,helper,histoNameSuffix=""):
 def METMonitoringConfig(inputFlags):    
 # '''Function to configures some algorithms in the monitoring system.'''
 
-#    from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator  
-#    result = ComponentAccumulator()
+    from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+    result = ComponentAccumulator()
+
+    # do not run monitoring in RAWtoESD
+    if inputFlags.DQ.Environment == 'tier0Raw':
+        return result
 
     from AthenaMonitoring import AthMonitorCfgHelper     
 #    helper = AthMonitorCfgHelper(inputFlags,'AthMonitorCfg') 
@@ -289,4 +293,6 @@ def METMonitoringConfig(inputFlags):
     BadJetsGroup = helper.addGroup(BadJets_EMTopoMETMonAlg,"METMonitor","MissingEt/AllTriggers/BadJets/MET_Calo/EMTopo")
     for mets in emtopomet_types:
         defineHistograms(BadJets_EMTopoMETMonAlg, BadJetsGroup,helper,mets)
-    return helper.result()
+
+    result.merge(helper.result())
+    return result
diff --git a/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonCombinedInDetCandidateAlg.cxx b/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonCombinedInDetCandidateAlg.cxx
index 75a82e51714cfc3923e73a6e8f820e1f3c35e37c..d8ac1397b87b62c0a5c0d348918a0e38e05acd44 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonCombinedInDetCandidateAlg.cxx
+++ b/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonCombinedInDetCandidateAlg.cxx
@@ -3,13 +3,14 @@
 */
 
 #include "MuonCombinedInDetCandidateAlg.h"
+
 #include "MuonLayerEvent/MuonSystemExtension.h"
 #include "xAODTruth/TruthParticleContainer.h"
 
 using namespace MuonCombined;
 
 MuonCombinedInDetCandidateAlg::MuonCombinedInDetCandidateAlg(const std::string& name, ISvcLocator* pSvcLocator)
-    : AthAlgorithm(name, pSvcLocator), m_doSiliconForwardMuons(false)
+    : AthReentrantAlgorithm(name, pSvcLocator), m_doSiliconForwardMuons(false)
 {
     declareProperty("TrackParticleLocation", m_indetTrackParticleLocation = {"InDetTrackParticles"});
     declareProperty("ForwardParticleLocation", m_indetForwardTrackParticleLocation = "InDetForwardTrackParticles");
@@ -33,49 +34,51 @@ MuonCombinedInDetCandidateAlg::initialize()
 }
 
 StatusCode
-MuonCombinedInDetCandidateAlg::execute()
+MuonCombinedInDetCandidateAlg::execute(const EventContext& ctx) const
 {
     auto collection = std::make_unique<InDetCandidateCollection>(SG::OWN_ELEMENTS);
 
-    m_currentTrackSelector = m_trackSelector;
+
     for (auto location : m_indetTrackParticleLocation) {
-        if (create(location, collection).isFailure()) {
+        if (create(ctx, m_trackSelector, location, collection).isFailure()) {
             ATH_MSG_FATAL("Could not create InDetCandidateCollection");
             return StatusCode::FAILURE;
         }
     }
     if (m_doSiliconForwardMuons) {
-        m_currentTrackSelector = m_forwardTrackSelector;
-        if (create(m_indetForwardTrackParticleLocation, collection, true).isFailure()) {
+        if (create(ctx, m_forwardTrackSelector, m_indetForwardTrackParticleLocation, collection, true).isFailure()) {
             ATH_MSG_FATAL("Could not create InDetForwardCandidateCollection");
             return StatusCode::FAILURE;
         }
     }
-    SG::WriteHandle<InDetCandidateCollection> indetCandidateCollection(m_candidateCollectionName);
+    SG::WriteHandle<InDetCandidateCollection> indetCandidateCollection(m_candidateCollectionName, ctx);
     ATH_CHECK(indetCandidateCollection.record(std::move(collection)));
 
     return StatusCode::SUCCESS;
 }
 
 StatusCode
-MuonCombinedInDetCandidateAlg::create(const SG::ReadHandleKey<xAOD::TrackParticleContainer>& location,
+MuonCombinedInDetCandidateAlg::create(const EventContext&                                    ctx,
+                                      const ToolHandle<Trk::ITrackSelectorTool>&             currentTrackSelector,
+                                      const SG::ReadHandleKey<xAOD::TrackParticleContainer>& location,
                                       std::unique_ptr<InDetCandidateCollection>&             collection,
                                       bool flagCandidateAsSiAssociate) const
 {
-    SG::ReadHandle<xAOD::TrackParticleContainer> indetTrackParticles(location);
+    SG::ReadHandle<xAOD::TrackParticleContainer> indetTrackParticles(location, ctx);
     if (!indetTrackParticles.isValid()) {
         ATH_MSG_ERROR("Could not read " << location);
         return StatusCode::FAILURE;
     }
     InDetCandidateCollection* tempCandidates = new InDetCandidateCollection(SG::VIEW_ELEMENTS);
-    create(*indetTrackParticles, *tempCandidates, flagCandidateAsSiAssociate);
+    create(currentTrackSelector, *indetTrackParticles, *tempCandidates, flagCandidateAsSiAssociate);
     collection->insert(collection->end(), tempCandidates->begin(), tempCandidates->end());
     delete tempCandidates;
     return StatusCode::SUCCESS;
 }
 
 void
-MuonCombinedInDetCandidateAlg::create(const xAOD::TrackParticleContainer& indetTrackParticles,
+MuonCombinedInDetCandidateAlg::create(const ToolHandle<Trk::ITrackSelectorTool>& currentTrackSelector,
+                                      const xAOD::TrackParticleContainer&        indetTrackParticles,
                                       InDetCandidateCollection& outputContainer, bool flagCandidateAsSiAssociated) const
 {
 
@@ -85,7 +88,7 @@ MuonCombinedInDetCandidateAlg::create(const xAOD::TrackParticleContainer& indetT
 
     for (auto* tp : indetTrackParticles) {
         ++trackIndex;
-        if (!isValidTrackParticle(tp)) continue;
+        if (!isValidTrackParticle(currentTrackSelector, tp)) continue;
 
         ElementLink<xAOD::TrackParticleContainer> link(indetTrackParticles, trackIndex);
         if (!link.isValid()) {
@@ -124,14 +127,15 @@ MuonCombinedInDetCandidateAlg::create(const xAOD::TrackParticleContainer& indetT
 }
 
 bool
-MuonCombinedInDetCandidateAlg::isValidTrackParticle(const xAOD::TrackParticle* const tp) const
+MuonCombinedInDetCandidateAlg::isValidTrackParticle(const ToolHandle<Trk::ITrackSelectorTool>& currentTrackSelector,
+                                                    const xAOD::TrackParticle* const           tp) const
 {
     if (!tp->perigeeParameters().covariance()) {
         ATH_MSG_WARNING("InDet TrackParticle without perigee! ");
         return false;
     }
 
-    if (!m_currentTrackSelector->decision(*tp)) {
+    if (!currentTrackSelector->decision(*tp)) {
         if (msgLvl(MSG::VERBOSE) && tp->pt() > 5000.) printTrackParticleInfo(tp, "Discarding");
         return false;
     }
diff --git a/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonCombinedInDetCandidateAlg.h b/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonCombinedInDetCandidateAlg.h
index 872dc7a179873c05fec1d06d756301115895c00a..72fdb360099783cb6f2e221098b6244adf70549b 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonCombinedInDetCandidateAlg.h
+++ b/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonCombinedInDetCandidateAlg.h
@@ -5,7 +5,9 @@
 #ifndef MUONCOMBINEDALGS_MUONCOMBINEDINDETCANDIDATEALG_H
 #define MUONCOMBINEDALGS_MUONCOMBINEDINDETCANDIDATEALG_H
 
-#include "AthenaBaseComps/AthAlgorithm.h"
+#include <string>
+
+#include "AthenaBaseComps/AthReentrantAlgorithm.h"
 #include "GaudiKernel/ToolHandle.h"
 #include "MuonCombinedEvent/InDetCandidateCollection.h"
 #include "MuonRecToolInterfaces/IMuonSystemExtensionTool.h"
@@ -14,15 +16,13 @@
 #include "TrkToolInterfaces/ITrackSelectorTool.h"
 #include "xAODTracking/TrackParticleContainer.h"
 
-#include <string>
-
-class MuonCombinedInDetCandidateAlg : public AthAlgorithm {
+class MuonCombinedInDetCandidateAlg : public AthReentrantAlgorithm {
   public:
     MuonCombinedInDetCandidateAlg(const std::string& name, ISvcLocator* pSvcLocator);
-    ~MuonCombinedInDetCandidateAlg()=default;
+    ~MuonCombinedInDetCandidateAlg() = default;
 
     StatusCode initialize();
-    StatusCode execute();
+    StatusCode execute(const EventContext& ctx) const;
 
   private:
     bool m_doSiliconForwardMuons;
@@ -30,27 +30,29 @@ class MuonCombinedInDetCandidateAlg : public AthAlgorithm {
     float m_extThreshold;
 
     SG::ReadHandleKeyArray<xAOD::TrackParticleContainer> m_indetTrackParticleLocation;
-    SG::ReadHandleKey<xAOD::TrackParticleContainer> m_indetForwardTrackParticleLocation;
-    SG::WriteHandleKey<InDetCandidateCollection> m_candidateCollectionName;
-    ToolHandle<Trk::ITrackSelectorTool> m_trackSelector{
+    SG::ReadHandleKey<xAOD::TrackParticleContainer>      m_indetForwardTrackParticleLocation;
+    SG::WriteHandleKey<InDetCandidateCollection>         m_candidateCollectionName;
+    ToolHandle<Trk::ITrackSelectorTool>                  m_trackSelector{
         this, "TrackSelector", "InDet::InDetDetailedTrackSelectorTool/MuonCombinedInDetDetailedTrackSelectorTool",
         "Track selector tool"};
     ToolHandle<Trk::ITrackSelectorTool> m_forwardTrackSelector{
         this, "InDetForwardTrackSelector",
         "InDet::InDetDetailedTrackSelectorTool/MuonCombinedInDetDetailedForwardTrackSelectorTool",
         "Forward track selector tool"};
-    ToolHandle<Trk::ITrackSelectorTool> m_currentTrackSelector;
     ToolHandle<Muon::IMuonSystemExtensionTool> m_muonSystemExtensionTool{
         this, "MuonSystemExtensionTool", "Muon::MuonSystemExtensionTool/MuonSystemExtensionTool",
         "Muon system extension tool"};
 
-    void create(const xAOD::TrackParticleContainer& indetTrackParticles, InDetCandidateCollection& outputContainer,
-                bool flagCandidateAsSiAssociated = false) const;
-    StatusCode create(const SG::ReadHandleKey<xAOD::TrackParticleContainer>& location,
+    void       create(const ToolHandle<Trk::ITrackSelectorTool>& currentTrackSelector,
+                      const xAOD::TrackParticleContainer& indetTrackParticles, InDetCandidateCollection& outputContainer,
+                      bool flagCandidateAsSiAssociated = false) const;
+    StatusCode create(const EventContext& ctx, const ToolHandle<Trk::ITrackSelectorTool>& currentTrackSelector,
+                      const SG::ReadHandleKey<xAOD::TrackParticleContainer>& location,
                       std::unique_ptr<InDetCandidateCollection>&             collection,
                       bool                                                   flagCandidateAsSiAssociate = false) const;
 
-    bool isValidTrackParticle(const xAOD::TrackParticle* const tp) const;
+    bool isValidTrackParticle(const ToolHandle<Trk::ITrackSelectorTool>& currentTrackSelector,
+                              const xAOD::TrackParticle* const           tp) const;
     void printTrackParticleInfo(const xAOD::TrackParticle* const tp, const std::string& what) const;
 
     int getCount(const xAOD::TrackParticle& tp, xAOD::SummaryType type) const;
diff --git a/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCandidateTool.cxx b/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCandidateTool.cxx
index d04466d5bd82abfda3c7c2dd2ec2d60de7d1e078..7092da07242c19b90c7c12c31d9f322e9840270f 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCandidateTool.cxx
+++ b/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCandidateTool.cxx
@@ -81,14 +81,16 @@ namespace MuonCombined {
 	  standaloneTrack=0;
 	  ATH_MSG_DEBUG("extrapolated track has no DOF, don't use it");
 	}
-	double mschi2=2.5; //a default we should hopefully never have to use (taken from CombinedMuonTrackBuilder)
-	if(msTrack.fitQuality()->doubleNumberDoF()>0) mschi2=msTrack.fitQuality()->chiSquared()/msTrack.fitQuality()->doubleNumberDoF();
-	//choice of 1000 is slightly arbitrary, the point is that the fit should be really be terrible
-	if(standaloneTrack->fitQuality()->chiSquared()/standaloneTrack->fitQuality()->doubleNumberDoF()>1000*mschi2){
-	  delete standaloneTrack;
-	  standaloneTrack=0;
-	  ATH_MSG_DEBUG("extrapolated track has a degraded fit, don't use it");
-        }
+	else{
+	  double mschi2=2.5; //a default we should hopefully never have to use (taken from CombinedMuonTrackBuilder)
+	  if(msTrack.fitQuality()->doubleNumberDoF()>0) mschi2=msTrack.fitQuality()->chiSquared()/msTrack.fitQuality()->doubleNumberDoF();
+	  //choice of 1000 is slightly arbitrary, the point is that the fit should be really be terrible
+	  if(standaloneTrack->fitQuality()->chiSquared()/standaloneTrack->fitQuality()->doubleNumberDoF()>1000*mschi2){
+	    delete standaloneTrack;
+	    standaloneTrack=0;
+	    ATH_MSG_DEBUG("extrapolated track has a degraded fit, don't use it");
+	  }
+	}
       }
       if (standaloneTrack) {
 	standaloneTrack->info().setParticleHypothesis(Trk::muon);
diff --git a/Reconstruction/MuonIdentification/MuonCombinedConfig/python/MuonCombinedRecToolsConfig.py b/Reconstruction/MuonIdentification/MuonCombinedConfig/python/MuonCombinedRecToolsConfig.py
index 0d44883535c6730c294662cce74a6ab5c0658dd5..4df13ee9e279d412d0dd9479f97e0805a1cc762a 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedConfig/python/MuonCombinedRecToolsConfig.py
+++ b/Reconstruction/MuonIdentification/MuonCombinedConfig/python/MuonCombinedRecToolsConfig.py
@@ -224,7 +224,7 @@ def MuonCreatorToolCfg(flags, name="MuonCreatorTool", **kwargs):
     kwargs.setdefault("TrackParticleCreator", acc.getPrimary() )
     result.merge(acc)
 
-    acc = ParticleCaloExtensionToolCfg(flags)
+    acc = ParticleCaloExtensionToolCfg(flags,StartFromPerigee=True)
     kwargs.setdefault("ParticleCaloExtensionTool", acc.getPrimary() )
     result.merge(acc)
 
diff --git a/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCombinedAlgs.py b/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCombinedAlgs.py
index 4bfc65d950b6fcae575a323f93f7bd5da8e554cf..955b15c1d02e38054efcdcb536109131911f9723 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCombinedAlgs.py
+++ b/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCombinedAlgs.py
@@ -175,6 +175,8 @@ class MuonCombinedReconstruction(ConfiguredMuonRec):
 
         # runs over outputs and create xAODMuon collection
         topSequence += getAlgorithm("MuonCreatorAlg")
+        # setting this here, in the new configuration it will be easier to do
+        topSequence.MuonCreatorAlg.MuonCreatorTool.ParticleCaloExtensionTool.StartFromPerigee=True
 
         if muonCombinedRecFlags.doMuGirl() and muonCombinedRecFlags.doMuGirlLowBeta():
             topSequence += getAlgorithm("StauCreatorAlg")
diff --git a/Reconstruction/MuonIdentification/MuonCombinedTimingTools/src/MuonCombinedTimingTool.cxx b/Reconstruction/MuonIdentification/MuonCombinedTimingTools/src/MuonCombinedTimingTool.cxx
index ec1dde08a28333ed7594fc215c03ee8a7a78d0f4..08e2b4979ef6f40a25471ed243a6e87d273e09d9 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedTimingTools/src/MuonCombinedTimingTool.cxx
+++ b/Reconstruction/MuonIdentification/MuonCombinedTimingTools/src/MuonCombinedTimingTool.cxx
@@ -2,15 +2,10 @@
   Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
-///////////////////////////////////////////////////////////////////
-// MuonCombinedTimingTool.cxx, (c) ATLAS Detector software
-///////////////////////////////////////////////////////////////////
-
 #include "MuonCombinedTimingTool.h"
 
 #include "TrkSpaceTimePoint/SpaceTimePoint.h"
 
-
 //================ Constructor =================================================
 
 Rec::MuonCombinedTimingTool::MuonCombinedTimingTool(const std::string& t, const std::string& n, const IInterface* p)
@@ -19,11 +14,6 @@ Rec::MuonCombinedTimingTool::MuonCombinedTimingTool(const std::string& t, const
     declareInterface<IMuonCombinedTimingTool>(this);
 }
 
-//================ Destructor =================================================
-
-Rec::MuonCombinedTimingTool::~MuonCombinedTimingTool() {}
-
-
 //================ Initialisation =================================================
 
 StatusCode
@@ -50,26 +40,10 @@ Rec::MuonCombinedTimingTool::initialize()
         ATH_MSG_DEBUG("Retrieved " << m_rpcTimingTool.name());
     }
 
-    /*
-    if (!m_cscTimingTool.empty()) {
-      if (m_cscTimingTool.retrieve().isFailure()) {
-        ATH_MSG_ERROR ("Could not retrieve "<<m_cscTimingTool.name());
-        return StatusCode::FAILURE;
-      } else ATH_MSG_DEBUG ("Retrieved " << m_cscTimingTool.name());
-      } */
-
     ATH_MSG_DEBUG("initialize() successful in " << name());
     return StatusCode::SUCCESS;
 }
 
-//================ Finalisation =================================================
-
-StatusCode
-Rec::MuonCombinedTimingTool::finalize()
-{
-    return StatusCode::SUCCESS;
-}
-
 //============================================================================================
 std::vector<Trk::SpaceTimePoint*>
 Rec::MuonCombinedTimingTool::timeMeasurements(const xAOD::Muon&) const
@@ -77,128 +51,6 @@ Rec::MuonCombinedTimingTool::timeMeasurements(const xAOD::Muon&) const
     std::vector<Trk::SpaceTimePoint*> spaceTimePoints;  // empty vector
     ATH_MSG_WARNING(
         "This tool is not migrated to xAOD yet, please volunteer to update it if you need the information filled");
-    //   // return empty vector in case no segment container was associated to the muon
-    //   if (!getSegmentContainer(muon)) return spaceTimePoints;
-
-    //   // ***
-    //   // *** first choice: primary author combined muon or MuGirl refitted
-    //   // ***
-    //   if (muon.hasCombinedMuonTrackParticle() ) {
-    // //  || muon.hasInnerExtrapolatedTrackParticle() ) // analysis will be based on MuGirl segments
-
-    //     const Rec::TrackParticle* muonParticle = muon.hasCombinedMuonTrackParticle() ?
-    //     muon.combinedMuonTrackParticle() : muon.innerExtrapolatedTrackParticle();
-
-    //     const Trk::Track* combinedTrack = muonParticle ? muonParticle->originalTrack() : NULL;
-
-    //     if (combinedTrack==NULL) return spaceTimePoints;
-
-    //     const Trk::Track* inDetTrack = muon.inDetTrkTrack();
-    //     if (!m_trtTimingTool.empty() && inDetTrack!= NULL) {
-    //       // in case a refit is attempted, better give only the ID track to the tool.
-    //       std::vector<Trk::SpaceTimePoint*> v1
-    // 	= m_trtTimingTool->timeMeasurements(*inDetTrack);
-    //       if (!v1.empty()) spaceTimePoints.insert( spaceTimePoints.end(), v1.begin(), v1.end());
-    //     }
-
-    //     if (!m_caloTimingTool.empty()) {
-    //       std::vector<Trk::SpaceTimePoint*> v2 = m_caloTimingTool->timeMeasurements(*combinedTrack);
-    //       if (!v2.empty()) spaceTimePoints.insert( spaceTimePoints.end(), v2.begin(), v2.end());
-    //     }
-
-    //     if (!m_mdtSegmentTimingTool.empty()) {
-    //       const Trk::SegmentCollection* segments = getSegmentContainer(muon);
-    //       std::vector<Trk::SpaceTimePoint*> v3 = m_mdtSegmentTimingTool->timeMeasurements(*combinedTrack, segments);
-    //       if (!v3.empty()) spaceTimePoints.insert( spaceTimePoints.end(), v3.begin(), v3.end());
-    //       // if at some point consider passing tracks, in case t0 determined on the fly
-    //       // std::vector<Trk::SpaceTimePoint*> v3 = m_mdtSegmentTimingTool->timeMeasurements(*combinedTrack);
-    //       // if (!v3.empty()) spaceTimePoints.insert( spaceTimePoints.end(), v3.begin(), v3.end());
-    //     }
-    //     if (!m_rpcTimingTool.empty()) {
-    //       std::vector<Trk::SpaceTimePoint*> v4 = m_rpcTimingTool->timeMeasurements(*combinedTrack);
-    //       if (!v4.empty()) spaceTimePoints.insert( spaceTimePoints.end(), v4.begin(), v4.end());
-    //     }
-    //     return spaceTimePoints;
-    //   }
-
-    //   // ***
-    //   // *** second choice: primary author segment-tagger
-    //   // ***
-    //   if ( (muon.hasInDetTrackParticle() || muon.hasInnerExtrapolatedTrackParticle()) && !muon.isCaloMuonId()) {
-    //     const Rec::TrackParticle* idParticle = muon.inDetTrackParticle();
-    //     const Trk::Track* idTrack = idParticle ? idParticle->originalTrack() : NULL;
-    //     if (idTrack==NULL) return spaceTimePoints;
-    //     if (!m_trtTimingTool.empty()) {
-    //       std::vector<Trk::SpaceTimePoint*> v1 = m_trtTimingTool->timeMeasurements(*idTrack);
-    //       if (!v1.empty()) spaceTimePoints.insert( spaceTimePoints.end(), v1.begin(), v1.end());
-    //     }
-    //     if (!m_caloTimingTool.empty()) {
-    //       std::vector<Trk::SpaceTimePoint*> v2 = m_caloTimingTool->timeMeasurements(*idTrack);
-    //       if (!v2.empty()) spaceTimePoints.insert( spaceTimePoints.end(), v2.begin(), v2.end());
-    //     }
-    //     if (!m_mdtSegmentTimingTool.empty() || !m_rpcTimingTool.empty()) {
-    //       std::vector<const Trk::Segment*> segments;
-    //       unsigned int nSeg = muon.numberOfSegments();
-    //       segments.reserve(nSeg);
-    //       for( unsigned int si=0;si<nSeg;++si ) {
-    //         const Trk::Segment* seg = muon.muonSegment(si);
-    //         if( seg ) segments.push_back(seg);
-    //       }
-    //       if (!m_mdtSegmentTimingTool.empty()) {
-    // 	std::vector<Trk::SpaceTimePoint*> v3 = m_mdtSegmentTimingTool->timeMeasurements(segments);
-    //         if (!v3.empty()) spaceTimePoints.insert( spaceTimePoints.end(), v3.begin(), v3.end());
-    //       }
-    //       if (!m_rpcTimingTool.empty()) {
-    //         std::vector<Trk::SpaceTimePoint*> v4 = m_rpcTimingTool->timeMeasurements(segments);
-    //         if (!v4.empty()) spaceTimePoints.insert( spaceTimePoints.end(), v4.begin(), v4.end());
-    //       }
-    //     }
-    //     return spaceTimePoints;
-    //   }
-
-    //   // ***
-    //   // *** third choice: standalone muon
-    //   // ***
-    //   if (muon.hasMuonExtrapolatedTrackParticle()){
-    //     const Rec::TrackParticle* muonParticle = muon.muonExtrapolatedTrackParticle();
-    //     const Trk::Track* msTrack = muonParticle ? muonParticle->originalTrack() : NULL;
-    //     if (msTrack==NULL) {
-    //        ATH_MSG_WARNING ("No muon track or segments associated to SA muon !?");
-    //        return spaceTimePoints;
-    //      }
-    //     if (!m_caloTimingTool.empty()) {
-    //       std::vector<Trk::SpaceTimePoint*> v2 = m_caloTimingTool->timeMeasurements(*msTrack);
-    //       if (!v2.empty()) spaceTimePoints.insert( spaceTimePoints.end(), v2.begin(), v2.end());
-    //     }
-    //     if (!m_mdtSegmentTimingTool.empty()) {
-    //       const Trk::SegmentCollection* segments = getSegmentContainer(muon);
-    //       std::vector<Trk::SpaceTimePoint*> v3 = m_mdtSegmentTimingTool->timeMeasurements(*msTrack, segments);
-    //       if (!v3.empty()) spaceTimePoints.insert( spaceTimePoints.end(), v3.begin(), v3.end());
-    //     }
-    //     if (!m_rpcTimingTool.empty()) {
-    //       std::vector<Trk::SpaceTimePoint*> v4 = m_rpcTimingTool->timeMeasurements(*msTrack);
-    //       if (!v4.empty()) spaceTimePoints.insert( spaceTimePoints.end(), v4.begin(), v4.end());
-    //     }
-    //     return spaceTimePoints;
-    //   }
-
-    //   // ***
-    //   // *** fourth choice: calo tagged muon
-    //   // ***
-    //   if (muon.hasInDetTrackParticle() && muon.isCaloMuonId()){
-    //     const Rec::TrackParticle* idParticle = muon.inDetTrackParticle();
-    //     const Trk::Track* idTrack = idParticle ? idParticle->originalTrack() : NULL;
-    //     if (idTrack==NULL) return spaceTimePoints;
-    //     if (!m_trtTimingTool.empty()) {
-    //       std::vector<Trk::SpaceTimePoint*> v1 = m_trtTimingTool->timeMeasurements(*idTrack);
-    //       if (!v1.empty()) spaceTimePoints.insert( spaceTimePoints.end(), v1.begin(), v1.end());
-    //     }
-    //     if (!m_caloTimingTool.empty()) {
-    //       std::vector<Trk::SpaceTimePoint*> v2 = m_caloTimingTool->timeMeasurements(*idTrack);
-    //       if (!v2.empty()) spaceTimePoints.insert( spaceTimePoints.end(), v2.begin(), v2.end());
-    //     }
-    //     return spaceTimePoints;
-    //   }
 
     return spaceTimePoints;
 }
@@ -209,33 +61,5 @@ Rec::MuonCombinedTimingTool::timeMeasurements(const xAOD::Muon&) const
 const Trk::SegmentCollection*
 Rec::MuonCombinedTimingTool::getSegmentContainer(const xAOD::Muon&) const
 {
-    //   std::string containerName = "";
-
-    //   MuonParameters::Author auth = muon.author();
-
-    //   // FIXME At the moment, space-time points are constructed only for muid.
-    //   // TODO In the future, 3rd muon chain has to be treated as well.
-    //   //First check if muon is Muonboy/STACO
-    // //  if(auth == MuonParameters::MuonboySP || auth == MuonParameters::Muonboy ||
-    // //     auth == MuonParameters::STACO) {// MuonboySP or Muonboy or STACO
-    // //    containerName = "ConvertedMBoySegments";
-    // //  } else
-    //   if (auth == MuonParameters::MOORE || auth == MuonParameters::MuidSA ||
-    // 	     auth == MuonParameters::MuidCo) { //MOORE or MuidSA or MuidCo
-    //     containerName = "MooreSegments";
-    //   }
-
-    //   if( evtStore()->contains<Trk::SegmentCollection>(containerName) ){
-    //     const Trk::SegmentCollection* segs = NULL;
-
-    //     if( evtStore()->retrieve(segs, containerName).isFailure() ){
-    //       ATH_MSG_DEBUG("Could not find segment container");
-    //     }else{
-    //       ATH_MSG_DEBUG("Successfully retrieved segment container");
-
-    //       return segs;
-    //     }
-    //   }
-
-    return NULL;
+    return nullptr;
 }
diff --git a/Reconstruction/MuonIdentification/MuonCombinedTimingTools/src/MuonCombinedTimingTool.h b/Reconstruction/MuonIdentification/MuonCombinedTimingTools/src/MuonCombinedTimingTool.h
index 7ed265021db3d76450064a87a847a3ba2b7b9468..d528b8b7581274c02c113a4c4629d39ebab2a1e2 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedTimingTools/src/MuonCombinedTimingTool.h
+++ b/Reconstruction/MuonIdentification/MuonCombinedTimingTools/src/MuonCombinedTimingTool.h
@@ -2,10 +2,6 @@
   Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
-///////////////////////////////////////////////////////////////////
-// MuonCombinedTimingTool.h, (c) ATLAS Detector software
-///////////////////////////////////////////////////////////////////
-
 #ifndef RECMUONCOMBINEDTIMINGTOOL_H
 #define RECMUONCOMBINEDTIMINGTOOL_H
 
@@ -16,11 +12,6 @@
 #include "TrkToolInterfaces/ITrackTimingTool.h"
 #include "xAODMuon/Muon.h"
 
-namespace Trk {
-class ITrackTimingTool;
-}
-// namespace Muon { class ISegmentTimingTool; }
-
 namespace Rec {
 class IMuonPropertiesTool;
 
@@ -38,12 +29,10 @@ class MuonCombinedTimingTool : virtual public IMuonCombinedTimingTool, public At
     MuonCombinedTimingTool(const std::string&, const std::string&, const IInterface*);
 
     /** default destructor */
-    virtual ~MuonCombinedTimingTool();
+    virtual ~MuonCombinedTimingTool()=default;
 
     /** standard Athena-Algorithm method */
     virtual StatusCode initialize();
-    /** standard Athena-Algorithm method */
-    virtual StatusCode finalize();
 
     virtual std::vector<Trk::SpaceTimePoint*> timeMeasurements(const xAOD::Muon& muon) const;
 
diff --git a/Reconstruction/ParticleTruth/ParticleTruth/ATLAS_CHECK_THREAD_SAFETY b/Reconstruction/ParticleTruth/ParticleTruth/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..15237f7b2edb11f9a99f09afa65aad2d33731f24
--- /dev/null
+++ b/Reconstruction/ParticleTruth/ParticleTruth/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Reconstruction/ParticleTruth
diff --git a/Reconstruction/RecExample/RecExCommon/share/CombinedRec_config.py b/Reconstruction/RecExample/RecExCommon/share/CombinedRec_config.py
index 3ea4098ff55bbe40081831542ca51a1e2bbff3b0..b788aea37e9dd2965714154125f6907b7d68c925 100755
--- a/Reconstruction/RecExample/RecExCommon/share/CombinedRec_config.py
+++ b/Reconstruction/RecExample/RecExCommon/share/CombinedRec_config.py
@@ -29,7 +29,7 @@ pdr.flag_domain('CaloExtensionBuilder')
 if (rec.doESD()) and (recAlgs.doEFlow() or rec.doTau() or rec.doEgamma()) : #   or rec.readESD()
     try:        
         from TrackToCalo.CaloExtensionBuilderAlgConfig import CaloExtensionBuilder
-        CaloExtensionBuilder("NoCut", 500.) #Arguments are cutLevel and minPt for track selection
+        CaloExtensionBuilder() 
     except Exception:
         treatException("Cannot include CaloExtensionBuilder !")
 
diff --git a/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py b/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py
index 98d249a73373ce64cf3b782c2ce1380dfa4bfec2..2fd95abd9dc0f196b3cbe862719f8a876ca36fd5 100644
--- a/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py
+++ b/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py
@@ -676,20 +676,6 @@ if rec.doESD() and not rec.readESD() and rec.doBeamBackgroundFiller():
 if recAlgs.doMonteCarloReact():
     protectedInclude ("MonteCarloReactTools/MonteCarloReact_for_RecExCommon.py")
 
-# run monitoring
-# ----------------------------------------------------------------------------
-# Monitoring Algorithms and Tools
-# ----------------------------------------------------------------------------
-
-pdr.flag_domain('monitoring')
-if rec.doMonitoring():
-    protectedInclude ("AthenaMonitoring/DataQualitySteering_jobOptions.py")
-
-
-
-# run"Fast Phsyics Monitoring"
-if rec.doFastPhysMonitoring():
-    protectedInclude("FastPhysMonExample/FastPhysicsMonitoring_jobOptions.py")
 
 # ----------------------------------------------------------------------------
 
@@ -981,6 +967,7 @@ if rec.doFileMetaData():
 
     pass
 
+
 ##--------------------------------------------------------
 ###=== Only run reco on events that pass selected triggers
 ##--------------------------------------------------------
@@ -1611,6 +1598,21 @@ if rec.readAOD():
     ServiceMgr.AthenaEventLoopMgr.EventPrintoutInterval = 100
     logRecExCommon_topOptions.info("AOD reading case: Set EventPrintoutInterval=100")
 
+# run monitoring
+# ----------------------------------------------------------------------------
+# Monitoring Algorithms and Tools
+# ----------------------------------------------------------------------------
+
+pdr.flag_domain('monitoring')
+if rec.doMonitoring():
+    protectedInclude ("AthenaMonitoring/DataQualitySteering_jobOptions.py")
+
+
+
+# run"Fast Phsyics Monitoring"
+if rec.doFastPhysMonitoring():
+    protectedInclude("FastPhysMonExample/FastPhysicsMonitoring_jobOptions.py")
+
 
 ###################
 ## Common Utils  ##
diff --git a/Reconstruction/RecExample/RecExRecoTest/share/RecExRecoTest_ART_egamma_fromESD.py b/Reconstruction/RecExample/RecExRecoTest/share/RecExRecoTest_ART_egamma_fromESD.py
index 9562a1025f4429a1a7dae04a21b436f9e8f94491..544e960c4fbb18e3914682b675c7dea5a4360298 100644
--- a/Reconstruction/RecExample/RecExRecoTest/share/RecExRecoTest_ART_egamma_fromESD.py
+++ b/Reconstruction/RecExample/RecExRecoTest/share/RecExRecoTest_ART_egamma_fromESD.py
@@ -159,7 +159,7 @@ except Exception:
 include( "McParticleAlgs/TruthParticleBuilder_jobOptions.py" )
 
 from TrackToCalo.CaloExtensionBuilderAlgConfig import CaloExtensionBuilder
-CaloExtensionBuilder("NoCut", 500.) 
+CaloExtensionBuilder() 
 
 from egammaRec.egammaRecFlags import jobproperties
 
diff --git a/Reconstruction/RecExample/RecJobTransformTests/test/test_mcLatest_13TeV.sh b/Reconstruction/RecExample/RecJobTransformTests/test/test_mcLatest_13TeV.sh
new file mode 100755
index 0000000000000000000000000000000000000000..c334ef91543981f66ff826cd1ad9a236eff882a1
--- /dev/null
+++ b/Reconstruction/RecExample/RecJobTransformTests/test/test_mcLatest_13TeV.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+#
+# art-description: Run reco with a latest (September 2020) MC setup with pileup
+# art-athena-mt: 4
+# art-type: grid
+# art-include: master/Athena
+
+export TRF_ECHO=True;
+Reco_tf.py --AMI=r11976 --outputRDOFile=myRDO.pool.root --outputAODFile=myAOD.pool.root --outputESDFile=myESD.pool.root --outputHISTFile=myHIST.root --inputHITSFile=/eos/atlas/atlascerngroupdisk/data-art/grid-input/RecJobTransformTests/mc16_13TeV/valid1/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3227/HITS.12560240._000287.pool.root.1 --inputHighPtMinbiasHitsFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecJobTransformTests/mc16_13TeV.361239.Pythia8EvtGen_A3NNPDF23LO_minbias_inelastic_high.merge.HITS.e4981_s3087_s3089/HITS.10501933._000008.pool.root.1 --inputLowPtMinbiasHitsFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecJobTransformTests/mc16_13TeV.361238.Pythia8EvtGen_A3NNPDF23LO_minbias_inelastic_low.merge.HITS.e4981_s3087_s3089/HITS.10501925._000027.pool.root.1 --maxEvents=500 --jobNumber=1 --imf False
+RES=$?
+echo "art-result: $RES Reco"
+if [ $RES -ne 0 ];then
+return $RES
+fi
diff --git a/Reconstruction/RecExample/RecJobTransformTests/test/test_mcLatest_nopileup_13TeV.sh b/Reconstruction/RecExample/RecJobTransformTests/test/test_mcLatest_nopileup_13TeV.sh
new file mode 100755
index 0000000000000000000000000000000000000000..e3238a254e27e8d6f713ad9eea1a55eea20aa484
--- /dev/null
+++ b/Reconstruction/RecExample/RecJobTransformTests/test/test_mcLatest_nopileup_13TeV.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+#
+# art-description: Run latest (Sep 2020) MC setup without pileup.
+# art-athena-mt: 4
+# art-type: grid
+# art-include: master/Athena
+
+export TRF_ECHO=True;
+Reco_tf.py --AMI=r11976 --outputRDOFile=myRDO.pool.root --outputAODFile=myAOD.pool.root --outputESDFile=myESD.pool.root --outputHISTFile=myHIST.root --inputHITSFile=/eos/atlas/atlascerngroupdisk/data-art/grid-input/RecJobTransformTests/mc16_13TeV/valid1/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3227/HITS.12560240._000287.pool.root.1  --maxEvents=500 --jobNumber=1 --imf False
+RES=$?
+echo "art-result: $RES Reco"
+if [ $RES -ne 0 ];then
+return $RES
+fi
diff --git a/Reconstruction/RecExample/RecJobTransformTests/test/test_mcLatest_nopileup_stdcmalloc_13TeV.sh b/Reconstruction/RecExample/RecJobTransformTests/test/test_mcLatest_nopileup_stdcmalloc_13TeV.sh
new file mode 100755
index 0000000000000000000000000000000000000000..f802a4492c0176a880466b31d6547bbc0b124a10
--- /dev/null
+++ b/Reconstruction/RecExample/RecJobTransformTests/test/test_mcLatest_nopileup_stdcmalloc_13TeV.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+#
+# art-description: Run latest (Sep 2020) MC setup without pileup and with stdcmalloc enabled.
+# art-athena-mt: 4
+# art-type: grid
+# art-include: master/Athena
+
+export TRF_ECHO=True;
+Reco_tf.py --AMI=r11976 --outputRDOFile=myRDO.pool.root --outputAODFile=myAOD.pool.root --outputESDFile=myESD.pool.root --outputHISTFile=myHIST.root --inputHITSFile=/eos/atlas/atlascerngroupdisk/data-art/grid-input/RecJobTransformTests/mc16_13TeV/valid1/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3227/HITS.12560240._000287.pool.root.1  --maxEvents=500 --jobNumber=1 --imf False --athenaopts="--stdcmalloc"
+RES=$?
+echo "art-result: $RES Reco"
+if [ $RES -ne 0 ];then
+return $RES
+fi
diff --git a/Reconstruction/RecExample/RecJobTransformTests/test/test_reco_mc15_13tev.sh b/Reconstruction/RecExample/RecJobTransformTests/test/test_reco_mc15_13tev.sh
deleted file mode 100755
index 2e3249d8988837e39aa6acc30d35e4d2b1a6a3ef..0000000000000000000000000000000000000000
--- a/Reconstruction/RecExample/RecJobTransformTests/test/test_reco_mc15_13tev.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/sh
-#
-# art-description: Reco_tf for PhysVal, updated with q221 (2017-11-13) + pileup
-# art-athena-mt: 4
-# art-type: grid
-# art-include: 21.0/Athena
-# art-include: 21.0-TrigMC/Athena
-# art-include: master/Athena
-# art-include: 21.3/Athena
-# art-include: 21.9/Athena
-
-
-export TRF_ECHO=True; Reco_tf.py --conditionsTag all:OFLCOND-RUN12-SDR-19 --ignoreErrors 'False' --autoConfiguration='everything' --digiSeedOffset2 '1'  --preExec  'all:rec.Commissioning.set_Value_and_Lock(True);from AthenaCommon.BeamFlags import jobproperties;jobproperties.Beam.numberOfCollisions.set_Value_and_Lock(0.);from LArROD.LArRODFlags import larRODFlags;larRODFlags.nSamples.set_Value_and_Lock(4);from TriggerJobOpts.TriggerFlags import TriggerFlags;TriggerFlags.AODEDMSet="AODFULL"'  'HITtoRDO:from Digitization.DigitizationFlags import digitizationFlags;digitizationFlags.overrideMetadata+=["PhysicsList"];'  'RAWtoESD:from TriggerJobOpts.TriggerFlags import TriggerFlags;TriggerFlags.triggerMenuSetup="MC_pp_v7";from CaloRec.CaloCellFlags import jobproperties;jobproperties.CaloCellFlags.doLArCellEmMisCalib=False;' --digiSeedOffset1 '1' --steering 'doRDO_TRIG' --DataRunNumber '222525' --outputRDOFile=myRDO.pool.root --outputAODFile=myAOD.pool.root --outputESDFile=myESD.pool.root --outputHISTFile=myHIST.root --inputHITSFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecJobTransformTests/mc15_13TeV.410500.PowhegPythia8EvtGen_A14_ttbar_hdamp172p5_nonallhad.simul.HITS.e4797_s2726.50events.pool.root --inputHighPtMinbiasHitsFile='/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecJobTransformTests/mc15_13TeV.361035.Pythia8EvtGen_A2MSTW2008LO_minbias_inelastic_high.merge.HITS.e3581_s2578_s2195/*' --inputLowPtMinbiasHitsFile='/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecJobTransformTests/mc15_13TeV.361034.Pythia8EvtGen_A2MSTW2008LO_minbias_inelastic_low.merge.HITS.e3581_s2578_s2195/*' --numberOfCavernBkg="0" --numberOfHighPtMinBias="0.12268057" --numberOfLowPtMinBias="39.8773194" --pileupFinalBunch 6 --imf False --maxEvents '500'
-RES=$?
-echo "art-result: $RES Reco"
-if [ $RES -ne 0 ];then
-return $RES
-fi
-
-Reco_tf.py --inputAODFile myAOD.pool.root --outputNTUP_PHYSVALFile PhysVal_13TeV_Example.pool.root --validationFlags doExample
-RES=$?
-echo "art-result: $RES PhysVal"
-if [ $RES -ne 0 ];then
-return $RES
-fi
-
-Reco_tf.py --validationFlags 'doExample,doMET,doPFlow,doTau,doEgamma,doBtag,doZee,doJet,doTopoCluster,doMuon,doTrigMinBias,doTrigIDtrk,doTrigBphys,doTrigMET,doTrigJet,doTrigTau, doTrigEgamma,doTrigMuon,doTrigBjet,doTrigHLTResult' --inputAODFile=myAOD.pool.root  --outputNTUP_PHYSVALFile=myNTUP_PHYSVAL.root
-RES=$?
-echo "art-result: $RES Ntup"
-return $RES
diff --git a/Reconstruction/RecExample/RecJobTransformTests/test/test_reco_mc15_13tev_nopileup.sh b/Reconstruction/RecExample/RecJobTransformTests/test/test_reco_mc15_13tev_nopileup.sh
deleted file mode 100755
index 193b3769af960ecb4a52dea0ff18b4e2e5f3592b..0000000000000000000000000000000000000000
--- a/Reconstruction/RecExample/RecJobTransformTests/test/test_reco_mc15_13tev_nopileup.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/sh
-#
-# art-description: Reco_tf for PhysVal, updated with q221 (2017-11-13), no pileup
-# art-athena-mt: 4
-# art-type: grid
-# art-include: 21.0/Athena
-# art-include: 21.0-TrigMC/Athena
-# art-include: master/Athena
-# art-include: 21.3/Athena
-# art-include: 21.9/Athena
-
-
-export TRF_ECHO=True; Reco_tf.py --conditionsTag all:OFLCOND-RUN12-SDR-19 --ignoreErrors 'False' --autoConfiguration='everything' --digiSeedOffset2 '1'  --preExec  'all:rec.Commissioning.set_Value_and_Lock(True);from AthenaCommon.BeamFlags import jobproperties;jobproperties.Beam.numberOfCollisions.set_Value_and_Lock(0.);from LArROD.LArRODFlags import larRODFlags;larRODFlags.nSamples.set_Value_and_Lock(4);from TriggerJobOpts.TriggerFlags import TriggerFlags;TriggerFlags.AODEDMSet="AODFULL"'  'HITtoRDO:from Digitization.DigitizationFlags import digitizationFlags;digitizationFlags.overrideMetadata+=["PhysicsList"];'  'RAWtoESD:from TriggerJobOpts.TriggerFlags import TriggerFlags;TriggerFlags.triggerMenuSetup="MC_pp_v7";from CaloRec.CaloCellFlags import jobproperties;jobproperties.CaloCellFlags.doLArCellEmMisCalib=False;' --digiSeedOffset1 '1' --steering 'doRDO_TRIG' --DataRunNumber '222525' --outputRDOFile=myRDO.pool.root --outputAODFile=myAOD.pool.root --outputESDFile=myESD.pool.root --outputHISTFile=myHIST.root --inputHITSFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecJobTransformTests/mc15_13TeV.410500.PowhegPythia8EvtGen_A14_ttbar_hdamp172p5_nonallhad.simul.HITS.e4797_s2726.50events.pool.root --imf False --maxEvents '500'
-
-RES=$?
-echo "art-result: $RES Reco"
-return $RES
-
diff --git a/Reconstruction/RecExample/RecJobTransformTests/test/test_reco_mc15_13tev_nopileup_stdcmalloc.sh b/Reconstruction/RecExample/RecJobTransformTests/test/test_reco_mc15_13tev_nopileup_stdcmalloc.sh
deleted file mode 100755
index e445ef38514ecdc857d50e7913aec0df5bdee15a..0000000000000000000000000000000000000000
--- a/Reconstruction/RecExample/RecJobTransformTests/test/test_reco_mc15_13tev_nopileup_stdcmalloc.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/sh
-#
-# art-description: Reco_tf for PhysVal, updated with q221 (2017-11-13), no pileup, with stdcmalloc
-# art-athena-mt: 4
-# art-type: grid
-# art-include: 21.0/Athena
-# art-include: 21.0-TrigMC/Athena
-# art-include: master/Athena
-# art-include: 21.3/Athena
-# art-include: 21.9/Athena
-
-
-export TRF_ECHO=True; Reco_tf.py --conditionsTag all:OFLCOND-RUN12-SDR-19 --ignoreErrors 'False' --autoConfiguration='everything' --digiSeedOffset2 '1'  --preExec  'all:rec.Commissioning.set_Value_and_Lock(True);from AthenaCommon.BeamFlags import jobproperties;jobproperties.Beam.numberOfCollisions.set_Value_and_Lock(0.);from LArROD.LArRODFlags import larRODFlags;larRODFlags.nSamples.set_Value_and_Lock(4);from TriggerJobOpts.TriggerFlags import TriggerFlags;TriggerFlags.AODEDMSet="AODFULL"'  'HITtoRDO:from Digitization.DigitizationFlags import digitizationFlags;digitizationFlags.overrideMetadata+=["PhysicsList"];'  'RAWtoESD:from TriggerJobOpts.TriggerFlags import TriggerFlags;TriggerFlags.triggerMenuSetup="MC_pp_v7";from CaloRec.CaloCellFlags import jobproperties;jobproperties.CaloCellFlags.doLArCellEmMisCalib=False;' --digiSeedOffset1 '1' --steering 'doRDO_TRIG' --DataRunNumber '222525' --outputRDOFile=myRDO.pool.root --outputAODFile=myAOD.pool.root --outputESDFile=myESD.pool.root --outputHISTFile=myHIST.root --inputHITSFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecJobTransformTests/mc15_13TeV.410500.PowhegPythia8EvtGen_A14_ttbar_hdamp172p5_nonallhad.simul.HITS.e4797_s2726.50events.pool.root --imf False --maxEvents '500' --athenaopts="--stdcmalloc"
-
-RES=$?
-echo "art-result: $RES Reco"
-return $RES
-
diff --git a/Reconstruction/RecoAlgs/IsolationAlgs/python/IsoGetter.py b/Reconstruction/RecoAlgs/IsolationAlgs/python/IsoGetter.py
index 64ca2286f62992615121a64fd2f7534a5408a553..b6b2fbfe15883de1de313143857db550bf409898 100644
--- a/Reconstruction/RecoAlgs/IsolationAlgs/python/IsoGetter.py
+++ b/Reconstruction/RecoAlgs/IsolationAlgs/python/IsoGetter.py
@@ -68,8 +68,13 @@ from egammaTools.egammaExtrapolators import egammaExtrapolator
 CaloExtensionTool =  ToolFactory (Trk__ParticleCaloExtensionTool,
                                   Extrapolator = egammaExtrapolator)
 
+#adding this to address a rare crash when calculating etCone iso for muons, the tool is not used by any other part of the code
+MuonCaloExtensionTool =  ToolFactory (Trk__ParticleCaloExtensionTool,
+                                      Extrapolator = egammaExtrapolator,
+                                      StartFromPerigee = True)
+
 CaloCellAssocTool =  ToolFactory (Rec__ParticleCaloCellAssociationTool,
-                                  ParticleCaloExtensionTool = CaloExtensionTool)
+                                  ParticleCaloExtensionTool = MuonCaloExtensionTool)
 
 
 # configuration for ED computation
diff --git a/Reconstruction/RecoTools/TrackToCalo/python/CaloExtensionBuilderAlgCfg.py b/Reconstruction/RecoTools/TrackToCalo/python/CaloExtensionBuilderAlgCfg.py
index 3d02a50f0cd71ef4bfffbb3fe48e80ef2a939110..576e4c5c6ac1379d5db391ca627f8b30c621f0f3 100644
--- a/Reconstruction/RecoTools/TrackToCalo/python/CaloExtensionBuilderAlgCfg.py
+++ b/Reconstruction/RecoTools/TrackToCalo/python/CaloExtensionBuilderAlgCfg.py
@@ -1,7 +1,7 @@
 # Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 from AthenaConfiguration.ComponentFactory import CompFactory
 
-def getCaloExtenstionBuilderAlgorithm(inputFlags, cutLevel = "TightPrimary", minPT = 100.0):
+def getCaloExtenstionBuilderAlgorithm(inputFlags):
     from TrkConfig.AtlasExtrapolatorConfig import AtlasExtrapolatorCfg    
     Trk__ParticleCaloExtensionTool = CompFactory.Trk.ParticleCaloExtensionTool
     extrapPFlowCfg = AtlasExtrapolatorCfg(inputFlags)
@@ -9,9 +9,5 @@ def getCaloExtenstionBuilderAlgorithm(inputFlags, cutLevel = "TightPrimary", min
         
     CaloExtensionBuilderAlg = CompFactory.Trk.CaloExtensionBuilderAlg 
     CaloExtensionBuilderAlg = CaloExtensionBuilderAlg(LastCaloExtentionTool = pcExtensionTool)
-
-    InDet__InDetTrackSelectionTool = CompFactory.InDet.InDetTrackSelectionTool    
-    TrackSelectionToolHC = InDet__InDetTrackSelectionTool(name = "CaloExtensionBuilderTrackSelectionTool",minPt = minPT, CutLevel = cutLevel, minNSiHits = 7) # SiHits = PixelHits + SCTHits + PixelDeadSensors + SCTDeadSensors    
-    CaloExtensionBuilderAlg.TrkSelection = TrackSelectionToolHC
      
     return CaloExtensionBuilderAlg
diff --git a/Reconstruction/RecoTools/TrackToCalo/python/CaloExtensionBuilderAlgConfig.py b/Reconstruction/RecoTools/TrackToCalo/python/CaloExtensionBuilderAlgConfig.py
index 1f7f5c57901e2df8d037b93d45b3b40400c70aca..4dfed02938ff9425924d518e0edcc2ed45afb25f 100644
--- a/Reconstruction/RecoTools/TrackToCalo/python/CaloExtensionBuilderAlgConfig.py
+++ b/Reconstruction/RecoTools/TrackToCalo/python/CaloExtensionBuilderAlgConfig.py
@@ -1,13 +1,11 @@
 ## CaloExtensionBuilderAlg Stuff
-# Defined as function such that the user can change the cut level and minPt
 
-
-def CaloExtensionBuilder( cutLevel = "TightPrimary", minPT = 100.0 ):
+def CaloExtensionBuilder():
     try: 
         from TrkExTools.AtlasExtrapolator import AtlasExtrapolator
         from TrackToCalo.TrackToCaloConf import Trk__ParticleCaloExtensionTool
     except:
-        mlog.error("could not import TrackToCaloConf.Trk__ParticleCaloExtensionTool")
+        mlog.error("could not import" "TrackToCaloConf.Trk__ParticleCaloExtensionTool")
         mlog.error("could not import TrkExTools.AtlasExtrapolator")
         mlog.error (traceback.format_exc())
     try:
@@ -15,12 +13,6 @@ def CaloExtensionBuilder( cutLevel = "TightPrimary", minPT = 100.0 ):
     except:
         mlog.error("could not import TrackToCaloConf.Trk__CaloExtensionBuilderAlg")
         mlog.error (traceback.format_exc())
-    try:
-        from InDetTrackSelectionTool.InDetTrackSelectionToolConf import InDet__InDetTrackSelectionTool
-        from InDetTrackSelectorTool.InDetTrackSelectorToolConf import InDet__InDetDetailedTrackSelectorTool
-    except:
-        mlog.error("could not import InDetTrackSelectionTool.InDet__InDetTrackSelectionTool")
-        mlog.error (traceback.format_exc())
     try:
         from AthenaCommon.AppMgr import ToolSvc
     except:
@@ -43,15 +35,6 @@ def CaloExtensionBuilder( cutLevel = "TightPrimary", minPT = 100.0 ):
     CaloExtensionBuilderTool = CaloExtensionBuilderAlg(LastCaloExtentionTool = pcExtensionTool)
 
     from AthenaCommon.BeamFlags import jobproperties
-
-    TrackSelectionToolHC = InDet__InDetTrackSelectionTool(name            = "CaloExtensionBuilderTrackSelectionTool",
-                                                           minPt           = minPT,
-                                                           CutLevel        = cutLevel,
-                                                           minNSiHits      = 7) # PixelHits + SCTHits + PixelDeadSensors + SCTDeadSensors
-    
-        
-    CaloExtensionBuilderTool.TrkSelection         = TrackSelectionToolHC    
-
     ToolSvc += CaloExtensionBuilderTool.LastCaloExtentionTool
 
     topSequence += CaloExtensionBuilderTool
diff --git a/Reconstruction/RecoTools/TrackToCalo/src/CaloExtensionBuilderAlg.cxx b/Reconstruction/RecoTools/TrackToCalo/src/CaloExtensionBuilderAlg.cxx
index d38034896abbe0b8eef716bf7ddf1316fd6e46c2..b55feae8f45802212559504a24d78bad5e82f300 100644
--- a/Reconstruction/RecoTools/TrackToCalo/src/CaloExtensionBuilderAlg.cxx
+++ b/Reconstruction/RecoTools/TrackToCalo/src/CaloExtensionBuilderAlg.cxx
@@ -6,7 +6,8 @@
 NAME:     CaloExtensionBuilderAlg
 PACKAGE:  offline/Reconstruction/RecoTools/TrackToCalo/CaloExtensionBuilderAlg
 
-Based on: offline/Reconstruction/egamma/egammaTrackTools/EMGSFCaloExtensionBuilder
+Based on:
+offline/Reconstruction/egamma/egammaTrackTools/EMGSFCaloExtensionBuilder
 
 AUTHORS:  Anastopoulos/Capriles
 PURPOSE:  Performs Calo Extension for all selected tracks
@@ -34,45 +35,58 @@ PURPOSE:  Performs Calo Extension for all selected tracks
 StatusCode
 Trk::CaloExtensionBuilderAlg::initialize()
 {
-
-  ATH_CHECK(m_TrkSelection.retrieve());
   ATH_CHECK(m_particleCaloExtensionTool.retrieve());
-
   ATH_CHECK(m_ParticleCacheKey.initialize());
   ATH_CHECK(m_TrkPartContainerKey.initialize());
-
-  return StatusCode::SUCCESS;
-}
-
-StatusCode
-Trk::CaloExtensionBuilderAlg::CaloExtensionBuilderAlg::finalize()
-{
   return StatusCode::SUCCESS;
 }
 
 StatusCode
-Trk::CaloExtensionBuilderAlg::execute_r(const EventContext& ctx) const
+Trk::CaloExtensionBuilderAlg::execute(const EventContext& ctx) const
 {
 
-  SG::ReadHandle<xAOD::TrackParticleContainer> tracks(m_TrkPartContainerKey, ctx);
+  SG::ReadHandle<xAOD::TrackParticleContainer> tracks(m_TrkPartContainerKey,
+                                                      ctx);
   if (!tracks.isValid()) {
-    ATH_MSG_FATAL("Failed to retrieve TrackParticle container: " << m_TrkPartContainerKey.key());
+    ATH_MSG_FATAL("Failed to retrieve TrackParticle container: "
+                  << m_TrkPartContainerKey.key());
     return StatusCode::FAILURE;
   }
 
   // creating and saving the calo extension collection
-  SG::WriteHandle<CaloExtensionCollection> lastCache(m_ParticleCacheKey,ctx);
+  SG::WriteHandle<CaloExtensionCollection> lastCache(m_ParticleCacheKey, ctx);
   ATH_CHECK(lastCache.record(std::make_unique<CaloExtensionCollection>()));
 
   const xAOD::TrackParticleContainer* ptrTracks = tracks.cptr();
   CaloExtensionCollection* ptrPart = lastCache.ptr();
   std::vector<bool> mask(ptrTracks->size(), false);
   for (auto track : *tracks) {
-    if (static_cast<bool>(m_TrkSelection->accept(*track, nullptr)))
-      mask[track->index()] = true;
+    if (track->pt() < 500) {
+      continue;
+    }
+    uint8_t dummy(0);
+    uint8_t nSiHits(0);
+    if (track->summaryValue(dummy, xAOD::numberOfPixelHits)) {
+      nSiHits += dummy;
+    }
+    if (track->summaryValue(dummy, xAOD::numberOfPixelDeadSensors)) {
+      nSiHits += dummy;
+    }
+    if (track->summaryValue(dummy, xAOD::numberOfSCTHits)) {
+      nSiHits += dummy;
+    }
+    if (track->summaryValue(dummy, xAOD::numberOfSCTDeadSensors)) {
+      nSiHits += dummy;
+    }
+    // Cut out TRT alone, but do it for all else
+    if (nSiHits < 4) {
+      continue;
+    }
+    mask[track->index()] = true;
   }
 
-  ATH_CHECK(m_particleCaloExtensionTool->caloExtensionCollection(ctx, *ptrTracks, mask, *ptrPart));
+  ATH_CHECK(m_particleCaloExtensionTool->caloExtensionCollection(
+    ctx, *ptrTracks, mask, *ptrPart));
 
   return StatusCode::SUCCESS;
 }
diff --git a/Reconstruction/RecoTools/TrackToCalo/src/CaloExtensionBuilderAlg.h b/Reconstruction/RecoTools/TrackToCalo/src/CaloExtensionBuilderAlg.h
index 3c79ad3fbc282ba51502a3956ef4739b073a0330..12288abb11632123ab3656733075b358709319ed 100644
--- a/Reconstruction/RecoTools/TrackToCalo/src/CaloExtensionBuilderAlg.h
+++ b/Reconstruction/RecoTools/TrackToCalo/src/CaloExtensionBuilderAlg.h
@@ -11,20 +11,14 @@
   Track Particles
   */
 
-#include "AthenaBaseComps/AthAlgorithm.h"
+#include "AthenaBaseComps/AthReentrantAlgorithm.h"
 #include "GaudiKernel/ToolHandle.h"
 #include "StoreGate/ReadHandleKey.h"
 #include "StoreGate/WriteHandleKey.h"
 
 #include "RecoToolInterfaces/IParticleCaloExtensionTool.h"
 #include "TrkCaloExtension/CaloExtensionCollection.h"
-
-#include "ITrackToVertex/ITrackToVertex.h"
-#include "InDetTrackSelectionTool/IInDetTrackSelectionTool.h"
-#include "TrkToolInterfaces/ITrackSelectorTool.h"
-
 #include "xAODTracking/TrackParticleContainer.h"
-#include "xAODTracking/VertexContainer.h"
 
 #include "InDetReadoutGeometry/SiDetectorElementCollection.h"
 #include "TRT_ReadoutGeometry/TRT_DetElementContainer.h"
@@ -57,20 +51,12 @@ to be done: `uniqueExtension = theTrackExtrapolatorTool->caloExtension(*track);`
 theTrackExtrapolatorTool->caloExtension(*track).get();` as it has unpredictable
 behavior.
 */
-class CaloExtensionBuilderAlg : public AthAlgorithm
+class CaloExtensionBuilderAlg : public AthReentrantAlgorithm
 {
 public:
-  using AthAlgorithm::AthAlgorithm;
-
+  using AthReentrantAlgorithm::AthReentrantAlgorithm;
   virtual StatusCode initialize() override final;
-  virtual StatusCode finalize() override final;
-  virtual StatusCode execute() override final
-  {
-    return execute_r(Algorithm::getContext());
-  }
-  // This will become the normal execute when
-  // inheriting from AthReentrantAlgorithm
-  StatusCode execute_r(const EventContext& ctx) const;
+  virtual StatusCode execute(const EventContext& ctx) const override final;
 
 private:
   /** @brief the Calo Extension tool*/
@@ -80,15 +66,6 @@ private:
     "Trk::CaloExtensionBuilderTool"
   };
 
-  /// Manages the track selection. It should be able to handle both pflow and
-  /// tau selections
-  ToolHandle<InDet::IInDetTrackSelectionTool> m_TrkSelection{
-    this,
-    "TrkSelection",
-    "TrkSelectionCaloExtensionBuilder",
-    "Tool that handles the track selection"
-  };
-
   /// output particle calo extension collection
   SG::WriteHandleKey<CaloExtensionCollection> m_ParticleCacheKey{
     this,
diff --git a/Reconstruction/eflowRec/eflowRec/PFEGamFlowElementAssoc.h b/Reconstruction/eflowRec/eflowRec/PFEGamFlowElementAssoc.h
new file mode 100644
index 0000000000000000000000000000000000000000..6c95a5121f2c0361962e2629dcd104612186bbbf
--- /dev/null
+++ b/Reconstruction/eflowRec/eflowRec/PFEGamFlowElementAssoc.h
@@ -0,0 +1,80 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+/*
+ * PFEGamFlowElementAssoc.h
+ * Header file for class PFEGamFlowElementAssoc
+ *                                                                                                                                                                                     
+ *  Created on: 13.03.19                                                                                                                                                            
+ *      Author: J. C. MacDonald & Upgraded by M.T. Anthony                                                                                                                                                      
+ */
+
+#ifndef PFEGAMFLOWELEMENTASSOC_H
+#define PFEGAMFLOWELEMENTASSOC_H
+
+#include "AthenaBaseComps/AthAlgorithm.h"
+#include "AthenaBaseComps/AthReentrantAlgorithm.h"
+#include "GaudiKernel/ToolHandle.h"
+#include "StoreGate/DataHandle.h"
+
+#include "xAODEgamma/ElectronContainer.h"
+#include "xAODEgamma/PhotonContainer.h"
+
+#include "StoreGate/WriteDecorHandle.h"
+#include "xAODPFlow/FlowElementContainer.h"
+/**                                                                                                                                                                                     
+This is the algorithm, which inherits from AthReentrantAlgorithm, that adds element links between particle flow objects (Flow Elements) and Egamma objects. The algorithm associates charged (c) Flow Elements to all electron and converted photon tracks, and neutral (n) Flow Elements to all electron and photon clusters. 
+
+This is done by adding decorations to the "Electron" and "Photon" container, for charged Charged Flow Elements and Neutral Flow Elements separately, in the form of vectors of element links to the associated Flow Elements. 
+The algorithm also adds decorations to the "JetETMissNeutralFlowElements" and 
+"JetETMissChargedParticleFlowElements" containers, in the form of vectors of element links to the associated electrons and photons.
+
+**/
+class PFEGamFlowElementAssoc : public AthReentrantAlgorithm {
+
+public:
+  using AthReentrantAlgorithm::AthReentrantAlgorithm;
+
+  PFEGamFlowElementAssoc(const std::string& name, ISvcLocator* pSvcLocator);
+  
+  virtual ~PFEGamFlowElementAssoc();
+
+  virtual StatusCode initialize();
+  virtual StatusCode execute(const EventContext & ctx) const;
+  virtual StatusCode finalize();
+  
+private:
+  //instantiate ReadHandle for the Photon/Electron
+  SG::ReadHandleKey<xAOD::ElectronContainer>m_electronReadHandleKey{this,"ElectronContainer","Electrons","ReadHandleKey for ElectronContainer"};
+
+  SG::ReadHandleKey<xAOD::PhotonContainer>m_photonReadHandleKey{this,"PhotonContainer","Photons","ReadHandleKey for PhotonContainer"};
+
+  //Readhandles for FlowElements.
+  SG::ReadHandleKey<xAOD::FlowElementContainer> m_neutralFEReadHandleKey{this,"JetEtMissNeutralFlowElementContainer","JetETMissNeutralFlowElements","ReadHandleKey for neutral FlowElements"};
+  
+  SG::ReadHandleKey<xAOD::FlowElementContainer> m_chargedFEReadHandleKey{this,"JetEtMissChargedFlowElementContainer","JetETMissChargedFlowElements","ReadHandleKey for charged FlowElements"};
+
+
+  /** The write key for adding Neutral Flow Element element link decorations to electrons */ 
+  SG::WriteDecorHandleKey<xAOD::ElectronContainer> m_electronNeutralFEWriteDecorKey;
+  /** The write key for adding Charged Flow Element element link decorations to electrons */
+  SG::WriteDecorHandleKey<xAOD::ElectronContainer> m_electronChargedFEWriteDecorKey;
+  /** The write key for adding electron element link decorations to Neutral Flow Elements */
+  SG::WriteDecorHandleKey<xAOD::FlowElementContainer> m_neutralFEElectronWriteDecorKey;
+  /** The write key for adding electron element link decorations to Charged Flow Elements */
+  SG::WriteDecorHandleKey<xAOD::FlowElementContainer> m_chargedFEElectronWriteDecorKey;
+
+  /** The write key for adding Neutral Flow Element element link decorations to photons */
+  SG::WriteDecorHandleKey<xAOD::PhotonContainer> m_photonNeutralFEWriteDecorKey;
+  /** The write key for adding Charged Flow Element element link decorations to photons */
+  SG::WriteDecorHandleKey<xAOD::PhotonContainer> m_photonChargedFEWriteDecorKey;
+  /** The write key for adding photon element link decorations to Neutral Flow Elements */
+  SG::WriteDecorHandleKey<xAOD::FlowElementContainer> m_neutralFEPhotonWriteDecorKey;
+  /** The write key for adding photon element link decorations to Charged Flow Elements */
+  SG::WriteDecorHandleKey<xAOD::FlowElementContainer> m_chargedFEPhotonWriteDecorKey;
+
+ 
+};
+
+#endif // PFEGamFlowElementAssoc
diff --git a/Reconstruction/eflowRec/eflowRec/eflowCellIntegrator.h b/Reconstruction/eflowRec/eflowRec/eflowCellIntegrator.h
index e302e6c8bdeff43e78fae42775c09602bca85ebc..9552c649688ca7ee6decd28e7373266ed1824184 100644
--- a/Reconstruction/eflowRec/eflowRec/eflowCellIntegrator.h
+++ b/Reconstruction/eflowRec/eflowRec/eflowCellIntegrator.h
@@ -40,7 +40,7 @@ public:
   virtual ~eflowRecursiveGaussLegendreIntegrator() { }
 
   virtual double integrate(const eflowRange& range) {
-    /* Try a 5th and 6th order Gauss–Legendre quadrature */
+    /* Try a 5th and 6th order Gauss-Legendre quadrature */
     double I5 = DoGaussLegendreIntegration(range, 5);
     double I6 = DoGaussLegendreIntegration(range, 6);
 
@@ -59,7 +59,7 @@ public:
 private:
 
   double DoGaussLegendreIntegration(const eflowRange& range, int nOrder){
-    /* Perform nth order Gauss–Legendre quadrature, see
+    /* Perform nth order Gauss-Legendre quadrature, see
      * http://en.wikipedia.org/wiki/Gaussian_quadrature#Gauss.E2.80.93Legendre_quadrature */
 
     /* Array offset for legendre weights/roots */
diff --git a/Reconstruction/eflowRec/eflowRec/eflowCellPosition.h b/Reconstruction/eflowRec/eflowRec/eflowCellPosition.h
index 3fc879d6c27235c627891fc7f684841167493d02..7a3d7cb2c8f2668b1996a2b30b28b1861c71663c 100644
--- a/Reconstruction/eflowRec/eflowRec/eflowCellPosition.h
+++ b/Reconstruction/eflowRec/eflowRec/eflowCellPosition.h
@@ -21,7 +21,7 @@ class CaloCell;
 class eflowAbstractCellList;
 
 /**
-This class stores the eta,phi and layer of the calorimeter cell and defines a “<” operator which can be used to order the eflowCellPosition based on eta,phi and layer. The < operator makes use of a stored pointer to the eflowAbstractCellList that the eflowCellPosition is in, in order to use eflowCellList::DR2 inside the < operator.
+This class stores the eta,phi and layer of the calorimeter cell and defines a "<" operator which can be used to order the eflowCellPosition based on eta,phi and layer. The < operator makes use of a stored pointer to the eflowAbstractCellList that the eflowCellPosition is in, in order to use eflowCellList::DR2 inside the < operator.
 
 So conceptually we can consider that a track has some list of associated calorimeter cells in the eflowCellList, where the information that we need for each cell is stored in the eflowCellPosition. A map is kept to link the eflowCellPosition back to the actual CaloCell.
 */
diff --git a/Reconstruction/eflowRec/share/PFlowMTConfig.py b/Reconstruction/eflowRec/share/PFlowMTConfig.py
index bf6780e54b77664f55577eb354d67adfb6119ea8..edd98bf0749f3fb7f105888d0a1d6d295059910e 100644
--- a/Reconstruction/eflowRec/share/PFlowMTConfig.py
+++ b/Reconstruction/eflowRec/share/PFlowMTConfig.py
@@ -13,7 +13,7 @@ TrackCaloExtensionTool=eflowTrackCaloExtensionTool(TrackCaloExtensionTool=pcExte
 
 #If reading from ESD we not create a cache of extrapolations to the calorimeter, so we should signify this by setting the cache key to a null string
 from RecExConfig.RecFlags import rec
-if True == rec.readESD:
+if rec.readESD==True:
    TrackCaloExtensionTool.PFParticleCache = ""
 
 PFTrackSelector.trackExtrapolatorTool = TrackCaloExtensionTool
@@ -243,15 +243,18 @@ if True == jobproperties.eflowRecFlags.provideShowerSubtractedClusters:
     PFONeutralCreatorAlgorithm.AddShowerSubtractedClusters = True
 
 topSequence += PFONeutralCreatorAlgorithm
+from eflowRec.eflowRecFlags import jobproperties # set reco flags for eFlowRec algorithms
+jobproperties.eflowRecFlags.usePFEGammaPFOAssoc.set_Value_and_Lock(True)
+jobproperties.eflowRecFlags.useFlowElements.set_Value_and_Lock(True)
 
 if jobproperties.eflowRecFlags.usePFEGammaPFOAssoc:
-
+   
    from eflowRec.eflowRecConf import PFEGammaPFOAssoc
    PFEGammaPFOAssoc=PFEGammaPFOAssoc("PFEGammaPFOAssoc")
    topSequence += PFEGammaPFOAssoc
 
 #Add new FlowElement creators
-if jobproperties.eflowRecFlags.useFlowElements:
+if jobproperties.eflowRecFlags.useFlowElements: 
   from eflowRec.eflowRecConf import PFChargedFlowElementCreatorAlgorithm
   PFChargedFlowElementCreatorAlgorithm = PFChargedFlowElementCreatorAlgorithm("PFChargedFlowElementCreatorAlgorithm")
   topSequence += PFChargedFlowElementCreatorAlgorithm 
@@ -263,3 +266,7 @@ if jobproperties.eflowRecFlags.useFlowElements:
   from eflowRec.eflowRecConf import PFLCNeutralFlowElementCreatorAlgorithm
   PFLCNeutralFlowElementCreatorAlgorithm = PFLCNeutralFlowElementCreatorAlgorithm("PFLCNeutralFlowElementCreatorAlgorithm")
   topSequence += PFLCNeutralFlowElementCreatorAlgorithm 
+
+  from eflowRec.eflowRecConf import PFEGamFlowElementAssoc
+  PFEGamFlowElementAssoc=PFEGamFlowElementAssoc("PFEGamFlowElementAssoc")
+  topSequence +=PFEGamFlowElementAssoc
diff --git a/Reconstruction/eflowRec/src/PFEGamFlowElementAssoc.cxx b/Reconstruction/eflowRec/src/PFEGamFlowElementAssoc.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..d4f91632eb5f3e910fca2718e6633abf892e9050
--- /dev/null
+++ b/Reconstruction/eflowRec/src/PFEGamFlowElementAssoc.cxx
@@ -0,0 +1,258 @@
+/*  
+ Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "StoreGate/WriteDecorHandle.h" 
+// Flow Element EDM
+#include "xAODPFlow/FlowElementContainer.h"
+#include "xAODPFlow/FlowElement.h"
+#include "xAODEgamma/ElectronContainer.h" 
+#include "xAODEgamma/PhotonContainer.h"
+#include "xAODEgamma/Electron.h" 
+#include "xAODEgamma/Photon.h"
+#include "xAODEgamma/ElectronxAODHelpers.h"
+#include "xAODEgamma/EgammaxAODHelpers.h" 
+
+
+#include "eflowRec/PFEGamFlowElementAssoc.h" 
+
+
+typedef ElementLink<xAOD::ElectronContainer> ElectronLink_t; 
+typedef ElementLink<xAOD::PhotonContainer> PhotonLink_t;
+typedef ElementLink<xAOD::FlowElementContainer> FlowElementLink_t; 
+
+PFEGamFlowElementAssoc::PFEGamFlowElementAssoc(
+const std::string& name,
+  ISvcLocator* pSvcLocator
+  ):
+  AthReentrantAlgorithm(name,pSvcLocator)
+{
+// Class initializer 
+declareProperty ("ElectronNeutralFEDecorKey", m_electronNeutralFEWriteDecorKey = "Electrons.neutralFELinks");   
+declareProperty ("ElectronChargedFEDecorKey", m_electronChargedFEWriteDecorKey = "Electrons.chargedFELinks");   
+
+declareProperty ("NeutralFEElectronDecorKey", m_neutralFEElectronWriteDecorKey = "JetETMissNeutralFlowElements.FE_ElectronLinks");   
+
+declareProperty ("ChargedFEElectronDecorKey", m_chargedFEElectronWriteDecorKey = "JetETMissChargedFlowElements.FE_ElectronLinks"); 
+
+declareProperty ("PhotonNeutralFEDecorKey", m_photonNeutralFEWriteDecorKey = "Photons.neutralFELinks");
+declareProperty ("PhotonChargedFEDecorKey", m_photonChargedFEWriteDecorKey = "Photons.chargedFELinks");
+declareProperty ("NeutralFEPhotonDecorKey", m_neutralFEPhotonWriteDecorKey = "JetETMissNeutralFlowElements.FE_PhotonLinks");
+declareProperty ("ChargedFEPhotonDecorKey", m_chargedFEPhotonWriteDecorKey = "JetETMissChargedFlowElements.FE_PhotonLinks");
+}
+
+// Class destructor 
+PFEGamFlowElementAssoc::~PFEGamFlowElementAssoc(){}
+
+StatusCode PFEGamFlowElementAssoc::initialize()
+{
+
+  ATH_MSG_DEBUG("Initializing "<<name() << "...");
+ ATH_CHECK(m_electronNeutralFEWriteDecorKey.initialize());   
+ ATH_CHECK(m_electronChargedFEWriteDecorKey.initialize());   
+ ATH_CHECK(m_neutralFEElectronWriteDecorKey.initialize());   
+ ATH_CHECK(m_chargedFEElectronWriteDecorKey.initialize());  
+
+ ATH_CHECK(m_photonNeutralFEWriteDecorKey.initialize());
+ ATH_CHECK(m_photonChargedFEWriteDecorKey.initialize());
+ ATH_CHECK(m_neutralFEPhotonWriteDecorKey.initialize());
+ ATH_CHECK(m_chargedFEPhotonWriteDecorKey.initialize());
+
+ //Init ReadHandleKeys
+ ATH_CHECK(m_photonReadHandleKey.initialize());
+ ATH_CHECK(m_electronReadHandleKey.initialize());
+ ATH_CHECK(m_chargedFEReadHandleKey.initialize());
+ ATH_CHECK(m_neutralFEReadHandleKey.initialize());
+
+ ATH_MSG_DEBUG("Initialization completed successfully");   
+
+return StatusCode::SUCCESS;
+}
+
+StatusCode PFEGamFlowElementAssoc::finalize(){
+return StatusCode::SUCCESS;
+}
+/**
+   This algorithm does the following:
+   1) Read the Input containers for Flow Elements, Electrons and Photons
+   2) Match the Clusters in the flow elements to the relevant E/Photon clusters (Neutral) or match tracks to relevant Electron/Photon tracks (Charged)
+   3) Link them
+   4) output the Electron/Photon containers with the linkers to the Flow element containers 
+**/
+StatusCode PFEGamFlowElementAssoc::execute(const EventContext &ctx) const
+{
+  // write decoration handles for the electron, photon and FE containers -- these are the OUTPUT handles
+  //Electron Write Handle
+  SG::WriteDecorHandle<xAOD::ElectronContainer, std::vector<FlowElementLink_t> > electronNeutralFEWriteDecorHandle (m_electronNeutralFEWriteDecorKey,ctx);   
+  SG::WriteDecorHandle<xAOD::ElectronContainer, std::vector<FlowElementLink_t> > electronChargedFEWriteDecorHandle (m_electronChargedFEWriteDecorKey,ctx);   
+  SG::WriteDecorHandle<xAOD::FlowElementContainer, std::vector<ElectronLink_t> > neutralFEElectronWriteDecorHandle (m_neutralFEElectronWriteDecorKey,ctx);   
+  SG::WriteDecorHandle<xAOD::FlowElementContainer, std::vector<ElectronLink_t> > chargedFEElectronWriteDecorHandle (m_chargedFEElectronWriteDecorKey,ctx); 
+
+  //Photon Write Handle
+  SG::WriteDecorHandle<xAOD::PhotonContainer, std::vector<FlowElementLink_t> > photonNeutralFEWriteDecorHandle (m_photonNeutralFEWriteDecorKey,ctx);
+  SG::WriteDecorHandle<xAOD::PhotonContainer, std::vector<FlowElementLink_t> > photonChargedFEWriteDecorHandle (m_photonChargedFEWriteDecorKey,ctx);
+  SG::WriteDecorHandle<xAOD::FlowElementContainer, std::vector<PhotonLink_t> > neutralFEPhotonWriteDecorHandle (m_neutralFEPhotonWriteDecorKey,ctx);
+  SG::WriteDecorHandle<xAOD::FlowElementContainer, std::vector<PhotonLink_t> > chargedFEPhotonWriteDecorHandle (m_chargedFEPhotonWriteDecorKey,ctx);  
+  
+  
+  // This is the READ handles (so the input containers for electron, photon, FE)
+  
+  SG::ReadHandle<xAOD::ElectronContainer>electronReadHandle (m_electronReadHandleKey,ctx);
+  SG::ReadHandle<xAOD::PhotonContainer> photonReadHandle (m_photonReadHandleKey,ctx);
+  
+  // Charged and Neutral PFlow "Flow elements"
+  SG::ReadHandle<xAOD::FlowElementContainer> neutralFEReadHandle (m_neutralFEReadHandleKey,ctx);   
+  SG::ReadHandle<xAOD::FlowElementContainer> chargedFEReadHandle (m_chargedFEReadHandleKey,ctx);   
+  
+  // now initialise some Flow element link containers
+  std::vector<std::vector<FlowElementLink_t>> electronNeutralFEVec(electronReadHandle->size());
+  std::vector<std::vector<FlowElementLink_t>> electronChargedFEVec(electronReadHandle->size());
+  
+  std::vector<std::vector<FlowElementLink_t>> photonNeutralFEVec(photonReadHandle->size());
+  std::vector<std::vector<FlowElementLink_t>> photonChargedFEVec(photonReadHandle->size());
+  //////////////////////////////////////////////////////////////////////////
+  ////                      DO MATCHING/LINKING
+  //////////////////////////////////////////////////////////////////////////
+  
+
+  ///////////////////////////
+  // Loop over neutral flow elements (FEs)
+  ///////////////////////////
+  for (const xAOD::FlowElement* FE: *neutralFEElectronWriteDecorHandle){
+    //Obtain the index of the FE calo-cluster
+    size_t FEClusterIndex=FE->otherObjects().at(0)->index();
+
+    // init the linkers
+    std::vector<ElectronLink_t> FEElectronLinks;
+    std::vector<PhotonLink_t> FEPhotonLinks;
+    
+    //Loop over electrons:
+    for (const xAOD::Electron* electron: *electronNeutralFEWriteDecorHandle){
+      // get the calo clusters from the electron
+
+      const std::vector<const xAOD::CaloCluster*> electronTopoClusters = xAOD::EgammaHelpers::getAssociatedTopoClusters(electron->caloCluster());
+	
+      
+      for(const xAOD::CaloCluster* cluster : electronTopoClusters){
+	// obtain the index of the electron seed topocluster
+	size_t electronClusterIndex=cluster->index();	
+	//match the indices: Cluster match between Flow Element (FE) and electron
+	if(electronClusterIndex==FEClusterIndex){
+	  FEElectronLinks.push_back( ElectronLink_t(*electronReadHandle,electron->index()) );
+	  //Add Flow Element (FE) link to a vector
+	  //index() is the unique index of the Flow Element in the container
+	  electronNeutralFEVec.at(electron->index()).push_back(FlowElementLink_t(*neutralFEReadHandle, FE->index()) );
+	}// end of matching block
+
+      } // end loop over cluster
+      
+    } // end Electron loop
+
+    // now loop over photons
+    for (const xAOD::Photon* photon: *photonNeutralFEWriteDecorHandle){
+      // retrieve clusters from the photon container
+      const std::vector<const xAOD::CaloCluster*> photonTopoClusters = xAOD::EgammaHelpers::getAssociatedTopoClusters(photon->caloCluster());
+      //loop over clusters, and do the matching
+      for (const xAOD::CaloCluster* cluster: photonTopoClusters){
+	//retrieve index of the cluster
+	size_t photonClusterIndex=cluster->index();
+	//do the matching
+	if(photonClusterIndex==FEClusterIndex){
+	  // Add flow element (FE) links to photon
+	  FEPhotonLinks.push_back( PhotonLink_t(*photonReadHandle,photon->index()) );
+	  //Add Flow Element (FE) link to a vector
+	  //index() is the unique index of the Flow Element in the container
+	  photonNeutralFEVec.at(photon->index()).push_back(FlowElementLink_t(*neutralFEReadHandle, FE->index()) );	  
+	}// end of matching block
+      } // end of neutral loop
+      
+
+    }// end of photon loop
+    
+    //Add vector of electron element links as decoration to FlowElement container
+    neutralFEElectronWriteDecorHandle (*FE)=FEElectronLinks;
+    neutralFEPhotonWriteDecorHandle (*FE)=FEPhotonLinks;
+
+  } // end neutral FE loop
+
+  ////////////////////////////////////////////////////////
+  //             Loop over charged Flow Elements (FEs)
+  ////////////////////////////////////////////////////////
+  for (const xAOD::FlowElement* FE: *chargedFEElectronWriteDecorHandle){
+    // retrieve the track from the Flow element
+    size_t FETrackIndex=FE->chargedObjects().at(0)->index();
+    // Initialise a vector of element links to electrons/Photons
+    std::vector<ElectronLink_t> FEElectronLinks;
+    std::vector<PhotonLink_t> FEPhotonLinks;
+
+    //loop over electrons
+    for (const xAOD::Electron* electron: *electronChargedFEWriteDecorHandle){
+      //obtain the clusters
+       const std::vector<const xAOD::TrackParticle*> electronTrackParticles = xAOD::EgammaHelpers::getTrackParticlesVec(electron, true, true); // useBremAssoc = true (get original non-GSF track), allParticles = true (include all track particles)
+       // loop over tracks
+       for (const xAOD::TrackParticle* electronTrack: electronTrackParticles){
+	 size_t electronTrackIndex = electronTrack->index();
+
+	 //link to FE if track indices match
+	 if(electronTrackIndex==FETrackIndex){
+	   // Add electron element link to a vector 
+	   // index() is the unique index of the electron in the electron container 
+	   FEElectronLinks.push_back( ElectronLink_t(*electronReadHandle, electron->index()) );
+	   // Add FE element link to a vector 
+	   // index() is the unique index of the cFE in the cFE container 
+	   electronChargedFEVec.at(electron->index()).push_back( FlowElementLink_t(*chargedFEReadHandle, FE->index()) );  
+
+	 }//end of matching block
+	 
+       }//end of loop on clusters
+    } // end of loop on electrons
+    
+    for(const xAOD::Photon* photon: *photonChargedFEWriteDecorHandle){
+      //obtain indices of the converted photon's original tracks
+      const std::set<const xAOD::TrackParticle*> photonTrackParticles = xAOD::EgammaHelpers::getTrackParticles(photon, true);
+      // loop over the tracks
+      for (const xAOD::TrackParticle* photonTrack: photonTrackParticles){
+	size_t photonTrackIndex=photonTrack->index();
+	
+	// Link the photon to the Flow Element (FE) if the track indices match
+	if (photonTrackIndex==FETrackIndex){
+	            // Add photon element link to a vector
+          // index() is the unique index of the photon in the photon container
+          FEPhotonLinks.push_back( PhotonLink_t(*photonReadHandle, photon->index()) );
+          // Add FE element link to a vector
+          // index() is the unique index of the cFE in the cFE container
+          photonChargedFEVec.at(photon->index()).push_back( FlowElementLink_t(*chargedFEReadHandle, FE->index()) );
+	}// end of matching block
+
+      }// end of loop on tracks
+      
+    }//end of loop on photons
+
+
+    // Add vector of electron element links as decoration to FE container     
+    chargedFEElectronWriteDecorHandle (*FE) = FEElectronLinks;  
+    // Add vector of photon element links as decoration to FE container
+    chargedFEPhotonWriteDecorHandle (*FE) = FEPhotonLinks;
+
+  } // end of charged FE loop
+  
+
+
+  ////////////////////////////////////////////////////
+  //   WRITE OUTPUT: ADD HANDLES TO EL/PHOT CONTAINERS
+  ////////////////////////////////////////////////////
+  // Add the vectors of the Flow Element (FE) Links as decorations to the electron container
+  for (const xAOD::Electron* electron : *electronNeutralFEWriteDecorHandle){
+    electronNeutralFEWriteDecorHandle (*electron) = electronNeutralFEVec.at(electron->index());
+    electronChargedFEWriteDecorHandle (*electron) = electronChargedFEVec.at(electron->index());
+  } //end of photon loop
+  // Add the vectors of the Flow Element (FE) Links as decorations to the photon container
+  for (const xAOD::Photon* photon: *photonNeutralFEWriteDecorHandle){
+    photonNeutralFEWriteDecorHandle (*photon) = photonNeutralFEVec.at(photon->index());
+    photonChargedFEWriteDecorHandle (*photon) = photonChargedFEVec.at(photon->index());
+  } // end of loop on photons
+
+  ATH_MSG_DEBUG("Execute completed successfully");
+
+  return StatusCode::SUCCESS;
+}
diff --git a/Reconstruction/eflowRec/src/components/eflowRec_entries.cxx b/Reconstruction/eflowRec/src/components/eflowRec_entries.cxx
index 3667e06ebd952faaeb247cbb3c36ba60d78f67af..f0ad355de1ce65f121457a6512f8facc179252d7 100644
--- a/Reconstruction/eflowRec/src/components/eflowRec_entries.cxx
+++ b/Reconstruction/eflowRec/src/components/eflowRec_entries.cxx
@@ -20,6 +20,7 @@
 #include "eflowRec/PFOChargedCreatorAlgorithm.h"
 #include "eflowRec/PFONeutralCreatorAlgorithm.h"
 #include "eflowRec/PFEGammaPFOAssoc.h"
+#include "eflowRec/PFEGamFlowElementAssoc.h"
 
 DECLARE_COMPONENT( eflowOverlapRemoval )
 DECLARE_COMPONENT( PFLeptonSelector )
@@ -43,3 +44,4 @@ DECLARE_COMPONENT( PFTrackClusterMatchingTool )
 DECLARE_COMPONENT( eflowCellEOverPTool_mc12_JetETMiss)
 DECLARE_COMPONENT(  eflowCellEOverPTool_mc12_HLLHC)
 DECLARE_COMPONENT( eflowCellEOverPTool_mc12_LC)
+DECLARE_COMPONENT( PFEGamFlowElementAssoc )
diff --git a/Reconstruction/egamma/egammaAlgs/src/EMBremCollectionBuilder.cxx b/Reconstruction/egamma/egammaAlgs/src/EMBremCollectionBuilder.cxx
index 969e7ee50f97c250df82079f369467d3057394bb..fedb6bc04bac98e87824543b9e7d805598c396f1 100644
--- a/Reconstruction/egamma/egammaAlgs/src/EMBremCollectionBuilder.cxx
+++ b/Reconstruction/egamma/egammaAlgs/src/EMBremCollectionBuilder.cxx
@@ -43,7 +43,7 @@ StatusCode EMBremCollectionBuilder::initialize() {
   ATH_CHECK(m_OutputTrkPartContainerKey.initialize());
   ATH_CHECK(m_OutputTrackContainerKey.initialize());
   ATH_CHECK(m_TruthParticlesLinkKey.initialize(m_doTruth));
-  
+
   /* retrieve the track refitter tool*/
   ATH_CHECK(m_trkRefitTool.retrieve());
   /* Get the particle creation tool */
@@ -52,12 +52,12 @@ StatusCode EMBremCollectionBuilder::initialize() {
   ATH_CHECK(m_slimTool.retrieve());
   /* Get the track summary tool */
   ATH_CHECK(m_summaryTool.retrieve());
-  
+
   return StatusCode::SUCCESS;
-}  
+}
+
+StatusCode EMBremCollectionBuilder::EMBremCollectionBuilder::finalize(){
 
-StatusCode EMBremCollectionBuilder::EMBremCollectionBuilder::finalize(){ 
-  
   ATH_MSG_INFO ("Not refitted due to Silicon Requirements " << m_FailedSiliconRequirFit);
   ATH_MSG_INFO ("Failed Fit Tracks " << m_FailedFitTracks);
   ATH_MSG_INFO ("RefittedTracks " << m_RefittedTracks);
@@ -99,62 +99,62 @@ EMBremCollectionBuilder::execute_r(const EventContext& ctx) const
   SG::WriteHandle<TrackCollection> finalTracks(m_OutputTrackContainerKey, ctx);
   ATH_CHECK(finalTracks.record(std::make_unique<TrackCollection>()));
   TrackCollection* cPtrTracks = finalTracks.ptr();
-  /* 
+  /*
    * Split TRT-alone from silicon ones
    * For the TRT we can get all the info already
    */
   std::vector<const xAOD::TrackParticle*> siliconTrkTracks;
-  siliconTrkTracks.reserve(16); 
+  siliconTrkTracks.reserve(16);
   std::vector<TrackWithIndex> trtAloneTrkTracks;
-  trtAloneTrkTracks.reserve(16); 
+  trtAloneTrkTracks.reserve(16);
   for(const xAOD::TrackParticle* track : *selectedTracks){
     const Trk::Track* trktrack{nullptr};
-    if (  track->trackLink().isValid() ){ 
+    if (  track->trackLink().isValid() ){
       trktrack =track->track();
     }
     else{
       ATH_MSG_ERROR("TrackParticle has not Track --  are you running on AOD?");
       return StatusCode::FAILURE;
     }
-    int nSiliconHits_trk =0; 
-    uint8_t dummy(0); 
+    int nSiliconHits_trk =0;
+    uint8_t dummy(0);
     if( track->summaryValue(dummy,xAOD::numberOfSCTHits) ){
       nSiliconHits_trk += dummy;
     }
     if(track->summaryValue(dummy,xAOD::numberOfPixelHits) ){
       nSiliconHits_trk += dummy;
     }
-    ATH_MSG_DEBUG("Number of Silicon hits "<<nSiliconHits_trk);    
+    ATH_MSG_DEBUG("Number of Silicon hits "<<nSiliconHits_trk);
 
     if(nSiliconHits_trk >= m_MinNoSiHits){
-      siliconTrkTracks.push_back(track); 
+      siliconTrkTracks.push_back(track);
     }else{
       //copy Trk::Track and keep also the index of the original
       trtAloneTrkTracks.emplace_back(
         std::make_unique<Trk::Track>(*trktrack),track->index());
     }
   }
-  /* 
+  /*
    * Refitted  and possible failed fit info
    */
-  std::vector<TrackWithIndex> refitted; 
-  refitted.reserve(siliconTrkTracks.size());    
-  std::vector<TrackWithIndex> failedfit; 
+  std::vector<TrackWithIndex> refitted;
+  refitted.reserve(siliconTrkTracks.size());
+  std::vector<TrackWithIndex> failedfit;
   /*
    * Do the refit and get all the info
    */
-  ATH_CHECK(refitTracks(ctx,siliconTrkTracks,refitted,failedfit)); 
+  ATH_CHECK(refitTracks(ctx,siliconTrkTracks,refitted,failedfit));
   siliconTrkTracks.clear();
   /*
    * Fill the final collections
    */
   ATH_CHECK(createCollections(refitted,failedfit,trtAloneTrkTracks,
                     cPtrTracks,cPtrTrkPart,trackTES.ptr()));
-   /* 
+   /*
    * update counters
    * */
   m_RefittedTracks.fetch_add(refitted.size(), std::memory_order_relaxed);
-  m_FailedFitTracks.fetch_add(failedfit.size(), std::memory_order_relaxed); 
+  m_FailedFitTracks.fetch_add(failedfit.size(), std::memory_order_relaxed);
   m_FailedSiliconRequirFit.fetch_add(trtAloneTrkTracks.size(),std::memory_order_relaxed);
   return StatusCode::SUCCESS;
 }
@@ -169,7 +169,7 @@ EMBremCollectionBuilder::refitTracks(
   for (const xAOD::TrackParticle* in:input){
     const Trk::Track* track =in->track();
     IegammaTrkRefitterTool::Cache cache{};
-    StatusCode status = m_trkRefitTool->refitTrack(ctx,                                                   
+    StatusCode status = m_trkRefitTool->refitTrack(ctx,
                                                    track,
                                                    cache);
     if (status == StatusCode::SUCCESS){
@@ -177,7 +177,7 @@ EMBremCollectionBuilder::refitTracks(
       //this is new track
       refitted.emplace_back(
         std::move(cache.refittedTrack),in->index()
-        ); 
+        );
     }
     else{
       ATH_MSG_DEBUG("FIT FAILED ");
@@ -185,7 +185,7 @@ EMBremCollectionBuilder::refitTracks(
       failedfit.emplace_back(
         std::make_unique<Trk::Track>(*track),in->index()
         );
-    }    
+    }
   }
   return StatusCode::SUCCESS;
 }
@@ -210,11 +210,11 @@ EMBremCollectionBuilder::createCollections(
   for (auto& Info : refitted){
     ATH_CHECK(createNew(Info,finalTracks,finalTrkPartContainer,AllTracks));
   }
-                                                               
+
   for (auto& Info  :  failedfit){
     ATH_CHECK(createNew(Info,finalTracks,finalTrkPartContainer,AllTracks));
   }
-                                                                
+
   for (auto& Info : trtAlone){
     ATH_CHECK(createNew(Info,finalTracks,finalTrkPartContainer,AllTracks));
   }
@@ -299,7 +299,7 @@ EMBremCollectionBuilder::createNew(
   m_slimTool->slimTrack(*(Info.track));
   finalTracks->push_back(std::move(Info.track));
   ElementLink<TrackCollection> trackLink(*finalTracks,finalTracks->size()-1);
-  aParticle->setTrackLink( trackLink );     
+  aParticle->setTrackLink( trackLink );
   return StatusCode::SUCCESS;
 }
 
@@ -310,19 +310,19 @@ EMBremCollectionBuilder::updateGSFTrack(
 {
 
   //update the summary of the non-const track without hole search
-  m_summaryTool->updateRefittedTrack(*(Info.track));
+  m_summaryTool->updateTrackSummary(*(Info.track));
   //Get the summary so as to add info to it
   Trk::TrackSummary* summary = Info.track->trackSummary();
 
   size_t origIndex = Info.origIndex;
   const xAOD::TrackParticle* original = AllTracks->at(origIndex);
-  
+
   uint8_t dummy(0);
   if (m_doPix) {
     //copy over dead sensors
     uint8_t deadPixel= original->summaryValue(dummy,xAOD::numberOfPixelDeadSensors)?dummy:0;
     summary->update(Trk::numberOfPixelDeadSensors,deadPixel);
-    
+
     int nPixHitsRefitted = summary->get(Trk::numberOfPixelHits);
     int nPixOutliersRefitted = summary->get(Trk::numberOfPixelOutliers);
     int nPixHitsOriginal = original->summaryValue(dummy,xAOD::numberOfPixelHits) ? dummy:-1;
@@ -336,10 +336,10 @@ EMBremCollectionBuilder::updateGSFTrack(
   }
   if (m_doSCT) {
     uint8_t deadSCT= original->summaryValue(dummy,xAOD::numberOfSCTDeadSensors)?dummy:0;
-    summary->update(Trk::numberOfSCTDeadSensors,deadSCT); 
+    summary->update(Trk::numberOfSCTDeadSensors,deadSCT);
 
     uint8_t SCTDoubleHoles = original->summaryValue(dummy,xAOD::numberOfSCTDoubleHoles )?dummy:0;
-    summary->update(Trk::numberOfSCTDoubleHoles , SCTDoubleHoles); 
+    summary->update(Trk::numberOfSCTDoubleHoles , SCTDoubleHoles);
 
     int nSCTHitsRefitted = summary->get(Trk::numberOfSCTHits);
     int nSCTOutliersRefitted = summary->get(Trk::numberOfSCTOutliers);
diff --git a/Reconstruction/egamma/egammaAlgs/src/egammaSuperClusterBuilder.cxx b/Reconstruction/egamma/egammaAlgs/src/egammaSuperClusterBuilder.cxx
index d38f58395d3635177a5692db0e59d6fb627621f1..91446362a14bc827aa66c94b10467f006278cdcf 100644
--- a/Reconstruction/egamma/egammaAlgs/src/egammaSuperClusterBuilder.cxx
+++ b/Reconstruction/egamma/egammaAlgs/src/egammaSuperClusterBuilder.cxx
@@ -106,7 +106,7 @@ etaphi_range(const CaloDetDescrManager& dd_man,
 // Constructor.
 egammaSuperClusterBuilder::egammaSuperClusterBuilder(const std::string& name,
                                                      ISvcLocator* pSvcLocator)
-  : AthAlgorithm(name, pSvcLocator)
+  : AthReentrantAlgorithm(name, pSvcLocator)
 {
 
   m_searchWindowPhiBarrel = m_searchWindowPhiCellsBarrel * s_cellPhiSize * 0.5;
diff --git a/Reconstruction/egamma/egammaAlgs/src/egammaSuperClusterBuilder.h b/Reconstruction/egamma/egammaAlgs/src/egammaSuperClusterBuilder.h
index 87de0d6277ca7391252240d7673698524e3f0542..f925bbd605fd6017a2213de211df63c6e0d09294 100644
--- a/Reconstruction/egamma/egammaAlgs/src/egammaSuperClusterBuilder.h
+++ b/Reconstruction/egamma/egammaAlgs/src/egammaSuperClusterBuilder.h
@@ -6,7 +6,7 @@
 #define EGAMMAALGS_EGAMMASUPERCLUSTERBUILDER_H
 
 // INCLUDE HEADER FILES:
-#include "AthenaBaseComps/AthAlgorithm.h"
+#include "AthenaBaseComps/AthReentrantAlgorithm.h"
 #include "GaudiKernel/EventContext.h"
 #include "GaudiKernel/SystemOfUnits.h"
 #include "GaudiKernel/ToolHandle.h"
@@ -29,7 +29,7 @@ class CaloDetDescrManager;
  *  The inheritance should be private. This class should never be instantiated
  *  by itself, and hence has no interface class
  **/
-class egammaSuperClusterBuilder : public AthAlgorithm
+class egammaSuperClusterBuilder : public AthReentrantAlgorithm
 {
 
 protected:
diff --git a/Reconstruction/egamma/egammaAlgs/src/electronSuperClusterBuilder.cxx b/Reconstruction/egamma/egammaAlgs/src/electronSuperClusterBuilder.cxx
index 2297cf933cc7d71a1d3d36f717c0047000e5d13d..2da7b8a630ad8a747013800c1653f12adf59c85b 100644
--- a/Reconstruction/egamma/egammaAlgs/src/electronSuperClusterBuilder.cxx
+++ b/Reconstruction/egamma/egammaAlgs/src/electronSuperClusterBuilder.cxx
@@ -55,7 +55,7 @@ electronSuperClusterBuilder::finalize()
 }
 
 StatusCode
-electronSuperClusterBuilder::execute_r(const EventContext& ctx) const
+electronSuperClusterBuilder::execute(const EventContext& ctx) const
 {
 
   SG::ReadHandle<EgammaRecContainer> egammaRecs(m_inputEgammaRecContainerKey, ctx);
diff --git a/Reconstruction/egamma/egammaAlgs/src/electronSuperClusterBuilder.h b/Reconstruction/egamma/egammaAlgs/src/electronSuperClusterBuilder.h
index cc4b46c976179ec0fb55e92eabd730dd9cab0a79..6458fd3d190617f25cec565e5a4e6ab281fc83eb 100644
--- a/Reconstruction/egamma/egammaAlgs/src/electronSuperClusterBuilder.h
+++ b/Reconstruction/egamma/egammaAlgs/src/electronSuperClusterBuilder.h
@@ -29,13 +29,7 @@ public:
   // Tool standard routines.
   virtual StatusCode initialize() override final;
   virtual StatusCode finalize() override final;
-  virtual StatusCode execute() override final
-  {
-    return execute_r(Algorithm::getContext());
-  }
-  // This will become the normal execute when
-  // inheriting from AthReentrantAlgorithm
-  StatusCode execute_r(const EventContext& ctx) const;
+  StatusCode execute(const EventContext& ctx) const override final;
 
 private:
   bool matchSameTrack(const xAOD::TrackParticle& seedTrack,
diff --git a/Reconstruction/egamma/egammaAlgs/src/photonSuperClusterBuilder.cxx b/Reconstruction/egamma/egammaAlgs/src/photonSuperClusterBuilder.cxx
index ae573e4b9019100c733812e45e775ea37a7657bd..0342ef800e5a6e3a7f2030ca9aa995c01b0976f9 100644
--- a/Reconstruction/egamma/egammaAlgs/src/photonSuperClusterBuilder.cxx
+++ b/Reconstruction/egamma/egammaAlgs/src/photonSuperClusterBuilder.cxx
@@ -58,7 +58,7 @@ photonSuperClusterBuilder::finalize()
 }
 
 StatusCode
-photonSuperClusterBuilder::execute_r(const EventContext& ctx) const
+photonSuperClusterBuilder::execute(const EventContext& ctx) const
 {
 
   // Retrieve input egammaRec container.
diff --git a/Reconstruction/egamma/egammaAlgs/src/photonSuperClusterBuilder.h b/Reconstruction/egamma/egammaAlgs/src/photonSuperClusterBuilder.h
index b5408a0c199e5375640ba1b2e39b13fba9fc506d..038869eeb6e785598ab3392e50bc89cb76d2d7e9 100644
--- a/Reconstruction/egamma/egammaAlgs/src/photonSuperClusterBuilder.h
+++ b/Reconstruction/egamma/egammaAlgs/src/photonSuperClusterBuilder.h
@@ -28,13 +28,7 @@ public:
   // Tool standard routines.
   virtual StatusCode initialize() override final;
   virtual StatusCode finalize() override final;
-  virtual StatusCode execute() override final
-  {
-    return execute_r(Algorithm::getContext());
-  }
-  // This will become the normal execute when
-  // inheriting from AthReentrantAlgorithm
-  StatusCode execute_r(const EventContext& ctx) const;
+  virtual StatusCode execute(const EventContext& ctx) const override final;
 
 private:
   /** Return extra clusters that can be added to make supercluster */
diff --git a/Reconstruction/egamma/egammaEvent/egammaEvent/EMShower.h b/Reconstruction/egamma/egammaEvent/egammaEvent/EMShower.h
index 43633463ab33026d902201777669dcc6f4851c05..aa1e885f7fba2f86cde91e5acb9ab1a65d5740a8 100755
--- a/Reconstruction/egamma/egammaEvent/egammaEvent/EMShower.h
+++ b/Reconstruction/egamma/egammaEvent/egammaEvent/EMShower.h
@@ -91,7 +91,7 @@ class EMShower : public egDetail
   double  e2ts1() const;    
   /** @brief energy of the cell corresponding to second energy maximum in the first sampling*/
   double  e2tsts1() const;  
-  /** @brief shower shape in the shower core : [E(+/-3)-E(+/-1)]/E(+/-1), where E(+/-n) is the energy in ± n strips around the strip with highest energy*/
+  /** @brief shower shape in the shower core : [E(+/-3)-E(+/-1)]/E(+/-1), where E(+/-n) is the energy in +- n strips around the strip with highest energy*/
   double  fracs1() const;   
   /** @brief same as egammaParameters::weta1 but without corrections 
   on particle impact point inside the cell*/
@@ -116,7 +116,7 @@ class EMShower : public egDetail
   double  pos7() const; 
   /** @brief  barycentre in sampling 1 calculated in 3 strips*/
   double  barys1() const;   
-  /** @brief shower width is determined in a window detaxdphi = 0,0625 ×~0,2, corresponding typically to 20 strips in eta : wtot1=sqrt{sum Ei x ( i-imax)^2 / sum Ei}, where i is the strip number and imax the strip number of the first local maximum*/
+  /** @brief shower width is determined in a window detaxdphi = 0,0625 x~0,2, corresponding typically to 20 strips in eta : wtot1=sqrt{sum Ei x ( i-imax)^2 / sum Ei}, where i is the strip number and imax the strip number of the first local maximum*/
   double  wtots1() const;   
   /** @brief energy reconstructed in the strip with the minimal value between the first and second maximum*/
   double  emins1() const;   
diff --git a/Reconstruction/egamma/egammaEvent/egammaEvent/egammaParamDefs.h b/Reconstruction/egamma/egammaEvent/egammaEvent/egammaParamDefs.h
index bd50254c5cc96503fcf4a01f68685cdf20786dad..67411aabec6da3cf28ef6c1f92be69c0dd55215b 100755
--- a/Reconstruction/egamma/egammaEvent/egammaEvent/egammaParamDefs.h
+++ b/Reconstruction/egamma/egammaEvent/egammaEvent/egammaParamDefs.h
@@ -137,7 +137,7 @@ namespace egammaParameters {
     e2ts1 = 26,
     /** @brief energy of the cell corresponding to second energy maximum in the first sampling */
     e2tsts1 = 27,
-    /** @brief shower shape in the shower core : [E(+/-3)-E(+/-1)]/E(+/-1), where E(+/-n) is the energy in ± n strips around the strip with highest energy */
+    /** @brief shower shape in the shower core : [E(+/-3)-E(+/-1)]/E(+/-1), where E(+/-n) is the energy in +- n strips around the strip with highest energy */
     fracs1 = 28,
     /** @brief same as egammaParameters::weta1 but without corrections 
   on particle impact point inside the cell */
@@ -161,7 +161,7 @@ namespace egammaParameters {
     pos7 = 35,
     /** @brief  barycentre in sampling 1 calculated in 3 strips*/
     barys1 = 36,
-    /** @brief shower width is determined in a window detaxdphi = 0,0625 ×~0,2, corresponding typically to 20 strips in eta : wtot1=sqrt{sum Ei x ( i-imax)^2 / sum Ei}, where i is the strip number and imax the strip number of the first local maximum */
+    /** @brief shower width is determined in a window detaxdphi = 0,0625 ~0,2, corresponding typically to 20 strips in eta : wtot1=sqrt{sum Ei x ( i-imax)^2 / sum Ei}, where i is the strip number and imax the strip number of the first local maximum */
     wtots1 = 37,
     /** @brief energy reconstructed in the strip with the minimal value between the first and second maximum */
     emins1 = 38,
diff --git a/Reconstruction/egamma/egammaLayerRecalibTool/test/ut_egammaLayerRecalibrationTool.py b/Reconstruction/egamma/egammaLayerRecalibTool/test/ut_egammaLayerRecalibrationTool.py
index cff18c8b93f32d62e575df26f47131503b1287b8..b2d2079dd259a68e54cf5ef3d8723a551b97db49 100755
--- a/Reconstruction/egamma/egammaLayerRecalibTool/test/ut_egammaLayerRecalibrationTool.py
+++ b/Reconstruction/egamma/egammaLayerRecalibTool/test/ut_egammaLayerRecalibrationTool.py
@@ -1,12 +1,17 @@
 #! /usr/bin/env python
-
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+#
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+#
 
 import unittest
 import ROOT
 import itertools
-ROOT.PyConfig.IgnoreCommandLineOptions = True
+import sys
 
+# Do the xAOD environment setup before anything else. To avoid any unwanted
+# warning messages while opening xAOD files (for testing whether they can) be
+# opened...
+ROOT.xAOD.Init().ignore()
 
 def arange(xmin, xmax, delta):
     # just to don't inject dep from numpy
@@ -31,7 +36,9 @@ def xAOD_electron_generator(tree):
 class TestLayer(unittest.TestCase):
     def setUp(self):
         self.egammaLayerRecalibTool = ROOT.egammaLayerRecalibTool
-        self.output_file = ROOT.TFile("test_output.root", "recreate")
+        self.output_file = ROOT.TFile.Open("test_output.root", "recreate")
+        self.assertTrue( self.output_file != ROOT.nullptr )
+        ROOT.CP.CorrectionCode.enableFailure()
 
     def tearDown(self):
         self.output_file.Close()
@@ -83,7 +90,7 @@ class TestLayer(unittest.TestCase):
 
         inputs = self.example_inputs()
 
-        tool.scale_inputs(inputs)
+        self.assertTrue(tool.scale_inputs(inputs) == ROOT.CP.CorrectionCode.Ok)
         self.assertAlmostEqual(inputs.E0raw,
                                self.example_inputs().E0raw * (1 + 0.01), places=5)
         self.assertAlmostEqual(inputs.E1raw, self.example_inputs().E1raw)
@@ -95,7 +102,7 @@ class TestLayer(unittest.TestCase):
         tool.add_scale(modifier2, amounter2)
 
         inputs.eta = -0.03
-        tool.scale_inputs(inputs)
+        self.assertTrue(tool.scale_inputs(inputs) == ROOT.CP.CorrectionCode.Ok)
         self.assertAlmostEqual(inputs.E1raw,
                                self.example_inputs().E1raw, places=5)
         self.assertAlmostEqual(inputs.E0raw,
@@ -103,7 +110,7 @@ class TestLayer(unittest.TestCase):
 
         inputs = self.example_inputs()
         inputs.eta = 0.03
-        tool.scale_inputs(inputs)
+        self.assertTrue(tool.scale_inputs(inputs) == ROOT.CP.CorrectionCode.Ok)
         self.assertAlmostEqual(inputs.E1raw,
                                self.example_inputs().E1raw * (1. + 0.05), places=5)
         self.assertAlmostEqual(inputs.E0raw,
@@ -114,7 +121,7 @@ class TestLayer(unittest.TestCase):
         inputs = self.example_inputs()
         inputs.eta = 2.
 
-        tool.scale_inputs(inputs)
+        self.assertTrue(tool.scale_inputs(inputs) == ROOT.CP.CorrectionCode.Ok)
         self.assertAlmostEqual(inputs.E1raw,
                                self.example_inputs().E1raw * (1. + 0.01), places=5)
         self.assertAlmostEqual(inputs.E0raw,
@@ -122,7 +129,7 @@ class TestLayer(unittest.TestCase):
 
         inputs = self.example_inputs()
         inputs.eta = -2.
-        tool.scale_inputs(inputs)
+        self.assertTrue(tool.scale_inputs(inputs) == ROOT.CP.CorrectionCode.Ok)
         self.assertAlmostEqual(inputs.E1raw,
                                self.example_inputs().E1raw * (1. + 0.01), places=5)
         self.assertAlmostEqual(inputs.E0raw,
@@ -139,7 +146,7 @@ class TestLayer(unittest.TestCase):
             inputs.eta = i * 0.05 - 2.5
             bin = histo_ps_tot_error.FindBin(inputs.eta)
             amount = histo_ps_tot_error.GetBinContent(bin)
-            tool.scale_inputs(inputs)
+            self.assertTrue(tool.scale_inputs(inputs) == ROOT.CP.CorrectionCode.Ok)
             self.assertAlmostEqual(inputs.E0raw,
                                    self.example_inputs().E0raw / amount, places=5)
 
@@ -157,7 +164,7 @@ class TestLayer(unittest.TestCase):
         for i in range(100):
             inputs = self.example_inputs()
             inputs.eta = i * 0.05 - 2.5
-            tool.scale_inputs(inputs)
+            self.assertTrue(tool.scale_inputs(inputs) == ROOT.CP.CorrectionCode.Ok)
             self.assertAlmostEqual(inputs.E0raw, self.example_inputs().E0raw)
             self.assertAlmostEqual(inputs.E1raw, self.example_inputs().E1raw)
 
@@ -169,7 +176,7 @@ class TestLayer(unittest.TestCase):
             inputs = self.example_inputs()
             inputs.eta = eta
             inputs.RunNumber = 200803
-            tool.scale_inputs(inputs)
+            self.assertTrue(tool.scale_inputs(inputs) == ROOT.CP.CorrectionCode.Ok)
             self.assertAlmostEqual(inputs.E1raw, self.example_inputs().E1raw)
             self.assertAlmostEqual(inputs.E2raw, self.example_inputs().E2raw)
             self.assertAlmostEqual(inputs.eta, eta, 4)
@@ -179,7 +186,7 @@ class TestLayer(unittest.TestCase):
             inputs = self.example_inputs()
             inputs.eta = eta
             inputs.RunNumber = 212810
-            tool.scale_inputs(inputs)
+            self.assertTrue(tool.scale_inputs(inputs) == ROOT.CP.CorrectionCode.Ok)
             if eta > 1.5:
                 self.assertAlmostEqual(inputs.E0raw, self.example_inputs().E0raw)
 
@@ -192,7 +199,7 @@ class TestLayer(unittest.TestCase):
 
             alpha = 0.97 if (abs(inputs.eta) < 1.425) else 1
 
-            tool.scale_inputs(inputs)
+            self.assertTrue(tool.scale_inputs(inputs) == ROOT.CP.CorrectionCode.Ok)
 
             self.assertAlmostEqual(inputs.E0raw, self.example_inputs().E0raw, 5)
             self.assertAlmostEqual(inputs.E1raw, self.example_inputs().E1raw / alpha, 5)
@@ -200,7 +207,8 @@ class TestLayer(unittest.TestCase):
     def _test_layer1_2010_v5(self): # TODO: fix path
         tool = self.egammaLayerRecalibTool('layer1_2010_v5')
 
-        f = ROOT.TFile("$ROOTCOREDIR/data/egammaLayerRecalibTool/egammaLayerRecalibTunes.root")
+        f = ROOT.TFile.Open("$ROOTCOREDIR/data/egammaLayerRecalibTool/egammaLayerRecalibTunes.root", "READ")
+        self.assertTrue(f != ROOT.nullptr)
         histo = f.Get("hE1E2ave_2010")
         etas = [histo.GetBinCenter(i) for i in range(histo.GetNbinsX())]
 
@@ -221,7 +229,8 @@ class TestLayer(unittest.TestCase):
     def _oldtest_multi_modifier(self): # TODO: fix path
         tool = self.egammaLayerRecalibTool('layer1_2')
         tool.add_scale('ps_1')
-        f = ROOT.TFile("$ROOTCOREDIR/data/egammaLayerRecalibTool/EnergyRescalerData.root")
+        f = ROOT.TFile.Open("$ROOTCOREDIR/data/egammaLayerRecalibTool/EnergyRescalerData.root", "READ")
+        self.assertTrue(f != ROOT.nullptr)
         histo_ps_tot_error = f.Get("Scales/2011/alphaPSmod_b12Fit_errTot")
 
         for i in range(100):
@@ -233,49 +242,43 @@ class TestLayer(unittest.TestCase):
 
             alpha = 0.97 if (abs(inputs.eta) < 1.425) else 1.05
 
-            tool.scale_inputs(inputs)
+            self.assertTrue(tool.scale_inputs(inputs) == ROOT.CP.CorrectionCode.Ok)
             self.assertAlmostEqual(inputs.E0raw, self.example_inputs().E0raw / amount, places=5)
             self.assertAlmostEqual(inputs.E1raw, self.example_inputs().E1raw / alpha, 5)
 
 
 def is_file_readable(path):
-    f = ROOT.TFile.Open(path)
+    f = ROOT.TFile.Open(path, "READ")
     return bool(f)
 
 
-@unittest.skipIf(not is_file_readable('root://eosatlas.cern.ch//eos/atlas/user/t/turra/user.blenzi.4956574.EXT0._000001.AOD.pool.root'),
+filename = 'root://eosatlas.cern.ch//eos/atlas/user/t/turra/user.blenzi.4956574.EXT0._000001.AOD.pool.root'
+@unittest.skipIf(not is_file_readable(filename),
                  "input file not available")
 class TestLayerxAOD(unittest.TestCase):
-    @classmethod
-    def setUpClass(cls):
-        """ using a filename where the egamma.e() is already computed
-        v1 MVA calibration
-        """
-        filename = 'root://eosatlas.cern.ch//eos/atlas/user/t/turra/user.blenzi.4956574.EXT0._000001.AOD.pool.root'
-        if (not ROOT.xAOD.Init().isSuccess()):
-            print("Failed xAOD.Init()")
 
+    def setUp(self):
         treeName = "CollectionTree"
+        self.file = ROOT.TFile.Open(filename, "READ")
+        self.assertTrue(self.file != ROOT.nullptr)
+        self.tree = ROOT.xAOD.MakeTransientTree(self.file, treeName)
+        self.assertTrue(self.tree != ROOT.nullptr)
 
-        f = ROOT.TFile.Open(filename)
-        if not f:
-            print("file %s not found" % filename)
-        cls.tree = ROOT.xAOD.MakeTransientTree(f, treeName)
-
-    @classmethod
-    def tearDownClass(cls):
+    def tearDown(self):
         ROOT.xAOD.ClearTransientTrees()
+        self.file.Close()
 
     def test_decoration(self):
         tune = "2012_alt_with_layer2"
         tool = ROOT.egammaLayerRecalibTool(tune)
+        ROOT.CP.CorrectionCode.enableFailure()
 
         N = 200
         i = 0
         for el in itertools.islice(xAOD_electron_generator(self.tree), None, N):
             event_info = self.tree.EventInfo
 
-            self.assertTrue(tool.applyCorrection(el, event_info).code() == ROOT.CP.CorrectionCode.Ok)
+            self.assertTrue(tool.applyCorrection(el, event_info) == ROOT.CP.CorrectionCode.Ok)
 
             inputs = ROOT.StdCalibrationInputs()
             inputs.RunNumber = event_info.runNumber()
@@ -286,12 +289,12 @@ class TestLayerxAOD(unittest.TestCase):
             inputs.phi = el.caloCluster().phi()
             inputs.eta = el.caloCluster().eta()
 
-            tool.scale_inputs(inputs)
-            self.assertAlmostEqual(inputs.E0raw, el.caloCluster().auxdataConst("double")("correctedcl_Es0"))
-            self.assertAlmostEqual(inputs.E1raw, el.caloCluster().auxdataConst("double")("correctedcl_Es1"))
-            self.assertAlmostEqual(inputs.E2raw, el.caloCluster().auxdataConst("double")("correctedcl_Es2"))
-            self.assertAlmostEqual(inputs.E3raw, el.caloCluster().auxdataConst("double")("correctedcl_Es3"))
-#            self.assertTrue(el.caloCluster().auxdataConst("string")("layer_correction") == tune) # TODO: check why not working in 2.4
+            self.assertTrue(tool.scale_inputs(inputs) == ROOT.CP.CorrectionCode.Ok)
+            self.assertAlmostEqual(inputs.E0raw, el.caloCluster().auxdataConst["double"]("correctedcl_Es0"))
+            self.assertAlmostEqual(inputs.E1raw, el.caloCluster().auxdataConst["double"]("correctedcl_Es1"))
+            self.assertAlmostEqual(inputs.E2raw, el.caloCluster().auxdataConst["double"]("correctedcl_Es2"))
+            self.assertAlmostEqual(inputs.E3raw, el.caloCluster().auxdataConst["double"]("correctedcl_Es3"))
+#            self.assertTrue(el.caloCluster().auxdataConst["string"]("layer_correction") == tune) # TODO: check why not working in 2.4
             i += 1
 
         self.assertGreater(i, 10, msg="too few electrons")
@@ -311,10 +314,11 @@ class TestLayerxAOD(unittest.TestCase):
 
 
 if __name__ == '__main__':
-    ROOT.gROOT.ProcessLine(".x $ROOTCOREDIR/scripts/load_packages.C")
     ROOT.gStyle.SetCanvasDefH(800)
     ROOT.gStyle.SetCanvasDefW(800)
     ROOT.gStyle.SetPadTickX(1)
     ROOT.gStyle.SetPadTickY(1)
 
-    unittest.main()
+    ROOT.PyConfig.IgnoreCommandLineOptions = True
+
+    sys.exit( unittest.main() )
diff --git a/Reconstruction/egamma/egammaTools/src/EMPIDBuilder.h b/Reconstruction/egamma/egammaTools/src/EMPIDBuilder.h
index cd7e7798891f7101f34f7e83536967281929667d..8ff922000e332bb0ba7dd7b63c8360a1ef927984 100644
--- a/Reconstruction/egamma/egammaTools/src/EMPIDBuilder.h
+++ b/Reconstruction/egamma/egammaTools/src/EMPIDBuilder.h
@@ -69,7 +69,7 @@ private:
     "The selector result names"
   };
 
-  ToolHandleArray<CP::ISelectionTool> m_genericIsEMselectors{
+  ToolHandleArray<IAsgSelectionTool> m_genericIsEMselectors{
     this,
     "genericIsEMselectors",
     {},
diff --git a/Reconstruction/egamma/egammaValidation/scripts/EgammaARTmonitoring_plotsMaker.py b/Reconstruction/egamma/egammaValidation/scripts/EgammaARTmonitoring_plotsMaker.py
index f11c90defd2fc8f6c525c933683977b4a59091c0..149cbbfe35a00f2ee77efc6dad323fe13f3d1ae7 100755
--- a/Reconstruction/egamma/egammaValidation/scripts/EgammaARTmonitoring_plotsMaker.py
+++ b/Reconstruction/egamma/egammaValidation/scripts/EgammaARTmonitoring_plotsMaker.py
@@ -117,6 +117,14 @@ photon_fraction_list = [
     {'name': 'truthPhotonConvRecoUnconvEfficiency', 'color': kPink + 2, 'title': 'True Conv #rightarrow Unconv'}
 ]
 
+photon_conversion_list = [
+    {'name': 'truthConvRecoConv2Si', 'color': kGreen + 2, 'title': 'True Conv #rightarrow Si-Si Conv'},
+    {'name': 'truthConvRecoConv1Si', 'color': kBlue + 2, 'title': 'True Conv #rightarrow 1 Si Conv'},
+    {'name': 'truthConvRecoConv1TRT', 'color': kRed + 2, 'title': 'True Conv #rightarrow 1 TRT Conv'},
+    {'name': 'truthConvRecoConv2TRT', 'color': kOrange + 2, 'title': 'True Conv #rightarrow TRT-TRT Conv'},
+    {'name': 'truthConvRecoConv2SiTRT', 'color': kCyan + 2, 'title': 'True Conv #rightarrow Si-TRT Conv'},
+]
+
 
 def get_key_names(file, directory=""):
     """
@@ -190,7 +198,66 @@ def make_profile_plots(f_base, f_nightly, result_file, particle_type):
               h_base_profile.SetTitle("")
               make_ratio_plot(h_base_profile, h_nightly_profile, folder['title'], result_file, y_axis_label)
 
+def make_conversion_plot(f_base, f_nightly, result_file):
+    """
+    This function creates conversion plots to study reco vs true 
+    converion radius for the various conversion categoried
+    """
+    for histo in get_key_names(f_nightly, 'truthConvRecoConv2Si'):
+        variable_name = histo.split("_", 1)[1]
+
+        if variable_name != "convRadiusTrueVsReco":
+            continue
+
+        c1 = TCanvas()
+
+        leg = TLegend(0.1, 0.75, 0.9, 0.9)
+        leg.SetNColumns(2)
+
+        for i, folder in enumerate(photon_conversion_list):
+
+            baseline = f_base.Get(folder['name'] + '/' + folder['name'] + "_" + variable_name)
+            baseline.SetDirectory(0)
+            nightly = f_nightly.Get(folder['name'] + '/' + folder['name'] + "_" + variable_name)
+            nightly.SetDirectory(0)
+
+            if baseline.Integral() != 0:
+                baseline.Scale(1/baseline.Integral())
+            if nightly.Integral() != 0:
+                nightly.Scale(1/nightly.Integral())
+
+            baseline.SetMinimum(min(baseline.GetMinimum(), baseline.GetMinimum()) * 0.7)
+            baseline.SetMaximum(max(baseline.GetMaximum(), baseline.GetMaximum()) * 1.3)
+
+            baseline.GetXaxis().SetTitle("R^{reco}_{conv. vtx} - R^{true}_{conv. vtx} [mm]")
+            baseline.GetYaxis().SetTitle("normalized to unity")
+
+            baseline.SetLineColor(folder['color'])
+            nightly.SetLineColor(folder['color'])
+            baseline.SetMarkerColor(folder['color'])
+            nightly.SetMarkerColor(folder['color'])
+
+            baseline.SetMarkerStyle(1)
+            nightly.SetMarkerStyle(20)
+
+            leg.AddEntry(nightly, folder['title'], "p")
+
+            if i == 0:
+                baseline.Draw("hist ")
+            else:
+                baseline.Draw("same hist")
+
+            nightly.Draw("p same")
 
+        leg.Draw()
+
+        c1.Update()
+
+        result_file.cd()
+
+        c1.SaveAs("ConversionRadiusTrueVsReco.png")
+
+        c1.Write("ConversionRadiusTrueVsReco")
 
 
 def make_photon_fraction_plot(f_base, f_nightly, result_file):
@@ -368,14 +435,15 @@ if __name__ == '__main__':
 
     output_file = TFile("BN_ComparisonPlots_" + particle_type + ".hist.root", "RECREATE")
 
-    make_comparison_plots(particle_type, baseline_file, nightly_file, output_file)
+    if particle_type == 'gamma':
 
-    make_profile_plots(baseline_file, nightly_file, output_file, particle_type)
+        make_photon_fraction_plot(baseline_file, nightly_file,output_file)
+        make_conversion_plot(baseline_file, nightly_file, output_file)
 
+    make_comparison_plots(particle_type, baseline_file, nightly_file, output_file)
 
-    if particle_type == 'gamma':
+    make_profile_plots(baseline_file, nightly_file, output_file, particle_type)
 
-        make_photon_fraction_plot(baseline_file, nightly_file,output_file)
 
 
 
diff --git a/Reconstruction/egamma/egammaValidation/src/TruthPhotonHistograms.cxx b/Reconstruction/egamma/egammaValidation/src/TruthPhotonHistograms.cxx
index 04f3686451ed992312f0bbf62839cc076de57ba0..d54c31b6a9ddb31a358a28ad28d144ead8e22473 100644
--- a/Reconstruction/egamma/egammaValidation/src/TruthPhotonHistograms.cxx
+++ b/Reconstruction/egamma/egammaValidation/src/TruthPhotonHistograms.cxx
@@ -18,6 +18,7 @@ StatusCode TruthPhotonHistograms::initializePlots() {
   ATH_CHECK(ParticleHistograms::initializePlots());
 
   histoMap["convRadius"] = new TH1D(Form("%s_%s",m_name.c_str(),"convRadius"), ";Conversion Radius [mm]; Conversion Radius Events", 14, m_cR_bins);
+  histoMap["convRadiusTrueVsReco"] = new TH1D(Form("%s_%s",m_name.c_str(),"convRadiusTrueVsReco"), ";R^{reco}_{conv. vtx} - R^{true}_{conv. vtx} [mm]; Events", 100, -200, 200);
 
   histoMap["resolution_e"] = new TH1D(Form("%s_%s", m_name.c_str(), "resolution_e"), "; E_{reco} - E_{true} / E_{truth}; Events", 40, -0.2, 0.2);
   histoMap["resolution_pT"] = new TH1D(Form("%s_%s", m_name.c_str(), "resolution_pT"), "; p_{T}_{reco} - p_{T}_{true} / p_{T}_{truth}; Events", 40, -0.2, 0.2);
@@ -28,6 +29,7 @@ StatusCode TruthPhotonHistograms::initializePlots() {
   histo2DMap["resolution_e_vs_eta"] = new TH2D(Form("%s_%s",m_name.c_str(),"resolution_e_vs_eta"), ";#eta;E_{reco} - E_{true} / E_{truth}", 20, 0, 3, 160, -0.2, 0.2); 
 
   ATH_CHECK(m_rootHistSvc->regHist(m_folder+"convRadius", histoMap["convRadius"]));
+  ATH_CHECK(m_rootHistSvc->regHist(m_folder+"convRadiusTrueVsReco", histoMap["convRadiusTrueVsReco"]));
 
   ATH_CHECK(m_rootHistSvc->regHist(m_folder+"resolution_e", histoMap["resolution_e"]));
   ATH_CHECK(m_rootHistSvc->regHist(m_folder+"resolution_pT", histoMap["resolution_pT"]));
@@ -48,6 +50,7 @@ void TruthPhotonHistograms::fill(const xAOD::IParticle& phrec) {
   float res_pT = -999;
   float res_eta = -999;
   float res_phi = -999;
+  float recoR = -999;
 
   ParticleHistograms::fill(phrec);
 
@@ -75,10 +78,13 @@ void TruthPhotonHistograms::fill(const xAOD::IParticle& phrec) {
       res_pT = (photon->pt() - truth->pt())/truth->pt();
       res_eta = photon->eta() - truth->eta();
       res_phi = photon->phi() - truth->phi();
+      recoR = xAOD::EgammaHelpers::conversionRadius(photon);
 
     }
   }
 
+  histoMap["convRadiusTrueVsReco"]->Fill(recoR - trueR);
+
   histoMap["resolution_e"]->Fill(res_e);
   histoMap["resolution_pT"]->Fill(res_pT);
   histoMap["resolution_eta"]->Fill(res_eta);
diff --git a/Reconstruction/tauMonitoring/python/TauMonitoringConfig.py b/Reconstruction/tauMonitoring/python/TauMonitoringConfig.py
index a2cb5d279c747b56356208d740ffa655c25c782b..4f802ce165cbc9e82db1e83af25e322cff735e53 100644
--- a/Reconstruction/tauMonitoring/python/TauMonitoringConfig.py
+++ b/Reconstruction/tauMonitoring/python/TauMonitoringConfig.py
@@ -6,7 +6,9 @@ def TauMonitoringConfig(flags):
     from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
     result = ComponentAccumulator()
 
-    from .tauMonitorAlgorithm import tauMonitoringConfig
-    result.merge(tauMonitoringConfig(flags))
+    # the following should not run in RAW to ESD, if we're in two-step
+    if flags.DQ.Environment != 'tier0Raw':
+        from .tauMonitorAlgorithm import tauMonitoringConfig
+        result.merge(tauMonitoringConfig(flags))
 
     return result
diff --git a/Reconstruction/tauRec/python/TauAlgorithmsHolder.py b/Reconstruction/tauRec/python/TauAlgorithmsHolder.py
index d095185b9c1c5c1437abf5ac6b3e4be59ac94e2c..91d668a8f2bad33c38ff9eeb895bfe67999ee3f9 100644
--- a/Reconstruction/tauRec/python/TauAlgorithmsHolder.py
+++ b/Reconstruction/tauRec/python/TauAlgorithmsHolder.py
@@ -78,6 +78,7 @@ def getTauAxis():
     TauAxisSetter = TauAxisSetter(  name = _name, 
                                     ClusterCone = 0.2,
                                     VertexCorrection = True,
+                                    TauVertexCorrection = getTauVertexCorrection(),
                                     IncShowerSubtr = tauFlags.useShowerSubClusters() )
                                     
     cached_instances[_name] = TauAxisSetter                
@@ -309,7 +310,7 @@ def getTauSubstructure():
     
     from tauRecTools.tauRecToolsConf import TauSubstructureVariables
     TauSubstructureVariables = TauSubstructureVariables(  name = _name,
-                                                          VertexCorrection = True,
+                                                          TauVertexCorrection = getTauVertexCorrection(),
                                                           IncShowerSubtr = tauFlags.useShowerSubClusters()
                                                        )
     
@@ -387,7 +388,7 @@ def getPi0ClusterCreator():
     
     from tauRecTools.tauRecToolsConf import TauPi0ClusterCreator
     TauPi0ClusterCreator = TauPi0ClusterCreator(name = _name,
-                                                Key_Pi0ClusterContainer="TauPi0SubtractedClusters",
+                                                TauVertexCorrection = getTauVertexCorrection(),
                                                 IncShowerSubtr = tauFlags.useShowerSubClusters()
                                                 )
     
@@ -678,6 +679,7 @@ def getMvaTESVariableDecorator():
     from tauRecTools.tauRecToolsConf import MvaTESVariableDecorator
     MvaTESVariableDecorator = MvaTESVariableDecorator(name = _name,
                                                       Key_vertexInputContainer=_DefaultVertexContainer,
+                                                      TauVertexCorrection = getTauVertexCorrection(),
                                                       IncShowerSubtr = tauFlags.useShowerSubClusters() )
     cached_instances[_name] = MvaTESVariableDecorator
     return MvaTESVariableDecorator
@@ -891,6 +893,7 @@ def getTauJetRNNEvaluator(_n, NetworkFile0P="", NetworkFile1P="", NetworkFile3P=
                                               InputLayerClusters=InputLayerClusters,
                                               OutputLayer=OutputLayer,
                                               OutputNode=OutputNode,
+                                              TauVertexCorrection = getTauVertexCorrection(),
                                               IncShowerSubtr = tauFlags.useShowerSubClusters() )
     cached_instances[_name] = myTauJetRNNEvaluator
     return myTauJetRNNEvaluator
@@ -911,12 +914,66 @@ def getTauJetBDTEvaluator(_n, weightsFile="", minNTracks=0, maxNTracks=10000, ou
 
 def getTauIDVarCalculator():
     _name = sPrefix + 'TauIDVarCalculator'
-    from tauRecTools.tauRecToolsConf import TauIDVarCalculator            
+    from tauRecTools.tauRecToolsConf import TauIDVarCalculator   
+
     myTauIDVarCalculator = TauIDVarCalculator(name=_name,
-                                              IncShowerSubtr = tauFlags.useShowerSubClusters() )
+                                              IncShowerSubtr = tauFlags.useShowerSubClusters(),
+                                              TauVertexCorrection = getTauVertexCorrection())
     cached_instances[_name] = myTauIDVarCalculator
     return myTauIDVarCalculator
 
+def getTauEleRNNEvaluator(_n,
+        NetworkFile1P="", NetworkFile3P="",
+        OutputVarname="RNNEleScore", MaxTracks=10,
+        MaxClusters=6, MaxClusterDR=1.0, InputLayerScalar="scalar",
+        InputLayerTracks="tracks", InputLayerClusters="clusters",
+        OutputLayer="rnneveto_output", OutputNode="sig_prob"):
+
+    _name = sPrefix + _n 
+    from tauRecTools.tauRecToolsConf import TauJetRNNEvaluator
+    tool = TauJetRNNEvaluator(name=_name,
+                              NetworkFile1P=NetworkFile1P,
+                              NetworkFile3P=NetworkFile3P,
+                              OutputVarname=OutputVarname,
+                              MaxTracks=MaxTracks,
+                              MaxClusters=MaxClusters,
+                              MaxClusterDR=MaxClusterDR,
+                              InputLayerScalar=InputLayerScalar,
+                              InputLayerTracks=InputLayerTracks,
+                              InputLayerClusters=InputLayerClusters,
+                              OutputLayer=OutputLayer,
+                              OutputNode=OutputNode,
+                              TauVertexCorrection = getTauVertexCorrection(),
+                              IncShowerSubtr = tauFlags.useShowerSubClusters())
+
+    cached_instances[_name] = tool
+    return tool
+
+def getTauWPDecoratorEleRNN():
+    import PyUtils.RootUtils as ru
+    ROOT = ru.import_root()
+    import cppyy
+    cppyy.load_library('libxAODTau_cDict')
+
+    _name = sPrefix + 'TauWPDecoratorEleRNN'
+    from tauRecTools.tauRecToolsConf import TauWPDecorator
+    myTauWPDecorator = TauWPDecorator( name=_name,
+                                       flatteningFile1Prong="rnneveto_mc16d_flat_1p.root",
+                                       flatteningFile3Prong="rnneveto_mc16d_flat_3p.root",
+                                       CutEnumVals =
+                                       [ ROOT.xAOD.TauJetParameters.IsTauFlag.EleRNNLoose,
+                                         ROOT.xAOD.TauJetParameters.IsTauFlag.EleRNNMedium,
+                                         ROOT.xAOD.TauJetParameters.IsTauFlag.EleRNNTight ],
+                                       SigEff1P = [0.95, 0.90, 0.85],
+                                       SigEff3P = [0.98, 0.95, 0.90],
+                                       UseEleBDT = True ,
+                                       ScoreName = "RNNEleScore",
+                                       NewScoreName = "RNNEleScoreSigTrans",
+                                       DefineWPs = True,
+                                       )
+    cached_instances[_name] = myTauWPDecorator
+    return myTauWPDecorator
+              
 def getTauDecayModeNNClassifier():
     _name = sPrefix + 'TauDecayModeNNClassifier'
 
@@ -937,6 +994,31 @@ def getTauEleOLRDecorator():
     cached_instances[_name] = myTauEleOLRDecorator
     return myTauEleOLRDecorator
 
+def getTauVertexCorrection():
+    from tauRec.tauRecFlags import tauFlags
+    from tauRecTools.tauRecToolsConf import TauVertexCorrection
+    from JetRec.JetRecFlags import jetFlags
+
+    _name = sPrefix + 'TauVertexCorrection'
+    
+    if _name in cached_instances:
+        return cached_instances[_name]
+  
+    doJetVertexCorrection = False
+    if tauFlags.isStandalone:
+        doJetVertexCorrection = True
+    if jetFlags.useVertices() and jetFlags.useTracks():
+        doJetVertexCorrection = True
+
+    myTauVertexCorrection = TauVertexCorrection(name = _name,
+                                                SeedJet = tauFlags.tauRecSeedJetCollection(), 
+                                                VertexCorrection = True,
+                                                JetVertexCorrection = doJetVertexCorrection)
+    
+    cached_instances[_name] = myTauVertexCorrection
+    return myTauVertexCorrection
+
+
 def getParticleCache():
     #If reading from ESD we not create a cache of extrapolations to the calorimeter, so we should signify this by setting the cache key to a null string
     from RecExConfig.RecFlags import rec
diff --git a/Reconstruction/tauRec/python/TauRecRunner.py b/Reconstruction/tauRec/python/TauRecRunner.py
index 176ebb9561f08f9116a24970feca815a80d452b7..42613a673f93231b430ff386d9576abe8a37ece2 100644
--- a/Reconstruction/tauRec/python/TauRecRunner.py
+++ b/Reconstruction/tauRec/python/TauRecRunner.py
@@ -122,6 +122,11 @@ class TauRecRunner ( TauRecRunConfigured ) :
                                                        weightsFile="EleBDT1PEnd23.root", minNTracks=1, minAbsTrackEta=2.0, 
                                                        maxAbsTrackEta=3.0, outputVarName="BDTEleScore"))
             tools.append(taualgs.getTauWPDecoratorEleBDT())
+            tools.append(taualgs.getTauEleRNNEvaluator("TauEleRNN",
+                                                         NetworkFile1P="rnneveto_mc16d_config_1p.json",
+                                                         NetworkFile3P="rnneveto_mc16d_config_3p.json",
+                                                         OutputVarname="RNNEleScore", MaxTracks=10, MaxClusters=6))
+            tools.append(taualgs.getTauWPDecoratorEleRNN())
             tools.append(taualgs.getTauDecayModeNNClassifier())
             tools.append(taualgs.getTauEleOLRDecorator())              
             
diff --git a/Reconstruction/tauRec/src/TauProcessorAlg.cxx b/Reconstruction/tauRec/src/TauProcessorAlg.cxx
index 220c4e9e7ae2d49a443630679a9cd0b6094c92e0..3a8ce013473ac1b99d02342588fd800da346d8e9 100644
--- a/Reconstruction/tauRec/src/TauProcessorAlg.cxx
+++ b/Reconstruction/tauRec/src/TauProcessorAlg.cxx
@@ -7,7 +7,6 @@
 #include "xAODJet/Jet.h"
 #include "xAODJet/JetContainer.h"
 
-
 #include "xAODTau/TauJetContainer.h"
 #include "xAODTau/TauJetAuxContainer.h"
 #include "xAODTau/TauDefs.h"
@@ -27,8 +26,8 @@ using Gaudi::Units::GeV;
 // Constructor
 //-----------------------------------------------------------------------------
 TauProcessorAlg::TauProcessorAlg(const std::string &name,
-    ISvcLocator * pSvcLocator) :
-AthAlgorithm(name, pSvcLocator) {
+				 ISvcLocator * pSvcLocator) :
+  AthReentrantAlgorithm(name, pSvcLocator) {
 }
 
 //-----------------------------------------------------------------------------
@@ -43,67 +42,36 @@ TauProcessorAlg::~TauProcessorAlg() {
 StatusCode TauProcessorAlg::initialize() {
   ATH_CHECK( detStore()->retrieve(m_cellID) );
     
-    ATH_CHECK( m_jetInputContainer.initialize() );
-    ATH_CHECK( m_tauOutputContainer.initialize() );
-    ATH_CHECK( m_tauTrackOutputContainer.initialize() );
-    ATH_CHECK( m_tauShotClusOutputContainer.initialize() );
-    ATH_CHECK( m_tauShotPFOOutputContainer.initialize() );
-    ATH_CHECK( m_tauPi0CellOutputContainer.initialize() );
-
-    ATH_CHECK( m_cellMakerTool.retrieve() );
-
-    //-------------------------------------------------------------------------
-    // No tools allocated!
-    //-------------------------------------------------------------------------
-    if (m_tools.size() == 0) {
-        ATH_MSG_ERROR("no tools given!");
-        return StatusCode::FAILURE;
-    }
-
-    //-------------------------------------------------------------------------
-    // Allocate tools
-    //-------------------------------------------------------------------------
-    ATH_CHECK( m_tools.retrieve() );
-    
-    ATH_MSG_INFO("List of tools in execution sequence:");
-    ATH_MSG_INFO("------------------------------------");
-
-    unsigned int tool_count = 0;
-
-    for (ToolHandle<ITauToolBase>& tool : m_tools) {
-      ++tool_count;
-      ATH_MSG_INFO(tool->type() << " - " << tool->name());
-    }
-    ATH_MSG_INFO(" ");
-    ATH_MSG_INFO("------------------------------------");
-
-    if (tool_count == 0) {
-        ATH_MSG_ERROR("could not allocate any tool!");
-        return StatusCode::FAILURE;
-    }
-
-    return StatusCode::SUCCESS;
-}
-
-//-----------------------------------------------------------------------------
-// Finalizer
-//-----------------------------------------------------------------------------
-StatusCode TauProcessorAlg::finalize() {
+  ATH_CHECK( m_jetInputContainer.initialize() );
+  ATH_CHECK( m_tauOutputContainer.initialize() );
+  ATH_CHECK( m_tauTrackOutputContainer.initialize() );
+  ATH_CHECK( m_tauShotClusOutputContainer.initialize() );
+  ATH_CHECK( m_tauShotPFOOutputContainer.initialize() );
+  ATH_CHECK( m_tauPi0CellOutputContainer.initialize() );
+
+  ATH_CHECK( m_cellMakerTool.retrieve() );
+
+  //-------------------------------------------------------------------------
+  // No tools allocated!
+  //-------------------------------------------------------------------------
+  if (m_tools.size() == 0) {
+    ATH_MSG_ERROR("no tools given!");
+    return StatusCode::FAILURE;
+  }
 
-  StatusCode sc;
+  //-------------------------------------------------------------------------
+  // Allocate tools
+  //-------------------------------------------------------------------------    
+  ATH_MSG_INFO("List of tools in execution sequence:");
+  ATH_MSG_INFO("------------------------------------");
 
-  //-----------------------------------------------------------------
-  // Loop stops when Failure indicated by one of the tools
-  //-----------------------------------------------------------------
-  for (ToolHandle<ITauToolBase>& tool : m_tools) {
-    ATH_MSG_VERBOSE("Invoking tool " << tool->name());
-    sc = tool->finalize();
-    if (sc.isFailure()) break;
+  for (const ToolHandle<ITauToolBase>& tool : m_tools) {
+    ATH_CHECK( tool.retrieve() );
+    ATH_MSG_INFO(tool->type() << " - " << tool->name());
   }
 
-  if (sc.isSuccess()) {
-    ATH_MSG_VERBOSE("All the invoded tools are finilized successfully.");
-  } 
+  ATH_MSG_INFO(" ");
+  ATH_MSG_INFO("------------------------------------");
 
   return StatusCode::SUCCESS;
 }
@@ -111,8 +79,7 @@ StatusCode TauProcessorAlg::finalize() {
 //-----------------------------------------------------------------------------
 // Execution
 //-----------------------------------------------------------------------------
-StatusCode TauProcessorAlg::execute() {
-  const EventContext& ctx = Gaudi::Hive::currentContext();
+StatusCode TauProcessorAlg::execute(const EventContext& ctx) const {
 
   /// record output containers
   SG::WriteHandle<xAOD::TauJetContainer> tauHandle( m_tauOutputContainer, ctx );
@@ -167,60 +134,60 @@ StatusCode TauProcessorAlg::execute() {
       continue;
     }
 
-      //-----------------------------------------------------------------                                                                 
-      // Seed passed cuts --> create tau candidate
-      //-----------------------------------------------------------------                                                                           
-      xAOD::TauJet* pTau = new xAOD::TauJet();
-      pContainer->push_back( pTau );
-      pTau->setJet(pSeedContainer, pSeed);
+    //-----------------------------------------------------------------                                                                 
+    // Seed passed cuts --> create tau candidate
+    //-----------------------------------------------------------------                                                                           
+    xAOD::TauJet* pTau = new xAOD::TauJet();
+    pContainer->push_back( pTau );
+    pTau->setJet(pSeedContainer, pSeed);
       
-      //-----------------------------------------------------------------
-      // Loop stops when Failure indicated by one of the tools
-      //-----------------------------------------------------------------
-      StatusCode sc;
-      for (ToolHandle<ITauToolBase>& tool : m_tools) {
-	ATH_MSG_DEBUG("ProcessorAlg Invoking tool " << tool->name());
-
-	if (tool->type() == "TauVertexFinder" ) {
-	  sc = tool->executeVertexFinder(*pTau);
-	}
-	else if ( tool->type() == "TauTrackFinder") {
-	  sc = tool->executeTrackFinder(*pTau, *pTauTrackCont);
-	}
-	else if ( tool->type() == "tauRecTools::TauTrackClassifier" || tool->type() == "tauRecTools::TauTrackRNNClassifier" ) {
-	  sc = tool->executeTrackClassifier(*pTau, *pTauTrackCont);
-	}
-	else if ( tool->type() == "TauShotFinder"){
-	  sc = tool->executeShotFinder(*pTau, *tauShotClusContainer, *tauShotPFOContainer);
-	}
-	else if ( tool->type() == "TauPi0CreateROI"){
-	  sc = tool->executePi0CreateROI(*pTau, *Pi0CellContainer, addedCellsMap);
-	}
-	else {
-	  sc = tool->execute(*pTau);
-	}
-	if (sc.isFailure())  break;
+    //-----------------------------------------------------------------
+    // Loop stops when Failure indicated by one of the tools
+    //-----------------------------------------------------------------
+    StatusCode sc;
+    for (const ToolHandle<ITauToolBase>& tool : m_tools) {
+      ATH_MSG_DEBUG("ProcessorAlg Invoking tool " << tool->name());
+
+      if (tool->type() == "TauVertexFinder" ) {
+	sc = tool->executeVertexFinder(*pTau);
+      }
+      else if ( tool->type() == "TauTrackFinder") {
+	sc = tool->executeTrackFinder(*pTau, *pTauTrackCont);
+      }
+      else if ( tool->type() == "tauRecTools::TauTrackClassifier" || tool->type() == "tauRecTools::TauTrackRNNClassifier" ) {
+	sc = tool->executeTrackClassifier(*pTau, *pTauTrackCont);
+      }
+      else if ( tool->type() == "TauShotFinder"){
+	sc = tool->executeShotFinder(*pTau, *tauShotClusContainer, *tauShotPFOContainer);
+      }
+      else if ( tool->type() == "TauPi0CreateROI"){
+	sc = tool->executePi0CreateROI(*pTau, *Pi0CellContainer, addedCellsMap);
       }
-
-      if (sc.isSuccess()) {
-	ATH_MSG_VERBOSE("The tau candidate has been registered");
-      } 
       else {
-	//remove orphaned tracks before tau is deleted via pop_back
-	xAOD::TauJet* bad_tau = pContainer->back();
-	ATH_MSG_DEBUG("Deleting " << bad_tau->nAllTracks() << "Tracks associated with tau: ");
-	pTauTrackCont->erase(pTauTrackCont->end()-bad_tau->nAllTracks(), pTauTrackCont->end());
-
-	pContainer->pop_back();
-      } 
-    }// loop through seeds
-
-    // Check this is needed for the cell container?
-    // symlink as INavigable4MomentumCollection (as in CaloRec/CaloCellMaker)
-    ATH_CHECK(evtStore()->symLink(Pi0CellContainer, static_cast<INavigable4MomentumCollection*> (0)));
+	sc = tool->execute(*pTau);
+      }
+      if (sc.isFailure())  break;
+    }
+
+    if (sc.isSuccess()) {
+      ATH_MSG_VERBOSE("The tau candidate has been registered");
+    } 
+    else {
+      //remove orphaned tracks before tau is deleted via pop_back
+      xAOD::TauJet* bad_tau = pContainer->back();
+      ATH_MSG_DEBUG("Deleting " << bad_tau->nAllTracks() << "Tracks associated with tau: ");
+      pTauTrackCont->erase(pTauTrackCont->end()-bad_tau->nAllTracks(), pTauTrackCont->end());
+
+      pContainer->pop_back();
+    } 
+  }// loop through seeds
+
+  // Check this is needed for the cell container?
+  // symlink as INavigable4MomentumCollection (as in CaloRec/CaloCellMaker)
+  ATH_CHECK(evtStore()->symLink(Pi0CellContainer, static_cast<INavigable4MomentumCollection*> (0)));
   
-    // sort the cell container by hash
-    ATH_CHECK( m_cellMakerTool->process(static_cast<CaloCellContainer*> (Pi0CellContainer), ctx) );
+  // sort the cell container by hash
+  ATH_CHECK( m_cellMakerTool->process(static_cast<CaloCellContainer*> (Pi0CellContainer), ctx) );
 
   ATH_MSG_VERBOSE("The tau candidate container has been modified");
   
diff --git a/Reconstruction/tauRec/tauRec/TauProcessorAlg.h b/Reconstruction/tauRec/tauRec/TauProcessorAlg.h
index 87be74c9064e0ccdf56b3b0eb724597fe3e20954..205ba5fe1da0db62e1d67e36d517eaf414411486 100644
--- a/Reconstruction/tauRec/tauRec/TauProcessorAlg.h
+++ b/Reconstruction/tauRec/tauRec/TauProcessorAlg.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 TAUREC_TAUPROCESSORALG_H
@@ -10,7 +10,9 @@
 #include "StoreGate/ReadCondHandleKey.h"
 #include "StoreGate/ReadHandle.h"
 #include "StoreGate/WriteHandle.h"
-#include "AthenaBaseComps/AthAlgorithm.h"
+
+#include "AthenaBaseComps/AthReentrantAlgorithm.h"
+
 #include "xAODTau/TauJetContainer.h"
 #include "xAODPFlow/PFOContainer.h"
 #include "xAODPFlow/PFOAuxContainer.h"
@@ -29,44 +31,43 @@
 
 class CaloCell_ID;
 
-class TauProcessorAlg: public AthAlgorithm
+class TauProcessorAlg: public AthReentrantAlgorithm
 {
-    public:
-        //-----------------------------------------------------------------
-        // Contructor and destructor
-        //-----------------------------------------------------------------
-        TauProcessorAlg( const std::string &name, ISvcLocator *pSvcLocator );
-        ~TauProcessorAlg();
+ public:
+  //-----------------------------------------------------------------
+  // Contructor and destructor
+  //-----------------------------------------------------------------
+  TauProcessorAlg( const std::string &name, ISvcLocator *pSvcLocator );
+  ~TauProcessorAlg();
 
-        //-----------------------------------------------------------------
-        // Gaudi algorithm hooks
-        //-----------------------------------------------------------------
-        virtual StatusCode initialize();
-        virtual StatusCode execute();
-        virtual StatusCode finalize();
+  //-----------------------------------------------------------------
+  // Gaudi algorithm hooks
+  //-----------------------------------------------------------------
+  virtual StatusCode initialize();
+  virtual StatusCode execute(const EventContext& ctx) const;
 
-    private:
+ private:
        
-    Gaudi::Property<double> m_maxEta {this, "MaxEta", 2.5, "maximum eta for jet seed"};
-    Gaudi::Property<double> m_minPt {this, "MinPt", 10 * Gaudi::Units::GeV, "minimum pT for jet seed"};
+  Gaudi::Property<double> m_maxEta {this, "MaxEta", 2.5, "maximum eta for jet seed"};
+  Gaudi::Property<double> m_minPt {this, "MinPt", 10 * Gaudi::Units::GeV, "minimum pT for jet seed"};
 
-    ToolHandleArray<ITauToolBase>  m_tools {this, "Tools", {}, "Tools processing taus"};
-	ToolHandle<ICaloCellMakerTool> m_cellMakerTool {this, "CellMakerTool", "", "Tool to sort the CaloCellContainer"};
+  const ToolHandleArray<ITauToolBase> m_tools {this, "Tools", {}, "Tools processing taus"};
+  const ToolHandle<ICaloCellMakerTool> m_cellMakerTool {this, "CellMakerTool", "", "Tool to sort the CaloCellContainer"};
 
-	SG::ReadHandleKey<xAOD::JetContainer> m_jetInputContainer{this,"Key_jetInputContainer","AntiKt4LCTopoJets","input jet key"};
+  SG::ReadHandleKey<xAOD::JetContainer> m_jetInputContainer{this,"Key_jetInputContainer","AntiKt4LCTopoJets","input jet key"};
 	
-    SG::WriteHandleKey<xAOD::TauJetContainer> m_tauOutputContainer{this,"Key_tauOutputContainer","tmp_TauJets","output tau data key"};
-	SG::WriteHandleKey<xAOD::TauTrackContainer> m_tauTrackOutputContainer{this,"Key_tauTrackOutputContainer","TauTracks","output tau tracks data key"};
-	SG::WriteHandleKey<xAOD::CaloClusterContainer> m_tauShotClusOutputContainer{this,"Key_tauShotClusOutputContainer", "TauShotClusters", "tau shot clusters out key"};
-	SG::WriteHandleKey<xAOD::PFOContainer> m_tauShotPFOOutputContainer{this,"Key_tauShotPFOOutputContainer", "TauShotParticleFlowObjects", "tau pfo out key"};
-	SG::WriteHandleKey<CaloCellContainer> m_tauPi0CellOutputContainer{this,"Key_tauPi0CellOutputContainer","TauCommonPi0Cells","output calo cell key"};
+  SG::WriteHandleKey<xAOD::TauJetContainer> m_tauOutputContainer{this,"Key_tauOutputContainer","tmp_TauJets","output tau data key"};
+  SG::WriteHandleKey<xAOD::TauTrackContainer> m_tauTrackOutputContainer{this,"Key_tauTrackOutputContainer","TauTracks","output tau tracks data key"};
+  SG::WriteHandleKey<xAOD::CaloClusterContainer> m_tauShotClusOutputContainer{this,"Key_tauShotClusOutputContainer", "TauShotClusters", "tau shot clusters out key"};
+  SG::WriteHandleKey<xAOD::PFOContainer> m_tauShotPFOOutputContainer{this,"Key_tauShotPFOOutputContainer", "TauShotParticleFlowObjects", "tau pfo out key"};
+  SG::WriteHandleKey<CaloCellContainer> m_tauPi0CellOutputContainer{this,"Key_tauPi0CellOutputContainer","TauCommonPi0Cells","output calo cell key"};
     
-    const CaloCell_ID* m_cellID;
+  const CaloCell_ID* m_cellID;
     
-    // These are needed to read ESD and AOD in AthenaMT for P->T conversion of ID tracks.
-    SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_pixelDetEleCollKey{this, "PixelDetEleCollKey", "PixelDetectorElementCollection", "Key of SiDetectorElementCollection for Pixel"};
-    SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_SCTDetEleCollKey{this, "SCTDetEleCollKey", "SCT_DetectorElementCollection", "Key of SiDetectorElementCollection for SCT"};
-    SG::ReadCondHandleKey<InDetDD::TRT_DetElementContainer> m_trtDetEleContKey{this, "TRTDetEleContKey", "TRT_DetElementContainer", "Key of TRT_DetElementContainer"}; 
+  // These are needed to read ESD and AOD in AthenaMT for P->T conversion of ID tracks.
+  SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_pixelDetEleCollKey{this, "PixelDetEleCollKey", "PixelDetectorElementCollection", "Key of SiDetectorElementCollection for Pixel"};
+  SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_SCTDetEleCollKey{this, "SCTDetEleCollKey", "SCT_DetectorElementCollection", "Key of SiDetectorElementCollection for SCT"};
+  SG::ReadCondHandleKey<InDetDD::TRT_DetElementContainer> m_trtDetEleContKey{this, "TRTDetEleContKey", "TRT_DetElementContainer", "Key of TRT_DetElementContainer"}; 
 
 };
 
diff --git a/Reconstruction/tauRecTools/CMakeLists.txt b/Reconstruction/tauRecTools/CMakeLists.txt
index 3813187ab2f39f832dc652ad714d77ff919a45d1..d9b7d10bf341df1fc0abf9b384117951220a0cee 100644
--- a/Reconstruction/tauRecTools/CMakeLists.txt
+++ b/Reconstruction/tauRecTools/CMakeLists.txt
@@ -29,6 +29,7 @@ atlas_add_root_dictionary( tauRecToolsLib tauRecToolsLibCintDict
   tauRecTools/TauJetRNNEvaluator.h
   tauRecTools/TauIDVarCalculator.h
   tauRecTools/TauDecayModeNNClassifier.h
+  tauRecTools/TauVertexCorrection.h
   Root/LinkDef.h
   EXTERNAL_PACKAGES ROOT
   )
diff --git a/Reconstruction/tauRecTools/Root/CaloClusterVariables.cxx b/Reconstruction/tauRecTools/Root/CaloClusterVariables.cxx
index 2f3f5e5a07d0e2262f72fb977150753ffc8561a8..166f13a549db40f77f9f7aefc32250807c6212b1 100644
--- a/Reconstruction/tauRecTools/Root/CaloClusterVariables.cxx
+++ b/Reconstruction/tauRecTools/Root/CaloClusterVariables.cxx
@@ -22,7 +22,6 @@ m_totMass(DEFAULT),
 m_effMass(DEFAULT),
 m_totEnergy(DEFAULT),
 m_effEnergy(DEFAULT),
-m_doVertexCorrection(false),
 m_incShowerSubtr(true){
 }
 
@@ -30,28 +29,29 @@ m_incShowerSubtr(true){
 // update/fill the cluster based variables
 //*******************************************
 
-bool CaloClusterVariables::update(const xAOD::TauJet& pTau) {
+bool CaloClusterVariables::update(const xAOD::TauJet& pTau, const ToolHandle<ITauVertexCorrection>& tauVertexCorrection) {
+    
+    if (! pTau.jetLink().isValid()) return false;
 
-    const xAOD::Jet* pSeed = pTau.jet();
-    if(!pSeed) return false;
+    const xAOD::Jet* jetSeed = pTau.jet();
+    const xAOD::Vertex* jetVertex = tauVertexCorrection->getJetVertex(*jetSeed);
 
-    // Loop through jets, get links to clusters
+    const xAOD::Vertex* tauVertex = nullptr;
+    if (pTau.vertexLink().isValid()) tauVertex = pTau.vertex();
+ 
     std::vector<const xAOD::CaloCluster*> clusterList;
-    StatusCode sc = tauRecTools::GetJetClusterList(pSeed, clusterList, m_incShowerSubtr);
-
-    std::vector<CaloVertexedClusterType> constituents;
-    for (auto pCluster : clusterList){
-      // correct cluster
-      if (pTau.vertexLink() && m_doVertexCorrection)
-	constituents.emplace_back (*pCluster, pTau.vertex()->position());
-      else
-        constituents.emplace_back (*pCluster);
+    StatusCode sc = tauRecTools::GetJetClusterList(jetSeed, clusterList, m_incShowerSubtr);
+
+    std::vector<TLorentzVector> clusterP4Vector;
+    for (const xAOD::CaloCluster* cluster : clusterList) {
+      TLorentzVector clusterP4 = tauVertexCorrection->getVertexCorrectedP4(*cluster, tauVertex, jetVertex);
+      clusterP4Vector.push_back(clusterP4);
     }
 
-    this->m_numConstit = (int) constituents.size();
+    this->m_numConstit = (int) clusterP4Vector.size();
 
     // Order constituents by energy
-    sort(constituents.begin(), constituents.end(), CaloClusterCompare());
+    sort(clusterP4Vector.begin(), clusterP4Vector.end(), CaloClusterCompare());
 
     //****************************************
     // Looping over all constituents
@@ -63,24 +63,16 @@ bool CaloClusterVariables::update(const xAOD::TauJet& pTau) {
     double sum_e = 0;
     double sum_of_E2 = 0;
     double sum_radii = 0;
-    TLorentzVector centroid = calculateTauCentroid(this->m_numConstit, constituents);
+    TLorentzVector centroid = calculateTauCentroid(this->m_numConstit, clusterP4Vector);
 
-    for (const CaloVertexedClusterType& c : constituents) {
-        double energy = c.e();
+    for (const TLorentzVector& clusterP4 : clusterP4Vector) {
+        double energy = clusterP4.E();
         sum_of_E2 += energy*energy;
 
-        double px = c.p4().Px();
-        double py = c.p4().Py();
-        double pz = c.p4().Pz();
-        // FF: phi is wrong in case px,py AND pz is negative when using HepLorentzVector(px,py,pz,1)
-        // because phi = atan(py/px)
-        // in trigger many clusters have negative energies/momentum
-        // negative values of px and py are only treated correctly if pz is positive.
-        // Otherwise px and py must be taken as positive values
-        // so using cluster eta/phi directly instead of creating a HLV.
-        //CLHEP::HepLorentzVector constituentHLV(px, py, pz, 1);
-        //sum_radii += centroid.deltaR(constituentHLV);
-        double dr = std::sqrt( std::pow(c.eta() - centroid.Eta(),2) + std::pow(c.phi() - centroid.Phi(),2));
+        double px = clusterP4.Px();
+        double py = clusterP4.Py();
+        double pz = clusterP4.Pz();
+        double dr = clusterP4.DeltaR(centroid);
         sum_radii += dr;
         sum_e += energy;
         sum_px += px;
@@ -122,18 +114,18 @@ bool CaloClusterVariables::update(const xAOD::TauJet& pTau) {
     sum_e = 0;
     sum_of_E2 = 0;
     sum_radii = 0;
-    centroid = calculateTauCentroid(this->m_effNumConstit_int, constituents);
+    centroid = calculateTauCentroid(this->m_effNumConstit_int, clusterP4Vector);
 
     int icount = this->m_effNumConstit_int;
-    for (const CaloVertexedClusterType& c : constituents) {
+    for (const TLorentzVector& clusterP4 : clusterP4Vector) {
       if (icount <= 0) break;
       --icount;
 
-        double energy = c.e();
-        double px = c.p4().Px();
-        double py = c.p4().Py();
-        double pz = c.p4().Pz();
-        double dr = std::sqrt( std::pow(c.eta() - centroid.Eta(),2) + std::pow(c.phi() - centroid.Phi(),2));
+        double energy = clusterP4.E();
+        double px = clusterP4.Px();
+        double py = clusterP4.Py();
+        double pz = clusterP4.Pz();
+        double dr = clusterP4.DeltaR(centroid);
         sum_radii += dr;
 
         sum_e += energy;
@@ -162,20 +154,20 @@ bool CaloClusterVariables::update(const xAOD::TauJet& pTau) {
 //***********************************************************
 // Calculate the geometrical center of the tau constituents
 //***********************************************************
-TLorentzVector CaloClusterVariables::calculateTauCentroid(int nConst, const std::vector<CaloVertexedClusterType>& constituents) {
+TLorentzVector CaloClusterVariables::calculateTauCentroid(int nConst, const std::vector<TLorentzVector>& clusterP4Vector) {
 
     double px = 0;
     double py = 0;
     double pz = 0;
     double current_px, current_py, current_pz, modulus;
 
-    for (const CaloVertexedClusterType& c : constituents) {
+    for (const TLorentzVector& clusterP4: clusterP4Vector) {
       if (nConst <= 0) break;
       --nConst;
-        current_px = c.p4().Px();
-        current_py = c.p4().Py();
-        current_pz = c.p4().Pz();
-        modulus = std::sqrt(current_px * current_px + current_py * current_py + current_pz * current_pz);
+        current_px = clusterP4.Px();
+        current_py = clusterP4.Py();
+        current_pz = clusterP4.Pz();
+        modulus = sqrt(current_px * current_px + current_py * current_py + current_pz * current_pz);
         px += current_px / modulus;
         py += current_py / modulus;
         pz += current_pz / modulus;
diff --git a/Reconstruction/tauRecTools/Root/HelperFunctions.cxx b/Reconstruction/tauRecTools/Root/HelperFunctions.cxx
index d2f8d07bde768ed70c4d94fa6775e0b67ffe62b3..354236c3b8a1b60b7c098b23cdc038ca6c6feee6 100644
--- a/Reconstruction/tauRecTools/Root/HelperFunctions.cxx
+++ b/Reconstruction/tauRecTools/Root/HelperFunctions.cxx
@@ -2,7 +2,6 @@
   Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
-// local include(s)
 #include "tauRecTools/HelperFunctions.h"
 
 #include <TObjString.h>
@@ -67,26 +66,27 @@ std::vector<TString> tauRecTools::parseStringMVAUtilsBDT(const TString& str, con
 
 //________________________________________________________________________________
 std::unique_ptr<MVAUtils::BDT> tauRecTools::configureMVABDT( std::map<TString, float*> &availableVars, const TString& weightFile){
+  using namespace tauRecTools::msgHelperFunction;
   std::unique_ptr<TFile> fBDT(TFile::Open(weightFile));
   if(!fBDT){
-    std::cerr << "ERROR Cannot find tau input BDT file: " << weightFile << std::endl;
+    ANA_MSG_ERROR("configureMVABDT: Cannot find tau input BDT file: " << weightFile );
     return nullptr;
   }
   
   TTree* tBDT = dynamic_cast<TTree*> (fBDT->Get("BDT"));
   if(!tBDT){
-    std::cerr << "ERROR Cannot find tau input BDT tree" << std::endl;
+    ANA_MSG_ERROR("configureMVABDT: Cannot find tau input BDT tree");
     return nullptr;
   }    
 
-  std::cout << "tauRecTools::configureMVABDT opened file: " << weightFile << std::endl;
+  ANA_MSG_INFO("configureMVABDT: opened file: " << weightFile);
 
   std::vector<float*> vars;
 
   //parsing of variables done here from TNamed object
   TNamed* n_varList = dynamic_cast<TNamed*> (fBDT->Get("varList"));
   if(!n_varList) {
-    std::cerr << "ERROR no Variable List in file : " << weightFile << std::endl;
+    ANA_MSG_ERROR("configureMVABDT: no Variable List in file: " << weightFile );
     return nullptr;
   }
   std::vector<TString> varList_ar = tauRecTools::parseStringMVAUtilsBDT(n_varList->GetTitle());
@@ -96,7 +96,7 @@ std::unique_ptr<MVAUtils::BDT> tauRecTools::configureMVABDT( std::map<TString, f
     if(str.Length()==0) continue;
     std::map<TString, float*>::iterator itr = availableVars.find(str);
     if(itr==availableVars.end()){
-      std::cerr << "ERROR Variable : " << str << " is not available" << std::endl;
+      ANA_MSG_ERROR("configureMVABDT: Variable : " << str << " is not available" );
       return nullptr;
     }
     vars.push_back( itr->second );
@@ -110,73 +110,92 @@ std::unique_ptr<MVAUtils::BDT> tauRecTools::configureMVABDT( std::map<TString, f
 }
 
 //________________________________________________________________________________
-const StatusCode tauRecTools::GetJetClusterList(const xAOD::Jet* jet, std::vector<const xAOD::CaloCluster*> &clusterList, bool incShowerSubtracted, TLorentzVector dRVector, double dRCut){
+std::unique_ptr<MVAUtils::BDT> tauRecTools::configureMVABDT(std::vector<TString>& availableVars, const TString& weightFile) {
+  using namespace tauRecTools::msgHelperFunction;
+  std::unique_ptr<TFile> fBDT(TFile::Open(weightFile));
+  if(!fBDT){
+    ANA_MSG_ERROR("configureMVABDT: Cannot find tau input BDT file: " << weightFile );
+    return nullptr;
+  }
+  
+  TTree* tBDT = dynamic_cast<TTree*> (fBDT->Get("BDT"));
+  if(!tBDT){
+    ANA_MSG_ERROR("configureMVABDT: Cannot find tau input BDT tree");
+    return nullptr;
+  }    
+
+  ANA_MSG_INFO("configureMVABDT: opened file: " << weightFile);
+
+  //parsing of variables done here from TNamed object
+  TNamed* n_varList = dynamic_cast<TNamed*> (fBDT->Get("varList"));
+  if(!n_varList) {
+    ANA_MSG_ERROR("configureMVABDT: no Variable List in file: " << weightFile );
+    return nullptr;
+  }
+  std::vector<TString> varList_ar = tauRecTools::parseStringMVAUtilsBDT(n_varList->GetTitle());
+  delete n_varList;
 
+  availableVars.clear();
+  for(const TString& str : varList_ar) {
+    availableVars.push_back( str );
+  }
+  
+  auto reader = std::make_unique<MVAUtils::BDT>(tBDT);
+
+  fBDT->Close();
+  return reader;
+}
+
+
+
+const StatusCode tauRecTools::GetJetClusterList(const xAOD::Jet* jet, std::vector<const xAOD::CaloCluster*> &clusterList, bool incShowerSubtracted) {
   using namespace tauRecTools::msgHelperFunction;
+
   // If using subtracted clusters, need to store unmodified to check if charged are duplicates
   std::vector<const xAOD::CaloCluster*> dupList;
 
   // Loop over jet constituents
-  xAOD::JetConstituentVector jVec = jet->getConstituents();
-  for(auto jCon : jVec){
+  xAOD::JetConstituentVector constituents = jet->getConstituents();
+  for(const xAOD::JetConstituent* constituent : constituents){
     ANA_MSG_DEBUG("JetConstituent: ");
-    ANA_MSG_DEBUG("eta: " << jCon->eta() << " phi: " << jCon->phi() << " e: " << jCon->e()); 
-
-    // do deltaR check against jet constituent
-    bool PassdR = true;
-    if (dRCut > 0){
-      TLorentzVector tempClusterVector;
-      tempClusterVector.SetPtEtaPhiE( jCon->pt(), jCon->eta(), jCon->phi(), jCon->e() );
-      ANA_MSG_DEBUG("Apply dR cut on JetConstituent: " << dRCut );
-      ANA_MSG_DEBUG("JetConstituent Pt: " << tempClusterVector.Pt() << ", Eta: " << tempClusterVector.Eta() << ", Phi: " << tempClusterVector.Phi());
-      ANA_MSG_DEBUG("dR " << dRVector.DeltaR(tempClusterVector));
-      if (dRVector.DeltaR(tempClusterVector) > dRCut){
-	ANA_MSG_DEBUG("Failed dR Cut ");
-	PassdR = false;
-      }
-    }
+    ANA_MSG_DEBUG("eta: " << constituent->eta() << " phi: " << constituent->phi() << " e: " << constituent->e()); 
 
-    if (PassdR){
-      if( jCon->type() == xAOD::Type::CaloCluster ) {
-	const xAOD::CaloCluster* cluster = static_cast<const xAOD::CaloCluster*>( jCon->rawConstituent() );
-	ANA_MSG_DEBUG("CaloCluster: ");
-	ANA_MSG_DEBUG("eta: " << cluster->eta() << " phi: " << cluster->phi() << " e: " << cluster->e());
-	ANA_MSG_DEBUG("rawEta: " << cluster->rawEta() << " rawPhi: " << cluster->rawPhi() << " rawE: " << cluster->rawE());
-	ANA_MSG_DEBUG("calEta: " << cluster->calEta() << " calPhi: " << cluster->calPhi() << " calE: " << cluster->calE());
+    if( constituent->type() == xAOD::Type::CaloCluster ) {
+	  const xAOD::CaloCluster* cluster = static_cast<const xAOD::CaloCluster*>( constituent->rawConstituent() );
+	  ANA_MSG_DEBUG("CaloCluster: ");
+	  ANA_MSG_DEBUG("eta: " << cluster->eta() << " phi: " << cluster->phi() << " e: " << cluster->e());
 
-	clusterList.push_back(cluster);
+	  clusterList.push_back(cluster);
+    }
+    else if ( constituent->type() == xAOD::Type::ParticleFlow ) {
+	  const xAOD::PFO* pfo = static_cast<const xAOD::PFO*>( constituent->rawConstituent() );
+	  
+      if (pfo->isCharged()) continue;
+	  if (pfo->nCaloCluster()!=1){
+	    ANA_MSG_WARNING("Neutral PFO has " << std::to_string(pfo->nCaloCluster()) << " clusters, expected exactly 1!\n");
+        continue;
       }
-      else if( jCon->type() == xAOD::Type::ParticleFlow ) {
-	const xAOD::PFO* pfo = static_cast<const xAOD::PFO*>( jCon->rawConstituent() );
-	if( !pfo->isCharged() ){
-	  if( pfo->nCaloCluster()==1 ){
-
-	    if (incShowerSubtracted){
-	      ElementLink<xAOD::CaloClusterContainer> subClusLink;
-	      pfo->attribute("PFOShowerSubtractedClusterLink", subClusLink);
-	      if ( !subClusLink.isValid() ){
-		ANA_MSG_ERROR("Tau HelperFunctions: Found invalid link to shower subtracted cluster");
-		return StatusCode::FAILURE;
-	      }
-	      else {
-		clusterList.push_back( (*subClusLink) );
-		dupList.push_back( pfo->cluster(0) );
-	      }
+
+	  if (incShowerSubtracted){
+	    ElementLink<xAOD::CaloClusterContainer> subClusLink;
+	    pfo->attribute("PFOShowerSubtractedClusterLink", subClusLink);
+	    if ( !subClusLink.isValid() ){
+	      ANA_MSG_ERROR("Tau HelperFunctions: Found invalid link to shower subtracted cluster");
+	      return StatusCode::FAILURE;
 	    }
 	    else {
-	      clusterList.push_back(pfo->cluster(0));
+	      clusterList.push_back( (*subClusLink) );
+	      dupList.push_back( pfo->cluster(0) );
 	    }
-
 	  }
-	  else ANA_MSG_WARNING("Neutral PFO has " << std::to_string(pfo->nCaloCluster()) << " clusters, expected exactly 1!\n");
-
-	}// neutral PFO check
-      }
-      else{
-	ANA_MSG_ERROR("GetJetConstCluster: Seed jet constituent type not supported!");
-	return StatusCode::FAILURE;
-      }
-    }// dR check
+	  else {
+	    clusterList.push_back(pfo->cluster(0));
+	  }
+	}
+    else {
+	  ANA_MSG_ERROR("GetJetConstCluster: Seed jet constituent type not supported!");
+	  return StatusCode::FAILURE;
+    }
   }
 
   // Get clusters from charged PFOs
@@ -184,41 +203,21 @@ const StatusCode tauRecTools::GetJetClusterList(const xAOD::Jet* jet, std::vecto
   if (incShowerSubtracted) checkList = dupList;
   else checkList = clusterList;
 
-  for(auto jCon : jVec){
-
-    if( jCon->type() == xAOD::Type::ParticleFlow ) {
-
-      bool PassdR = true;
-      if (dRCut > 0){
-	TLorentzVector tempClusterVector;
-	tempClusterVector.SetPtEtaPhiE( jCon->pt(), jCon->eta(), jCon->phi(), jCon->e() );
-	ANA_MSG_DEBUG("Apply dR cut on JetConstituent: " << dRCut );
-	ANA_MSG_DEBUG("JetConstituent Pt: " << tempClusterVector.Pt() << ", Eta: " << tempClusterVector.Eta() << ", Phi: " << tempClusterVector.Phi());
-	ANA_MSG_DEBUG("dR " << dRVector.DeltaR(tempClusterVector));
-	if (dRVector.DeltaR(tempClusterVector) > dRCut){
-	  ANA_MSG_DEBUG("Failed dR Cut ");
-	  PassdR = false;
-	}
-      }
-
-      if (PassdR){
-	const xAOD::PFO* pfo = static_cast<const xAOD::PFO*>( jCon->rawConstituent() );
-	if( pfo->isCharged() ){
-
-	  // loop through clusters linked to charged PFO
-	  for (u_int cc=0; cc<pfo->nCaloCluster(); cc++){
-	    const xAOD::CaloCluster* cluster = pfo->cluster(cc);
-	    // check it is not duplicate of one in neutral list
-	    if ( std::find(checkList.begin(), checkList.end(), cluster) == checkList.end() ){
-	      clusterList.push_back(cluster);
-	      checkList.push_back(cluster);
-	    }
+  for (const xAOD::JetConstituent* constituent : constituents){
+    if ( constituent->type() != xAOD::Type::ParticleFlow ) break;
+	
+    const xAOD::PFO* pfo = static_cast<const xAOD::PFO*>( constituent->rawConstituent() );
+	if (! pfo->isCharged()) continue;
+
+	for (u_int index=0; index<pfo->nCaloCluster(); index++){
+	  const xAOD::CaloCluster* cluster = pfo->cluster(index);
+	  // check it is not duplicate of one in neutral list
+	  if ( std::find(checkList.begin(), checkList.end(), cluster) == checkList.end() ) {
+	    clusterList.push_back(cluster);
+	    checkList.push_back(cluster);
 	  }
-
 	}
-      }// dR check
-    }
-  }// loop through jet constituents
+  }
 
   return StatusCode::SUCCESS;
 }
diff --git a/Reconstruction/tauRecTools/Root/LinkDef.h b/Reconstruction/tauRecTools/Root/LinkDef.h
index 2861a22edbf6465acb8115b656cbc1f3d7cd0870..9078305d94444e124e319b7e8ee198fe06fed84f 100644
--- a/Reconstruction/tauRecTools/Root/LinkDef.h
+++ b/Reconstruction/tauRecTools/Root/LinkDef.h
@@ -17,6 +17,7 @@
 #include "tauRecTools/TauIDVarCalculator.h"
 #include "tauRecTools/TauJetRNNEvaluator.h"
 #include "tauRecTools/TauDecayModeNNClassifier.h"
+#include "tauRecTools/TauVertexCorrection.h"
 
 #ifdef __CINT__
 
@@ -42,5 +43,7 @@
 #pragma link C++ class TauIDVarCalculator+;
 #pragma link C++ class TauJetRNNEvaluator+;
 #pragma link C++ class TauDecayModeNNClassifier+;
+#pragma link C++ class ITauVertexCorrection+;
+#pragma link C++ class TauVertexCorrection+;
 
 #endif
diff --git a/Reconstruction/tauRecTools/Root/MvaTESVariableDecorator.cxx b/Reconstruction/tauRecTools/Root/MvaTESVariableDecorator.cxx
index e109b2cac42cb4852fc95532360fa66701ab7fdf..292e8e2fc3a90fce14eb49699f4a05a1ccbcd9ae 100644
--- a/Reconstruction/tauRecTools/Root/MvaTESVariableDecorator.cxx
+++ b/Reconstruction/tauRecTools/Root/MvaTESVariableDecorator.cxx
@@ -24,9 +24,9 @@ MvaTESVariableDecorator::~MvaTESVariableDecorator() {
 
 StatusCode MvaTESVariableDecorator::initialize() {
 
-  ATH_CHECK( m_aveIntPerXKey.initialize() );
-
-  ATH_CHECK( m_vertexInputContainer.initialize(!m_vertexInputContainer.key().empty()) );
+  ATH_CHECK(m_tauVertexCorrection.retrieve()); 
+  ATH_CHECK(m_aveIntPerXKey.initialize());
+  ATH_CHECK(m_vertexContainerKey.initialize(SG::AllowEmpty));
   
   return StatusCode::SUCCESS;
 }
@@ -46,9 +46,9 @@ StatusCode MvaTESVariableDecorator::execute(xAOD::TauJet& xTau) const {
   } 
 
   int nVtxPU = 0;
-  if(!m_vertexInputContainer.key().empty()) {
+  if(!m_vertexContainerKey.empty()) {
     // Get the primary vertex container from StoreGate
-    SG::ReadHandle<xAOD::VertexContainer> vertexInHandle( m_vertexInputContainer );
+    SG::ReadHandle<xAOD::VertexContainer> vertexInHandle( m_vertexContainerKey );
     if (!vertexInHandle.isValid()) {
       ATH_MSG_WARNING ("Could not retrieve HiveDataObj with key " << vertexInHandle.key() << ", will set nVtxPU=0.");
     }
@@ -68,8 +68,6 @@ StatusCode MvaTESVariableDecorator::execute(xAOD::TauJet& xTau) const {
   acc_nVtxPU(xTau) = nVtxPU;
 
   // Decorate jet seed variables
-  const xAOD::Jet* jet_seed = xTau.jet();
-  
   double center_lambda=0.       , first_eng_dens=0.      , em_probability=0.      , second_lambda=0.      ;
   double mean_center_lambda=0.  , mean_first_eng_dens=0. , mean_em_probability=0. , mean_second_lambda=0. ;
   double mean_presampler_frac=0., lead_cluster_frac = 0. ;
@@ -80,42 +78,56 @@ StatusCode MvaTESVariableDecorator::execute(xAOD::TauJet& xTau) const {
   clusters_EM_P4.SetPtEtaPhiM(0,0,0,0);
   TLorentzVector clusters_had_P4;
   clusters_had_P4.SetPtEtaPhiM(0,0,0,0);
+ 
+  if (! xTau.jetLink().isValid()) {
+    ATH_MSG_ERROR("Tau jet link is invalid.");
+    return StatusCode::FAILURE;
+  }
+  const xAOD::Jet *jetSeed = xTau.jet();
+  
+  const xAOD::Vertex* jetVertex = m_tauVertexCorrection->getJetVertex(*jetSeed); 
+
+  const xAOD::Vertex* tauVertex = nullptr;
+  if (xTau.vertexLink().isValid()) tauVertex = xTau.vertex();
 
-  const TLorentzVector& LC_P4 = xTau.p4(xAOD::TauJetParameters::DetectorAxis);
+  TLorentzVector tauAxis = m_tauVertexCorrection->getTauAxis(xTau);
 
   // Loop through jets, get links to clusters
   std::vector<const xAOD::CaloCluster*> clusterList;
-  ATH_CHECK(tauRecTools::GetJetClusterList(jet_seed, clusterList, m_incShowerSubtr, LC_P4, 0.2));
+  ATH_CHECK(tauRecTools::GetJetClusterList(jetSeed, clusterList, m_incShowerSubtr));
 
   // Loop through clusters and jet constituents
-  for (auto cl : clusterList){
+  for (const xAOD::CaloCluster* cluster : clusterList){
+    TLorentzVector clusterP4 = m_tauVertexCorrection->getVertexCorrectedP4(*cluster, tauVertex, jetVertex);
+  
+    if (clusterP4.DeltaR(tauAxis) > 0.2) continue;
 
-    clE = cl->calE();
+    clE = cluster->calE();
     Etot += clE;
 
     if(clE>lead_cluster_frac) lead_cluster_frac = clE;
 
-    if(cl->retrieveMoment(xAOD::CaloCluster::MomentType::CENTER_LAMBDA,center_lambda))
+    if(cluster->retrieveMoment(xAOD::CaloCluster::MomentType::CENTER_LAMBDA,center_lambda))
       mean_center_lambda += clE*center_lambda;
     else ATH_MSG_WARNING("Failed to retrieve moment: CENTER_LAMBDA");
 
-    if(cl->retrieveMoment(xAOD::CaloCluster::MomentType::FIRST_ENG_DENS,first_eng_dens))
+    if(cluster->retrieveMoment(xAOD::CaloCluster::MomentType::FIRST_ENG_DENS,first_eng_dens))
       mean_first_eng_dens += clE*first_eng_dens;
     else ATH_MSG_WARNING("Failed to retrieve moment: FIRST_ENG_DENS");
 
-    if(cl->retrieveMoment(xAOD::CaloCluster::MomentType::EM_PROBABILITY,em_probability)) {
+    if(cluster->retrieveMoment(xAOD::CaloCluster::MomentType::EM_PROBABILITY,em_probability)) {
       mean_em_probability += clE*em_probability;
 
-      if(em_probability>0.5) clusters_EM_P4 += cl->p4(xAOD::CaloCluster::State::CALIBRATED);      
-      else clusters_had_P4 += cl->p4(xAOD::CaloCluster::State::CALIBRATED);
+      if(em_probability>0.5) clusters_EM_P4 += cluster->p4(xAOD::CaloCluster::State::CALIBRATED);      
+      else clusters_had_P4 += cluster->p4(xAOD::CaloCluster::State::CALIBRATED);
     }
     else ATH_MSG_WARNING("Failed to retrieve moment: EM_PROBABILITY");
 
-    if(cl->retrieveMoment(xAOD::CaloCluster::MomentType::SECOND_LAMBDA,second_lambda))
+    if(cluster->retrieveMoment(xAOD::CaloCluster::MomentType::SECOND_LAMBDA,second_lambda))
       mean_second_lambda += clE*second_lambda;
     else ATH_MSG_WARNING("Failed to retrieve moment: SECOND_LAMBDA");
 
-    mean_presampler_frac += (cl->eSample(CaloSampling::PreSamplerB) + cl->eSample(CaloSampling::PreSamplerE));
+    mean_presampler_frac += (cluster->eSample(CaloSampling::PreSamplerB) + cluster->eSample(CaloSampling::PreSamplerE));
   }
   
   // ----calculate mean values
@@ -154,7 +166,7 @@ StatusCode MvaTESVariableDecorator::execute(xAOD::TauJet& xTau) const {
 
   // ----retrieve Ghost Muon Segment Count (for punch-through studies)
   int nMuSeg=0;
-  if(!jet_seed->getAttribute<int>("GhostMuonSegmentCount", nMuSeg)) nMuSeg=0;
+  if(!jetSeed->getAttribute<int>("GhostMuonSegmentCount", nMuSeg)) nMuSeg=0;
   xTau.setDetail(xAOD::TauJetParameters::GhostMuonSegmentCount, nMuSeg);
   
   // ----summing corrected Pi0 PFO energies
diff --git a/Reconstruction/tauRecTools/Root/TauIDVarCalculator.cxx b/Reconstruction/tauRecTools/Root/TauIDVarCalculator.cxx
index fcddc9dc877a27dd81e4097fb5ac1d7b7fe9bda9..6df31f25c0a60e67ceec2290f361eaebfee63204 100644
--- a/Reconstruction/tauRecTools/Root/TauIDVarCalculator.cxx
+++ b/Reconstruction/tauRecTools/Root/TauIDVarCalculator.cxx
@@ -26,8 +26,14 @@ TauIDVarCalculator::TauIDVarCalculator(const std::string& name):
   declareProperty("IncShowerSubtr", m_incShowerSubtr);
 }
 
+StatusCode TauIDVarCalculator::initialize()
+{  
+  ATH_CHECK(m_tauVertexCorrection.retrieve()); 
+  return StatusCode::SUCCESS;
+}
+
 StatusCode TauIDVarCalculator::execute(xAOD::TauJet& tau) const
-{ 
+{
   static const SG::AuxElement::Accessor<float> acc_absipSigLeadTrk("absipSigLeadTrk");
   float ipSigLeadTrk=0.;
   if(!tau.detail(xAOD::TauJetParameters::ipSigLeadTrk, ipSigLeadTrk))
@@ -75,33 +81,37 @@ StatusCode TauIDVarCalculator::execute(xAOD::TauJet& tau) const
   std::vector<CaloSampling::CaloSample> Had1Samps = { 
         CaloSampling::HEC0, CaloSampling::TileBar0, CaloSampling::TileGap1, CaloSampling::TileExt0};
 
-  // Get Clusters via Jet Seed 
-  const xAOD::Jet *jetSeed = tau.jet();
-  if (!jetSeed) {
+  if (! tau.jetLink().isValid()) {
     ATH_MSG_ERROR("Tau jet link is invalid.");
     return StatusCode::FAILURE;
-  } 
+  }
+  const xAOD::Jet *jetSeed = tau.jet();
+  
+  const xAOD::Vertex* jetVertex = m_tauVertexCorrection->getJetVertex(*jetSeed);
+  
+  const xAOD::Vertex* tauVertex = nullptr;
+  if (tau.vertexLink().isValid()) tauVertex = tau.vertex();
+  
+  TLorentzVector tauAxis = m_tauVertexCorrection->getTauAxis(tau);
 
-  const TLorentzVector& p4IntAxis = tau.p4(xAOD::TauJetParameters::IntermediateAxis);
+  std::vector<const xAOD::CaloCluster*> clusterList;
+  ATH_CHECK(tauRecTools::GetJetClusterList(jetSeed, clusterList, m_incShowerSubtr));
+  
   float eEMAtEMScaleFixed = 0.;
   float eHadAtEMScaleFixed = 0.;
   float eHad1AtEMScaleFixed = 0.;
 
-  // Loop through jets, get links to clusters
-  std::vector<const xAOD::CaloCluster*> clusterList;
-  ATH_CHECK(tauRecTools::GetJetClusterList(jetSeed, clusterList, m_incShowerSubtr));
-
-  for( auto cl : clusterList){
+  for (const xAOD::CaloCluster* cluster  : clusterList) {
+    TLorentzVector clusterP4 = m_tauVertexCorrection->getVertexCorrectedP4(*cluster, tauVertex, jetVertex);
     
-    // Only take clusters with dR<0.2 w.r.t IntermediateAxis
-    if( p4IntAxis.DeltaR(cl->p4(xAOD::CaloCluster::UNCALIBRATED)) > 0.2 ) continue;
+    if( tauAxis.DeltaR(clusterP4) > 0.2 ) continue;
     
     for( auto samp : EMSamps )
-      eEMAtEMScaleFixed += cl->eSample(samp);
+      eEMAtEMScaleFixed += cluster->eSample(samp);
     for( auto samp : HadSamps )
-      eHadAtEMScaleFixed += cl->eSample(samp);
+      eHadAtEMScaleFixed += cluster->eSample(samp);
     for( auto samp : Had1Samps )
-      eHad1AtEMScaleFixed += cl->eSample(samp);  
+      eHad1AtEMScaleFixed += cluster->eSample(samp);  
   }
   acc_EMFracFixed(tau) = ( eEMAtEMScaleFixed + eHadAtEMScaleFixed ) != 0. ? 
       eEMAtEMScaleFixed / ( eEMAtEMScaleFixed + eHadAtEMScaleFixed ) : LOW_NUMBER;
diff --git a/Reconstruction/tauRecTools/Root/TauJetRNNEvaluator.cxx b/Reconstruction/tauRecTools/Root/TauJetRNNEvaluator.cxx
index bfa52f0a8e0308628854b135ec6d26b4356828d7..e5ca38e7aa873a7dd34fe7a615117422dfb62c13 100644
--- a/Reconstruction/tauRecTools/Root/TauJetRNNEvaluator.cxx
+++ b/Reconstruction/tauRecTools/Root/TauJetRNNEvaluator.cxx
@@ -3,12 +3,13 @@
 */
 
 #include "tauRecTools/TauJetRNNEvaluator.h"
+#include "tauRecTools/TauJetRNN.h"
+#include "tauRecTools/HelperFunctions.h"
+
+#include "PathResolver/PathResolver.h"
 
 #include <algorithm>
 
-#include "PathResolver/PathResolver.h"
-#include "tauRecTools/TauJetRNN.h"
-#include "tauRecTools/HelperFunctions.h"
 
 TauJetRNNEvaluator::TauJetRNNEvaluator(const std::string &name): 
     TauRecToolBase(name),
@@ -38,6 +39,8 @@ TauJetRNNEvaluator::~TauJetRNNEvaluator() {}
 
 StatusCode TauJetRNNEvaluator::initialize() {
     ATH_MSG_INFO("Initializing TauJetRNNEvaluator");
+  
+    ATH_CHECK(m_tauVertexCorrection.retrieve()); 
 
     std::string weightfile_0p("");
     std::string weightfile_1p("");
@@ -177,23 +180,34 @@ StatusCode TauJetRNNEvaluator::get_tracks(
 StatusCode TauJetRNNEvaluator::get_clusters(
     const xAOD::TauJet &tau, std::vector<const xAOD::CaloCluster *> &out) const {
 
-    const xAOD::Jet *jet_seed = tau.jet();
-    if (!jet_seed) {
+    if (! tau.jetLink().isValid()) {
         ATH_MSG_ERROR("Tau jet link is invalid.");
         return StatusCode::FAILURE;
     }
+    const xAOD::Jet *jetSeed = tau.jet();
+    
+    const xAOD::Vertex* jetVertex = m_tauVertexCorrection->getJetVertex(*jetSeed);
+    
+    const xAOD::Vertex* tauVertex = nullptr;
+    if (tau.vertexLink().isValid()) tauVertex = tau.vertex();
+    
+    TLorentzVector tauAxis = m_tauVertexCorrection->getTauAxis(tau);
 
     std::vector<const xAOD::CaloCluster*> clusters;
-    ATH_CHECK(tauRecTools::GetJetClusterList(jet_seed, clusters, m_incShowerSubtr));
+    ATH_CHECK(tauRecTools::GetJetClusterList(jetSeed, clusters, m_incShowerSubtr));
 
     // remove clusters that do not meet dR requirement
     auto cItr = clusters.begin();
     while( cItr != clusters.end() ){
-      const auto lc_p4 = tau.p4(xAOD::TauJetParameters::DetectorAxis);
-      if (lc_p4.DeltaR((*cItr)->p4()) > m_max_cluster_dr) {
+      const xAOD::CaloCluster* cluster = (*cItr);
+      TLorentzVector clusterP4 = m_tauVertexCorrection->getVertexCorrectedP4(*cluster, tauVertex, jetVertex);
+
+      if (tauAxis.DeltaR(clusterP4) > m_max_cluster_dr) {
         clusters.erase(cItr);
       }
-      else ++cItr;
+      else {
+        ++cItr;
+      }
     }
 
     // Sort by descending et
diff --git a/Reconstruction/tauRecTools/Root/TauJetRNNUtils.cxx b/Reconstruction/tauRecTools/Root/TauJetRNNUtils.cxx
index 685066fad69e374a385c6c52c0988402de649853..317104d80a8167035e75727cdaefc3b20fafdd50 100644
--- a/Reconstruction/tauRecTools/Root/TauJetRNNUtils.cxx
+++ b/Reconstruction/tauRecTools/Root/TauJetRNNUtils.cxx
@@ -3,6 +3,7 @@
 */
 
 #include "tauRecTools/TauJetRNNUtils.h"
+#include "tauRecTools/HelperFunctions.h"
 
 #define GeV 1000
 
@@ -115,6 +116,18 @@ std::unique_ptr<VarCalc> get_default_calculator() {
     calc->insert("pt", Variables::pt);
     calc->insert("ptDetectorAxis", Variables::ptDetectorAxis);
     calc->insert("ptIntermediateAxis", Variables::ptIntermediateAxis);
+    //---added for the eVeto
+    calc->insert("ptJetSeed_log",              Variables::ptJetSeed_log  );
+    calc->insert("absleadTrackEta",            Variables::absleadTrackEta  );
+    calc->insert("leadTrackDeltaEta",          Variables::leadTrackDeltaEta);
+    calc->insert("leadTrackDeltaPhi",          Variables::leadTrackDeltaPhi);
+    calc->insert("EMFracFixed",                Variables::EMFracFixed      );
+    calc->insert("etHotShotWinOverPtLeadTrk",  Variables::etHotShotWinOverPtLeadTrk);
+    calc->insert("hadLeakFracFixed",           Variables::hadLeakFracFixed);
+    calc->insert("PSFrac",                     Variables::PSFrac);
+    calc->insert("ClustersMeanCenterLambda",   Variables::ClustersMeanCenterLambda  );
+    calc->insert("ClustersMeanFirstEngDens",   Variables::ClustersMeanFirstEngDens  );
+    calc->insert("ClustersMeanPresamplerFrac", Variables::ClustersMeanPresamplerFrac);
 
     // Track variable calculator functions
     calc->insert("pt_log", Variables::Track::pt_log);
@@ -129,6 +142,7 @@ std::unique_ptr<VarCalc> get_default_calculator() {
     calc->insert("nIBLHitsAndExp", Variables::Track::nIBLHitsAndExp);
     calc->insert("nPixelHitsPlusDeadSensors", Variables::Track::nPixelHitsPlusDeadSensors);
     calc->insert("nSCTHitsPlusDeadSensors", Variables::Track::nSCTHitsPlusDeadSensors);
+    calc->insert("eProbabilityHT", Variables::Track::eProbabilityHT);
 
     // Cluster variable calculator functions
     calc->insert("et_log", Variables::Cluster::et_log);
@@ -138,7 +152,10 @@ std::unique_ptr<VarCalc> get_default_calculator() {
     calc->insert("SECOND_R", Variables::Cluster::SECOND_R);
     calc->insert("SECOND_LAMBDA", Variables::Cluster::SECOND_LAMBDA);
     calc->insert("CENTER_LAMBDA", Variables::Cluster::CENTER_LAMBDA);
-
+    //---added for the eVeto
+    calc->insert("SECOND_LAMBDAOverClustersMeanSecondLambda", Variables::Cluster::SECOND_LAMBDAOverClustersMeanSecondLambda);
+    calc->insert("CENTER_LAMBDAOverClustersMeanCenterLambda", Variables::Cluster::CENTER_LAMBDAOverClustersMeanCenterLambda);
+    calc->insert("FirstEngDensOverClustersMeanFirstEngDens" , Variables::Cluster::FirstEngDensOverClustersMeanFirstEngDens);
     return calc;
 }
 
@@ -157,7 +174,7 @@ bool etOverPtLeadTrk(const xAOD::TauJet &tau, double &out) {
     float etOverPtLeadTrk;
     const auto success = tau.detail(TauDetail::etOverPtLeadTrk,
                                     etOverPtLeadTrk);
-    out = TMath::Log10(std::max(etOverPtLeadTrk, 0.1f));
+    out = std::log10(std::max(etOverPtLeadTrk, 0.1f));
     return success;
 }
 
@@ -186,7 +203,7 @@ bool SumPtTrkFrac(const xAOD::TauJet &tau, double &out) {
 bool EMPOverTrkSysP(const xAOD::TauJet &tau, double &out) {
     float EMPOverTrkSysP;
     const auto success = tau.detail(TauDetail::EMPOverTrkSysP, EMPOverTrkSysP);
-    out = TMath::Log10(std::max(EMPOverTrkSysP, 1e-3f));
+    out = std::log10(std::max(EMPOverTrkSysP, 1e-3f));
     return success;
 }
 
@@ -201,7 +218,7 @@ bool ptRatioEflowApprox(const xAOD::TauJet &tau, double &out) {
 bool mEflowApprox(const xAOD::TauJet &tau, double &out) {
     float mEflowApprox;
     const auto success = tau.detail(TauDetail::mEflowApprox, mEflowApprox);
-    out = TMath::Log10(std::max(mEflowApprox, 140.0f));
+    out = std::log10(std::max(mEflowApprox, 140.0f));
     return success;
 }
 
@@ -216,56 +233,140 @@ bool trFlightPathSig(const xAOD::TauJet &tau, double &out) {
     float trFlightPathSig;
     const auto success = tau.detail(TauDetail::trFlightPathSig,
                                     trFlightPathSig);
-    out = TMath::Log10(std::max(trFlightPathSig, 0.01f));
+    out = std::log10(std::max(trFlightPathSig, 0.01f));
     return success;
 }
 
 bool massTrkSys(const xAOD::TauJet &tau, double &out) {
     float massTrkSys;
     const auto success = tau.detail(TauDetail::massTrkSys, massTrkSys);
-    out = TMath::Log10(std::max(massTrkSys, 140.0f));
+    out = std::log10(std::max(massTrkSys, 140.0f));
     return success;
 }
 
 bool pt(const xAOD::TauJet &tau, double &out) {
-    out = TMath::Log10(std::min(tau.pt() / GeV, 100.0));
+    out = std::log10(std::min(tau.pt() / GeV, 100.0));
     return true;
 }
 
 bool ptDetectorAxis(const xAOD::TauJet &tau, double &out) {
-    out = TMath::Log10(std::min(tau.ptDetectorAxis() / GeV, 100.0));
+    out = std::log10(std::min(tau.ptDetectorAxis() / GeV, 100.0));
     return true;
 }
 
 bool ptIntermediateAxis(const xAOD::TauJet &tau, double &out) {
-    out = TMath::Log10(std::min(tau.ptIntermediateAxis() /GeV, 100.0));
+    out = std::log10(std::min(tau.ptIntermediateAxis() /GeV, 100.0));
     return true;
 }
 
+bool ptJetSeed_log(const xAOD::TauJet &tau, double &out) {
+  out = std::log10(std::max(tau.ptJetSeed(), 1e-3));
+  return true;
+}
+
+bool absleadTrackEta(const xAOD::TauJet &tau, double &out){
+  out = std::max(0.f, tau.auxdata<float>("ABS_ETA_LEAD_TRACK"));
+  return true;
+}
+
+bool leadTrackDeltaEta(const xAOD::TauJet &tau, double &out){
+  out = std::max(0.f, tau.auxdata<float>("TAU_ABSDELTAETA"));
+  return true;
+}
+
+bool leadTrackDeltaPhi(const xAOD::TauJet &tau, double &out){
+  out = std::max(0.f, tau.auxdata<float>("TAU_ABSDELTAPHI"));
+  return true;
+}
+
+bool EMFracFixed(const xAOD::TauJet &tau, double &out){
+  float emFracFized = tau.auxdata<float>("EMFracFixed");
+  out = std::max(emFracFized, 0.0f);
+  return true;
+}
+
+bool etHotShotWinOverPtLeadTrk(const xAOD::TauJet &tau, double &out){
+  float etHotShotWinOverPtLeadTrk = tau.auxdata<float>("etHotShotWinOverPtLeadTrk");
+  out = std::max(etHotShotWinOverPtLeadTrk, 1e-6f);
+  out = std::log10(out);
+  return true;
+}
+
+bool hadLeakFracFixed(const xAOD::TauJet &tau, double &out){
+  float hadLeakFracFixed = tau.auxdata<float>("hadLeakFracFixed");
+  out = std::max(0.f, hadLeakFracFixed);
+  return true;
+}
+
+bool PSFrac(const xAOD::TauJet &tau, double &out){
+  float PSFrac;
+  const auto success = tau.detail(TauDetail::PSSFraction, PSFrac);
+  out = std::max(0.f,PSFrac);
+  
+  return success;
+}
+
+bool ClustersMeanCenterLambda(const xAOD::TauJet &tau, double &out){
+  float ClustersMeanCenterLambda;
+  const auto success = tau.detail(TauDetail::ClustersMeanCenterLambda, ClustersMeanCenterLambda);
+  out = std::max(0.f, ClustersMeanCenterLambda);
+
+  return success;
+}
+
+bool ClustersMeanEMProbability(const xAOD::TauJet &tau, double &out){
+  float ClustersMeanEMProbability;
+  const auto success = tau.detail(TauDetail::ClustersMeanEMProbability, ClustersMeanEMProbability);
+  out = std::max(0.f, ClustersMeanEMProbability);
+  return success;
+}
+
+bool ClustersMeanFirstEngDens(const xAOD::TauJet &tau, double &out){
+  float ClustersMeanFirstEngDens;
+  const auto success = tau.detail(TauDetail::ClustersMeanFirstEngDens, ClustersMeanFirstEngDens);
+  out =  std::max(-10.f, ClustersMeanFirstEngDens);
+  return success;
+}
+
+bool ClustersMeanPresamplerFrac(const xAOD::TauJet &tau, double &out){
+  float ClustersMeanPresamplerFrac;
+  const auto success = tau.detail(TauDetail::ClustersMeanPresamplerFrac, ClustersMeanPresamplerFrac);
+  out = std::max(0.f, ClustersMeanPresamplerFrac);
+
+  return success;
+}
+
+bool ClustersMeanSecondLambda(const xAOD::TauJet &tau, double &out){
+  float ClustersMeanSecondLambda;
+  const auto success = tau.detail(TauDetail::ClustersMeanSecondLambda, ClustersMeanSecondLambda);
+  out = std::max(0.f, ClustersMeanSecondLambda);
+
+  return success;
+}
 
 namespace Track {
 
 bool pt_log(const xAOD::TauJet& /*tau*/, const xAOD::TauTrack &track,
             double &out) {
-    out = TMath::Log10(track.pt());
+    out = std::log10(track.pt());
     return true;
 }
 
 bool pt_jetseed_log(const xAOD::TauJet &tau, const xAOD::TauTrack& /*track*/,
                     double &out) {
-    out = TMath::Log10(tau.ptJetSeed());
+    out = std::log10(tau.ptJetSeed());
     return true;
 }
 
 bool d0_abs_log(const xAOD::TauJet& /*tau*/, const xAOD::TauTrack &track,
                 double &out) {
-    out = TMath::Log10(TMath::Abs(track.track()->d0()) + 1e-6);
+    out = std::log10(TMath::Abs(track.track()->d0()) + 1e-6);
     return true;
 }
 
 bool z0sinThetaTJVA_abs_log(const xAOD::TauJet& tau, const xAOD::TauTrack &track,
                             double &out) {
-    out = TMath::Log10(TMath::Abs(track.z0sinThetaTJVA(tau)) + 1e-6);
+    out = std::log10(TMath::Abs(track.z0sinThetaTJVA(tau)) + 1e-6);
     return true;
 }
 
@@ -334,6 +435,16 @@ bool nSCTHitsPlusDeadSensors(const xAOD::TauJet& /*tau*/, const xAOD::TauTrack &
     return success1 && success2;
 }
 
+bool eProbabilityHT(const xAOD::TauJet& /*tau*/, const xAOD::TauTrack &track,
+		    double &out) {
+
+    float tracksEProbabilityHT;
+    const auto success =  track.track()->summaryValue( tracksEProbabilityHT, 
+						       xAOD::eProbabilityHT);
+    out = tracksEProbabilityHT;
+    return success;
+}
+
 } // namespace Track
 
 
@@ -342,13 +453,13 @@ using MomentType = xAOD::CaloCluster::MomentType;
 
 bool et_log(const xAOD::TauJet& /*tau*/, const xAOD::CaloCluster &cluster,
             double &out) {
-    out = TMath::Log10(cluster.et());
+    out = std::log10(cluster.et());
     return true;
 }
 
 bool pt_jetseed_log(const xAOD::TauJet &tau, const xAOD::CaloCluster& /*cluster*/,
                     double &out) {
-    out = TMath::Log10(tau.ptJetSeed());
+    out = std::log10(tau.ptJetSeed());
     return true;
 }
 
@@ -367,24 +478,97 @@ bool dPhi(const xAOD::TauJet &tau, const xAOD::CaloCluster &cluster,
 bool SECOND_R(const xAOD::TauJet& /*tau*/, const xAOD::CaloCluster &cluster,
               double &out) {
     const auto success = cluster.retrieveMoment(MomentType::SECOND_R, out);
-    out = TMath::Log10(out + 0.1);
+    out = std::log10(out + 0.1);
     return success;
 }
 
 bool SECOND_LAMBDA(const xAOD::TauJet& /*tau*/, const xAOD::CaloCluster &cluster,
                    double &out) {
     const auto success = cluster.retrieveMoment(MomentType::SECOND_LAMBDA, out);
-    out = TMath::Log10(out + 0.1);
+    out = std::log10(out + 0.1);
     return success;
 }
 
 bool CENTER_LAMBDA(const xAOD::TauJet& /*tau*/, const xAOD::CaloCluster &cluster,
                    double &out) {
     const auto success = cluster.retrieveMoment(MomentType::CENTER_LAMBDA, out);
-    out = TMath::Log10(out + 1e-6);
+    out = std::log10(out + 1e-6);
     return success;
 }
 
+bool SECOND_LAMBDAOverClustersMeanSecondLambda   (const xAOD::TauJet &tau, const xAOD::CaloCluster &cluster, double &out){
+  float ClustersMeanSecondLambda = tau.auxdata<float>("ClustersMeanSecondLambda");
+
+  double secondLambda(0);
+  const auto success = cluster.retrieveMoment(MomentType::SECOND_LAMBDA, secondLambda);
+
+  out = secondLambda/ClustersMeanSecondLambda;
+
+  return success;
+}
+
+bool CENTER_LAMBDAOverClustersMeanCenterLambda   (const xAOD::TauJet &tau, const xAOD::CaloCluster &cluster, double &out){
+  float ClustersMeanCenterLambda = tau.auxdata<float>("ClustersMeanCenterLambda");
+
+  double centerLambda(0);
+  const auto success = cluster.retrieveMoment(MomentType::CENTER_LAMBDA, centerLambda);
+  if (ClustersMeanCenterLambda == 0.){
+    out = 250.;
+  }else {
+    out = centerLambda/ClustersMeanCenterLambda;
+  }
+
+  out = std::min(out, 250.);
+
+  return success;
+}
+
+
+bool FirstEngDensOverClustersMeanFirstEngDens    (const xAOD::TauJet &tau, const xAOD::CaloCluster &cluster, double &out){
+  if (!tau.jetLink().isValid()){
+    return false;
+  }
+  const xAOD::Jet *jetSeed = tau.jet();
+   
+  std::vector<const xAOD::CaloCluster *> clusters;
+  bool            incShowerSubtracted(true);
+  auto check_tauClusters = tauRecTools::GetJetClusterList(jetSeed, clusters, incShowerSubtracted);
+
+  std::size_t nClustersTotal = clusters.size();
+
+  // Number of tracks to save
+  std::size_t nClustersSave = nClustersTotal;
+  std::size_t n_clusterMax(6);
+  if (n_clusterMax > 0) {
+    nClustersSave = std::min((n_clusterMax),nClustersTotal);
+  }
+  // Sort clusters in descending et order
+  auto et_cmp = [](const xAOD::CaloCluster *lhs,
+		     const xAOD::CaloCluster *rhs) {
+    return lhs->et() > rhs->et();
+  };
+  std::sort(clusters.begin(), clusters.end(), et_cmp);
+  
+  float Etot(0.);
+  using MomentType = xAOD::CaloCluster::MomentType;
+  const xAOD::CaloCluster *cls(0);
+  for (std::size_t i = 0; i < nClustersSave; ++i) {
+    cls = clusters[i];
+
+    TLorentzVector cluster_P4 = cls->p4(xAOD::CaloCluster::State::CALIBRATED);
+    Etot += cls->calE();
+  }
+	
+  // the ClustersMeanFirstEngDens is the log10 of the energy weighted average of the First_ENG_DENS 
+  // divided by ETot to make it dimension-less, 
+  // so we need to evaluate the differance of log10(cluster_firstEngDens) and the ClustersMeanFirstEngDens
+  float min_FirstEng = 1e-10;
+  float cluster_FirstEngDens       = std::max(cluster.getMomentValue(MomentType::FIRST_ENG_DENS), (double)min_FirstEng);
+  out = std::log10(cluster_FirstEngDens/std::max(Etot, min_FirstEng)) - tau.auxdata<float>("ClustersMeanFirstEngDens");
+  
+  return true;
+}
+
 } // namespace Cluster
 } // namespace Variables
 } // namespace TauJetRNNUtils
diff --git a/Reconstruction/tauRecTools/Root/TauRecToolBase.cxx b/Reconstruction/tauRecTools/Root/TauRecToolBase.cxx
index 871595ff2c05452b7c817bcbb7d6df28ba31828a..a0d2165874ae9b134f8288faa915fa2a2623cdd9 100644
--- a/Reconstruction/tauRecTools/Root/TauRecToolBase.cxx
+++ b/Reconstruction/tauRecTools/Root/TauRecToolBase.cxx
@@ -148,7 +148,7 @@ StatusCode TauRecToolBase::executeDev(xAOD::TauJet&) {
   return StatusCode::FAILURE;
 }
 #else
-StatusCode TauRecToolBase::executePi0CreateROI(xAOD::TauJet& /*pTau*/, CaloCellContainer& /*caloCellContainer*/, std::vector<CaloCell*>& /*map*/ ) {
+StatusCode TauRecToolBase::executePi0CreateROI(xAOD::TauJet& /*pTau*/, CaloCellContainer& /*caloCellContainer*/, std::vector<CaloCell*>& /*map*/ ) const {
   ATH_MSG_ERROR("function not implemented");
   return StatusCode::FAILURE;
 }
diff --git a/Reconstruction/tauRecTools/Root/TauSubstructureVariables.cxx b/Reconstruction/tauRecTools/Root/TauSubstructureVariables.cxx
index 05437d8655be4ff3cc9e0e3669772a55ef34ffb3..dd0f79b48d9e9eeaa3658c6bc8166160a048b222 100644
--- a/Reconstruction/tauRecTools/Root/TauSubstructureVariables.cxx
+++ b/Reconstruction/tauRecTools/Root/TauSubstructureVariables.cxx
@@ -23,44 +23,33 @@
 #define GeV 1000
 const float TauSubstructureVariables::DEFAULT = -1111.;
 
-//**********************************
-// Constructor
-//**********************************
+
 
 TauSubstructureVariables::TauSubstructureVariables( const std::string& name )
   : TauRecToolBase(name) {
-  declareProperty("VertexCorrection", m_doVertexCorrection = false);
   declareProperty("IncShowerSubtr", m_incShowerSubtr = true);
 }
 
-//**********************************
-// Destructor
-//**********************************
+
 
 TauSubstructureVariables::~TauSubstructureVariables() {
 }
 
-//************************************
-// Execute method
-//************************************
 
-StatusCode TauSubstructureVariables::execute(xAOD::TauJet& pTau) const {
 
-  const xAOD::Jet* taujetseed = pTau.jet();
-  if (!taujetseed) {
-    ATH_MSG_ERROR("Tau jet link is invalid.");
-    return StatusCode::FAILURE;
-  } 
+StatusCode TauSubstructureVariables::initialize() {
+  ATH_CHECK(m_tauVertexCorrection.retrieve()); 
+  return StatusCode::SUCCESS;
+}
+
 
-  //*****************************************************
-  // calculate some tau substructure variables
-  //*****************************************************
+
+StatusCode TauSubstructureVariables::execute(xAOD::TauJet& pTau) const {
 
   CaloClusterVariables CaloClusterVariablesTool;
-  CaloClusterVariablesTool.setVertexCorrection(m_doVertexCorrection);
   CaloClusterVariablesTool.setIncSub(m_incShowerSubtr);
 
-  bool isFilled = CaloClusterVariablesTool.update(pTau);
+  bool isFilled = CaloClusterVariablesTool.update(pTau, m_tauVertexCorrection);
 
   if (!isFilled) {
     ATH_MSG_DEBUG("problem in calculating calo cluster variables -> will be set to -1111");
@@ -95,50 +84,49 @@ StatusCode TauSubstructureVariables::execute(xAOD::TauJet& pTau) const {
   double clusELead = DEFAULT;
   double clusESubLead = DEFAULT;
 
-  // Loop through jets, get links to clusters
-  std::vector<const xAOD::CaloCluster*> vClusters;
-  ATH_CHECK(tauRecTools::GetJetClusterList(taujetseed, vClusters, m_incShowerSubtr));
+  if (! pTau.jetLink().isValid()) {
+    ATH_MSG_ERROR("Tau jet link is invalid.");
+    return StatusCode::FAILURE;
+  }
+  const xAOD::Jet *jetSeed = pTau.jet();
+  
+  const xAOD::Vertex* jetVertex = m_tauVertexCorrection->getJetVertex(*jetSeed);
+  
+  const xAOD::Vertex* tauVertex = nullptr;
+  if (pTau.vertexLink().isValid()) tauVertex = pTau.vertex();
 
-  for (auto incluster : vClusters){
+  TLorentzVector tauAxis = m_tauVertexCorrection->getTauAxis(pTau);
 
-    // calc total energy
-    totalEnergy += incluster->e();
+  std::vector<const xAOD::CaloCluster*> vClusters;
+  ATH_CHECK(tauRecTools::GetJetClusterList(jetSeed, vClusters, m_incShowerSubtr));
+  
+  for (auto cluster : vClusters){
+    totalEnergy += cluster->e();
 		
-    //apply Vertex correction on a temporary
-    TLorentzVector tempclusvec;
-    if (m_doVertexCorrection && pTau.vertexLink())
-      tempclusvec = CaloVertexedClusterType(*incluster, pTau.vertex()->position()).p4();
-    else
-      tempclusvec = CaloVertexedClusterType(*incluster).p4();
-
-    dr = pTau.p4().DeltaR(tempclusvec);
-    if (0.2 <= dr && dr < 0.4) 
-      {
-	calo_iso += tempclusvec.Et();
-      }
-    else if (dr < 0.2)
-      {
-	double clusEnergyBE = ( incluster->energyBE(0) + incluster->energyBE(1) + incluster->energyBE(2) );
+    TLorentzVector clusterP4 = m_tauVertexCorrection->getVertexCorrectedP4(*cluster, tauVertex, jetVertex);
+    dr = tauAxis.DeltaR(clusterP4);    
+    
+    if (0.2 <= dr && dr < 0.4) {
+	  calo_iso += clusterP4.Et();
+    }
+    else if (dr < 0.2) {
+	  double clusEnergyBE = ( cluster->energyBE(0) + cluster->energyBE(1) + cluster->energyBE(2) );
 		    
-	if (clusEnergyBE > clusELead) 
-	  {
+	  if (clusEnergyBE > clusELead) {
 	    //change current leading cluster to subleading
 	    clusESubLead = clusELead;
 	    subLeadClusVec = leadClusVec;
 
 	    //set energy and 4-vector of leading cluster
 	    clusELead = clusEnergyBE;
-	    leadClusVec.SetPtEtaPhiM(clusELead/std::cosh(tempclusvec.Eta()), tempclusvec.Eta(), tempclusvec.Phi(), 0.);
+	    leadClusVec.SetPtEtaPhiM(clusELead/std::cosh(clusterP4.Eta()), clusterP4.Eta(), clusterP4.Phi(), 0.);
 	  }
-	else if (clusEnergyBE > clusESubLead) 
-	  {
+	  else if (clusEnergyBE > clusESubLead) {
 	    //set energy and 4-vector of subleading cluster only
 	    clusESubLead = clusEnergyBE;
-	    subLeadClusVec.SetPtEtaPhiM(clusESubLead/std::cosh(tempclusvec.Eta()), tempclusvec.Eta(), tempclusvec.Phi(), 0.);
+	    subLeadClusVec.SetPtEtaPhiM(clusESubLead/std::cosh(clusterP4.Eta()), clusterP4.Eta(), clusterP4.Phi(), 0.);
 	  }
-
-      }
-		
+    }	
   }
 
   if (clusELead > 0.) {
@@ -219,7 +207,7 @@ StatusCode TauSubstructureVariables::execute(xAOD::TauJet& pTau) const {
     float dR = 0.;
 
     for (size_t i=0; i < numTrack; ++i) {
-      dR = pTau.track(i)->p4().DeltaR(pTau.p4());
+      dR = pTau.track(i)->p4().DeltaR(tauAxis);
       if (dR > dRmax) dRmax = dR;
     }
     pTau.setDetail(xAOD::TauJetParameters::dRmax, dRmax);
diff --git a/Reconstruction/tauRecTools/Root/TauTrackClassifier.cxx b/Reconstruction/tauRecTools/Root/TauTrackClassifier.cxx
index 7268663e5c9158c18b1288c4fabde082dc4cb0d3..d669aabd04fa6695c9deea0a0e6180e28b20efa4 100644
--- a/Reconstruction/tauRecTools/Root/TauTrackClassifier.cxx
+++ b/Reconstruction/tauRecTools/Root/TauTrackClassifier.cxx
@@ -98,7 +98,7 @@ TrackMVABDT::TrackMVABDT(const std::string& sName)
   , m_iBackgroundType(xAOD::TauJetParameters::classifiedFake)
   , m_iExpectedFlag(xAOD::TauJetParameters::unclassified)
   , m_rReader(nullptr)
-  , m_mAvailableVars({})
+  , m_inputVariableNames()
 {
   declareProperty( "InputWeightsPath", m_sInputWeightsPath );
   declareProperty( "Threshold", m_fThreshold );
@@ -112,94 +112,24 @@ TrackMVABDT::~TrackMVABDT()
 {
 }
 
-//______________________________________________________________________________
-StatusCode TrackMVABDT::finalize()
-{
-  for( std::pair<TString, float*> p : m_mAvailableVars ) delete p.second;
-  m_mAvailableVars.clear();
-  return StatusCode::SUCCESS;
-}
-
 //______________________________________________________________________________
 StatusCode TrackMVABDT::initialize()
 {
-  m_mAvailableVars={
-    {"TracksAuxDyn.tauPt", new float(0)}
-    , {"TracksAuxDyn.jetSeedPt", new float(0)}
-    , {"TracksAuxDyn.tauEta", new float(0)}
-    , {"TracksAuxDyn.trackEta", new float(0)}
-    , {"TracksAuxDyn.z0sinThetaTJVA", new float(0)}
-    , {"TracksAuxDyn.rConv", new float(0)}
-    , {"TracksAuxDyn.rConvII", new float(0)}
-    , {"TauTracksAuxDyn.rConv/TauTracksAuxDyn.rConvII", new float(0)}
-    , {"TracksAuxDyn.DRJetSeedAxis", new float(0)}
-    , {"TracksAuxDyn.dRJetSeedAxis", new float(0)}
-    , {"TracksAux.d0", new float(0)}
-    , {"TracksAux.qOverP", new float(0)}
-    , {"TracksAux.theta", new float(0)}
-    , {"TracksAux.eProbabilityHT", new float(0)}
-    , {"TracksAux.numberOfInnermostPixelLayerHits", new float(0)}
-    , {"TracksAux.numberOfPixelHits", new float(0)}
-    , {"TracksAux.numberOfPixelDeadSensors", new float(0)}
-    , {"TracksAux.numberOfPixelSharedHits", new float(0)}
-    , {"TracksAux.numberOfSCTHits", new float(0)}
-    , {"TracksAux.numberOfSCTDeadSensors", new float(0)}
-    , {"TracksAux.numberOfSCTSharedHits", new float(0)}
-    , {"TracksAux.numberOfTRTHighThresholdHits", new float(0)}
-    , {"TracksAux.numberOfTRTHits", new float(0)}
-    , {"TracksAux.numberOfPixelHits+TracksAux.numberOfPixelDeadSensors", new float(0)}
-    , {"TracksAux.numberOfPixelHits+TracksAux.numberOfPixelDeadSensors+TracksAux.numberOfSCTHits+TracksAux.numberOfSCTDeadSensors", new float(0)}
-    
-    , {"TauTracksAuxDyn.tauPt", new float(0)}
-    , {"TauTracksAuxDyn.jetSeedPt", new float(0)}
-    , {"TauTracksAuxDyn.tauEta", new float(0)}
-    , {"TauTracksAuxDyn.trackEta", new float(0)}
-    , {"TauTracksAuxDyn.z0sinThetaTJVA", new float(0)}
-    , {"TauTracksAuxDyn.rConv", new float(0)}
-    , {"TauTracksAuxDyn.rConvII", new float(0)}
-    , {"TauTracksAuxDyn.dRJetSeedAxis", new float(0)}
-    , {"TauTracksAuxDyn.d0", new float(0)}
-    , {"TauTracksAuxDyn.qOverP", new float(0)}
-    , {"TauTracksAuxDyn.theta", new float(0)}
-    , {"TauTracksAuxDyn.eProbabilityHT", new float(0)}
-    , {"TauTracksAuxDyn.numberOfInnermostPixelLayerHits", new float(0)}
-    , {"TauTracksAuxDyn.numberOfPixelHits", new float(0)}
-    , {"TauTracksAuxDyn.numberOfPixelDeadSensors", new float(0)}
-    , {"TauTracksAuxDyn.numberOfPixelSharedHits", new float(0)}
-    , {"TauTracksAuxDyn.numberOfSCTHits", new float(0)}
-    , {"TauTracksAuxDyn.numberOfSCTDeadSensors", new float(0)}
-    , {"TauTracksAuxDyn.numberOfSCTSharedHits", new float(0)}
-    , {"TauTracksAuxDyn.numberOfTRTHighThresholdHits", new float(0)}
-    , {"TauTracksAuxDyn.numberOfTRTHits", new float(0)}
-    , {"TauTracksAuxDyn.numberOfPixelHits+TauTracksAuxDyn.numberOfPixelDeadSensors", new float(0)}
-    , {"TauTracksAuxDyn.numberOfPixelHits+TauTracksAuxDyn.numberOfPixelDeadSensors+TauTracksAuxDyn.numberOfSCTHits+TauTracksAuxDyn.numberOfSCTDeadSensors", new float(0)}
-    
-    
-    , {"1/(TauTracksAuxDyn.trackPt)", new float(0)}
-    , {"fabs(TauTracksAuxDyn.qOverP)", new float(0)}
-    , {"TauTracksAuxDyn.numberOfContribPixelLayers", new float(0)}
-    , {"TauTracksAuxDyn.numberOfPixelHits+TauTracksAuxDyn.numberOfPixelDeadSensors+TauTracksAuxDyn.numberOfPixelHoles", new float(0)}
-    , {"TauTracksAuxDyn.numberOfPixelHits+TauTracksAuxDyn.numberOfPixelDeadSensors+TauTracksAuxDyn.numberOfPixelHoles+TauTracksAuxDyn.numberOfSCTHits+TauTracksAuxDyn.numberOfSCTDeadSensors+TauTracksAuxDyn.numberOfSCTHoles", new float(0)}
-    , {"TauTracksAuxDyn.numberOfPixelHoles", new float(0)}
-    , {"TauTracksAuxDyn.numberOfPixelHoles+TauTracksAuxDyn.numberOfSCTHoles", new float(0)}
-    , {"TauTracksAuxDyn.numberOfSCTHoles", new float(0)}
-    , {"TauTracksAux.pt", new float(0)}
-  };
-    
   ATH_CHECK(addWeightsFile());
   
   return StatusCode::SUCCESS;
 }
 
 //______________________________________________________________________________
-StatusCode TrackMVABDT::classifyTrack(xAOD::TauTrack& xTrack, const xAOD::TauJet& xTau)
+StatusCode TrackMVABDT::classifyTrack(xAOD::TauTrack& xTrack, const xAOD::TauJet& xTau) const
 {
   /// If TT/IT gives TT, only run TT/CR; otherwise, run IT/FT 
   if (xTrack.flag((xAOD::TauJetParameters::TauTrackFlag) m_iExpectedFlag)==false)
     return StatusCode::SUCCESS;
   
-  ATH_CHECK(setVars(xTrack, xTau));
-  double dValue = m_rReader->GetClassification();
+  std::vector<float> values;
+  ATH_CHECK(calculateVariables(xTrack, xTau, values));
+  double dValue = m_rReader->GetClassification(values);
   
   xTrack.setFlag((xAOD::TauJetParameters::TauTrackFlag) m_iExpectedFlag, false);
   if (m_fThreshold < dValue)
@@ -218,7 +148,7 @@ StatusCode TrackMVABDT::addWeightsFile()
   m_sInputWeightsPath = find_file(m_sInputWeightsPath);
   ATH_MSG_DEBUG("InputWeightsPath: " << m_sInputWeightsPath);
   
-  m_rReader = tauRecTools::configureMVABDT( m_mAvailableVars, m_sInputWeightsPath.c_str() );
+  m_rReader = tauRecTools::configureMVABDT( m_inputVariableNames, m_sInputWeightsPath.c_str() );
   if(m_rReader==nullptr) {
     ATH_MSG_FATAL("Couldn't configure MVA");
     return StatusCode::FAILURE;
@@ -228,7 +158,7 @@ StatusCode TrackMVABDT::addWeightsFile()
 }
 
 //______________________________________________________________________________
-StatusCode TrackMVABDT::setVars(const xAOD::TauTrack& xTrack, const xAOD::TauJet& xTau)
+StatusCode TrackMVABDT::calculateVariables(const xAOD::TauTrack& xTrack, const xAOD::TauJet& xTau, std::vector<float>& values) const
 {
   const xAOD::TrackParticle* xTrackParticle = xTrack.track();
   uint8_t iTracksNumberOfInnermostPixelLayerHits = 0; ATH_CHECK( xTrackParticle->summaryValue(iTracksNumberOfInnermostPixelLayerHits, xAOD::numberOfInnermostPixelLayerHits) );
@@ -263,67 +193,74 @@ StatusCode TrackMVABDT::setVars(const xAOD::TauTrack& xTrack, const xAOD::TauJet
   float fNumberOfPixelHoles = float(iNumberOfPixelHoles);
   float fNumberOfSCTHoles = float(iNumberOfSCTHoles);
 
+  std::map<TString, float> valueMap;
   // Could use the same naming convention in the BDT to simplify 
-  setVar("TracksAuxDyn.jetSeedPt") = xTau.ptJetSeed();
-  setVar("TracksAuxDyn.tauPt") = xTau.ptIntermediateAxis();
-  setVar("TracksAuxDyn.tauEta") = xTau.etaIntermediateAxis();
-  setVar("TracksAuxDyn.z0sinThetaTJVA") = xTrack.z0sinThetaTJVA(xTau);
-  setVar("TracksAuxDyn.rConv") = xTrack.rConv(xTau);
-  setVar("TracksAuxDyn.rConvII") = xTrack.rConvII(xTau);
-  setVar("TauTracksAuxDyn.rConv/TauTracksAuxDyn.rConvII") = xTrack.rConv(xTau)/xTrack.rConvII(xTau);
-  setVar("TracksAuxDyn.DRJetSeedAxis") = xTrack.dRJetSeedAxis(xTau);
-  setVar("TracksAuxDyn.dRJetSeedAxis") = xTrack.dRJetSeedAxis(xTau);
-  setVar("TracksAuxDyn.trackEta") = xTrackParticle->eta();
-  setVar("TracksAux.d0") = xTrackParticle->d0();
-  setVar("TracksAux.qOverP") = xTrackParticle->qOverP();
-  setVar("TracksAux.theta") = xTrackParticle->theta();
-  setVar("TracksAux.eProbabilityHT") = fTracksEProbabilityHT;
-  setVar("TracksAux.numberOfInnermostPixelLayerHits") = fTracksNumberOfInnermostPixelLayerHits;
-  setVar("TracksAux.numberOfPixelHits") = fTracksNPixelHits;
-  setVar("TracksAux.numberOfPixelDeadSensors") = fTracksNPixelDeadSensors;
-  setVar("TracksAux.numberOfPixelSharedHits") = fTracksNPixelSharedHits;
-  setVar("TracksAux.numberOfSCTHits") = fTracksNSCTHits;
-  setVar("TracksAux.numberOfSCTDeadSensors") = fTracksNSCTDeadSensors;
-  setVar("TracksAux.numberOfSCTSharedHits") = fTracksNSCTSharedHits;
-  setVar("TracksAux.numberOfTRTHighThresholdHits") = fTracksNTRTHighThresholdHits;
-  setVar("TracksAux.numberOfTRTHits") = fTracksNTRTHits;
-  setVar("TracksAux.numberOfPixelHits+TracksAux.numberOfPixelDeadSensors") = fTracksNPixHits;
-  setVar("TracksAux.numberOfPixelHits+TracksAux.numberOfPixelDeadSensors+TracksAux.numberOfSCTHits+TracksAux.numberOfSCTDeadSensors") = fTracksNSiHits;
-
-  setVar("TauTracksAuxDyn.jetSeedPt") = xTau.ptJetSeed();
-  setVar("TauTracksAuxDyn.tauPt") = xTau.ptIntermediateAxis();
-  setVar("TauTracksAuxDyn.tauEta") = xTau.etaIntermediateAxis();
-  setVar("TauTracksAuxDyn.z0sinThetaTJVA") = xTrack.z0sinThetaTJVA(xTau);
-  setVar("TauTracksAuxDyn.rConv") = xTrack.rConv(xTau);
-  setVar("TauTracksAuxDyn.rConvII") = xTrack.rConvII(xTau);
-  setVar("TauTracksAuxDyn.rConv/TauTracksAuxDyn.rConvII") = xTrack.rConv(xTau)/xTrack.rConvII(xTau);
-  setVar("TauTracksAuxDyn.dRJetSeedAxis") = xTrack.dRJetSeedAxis(xTau);
-  setVar("TauTracksAuxDyn.trackEta") = xTrackParticle->eta();
-  setVar("TauTracksAuxDyn.d0") = xTrackParticle->d0();
-  setVar("TauTracksAuxDyn.qOverP") = xTrackParticle->qOverP();
-  setVar("TauTracksAuxDyn.theta") = xTrackParticle->theta();
-  setVar("TauTracksAuxDyn.eProbabilityHT") = fTracksEProbabilityHT;
-  setVar("TauTracksAuxDyn.numberOfInnermostPixelLayerHits") = fTracksNumberOfInnermostPixelLayerHits;
-  setVar("TauTracksAuxDyn.numberOfPixelHits") = fTracksNPixelHits;
-  setVar("TauTracksAuxDyn.numberOfPixelDeadSensors") = fTracksNPixelDeadSensors;
-  setVar("TauTracksAuxDyn.numberOfPixelSharedHits") = fTracksNPixelSharedHits;
-  setVar("TauTracksAuxDyn.numberOfSCTHits") = fTracksNSCTHits;
-  setVar("TauTracksAuxDyn.numberOfSCTDeadSensors") = fTracksNSCTDeadSensors;
-  setVar("TauTracksAuxDyn.numberOfSCTSharedHits") = fTracksNSCTSharedHits;
-  setVar("TauTracksAuxDyn.numberOfTRTHighThresholdHits") = fTracksNTRTHighThresholdHits;
-  setVar("TauTracksAuxDyn.numberOfTRTHits") = fTracksNTRTHits;
-  setVar("TauTracksAuxDyn.numberOfPixelHits+TauTracksAuxDyn.numberOfPixelDeadSensors") = fTracksNPixHits;
-  setVar("TauTracksAuxDyn.numberOfPixelHits+TauTracksAuxDyn.numberOfPixelDeadSensors+TauTracksAuxDyn.numberOfSCTHits+TauTracksAuxDyn.numberOfSCTDeadSensors") = fTracksNSiHits;
-
-  setVar("1/(TauTracksAuxDyn.trackPt)") = 1./xTrackParticle->pt();
-  setVar("fabs(TauTracksAuxDyn.qOverP)") = std::abs(xTrackParticle->qOverP());
-  setVar("TauTracksAuxDyn.numberOfContribPixelLayers") = fNumberOfContribPixelLayers;
-  setVar("TauTracksAuxDyn.numberOfPixelHits+TauTracksAuxDyn.numberOfPixelDeadSensors+TauTracksAuxDyn.numberOfPixelHoles") = fTracksNPixHits+fNumberOfPixelHoles;
-  setVar("TauTracksAuxDyn.numberOfPixelHits+TauTracksAuxDyn.numberOfPixelDeadSensors+TauTracksAuxDyn.numberOfPixelHoles+TauTracksAuxDyn.numberOfSCTHits+TauTracksAuxDyn.numberOfSCTDeadSensors+TauTracksAuxDyn.numberOfSCTHoles") = fTracksNSiHits+fNumberOfPixelHoles+fNumberOfSCTHoles;
-  setVar("TauTracksAuxDyn.numberOfPixelHoles") = fNumberOfPixelHoles;
-  setVar("TauTracksAuxDyn.numberOfPixelHoles+TauTracksAuxDyn.numberOfSCTHoles") = fNumberOfPixelHoles+fNumberOfSCTHoles;
-  setVar("TauTracksAuxDyn.numberOfSCTHoles") = fNumberOfSCTHoles;
-  setVar("TauTracksAux.pt") = xTrackParticle->pt();
+  valueMap["TracksAuxDyn.jetSeedPt"] = xTau.ptJetSeed();
+  valueMap["TracksAuxDyn.tauPt"] = xTau.ptIntermediateAxis();
+  valueMap["TracksAuxDyn.tauEta"] = xTau.etaIntermediateAxis();
+  valueMap["TracksAuxDyn.z0sinThetaTJVA"] = xTrack.z0sinThetaTJVA(xTau);
+  valueMap["TracksAuxDyn.rConv"] = xTrack.rConv(xTau);
+  valueMap["TracksAuxDyn.rConvII"] = xTrack.rConvII(xTau);
+  valueMap["TauTracksAuxDyn.rConv/TauTracksAuxDyn.rConvII"] = xTrack.rConv(xTau)/xTrack.rConvII(xTau);
+  valueMap["TracksAuxDyn.DRJetSeedAxis"] = xTrack.dRJetSeedAxis(xTau);
+  valueMap["TracksAuxDyn.dRJetSeedAxis"] = xTrack.dRJetSeedAxis(xTau);
+  valueMap["TracksAuxDyn.trackEta"] = xTrackParticle->eta();
+  valueMap["TracksAux.d0"] = xTrackParticle->d0();
+  valueMap["TracksAux.qOverP"] = xTrackParticle->qOverP();
+  valueMap["TracksAux.theta"] = xTrackParticle->theta();
+  valueMap["TracksAux.eProbabilityHT"] = fTracksEProbabilityHT;
+  valueMap["TracksAux.numberOfInnermostPixelLayerHits"] = fTracksNumberOfInnermostPixelLayerHits;
+  valueMap["TracksAux.numberOfPixelHits"] = fTracksNPixelHits;
+  valueMap["TracksAux.numberOfPixelDeadSensors"] = fTracksNPixelDeadSensors;
+  valueMap["TracksAux.numberOfPixelSharedHits"] = fTracksNPixelSharedHits;
+  valueMap["TracksAux.numberOfSCTHits"] = fTracksNSCTHits;
+  valueMap["TracksAux.numberOfSCTDeadSensors"] = fTracksNSCTDeadSensors;
+  valueMap["TracksAux.numberOfSCTSharedHits"] = fTracksNSCTSharedHits;
+  valueMap["TracksAux.numberOfTRTHighThresholdHits"] = fTracksNTRTHighThresholdHits;
+  valueMap["TracksAux.numberOfTRTHits"] = fTracksNTRTHits;
+  valueMap["TracksAux.numberOfPixelHits+TracksAux.numberOfPixelDeadSensors"] = fTracksNPixHits;
+  valueMap["TracksAux.numberOfPixelHits+TracksAux.numberOfPixelDeadSensors+TracksAux.numberOfSCTHits+TracksAux.numberOfSCTDeadSensors"] = fTracksNSiHits;
+
+  valueMap["TauTracksAuxDyn.jetSeedPt"] = xTau.ptJetSeed();
+  valueMap["TauTracksAuxDyn.tauPt"] = xTau.ptIntermediateAxis();
+  valueMap["TauTracksAuxDyn.tauEta"] = xTau.etaIntermediateAxis();
+  valueMap["TauTracksAuxDyn.z0sinThetaTJVA"] = xTrack.z0sinThetaTJVA(xTau);
+  valueMap["TauTracksAuxDyn.rConv"] = xTrack.rConv(xTau);
+  valueMap["TauTracksAuxDyn.rConvII"] = xTrack.rConvII(xTau);
+  valueMap["TauTracksAuxDyn.rConv/TauTracksAuxDyn.rConvII"] = xTrack.rConv(xTau)/xTrack.rConvII(xTau);
+  valueMap["TauTracksAuxDyn.dRJetSeedAxis"] = xTrack.dRJetSeedAxis(xTau);
+  valueMap["TauTracksAuxDyn.trackEta"] = xTrackParticle->eta();
+  valueMap["TauTracksAuxDyn.d0"] = xTrackParticle->d0();
+  valueMap["TauTracksAuxDyn.qOverP"] = xTrackParticle->qOverP();
+  valueMap["TauTracksAuxDyn.theta"] = xTrackParticle->theta();
+  valueMap["TauTracksAuxDyn.eProbabilityHT"] = fTracksEProbabilityHT;
+  valueMap["TauTracksAuxDyn.numberOfInnermostPixelLayerHits"] = fTracksNumberOfInnermostPixelLayerHits;
+  valueMap["TauTracksAuxDyn.numberOfPixelHits"] = fTracksNPixelHits;
+  valueMap["TauTracksAuxDyn.numberOfPixelDeadSensors"] = fTracksNPixelDeadSensors;
+  valueMap["TauTracksAuxDyn.numberOfPixelSharedHits"] = fTracksNPixelSharedHits;
+  valueMap["TauTracksAuxDyn.numberOfSCTHits"] = fTracksNSCTHits;
+  valueMap["TauTracksAuxDyn.numberOfSCTDeadSensors"] = fTracksNSCTDeadSensors;
+  valueMap["TauTracksAuxDyn.numberOfSCTSharedHits"] = fTracksNSCTSharedHits;
+  valueMap["TauTracksAuxDyn.numberOfTRTHighThresholdHits"] = fTracksNTRTHighThresholdHits;
+  valueMap["TauTracksAuxDyn.numberOfTRTHits"] = fTracksNTRTHits;
+  valueMap["TauTracksAuxDyn.numberOfPixelHits+TauTracksAuxDyn.numberOfPixelDeadSensors"] = fTracksNPixHits;
+  valueMap["TauTracksAuxDyn.numberOfPixelHits+TauTracksAuxDyn.numberOfPixelDeadSensors+TauTracksAuxDyn.numberOfSCTHits+TauTracksAuxDyn.numberOfSCTDeadSensors"] = fTracksNSiHits;
+
+  valueMap["1/(TauTracksAuxDyn.trackPt)"] = 1./xTrackParticle->pt();
+  valueMap["fabs(TauTracksAuxDyn.qOverP)"] = std::abs(xTrackParticle->qOverP());
+  valueMap["TauTracksAuxDyn.numberOfContribPixelLayers"] = fNumberOfContribPixelLayers;
+  valueMap["TauTracksAuxDyn.numberOfPixelHits+TauTracksAuxDyn.numberOfPixelDeadSensors+TauTracksAuxDyn.numberOfPixelHoles"] = fTracksNPixHits+fNumberOfPixelHoles;
+  valueMap["TauTracksAuxDyn.numberOfPixelHits+TauTracksAuxDyn.numberOfPixelDeadSensors+TauTracksAuxDyn.numberOfPixelHoles+TauTracksAuxDyn.numberOfSCTHits+TauTracksAuxDyn.numberOfSCTDeadSensors+TauTracksAuxDyn.numberOfSCTHoles"] = fTracksNSiHits+fNumberOfPixelHoles+fNumberOfSCTHoles;
+  valueMap["TauTracksAuxDyn.numberOfPixelHoles"] = fNumberOfPixelHoles;
+  valueMap["TauTracksAuxDyn.numberOfPixelHoles+TauTracksAuxDyn.numberOfSCTHoles"] = fNumberOfPixelHoles+fNumberOfSCTHoles;
+  valueMap["TauTracksAuxDyn.numberOfSCTHoles"] = fNumberOfSCTHoles;
+  valueMap["TauTracksAux.pt"] = xTrackParticle->pt();
+
+  values.clear();
+  values.reserve(m_inputVariableNames.size());
+  for (auto varName : m_inputVariableNames) {
+    values.push_back(valueMap[varName]);
+  }
 
   return StatusCode::SUCCESS;  
 }
diff --git a/Reconstruction/tauRecTools/Root/TauVertexCorrection.cxx b/Reconstruction/tauRecTools/Root/TauVertexCorrection.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..56365e41b8dfbebe4f8143c59f99dac44b6bfd10
--- /dev/null
+++ b/Reconstruction/tauRecTools/Root/TauVertexCorrection.cxx
@@ -0,0 +1,218 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "tauRecTools/TauVertexCorrection.h"
+
+#include "xAODCaloEvent/CaloVertexedTopoCluster.h"
+
+TauVertexCorrection::TauVertexCorrection(const std::string& name):
+  asg::AsgTool(name) {
+  declareProperty("SeedJet", m_seedJet = ""); 
+  declareProperty("VertexCorrection", m_doVertexCorrection = true);
+  declareProperty("JetVertexCorrection", m_doJetVertexCorrection = true);
+}
+
+
+
+StatusCode TauVertexCorrection::initialize() {  
+ 
+  ATH_MSG_INFO("in initialize");
+
+  if (m_seedJet == "AntiKt4LCTopoJets") {
+    m_isPFO = false;
+    m_isEMScale = false;
+  }
+  else if (m_seedJet == "AntiKt4EMPFlowJets") {
+    m_isPFO = true;
+    m_isEMScale = true;
+  }
+  else {
+    ATH_MSG_ERROR("Seed jet " << m_seedJet << " not supported !");
+    return StatusCode::FAILURE;
+  }
+
+  ATH_MSG_INFO("VertexCorrection: " << m_doVertexCorrection);
+  ATH_MSG_INFO("JetVertexCorrection: " << m_doJetVertexCorrection);
+  ATH_MSG_INFO("SeedJet: " <<  m_seedJet);
+  ATH_MSG_INFO("PFO: " << m_isPFO);
+  ATH_MSG_INFO("EMScale: " << m_isEMScale);
+
+  return StatusCode::SUCCESS;
+}
+
+
+  
+const xAOD::Vertex* TauVertexCorrection::getJetVertex(const xAOD::Jet& jet) const {
+  
+  const xAOD::Vertex* jetVertex = nullptr;
+  
+  if (m_doJetVertexCorrection) {
+    bool isAvailable = jet.getAssociatedObject("OriginVertex", jetVertex);
+    if (!isAvailable) {
+      ATH_MSG_WARNING("OriginVertex not available !");
+      jetVertex = nullptr;
+    }
+  }
+
+  return jetVertex;
+}
+
+
+
+TLorentzVector TauVertexCorrection::getTauAxis(const xAOD::TauJet& tau) const {
+  TLorentzVector tauAxis;
+  if (m_doVertexCorrection) {
+    tauAxis = tau.p4(xAOD::TauJetParameters::IntermediateAxis);
+  }
+  else {
+    tauAxis = tau.p4(xAOD::TauJetParameters::DetectorAxis);
+  }
+
+  return tauAxis;
+}
+
+
+
+TLorentzVector TauVertexCorrection::getVertexCorrectedP4(const xAOD::CaloCluster& cluster,
+                                                 const Amg::Vector3D& position) const {
+  
+  TLorentzVector vertexCorrectedP4 = xAOD::CaloVertexedTopoCluster(cluster, position).p4();
+  
+  ATH_MSG_DEBUG("Cluster: " << &cluster);
+  ATH_MSG_DEBUG("Original cluster four momentum, pt: " << cluster.pt() << 
+                " eta: " << cluster.eta() << " phi: " << cluster.phi() << " e: " << cluster.e());
+  ATH_MSG_DEBUG("Vertex corrected four momentum, pt: " << vertexCorrectedP4.Pt() << 
+                " eta: " << vertexCorrectedP4.Eta() << " phi: " << vertexCorrectedP4.Phi() << " e: " << vertexCorrectedP4.E());
+
+  return vertexCorrectedP4;
+} 
+
+
+
+TLorentzVector TauVertexCorrection::getVertexCorrectedP4(const xAOD::PFO& pfo,
+                                                 const Amg::Vector3D& position) const {
+  TLorentzVector vertexCorrectedP4;
+  
+  if (!pfo.isCharged()) {
+    TVector3 pos(position.x(), position.y(), position.z()); 
+
+    if (m_isEMScale) {
+      vertexCorrectedP4 = pfo.GetVertexCorrectedEMFourVec(pos); 
+    }
+    else {
+      vertexCorrectedP4 = pfo.GetVertexCorrectedFourVec(pos);
+    }
+  }
+  else {
+    vertexCorrectedP4 = pfo.p4();  
+  }
+  
+  if (m_isEMScale) {
+    ATH_MSG_DEBUG("Original pfo four momentum, pt: " << pfo.ptEM() << 
+                  " eta: " << pfo.etaEM() << " phi: " << pfo.phiEM() << " e: " << pfo.eEM());
+  }
+  else {
+    ATH_MSG_DEBUG("Original pfo four momentum, pt: " << pfo.pt() << 
+                  " eta: " << pfo.eta() << " phi: " << pfo.phi() << " e: " << pfo.e());
+  }
+
+  ATH_MSG_DEBUG("Vertex corrected four momentum, pt: " << vertexCorrectedP4.Pt() << 
+                " eta: " << vertexCorrectedP4.Eta() << " phi: " << vertexCorrectedP4.Phi() << " e: " << vertexCorrectedP4.E());
+
+  return vertexCorrectedP4;
+} 
+
+
+
+TLorentzVector TauVertexCorrection::getVertexCorrectedP4(const xAOD::CaloCluster& cluster, 
+                                                    const xAOD::Vertex* tauVertex,
+                                                    const xAOD::Vertex* jetVertex) const { 
+  TLorentzVector vertexCorrectedP4 = cluster.p4();
+  Amg::Vector3D position;
+
+  // In jet reconstruction:
+  // Clusters in Topo jets are corrected to point at PV0 when m_doJetVertexCorrection is true
+  // Clusters in PFlow jets are not corrected in jet reconstruction 
+  // In tau reconstruction:
+  // If we want to do the vertex correction using tau vertexs, use the position of the tau vertex 
+  // for PFlow jets, while the relative position of the tau vertex and default vertex for Topo jets
+  // If not, use the default vertex to correct clusters from PFlow jets 
+  if (m_doVertexCorrection) {
+    if (m_isPFO) { // use the position of tau vertex 
+      if (tauVertex) {
+        position = tauVertex->position();
+        vertexCorrectedP4 = getVertexCorrectedP4(cluster, position);
+      }
+    }
+    else { // use the relative position of tau vertex and default vertex
+      if (tauVertex && tauVertex != jetVertex) {         
+        position = tauVertex->position();
+        if (m_doJetVertexCorrection && jetVertex) {
+          position -= jetVertex->position();
+        }
+        vertexCorrectedP4 = getVertexCorrectedP4(cluster, position);
+      }
+    }
+  }
+  else if (m_doJetVertexCorrection && m_isPFO) { // use the position of default vertex
+    if (jetVertex) {
+      position = jetVertex->position();
+      vertexCorrectedP4 = getVertexCorrectedP4(cluster, position);
+    }
+  }
+  
+  return vertexCorrectedP4;
+}
+
+
+
+TLorentzVector TauVertexCorrection::getVertexCorrectedP4(const xAOD::PFO& pfo,
+                                                    const xAOD::Vertex* tauVertex,
+                                                    const xAOD::Vertex* jetVertex) const {
+  TLorentzVector vertexCorrectedP4 = pfo.p4();
+  Amg::Vector3D position;
+
+  // In jet reconstruction:
+  // PFOs are corrected to point at PV0 when m_doJetVertexCorrection is true
+  
+  // In tau reconstruction:
+  // If we want to do the vertex correction using tau vertexs, use the relative position 
+  // of the tau vertex and default vertex
+  
+  if (m_doVertexCorrection) {
+    // use the relative position of tau vertex and default vertex
+    if (tauVertex) {         
+      position = tauVertex->position();
+      if (m_doJetVertexCorrection && jetVertex) {
+        position -= jetVertex->position();
+      }
+      vertexCorrectedP4 = getVertexCorrectedP4(pfo, position);
+    }
+  }
+  
+  return vertexCorrectedP4;
+}
+
+
+
+TLorentzVector TauVertexCorrection::getVertexCorrectedP4(const xAOD::JetConstituent& constituent,
+                                                    const xAOD::Vertex* tauVertex,
+                                                    const xAOD::Vertex* jetVertex) const {
+  TLorentzVector vertexCorrectedP4;
+  
+  if (constituent.type() == xAOD::Type::CaloCluster) {
+	const xAOD::CaloCluster* cluster = static_cast<const xAOD::CaloCluster*>( constituent.rawConstituent() );
+    vertexCorrectedP4 = getVertexCorrectedP4(*cluster, tauVertex, jetVertex);
+  }
+  else if (constituent.type() == xAOD::Type::ParticleFlow) {
+	const xAOD::PFO* pfo = static_cast<const xAOD::PFO*>( constituent.rawConstituent() );
+    vertexCorrectedP4 = getVertexCorrectedP4(*pfo, tauVertex, jetVertex); 
+  }
+  else {
+	ATH_MSG_WARNING("Seed jet constituent type not supported, will not do vertex correction !");
+    vertexCorrectedP4.SetPtEtaPhiE(constituent.pt(), constituent.eta(), constituent.phi(), constituent.e());
+  }
+ 
+  return vertexCorrectedP4; 
+}
diff --git a/Reconstruction/tauRecTools/src/JetSeedBuilder.cxx b/Reconstruction/tauRecTools/src/JetSeedBuilder.cxx
index 17950599553cb8cc64ff9831b5bfac38aba15e62..1d9682db60d24e328fddd6e116afcddb5673b237 100644
--- a/Reconstruction/tauRecTools/src/JetSeedBuilder.cxx
+++ b/Reconstruction/tauRecTools/src/JetSeedBuilder.cxx
@@ -24,16 +24,11 @@ JetSeedBuilder::~JetSeedBuilder() {
 //______________________________________________________________________________
 StatusCode JetSeedBuilder::execute(xAOD::TauJet& pTau) const {
 
-  ATH_MSG_DEBUG("Starting execute");
-
-  const xAOD::Jet* jetSeed = nullptr;
-  if (pTau.jetLink().isValid()) {
-    jetSeed = pTau.jet();
-  }
-  else { 
-    ATH_MSG_ERROR("seed is not a jet -> tau will not be reconstructed");
+  if (! pTau.jetLink().isValid()) {
+    ATH_MSG_ERROR("Tau jet link is invalid.");
     return StatusCode::FAILURE;
   }
+  const xAOD::Jet* jetSeed = pTau.jet();
 
   ATH_MSG_DEBUG("seed is Jet with"
 		<< " pt=" << jetSeed->pt()
diff --git a/Reconstruction/tauRecTools/src/TauAxisSetter.cxx b/Reconstruction/tauRecTools/src/TauAxisSetter.cxx
index 281811a695e9593fd0dde1870d755904d3ca3dcf..05a0d8c9362f55c88fa3cbb67b777626e4b571b6 100644
--- a/Reconstruction/tauRecTools/src/TauAxisSetter.cxx
+++ b/Reconstruction/tauRecTools/src/TauAxisSetter.cxx
@@ -10,7 +10,6 @@
 #include "xAODTau/TauJetContainer.h"
 #include "xAODTau/TauJetAuxContainer.h"
 #include "xAODTau/TauJet.h"
-#include "CaloUtils/CaloVertexedCluster.h"
 
 //______________________________________________________________________________
 TauAxisSetter::TauAxisSetter(const std::string& name) :
@@ -21,19 +20,26 @@ TauRecToolBase(name) {
 TauAxisSetter::~TauAxisSetter() { 
 }
 
-//______________________________________________________________________________
-StatusCode TauAxisSetter::execute(xAOD::TauJet& pTau) const {
 
-  const xAOD::Jet* pJetSeed = pTau.jet();
-  if (!pJetSeed) {
+
+StatusCode TauAxisSetter::initialize() {
+  ATH_CHECK(m_tauVertexCorrection.retrieve()); 
+  return StatusCode::SUCCESS;
+}
+
+
+
+StatusCode TauAxisSetter::execute(xAOD::TauJet& pTau) const {
+  if (! pTau.jetLink().isValid()) {
     ATH_MSG_ERROR("Tau jet link is invalid.");
     return StatusCode::FAILURE;
   }
+  const xAOD::Jet* jetSeed = pTau.jet();
 
   // Barycenter is the sum of cluster p4 in the seed jet
   TLorentzVector baryCenter;  
   
-  xAOD::JetConstituentVector constituents = pJetSeed->getConstituents();
+  xAOD::JetConstituentVector constituents = jetSeed->getConstituents();
   for (const xAOD::JetConstituent* constituent : constituents) {
     TLorentzVector constituentP4;
     constituentP4.SetPtEtaPhiE(constituent->pt(), constituent->eta(), constituent->phi(), constituent->e());
@@ -74,18 +80,28 @@ StatusCode TauAxisSetter::execute(xAOD::TauJet& pTau) const {
   pTau.setP4(xAOD::TauJetParameters::DetectorAxis, tauDetectorAxis.Pt(), tauDetectorAxis.Eta(), tauDetectorAxis.Phi(), tauDetectorAxis.M());
 
 
-  if(m_doVertexCorrection) {
+  if (m_doVertexCorrection) {
+    const xAOD::Vertex* jetVertex = m_tauVertexCorrection->getJetVertex(*jetSeed);
+
+    const xAOD::Vertex* tauVertex = nullptr;
+    if (pTau.vertexLink().isValid()) tauVertex = pTau.vertex();
+    
     // calculate tau intermediate axis (corrected for tau vertex)
     TLorentzVector tauInterAxis;
 
-    std::vector<const xAOD::CaloCluster*> clusterList;
-    ATH_CHECK(tauRecTools::GetJetClusterList(pJetSeed, clusterList, m_incShowerSubtr, baryCenter, m_clusterCone));
-    for (auto cluster : clusterList){
-      if (pTau.vertexLink()) {
-        tauInterAxis += xAOD::CaloVertexedCluster(*cluster, pTau.vertex()->position()).p4();
-      }
-      else {
-        tauInterAxis += xAOD::CaloVertexedCluster(*cluster).p4();
+    if (tauVertex == jetVertex) {
+      tauInterAxis = tauDetectorAxis;
+    }
+    else {
+      for (const xAOD::JetConstituent* constituent : constituents) {
+        TLorentzVector constituentP4;
+        constituentP4.SetPtEtaPhiE(constituent->pt(), constituent->eta(), constituent->phi(), constituent->e());
+      
+        double dR = baryCenter.DeltaR(constituentP4);
+        if (dR > m_clusterCone) continue;
+        
+        TLorentzVector vertexCorrectedP4 = m_tauVertexCorrection->getVertexCorrectedP4(*constituent, tauVertex, jetVertex); 
+        tauInterAxis += vertexCorrectedP4;
       }
     }
 
diff --git a/Reconstruction/tauRecTools/src/TauAxisSetter.h b/Reconstruction/tauRecTools/src/TauAxisSetter.h
index 09095467f33a74abe6e8c59c9f0d20d0482f9aea..f6d7e7caca63aa564e2f1f2b038b25db92a15a32 100644
--- a/Reconstruction/tauRecTools/src/TauAxisSetter.h
+++ b/Reconstruction/tauRecTools/src/TauAxisSetter.h
@@ -6,7 +6,9 @@
 #define TAUREC_TAUAXISSETTER_H
 
 #include "tauRecTools/TauRecToolBase.h"
+#include "tauRecTools/ITauVertexCorrection.h"
 
+#include "AsgTools/ToolHandle.h"
 
 /**
  * @brief Set Tau "Detector Axis" and "Intermediate Axis". 
@@ -33,14 +35,20 @@ class TauAxisSetter : public TauRecToolBase {
     /** @brief Destructor */
     ~TauAxisSetter();
 
+    /** @brief Initialization of this tool */ 
+    virtual StatusCode initialize() override;
+    
     /** @brief Execution of this tool */ 
     virtual StatusCode execute(xAOD::TauJet& pTau) const override;
 
   private:
 
     Gaudi::Property<double> m_clusterCone {this, "ClusterCone", 0.2, "cone of tau candidate"};
-    Gaudi::Property<bool> m_doVertexCorrection {this, "VertexCorrection", true, "switch of vertex correction"};
+    Gaudi::Property<bool> m_doVertexCorrection {this, "VertexCorrection", true, "switch of tau vertex correction"};
     Gaudi::Property<bool> m_incShowerSubtr {this, "IncShowerSubtr", true, "use shower subtracted clusters in calo calculations"};
+
+    ToolHandle<ITauVertexCorrection> m_tauVertexCorrection { this, 
+      "TauVertexCorrection", "TauVertexCorrection", "Tool to perform the vertex correction"};
 };
 
 #endif
diff --git a/Reconstruction/tauRecTools/src/TauCellVariables.cxx b/Reconstruction/tauRecTools/src/TauCellVariables.cxx
index ddceb6ffbfb6e4589382325c22fb66094f1f970b..3584cce767a3a361aa176bd4a8169ab40c69eef0 100644
--- a/Reconstruction/tauRecTools/src/TauCellVariables.cxx
+++ b/Reconstruction/tauRecTools/src/TauCellVariables.cxx
@@ -27,11 +27,11 @@ TauCellVariables::~TauCellVariables() {
 //______________________________________________________________________________
 StatusCode TauCellVariables::execute(xAOD::TauJet& pTau) const {
 
-  const xAOD::Jet* pJetSeed = pTau.jet();
-  if (!pJetSeed) {
+  if (! pTau.jetLink().isValid()) {
     ATH_MSG_ERROR("tau does not have jet seed for cell variable calculation");
     return StatusCode::FAILURE;
   }
+  const xAOD::Jet* pJetSeed = pTau.jet();
   
   ATH_MSG_VERBOSE("cluster position is eta=" << pTau.eta() << " phi=" << pTau.phi() );
 
@@ -76,17 +76,19 @@ StatusCode TauCellVariables::execute(xAOD::TauJet& pTau) const {
       double cellEta = cell->eta();
       double cellET = cell->et();
       double cellEnergy = cell->energy();
+      TLorentzVector tauAxis = pTau.p4(xAOD::TauJetParameters::DetectorAxis);
 
       // correct cell four momentum based on tau vertex
-      if (m_doVertexCorrection && pTau.vertexLink()) {
+      if (m_doVertexCorrection && pTau.vertexLink().isValid()) {
         CaloVertexedCell vxCell (*cell, pTau.vertex()->position());
         cellPhi = vxCell.phi();
         cellEta = vxCell.eta();
         cellET = vxCell.et();
         cellEnergy = vxCell.energy();
+        tauAxis = pTau.p4(xAOD::TauJetParameters::IntermediateAxis);
       }
       
-      double dR = Tau1P3PKineUtils::deltaR(pTau.eta(),pTau.phi(),cellEta,cellPhi);
+      double dR = Tau1P3PKineUtils::deltaR(tauAxis.Eta(), tauAxis.Phi(), cellEta, cellPhi);
       CaloSampling::CaloSample calo = cell->caloDDE()->getSampling();
       
       // use cells with dR < m_cellCone relative to tau intermediate axis:
diff --git a/Reconstruction/tauRecTools/src/TauElectronVetoVariables.cxx b/Reconstruction/tauRecTools/src/TauElectronVetoVariables.cxx
index a47162cb0ab48d388adf8de3023aad79eb59a0d7..0dc129375acd90ce8d510d803c243506279e615b 100644
--- a/Reconstruction/tauRecTools/src/TauElectronVetoVariables.cxx
+++ b/Reconstruction/tauRecTools/src/TauElectronVetoVariables.cxx
@@ -168,11 +168,11 @@ StatusCode TauElectronVetoVariables::execute(xAOD::TauJet& pTau) const
       }
     }
 
-    const xAOD::Jet* pJetSeed = pTau.jet();
-    if (!pJetSeed) {
+    if (! pTau.jetLink().isValid()) {
       ATH_MSG_ERROR("tau does not have jet seed for electron veto cell variable calculation");
       return StatusCode::FAILURE;
     }
+    const xAOD::Jet* pJetSeed = pTau.jet();
 
     // Loop through jets, get links to clusters
     std::vector<const xAOD::CaloCluster*> clusterList;
@@ -193,7 +193,7 @@ StatusCode TauElectronVetoVariables::execute(xAOD::TauJet& pTau) const
 	    if (cellSeen.test(pCell->caloDDE()->calo_hash())) continue;
 	    else cellSeen.set(pCell->caloDDE()->calo_hash());
 
-        if (m_doVertexCorrection && pTau.vertexLink()) {
+        if (m_doVertexCorrection && pTau.vertexLink().isValid()) {
           CaloVertexedCell vxCell (*pCell, pTau.vertex()->position());
           cellPhi = vxCell.phi();
           cellEta = vxCell.eta();
diff --git a/Reconstruction/tauRecTools/src/TauElectronVetoVariables.h b/Reconstruction/tauRecTools/src/TauElectronVetoVariables.h
index 975c731e44038d589252291598133738cfe5b376..335aa6f8ec30d73b489af5fa35d2e1b80e00174b 100644
--- a/Reconstruction/tauRecTools/src/TauElectronVetoVariables.h
+++ b/Reconstruction/tauRecTools/src/TauElectronVetoVariables.h
@@ -33,7 +33,7 @@ public:
     virtual StatusCode initialize() override;
 
 private:
-    Gaudi::Property<bool> m_doVertexCorrection {this, "VertexCorrection", false, "switch of vertex correction"}; 
+    Gaudi::Property<bool> m_doVertexCorrection {this, "VertexCorrection", true, "switch of vertex correction"}; 
     Gaudi::Property<bool> m_useOldCalo{this,"useOldCalo",false,"If true, it uses the CaloExtensionTool for calculating track extrapolation. Otherwise, it allows the code to read from the cache created by CaloExtensionBuilderalg."};
     Gaudi::Property<bool> m_incShowerSubtr {this, "IncShowerSubtr", true, "use shower subtracted clusters in calo calculations"};
     ToolHandle<Trk::IParticleCaloExtensionTool> m_caloExtensionTool {this, 
diff --git a/Reconstruction/tauRecTools/src/TauPi0ClusterCreator.cxx b/Reconstruction/tauRecTools/src/TauPi0ClusterCreator.cxx
index eed20fb0e6a3d2aa44d5b79837eb43b6f4c49223..59a1e7c708da24654dfcd20eb4ed5fc39daac51d 100644
--- a/Reconstruction/tauRecTools/src/TauPi0ClusterCreator.cxx
+++ b/Reconstruction/tauRecTools/src/TauPi0ClusterCreator.cxx
@@ -33,6 +33,12 @@ TauPi0ClusterCreator::~TauPi0ClusterCreator()
 {
 }
 
+
+StatusCode TauPi0ClusterCreator::initialize() {
+  ATH_CHECK(m_tauVertexCorrection.retrieve()); 
+  return StatusCode::SUCCESS;
+}
+
 //______________________________________________________________________________
 StatusCode TauPi0ClusterCreator::executePi0ClusterCreator(xAOD::TauJet& pTau, xAOD::PFOContainer& neutralPFOContainer,
 							  xAOD::PFOContainer& hadronicClusterPFOContainer,
@@ -61,14 +67,28 @@ StatusCode TauPi0ClusterCreator::executePi0ClusterCreator(xAOD::TauJet& pTau, xA
         shotVector.push_back( thisShot );
     }
     std::map<unsigned, xAOD::CaloCluster*> clusterToShotMap = getClusterToShotMap(shotVector, pPi0ClusterContainer, pTau);
-
-    for (auto cluster: pPi0ClusterContainer){
-
+ 
+    if (! pTau.jetLink().isValid()) {
+      ATH_MSG_ERROR("Tau jet link is invalid.");
+      return StatusCode::FAILURE;
+    }
+    const xAOD::Jet *jetSeed = pTau.jet();
+    
+    const xAOD::Vertex* jetVertex = m_tauVertexCorrection->getJetVertex(*jetSeed);
+    
+    const xAOD::Vertex* tauVertex = nullptr;
+    if (pTau.vertexLink().isValid()) tauVertex = pTau.vertex();
+    
+    TLorentzVector tauAxis = m_tauVertexCorrection->getTauAxis(pTau);
+
+    for (const xAOD::CaloCluster* cluster: pPi0ClusterContainer){
+        TLorentzVector clusterP4 = m_tauVertexCorrection->getVertexCorrectedP4(*cluster, tauVertex, jetVertex);
+        
         // selection
-        if (cluster->pt() < m_clusterEtCut)   continue;
+        if (clusterP4.Pt() < m_clusterEtCut)   continue;
         // Cluster container has clusters for all taus.
         // Only run on clusters that belong to this tau
-        if (cluster->p4().DeltaR(pTau.p4()) > .4) continue;
+        if (clusterP4.DeltaR(tauAxis) > 0.4) continue;
 
         // Get shots in this cluster. Need to use (CaloCluster*) (*clusterItr) 
         // (not a copy!) since the pointer will otherwise be different than in clusterToShotMap
@@ -107,21 +127,19 @@ StatusCode TauPi0ClusterCreator::executePi0ClusterCreator(xAOD::TauJet& pTau, xA
         double ENG_FRAC_CORE = 0.0;
         double SECOND_ENG_DENS = 0.0;
 
-        // TODO: Replace numbers by human readable enums
-        if( !pPi0Cluster->retrieveMoment((xAOD::CaloCluster_v1::MomentType) 404, CENTER_MAG) ) ATH_MSG_WARNING("Couldn't retrieve CENTER_MAG moment. Set it to 0.");
-
-        if( !pPi0Cluster->retrieveMoment((xAOD::CaloCluster_v1::MomentType) 102, FIRST_ETA) )       ATH_MSG_WARNING("Couldn't retrieve FIRST_ETA moment. Set it to 0.");
-        if( !pPi0Cluster->retrieveMoment((xAOD::CaloCluster_v1::MomentType) 201, SECOND_R) )        ATH_MSG_WARNING("Couldn't retrieve SECOND_R moment. Set it to 0.");
-        if( !pPi0Cluster->retrieveMoment((xAOD::CaloCluster_v1::MomentType) 202, SECOND_LAMBDA) )   ATH_MSG_WARNING("Couldn't retrieve SECOND_LAMBDA moment. Set it to 0.");
-        if( !pPi0Cluster->retrieveMoment((xAOD::CaloCluster_v1::MomentType) 301, DELTA_PHI) )       ATH_MSG_WARNING("Couldn't retrieve DELTA_PHI moment. Set it to 0.");
-        if( !pPi0Cluster->retrieveMoment((xAOD::CaloCluster_v1::MomentType) 302, DELTA_THETA) )     ATH_MSG_WARNING("Couldn't retrieve DELTA_THETA moment. Set it to 0.");
-        if( !pPi0Cluster->retrieveMoment((xAOD::CaloCluster_v1::MomentType) 501, CENTER_LAMBDA) )   ATH_MSG_WARNING("Couldn't retrieve CENTER_LAMBDA moment. Set it to 0.");
-        if( !pPi0Cluster->retrieveMoment((xAOD::CaloCluster_v1::MomentType) 601, LATERAL) )         ATH_MSG_WARNING("Couldn't retrieve LATERAL moment. Set it to 0.");
-        if( !pPi0Cluster->retrieveMoment((xAOD::CaloCluster_v1::MomentType) 602, LONGITUDINAL) )    ATH_MSG_WARNING("Couldn't retrieve LONGITUDINAL moment. Set it to 0.");
-        if( !pPi0Cluster->retrieveMoment((xAOD::CaloCluster_v1::MomentType) 701, ENG_FRAC_EM) )     ATH_MSG_WARNING("Couldn't retrieve ENG_FRAC_EM moment. Set it to 0.");
-        if( !pPi0Cluster->retrieveMoment((xAOD::CaloCluster_v1::MomentType) 702, ENG_FRAC_MAX) )    ATH_MSG_WARNING("Couldn't retrieve ENG_FRAC_MAX moment. Set it to 0.");
-        if( !pPi0Cluster->retrieveMoment((xAOD::CaloCluster_v1::MomentType) 703, ENG_FRAC_CORE) )   ATH_MSG_WARNING("Couldn't retrieve ENG_FRAC_CORE moment. Set it to 0.");
-        if( !pPi0Cluster->retrieveMoment((xAOD::CaloCluster_v1::MomentType) 805, SECOND_ENG_DENS) ) ATH_MSG_WARNING("Couldn't retrieve SECOND_ENG_DENS moment. Set it to 0.");
+        if( !pPi0Cluster->retrieveMoment(xAOD::CaloCluster::MomentType::CENTER_MAG, CENTER_MAG) ) ATH_MSG_WARNING("Couldn't retrieve CENTER_MAG moment. Set it to 0.");
+        if( !pPi0Cluster->retrieveMoment(xAOD::CaloCluster::MomentType::FIRST_ETA, FIRST_ETA) ) ATH_MSG_WARNING("Couldn't retrieve FIRST_ETA moment. Set it to 0.");
+        if( !pPi0Cluster->retrieveMoment(xAOD::CaloCluster::MomentType::SECOND_R, SECOND_R) ) ATH_MSG_WARNING("Couldn't retrieve SECOND_R moment. Set it to 0.");
+        if( !pPi0Cluster->retrieveMoment(xAOD::CaloCluster::MomentType::SECOND_LAMBDA, SECOND_LAMBDA) ) ATH_MSG_WARNING("Couldn't retrieve SECOND_LAMBDA moment. Set it to 0.");
+        if( !pPi0Cluster->retrieveMoment(xAOD::CaloCluster::MomentType::DELTA_PHI, DELTA_PHI) ) ATH_MSG_WARNING("Couldn't retrieve DELTA_PHI moment. Set it to 0.");
+        if( !pPi0Cluster->retrieveMoment(xAOD::CaloCluster::MomentType::DELTA_THETA, DELTA_THETA) ) ATH_MSG_WARNING("Couldn't retrieve DELTA_THETA moment. Set it to 0.");
+        if( !pPi0Cluster->retrieveMoment(xAOD::CaloCluster::MomentType::CENTER_LAMBDA, CENTER_LAMBDA) ) ATH_MSG_WARNING("Couldn't retrieve CENTER_LAMBDA moment. Set it to 0.");
+        if( !pPi0Cluster->retrieveMoment(xAOD::CaloCluster::MomentType::LATERAL, LATERAL) ) ATH_MSG_WARNING("Couldn't retrieve LATERAL moment. Set it to 0.");
+        if( !pPi0Cluster->retrieveMoment(xAOD::CaloCluster::MomentType::LONGITUDINAL, LONGITUDINAL) ) ATH_MSG_WARNING("Couldn't retrieve LONGITUDINAL moment. Set it to 0.");
+        if( !pPi0Cluster->retrieveMoment(xAOD::CaloCluster::MomentType::ENG_FRAC_EM, ENG_FRAC_EM) ) ATH_MSG_WARNING("Couldn't retrieve ENG_FRAC_EM moment. Set it to 0.");
+        if( !pPi0Cluster->retrieveMoment(xAOD::CaloCluster::MomentType::ENG_FRAC_MAX, ENG_FRAC_MAX) ) ATH_MSG_WARNING("Couldn't retrieve ENG_FRAC_MAX moment. Set it to 0.");
+        if( !pPi0Cluster->retrieveMoment(xAOD::CaloCluster::MomentType::ENG_FRAC_CORE, ENG_FRAC_CORE) ) ATH_MSG_WARNING("Couldn't retrieve ENG_FRAC_CORE moment. Set it to 0.");
+        if( !pPi0Cluster->retrieveMoment(xAOD::CaloCluster::MomentType::SECOND_ENG_DENS, SECOND_ENG_DENS) ) ATH_MSG_WARNING("Couldn't retrieve SECOND_ENG_DENS moment. Set it to 0.");
 
        	float E_EM1 = pPi0Cluster->eSample(CaloSampling::EMB1) + pPi0Cluster->eSample(CaloSampling::EME1);
 	      float E_EM2 = pPi0Cluster->eSample(CaloSampling::EMB2) + pPi0Cluster->eSample(CaloSampling::EME2);
@@ -239,13 +257,28 @@ std::map<unsigned, xAOD::CaloCluster*> TauPi0ClusterCreator::getClusterToShotMap
                                                    clusterItrEnd(pPi0ClusterContainer.end());
         float weightInCluster=-1.;
         float weightInPreviousCluster=-1;
+    
+        const xAOD::Jet *jetSeed = pTau.jet();
+        if (!jetSeed) {
+          ATH_MSG_ERROR("Tau jet link is invalid.");
+          return clusterToShotMap;
+        }
+        const xAOD::Vertex* jetVertex = m_tauVertexCorrection->getJetVertex(*jetSeed);
+    
+        const xAOD::Vertex* tauVertex = nullptr;
+        if (pTau.vertexLink().isValid()) tauVertex = pTau.vertex();
+      
+        TLorentzVector tauAxis = m_tauVertexCorrection->getTauAxis(pTau);
+
         for (; clusterItr != clusterItrEnd; ++clusterItr){
             xAOD::CaloCluster* cluster = (xAOD::CaloCluster*) (*clusterItr);
+            TLorentzVector clusterP4 = m_tauVertexCorrection->getVertexCorrectedP4(*cluster, tauVertex, jetVertex);
+            
             weightInCluster=-1.;
-            if (cluster->p4().Et() < m_clusterEtCut) continue; // Not interested in clusters that fail the Et cut
+            if (clusterP4.Et() < m_clusterEtCut) continue; // Not interested in clusters that fail the Et cut
             // Cluster container has clusters for all taus.
             // Only run on clusters that belong to this tau
-            if (cluster->p4().DeltaR(pTau.p4()) > .4)  continue;
+            if (clusterP4.DeltaR(tauAxis) > 0.4)  continue;
             const CaloClusterCellLink* theCellLink = cluster->getCellLinks();
             CaloClusterCellLink::const_iterator cellItr  = theCellLink->begin();
             CaloClusterCellLink::const_iterator cellItrE = theCellLink->end();
@@ -393,27 +426,36 @@ std::vector<float> TauPi0ClusterCreator::get2ndEtaMomWRTCluster( const xAOD::Cal
 //______________________________________________________________________________
 bool TauPi0ClusterCreator::setHadronicClusterPFOs(xAOD::TauJet& pTau, xAOD::PFOContainer& pHadronPFOContainer) const
 {
-    const xAOD::Jet* tauJetSeed = pTau.jet();
-    if (!tauJetSeed) {
-        ATH_MSG_ERROR("Could not retrieve tau jet seed");
-        return false;
+    if (! pTau.jetLink().isValid()) {
+      ATH_MSG_ERROR("Tau jet link is invalid.");
+      return false;
     }
+    const xAOD::Jet *jetSeed = pTau.jet();
+    
+    const xAOD::Vertex* jetVertex = m_tauVertexCorrection->getJetVertex(*jetSeed);
+    
+    const xAOD::Vertex* tauVertex = nullptr;
+    if (pTau.vertexLink().isValid()) tauVertex = pTau.vertex();
+    
+    TLorentzVector tauAxis = m_tauVertexCorrection->getTauAxis(pTau);
+    
     std::vector<const xAOD::CaloCluster*> clusterList;
-
-    StatusCode sc = tauRecTools::GetJetClusterList(tauJetSeed, clusterList, m_incShowerSubtr);
+    StatusCode sc = tauRecTools::GetJetClusterList(jetSeed, clusterList, m_incShowerSubtr);
     if (!sc) return false;
 
-    for (auto cluster : clusterList){
+    for (const xAOD::CaloCluster* cluster : clusterList){
         // Procedure: 
         // - Calculate cluster energy in Hcal. This is to treat -ve energy cells correctly
         // - Then set 4momentum via setP4(E/cosh(eta), eta, phi, m). This forces the PFO to have the correct energy and mass
         // - Ignore clusters outside 0.2 cone and those with overall negative energy or negative energy in Hcal
 
         // Don't create PFOs for clusters with overall (Ecal+Hcal) negative energy (noise)
-        if(cluster->e()<=0.) continue;
+        TLorentzVector clusterP4 = m_tauVertexCorrection->getVertexCorrectedP4(*cluster, tauVertex, jetVertex);
+        
+        if(clusterP4.E()<=0.) continue;
 
         // Only need clusters in core cone. Others are not needed for subtraction
-        if(pTau.p4().DeltaR(cluster->p4()) > 0.2) continue;
+        if(tauAxis.DeltaR(clusterP4) > 0.2) continue;
 
         // Loop over cells to calculate cluster energy in Hcal
         double clusterE_Hcal=0.;
diff --git a/Reconstruction/tauRecTools/src/TauPi0ClusterCreator.h b/Reconstruction/tauRecTools/src/TauPi0ClusterCreator.h
index 6185d81cb347e34cf20499c4311132618e1b9cd1..49c3bc0da56b00c774cecf64d84f491a75a69563 100644
--- a/Reconstruction/tauRecTools/src/TauPi0ClusterCreator.h
+++ b/Reconstruction/tauRecTools/src/TauPi0ClusterCreator.h
@@ -5,13 +5,18 @@
 #ifndef TAUREC_TAUPI0CLUSTERCREATOR_H
 #define	TAUREC_TAUPI0CLUSTERCREATOR_H
 
-#include <string>
-#include <vector>
 #include "tauRecTools/TauRecToolBase.h"
+#include "tauRecTools/ITauVertexCorrection.h"
+
 #include "xAODPFlow/PFOAuxContainer.h"
 #include "xAODCaloEvent/CaloClusterAuxContainer.h"
+
+#include "AsgTools/ToolHandle.h"
 #include "GaudiKernel/SystemOfUnits.h"
 
+#include <string>
+#include <vector>
+
 /**
  * @brief Creates Pi0 clusters (Pi0 Finder).
  * 
@@ -26,6 +31,7 @@ public:
     ASG_TOOL_CLASS2(TauPi0ClusterCreator, TauRecToolBase, ITauToolBase);
     virtual ~TauPi0ClusterCreator();
 
+    virtual StatusCode initialize() override;
     virtual StatusCode executePi0ClusterCreator(xAOD::TauJet& pTau, xAOD::PFOContainer& neutralPFOContainer, 
 						xAOD::PFOContainer& hadronicClusterPFOContainer,
 						xAOD::CaloClusterContainer& pi0CaloClusContainer,
@@ -60,13 +66,11 @@ private:
     /** @brief get hadronic cluster PFOs*/
     bool setHadronicClusterPFOs(xAOD::TauJet& pTau, xAOD::PFOContainer& pHadronicClusterContainer) const;
 
-    /** @brief pt threshold for pi0 candidate clusters */
     Gaudi::Property<double> m_clusterEtCut {this, "ClusterEtCut", 0.5 * Gaudi::Units::GeV, "Et threshould for pi0 candidate clusters"};
-    
     Gaudi::Property<bool> m_incShowerSubtr {this, "IncShowerSubtr", true, "use shower subtracted clusters in calo calculations"};
 
-    SG::ReadHandleKey<xAOD::CaloClusterContainer> m_pi0ClusterInputContainer{this,"Key_Pi0ClusterContainer", "TauPi0SubtractedClusters", "input pi0 cluster"};
-
+    ToolHandle<ITauVertexCorrection> m_tauVertexCorrection { this, 
+      "TauVertexCorrection", "TauVertexCorrection", "Tool to perform the vertex correction"};
 };
 
 #endif	/* TAUPI0CLUSTERCREATOR_H */
diff --git a/Reconstruction/tauRecTools/src/TauPi0ClusterScaler.cxx b/Reconstruction/tauRecTools/src/TauPi0ClusterScaler.cxx
index 6877ae6ce9378dd28f754dc8e1026ac748c002f8..45aeb323e2db670626a9ac6cf8ebded2293c96d9 100644
--- a/Reconstruction/tauRecTools/src/TauPi0ClusterScaler.cxx
+++ b/Reconstruction/tauRecTools/src/TauPi0ClusterScaler.cxx
@@ -77,7 +77,7 @@ void TauPi0ClusterScaler::resetNeutralPFOs(xAOD::TauJet& pTau, xAOD::PFOContaine
         const xAOD::CaloCluster* cl = pfo->cluster(0);
 
         // apply cluster vertex correction 
-        if(pTau.vertexLink()){
+        if(pTau.vertexLink().isValid()){
             auto clcorr = xAOD::CaloVertexedTopoCluster(*cl, pTau.vertex()->position());
             pfo->setP4(clcorr.pt(), clcorr.eta(), clcorr.phi(), 0.0);
         }
diff --git a/Reconstruction/tauRecTools/src/TauPi0CreateROI.cxx b/Reconstruction/tauRecTools/src/TauPi0CreateROI.cxx
index b372dffc1ae1ae3efbcbd7b148ff6ba9640d1169..6611aea2e5f765431cba6e9e42adf42947ebf5ba 100644
--- a/Reconstruction/tauRecTools/src/TauPi0CreateROI.cxx
+++ b/Reconstruction/tauRecTools/src/TauPi0CreateROI.cxx
@@ -42,7 +42,7 @@ StatusCode TauPi0CreateROI::initialize() {
 }
 
 //______________________________________________________________________________
-StatusCode TauPi0CreateROI::executePi0CreateROI(xAOD::TauJet& pTau, CaloCellContainer& pPi0CellContainer, std::vector<CaloCell*>& addedCellsMap) {
+StatusCode TauPi0CreateROI::executePi0CreateROI(xAOD::TauJet& pTau, CaloCellContainer& pPi0CellContainer, std::vector<CaloCell*>& addedCellsMap) const {
 
     //---------------------------------------------------------------------
     // only run on 1-5 prong taus 
diff --git a/Reconstruction/tauRecTools/src/TauPi0CreateROI.h b/Reconstruction/tauRecTools/src/TauPi0CreateROI.h
index b5b7a1fe055f115607037062b0b28ea7d9e66309..61413ebbab5f39d74c43a168e974be396c243e16 100644
--- a/Reconstruction/tauRecTools/src/TauPi0CreateROI.h
+++ b/Reconstruction/tauRecTools/src/TauPi0CreateROI.h
@@ -31,7 +31,7 @@ public:
     virtual ~TauPi0CreateROI();
 
     virtual StatusCode initialize() override;
-    virtual StatusCode executePi0CreateROI(xAOD::TauJet& pTau, CaloCellContainer& Pi0CellContainer, std::vector<CaloCell*>& map) override;
+    virtual StatusCode executePi0CreateROI(xAOD::TauJet& pTau, CaloCellContainer& Pi0CellContainer, std::vector<CaloCell*>& map) const override;
 
 private:
     SG::ReadHandleKey<CaloCellContainer> m_caloCellInputContainer{this,"Key_caloCellInputContainer", "AllCalo", "input vertex container key"};
diff --git a/Reconstruction/tauRecTools/src/TauTrackFinder.cxx b/Reconstruction/tauRecTools/src/TauTrackFinder.cxx
index 996718a98892b9aa059143981d187fb63b6f2820..7819dcef8aa05844bcb2feec8e85f9c9bd08eeb5 100644
--- a/Reconstruction/tauRecTools/src/TauTrackFinder.cxx
+++ b/Reconstruction/tauRecTools/src/TauTrackFinder.cxx
@@ -68,7 +68,8 @@ StatusCode TauTrackFinder::executeTrackFinder(xAOD::TauJet& pTau, xAOD::TauTrack
   }
 
   // get the primary vertex
-  const xAOD::Vertex* pVertex = pTau.vertexLink() ? pTau.vertex() : nullptr;
+  const xAOD::Vertex* pVertex = nullptr;
+  if (pTau.vertexLink().isValid()) pVertex = pTau.vertex();
 
   // retrieve tracks wrt a vertex                                                                                                                              
   // as a vertex is used: tau origin / PV / beamspot / 0,0,0 (in this order, depending on availability)                                                        
diff --git a/Reconstruction/tauRecTools/src/TauVertexFinder.cxx b/Reconstruction/tauRecTools/src/TauVertexFinder.cxx
index a40c2bb93fec6e9a3c20178bc7b99293d7421280..2612c7bd6c0c242de6cd37358a61b89a2fd6b2ad 100644
--- a/Reconstruction/tauRecTools/src/TauVertexFinder.cxx
+++ b/Reconstruction/tauRecTools/src/TauVertexFinder.cxx
@@ -25,8 +25,7 @@ TauVertexFinder::~TauVertexFinder() {
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 StatusCode TauVertexFinder::initialize() {
   ATH_CHECK( m_vertexInputContainer.initialize(SG::AllowEmpty) );
-  if (inTrigger())
-    ATH_CHECK( m_trackPartInputContainer.initialize(SG::AllowEmpty) );
+  ATH_CHECK( m_trackPartInputContainer.initialize(SG::AllowEmpty) );
   ATH_CHECK( m_jetTrackVtxAssoc.initialize() );
   
   if (m_useTJVA) ATH_MSG_INFO("using TJVA to determine tau vertex");
diff --git a/Reconstruction/tauRecTools/src/TauVertexVariables.cxx b/Reconstruction/tauRecTools/src/TauVertexVariables.cxx
index 1fecbc1b0bfbf2615b3c8075effdaf8e320e3d4d..92ba975c10edddcc4f4b267f4e454e2dcb270b1d 100644
--- a/Reconstruction/tauRecTools/src/TauVertexVariables.cxx
+++ b/Reconstruction/tauRecTools/src/TauVertexVariables.cxx
@@ -74,7 +74,7 @@ StatusCode TauVertexVariables::executeVertexVariables(xAOD::TauJet& pTau, xAOD::
         ATH_MSG_DEBUG("No Beamspot object in tau candidate");
       }
     }
-    else if (pTau.vertexLink()) { // offline: obtain tau vertex by link
+    else if (pTau.vertexLink().isValid()) { // offline: obtain tau vertex by link
       vxcand = pTau.vertex() ;
       //check if vertex has a valid type (skip if vertex has type NoVtx)
       if (vxcand->vertexType() != xAOD::VxType::NoVtx) {
@@ -118,7 +118,7 @@ StatusCode TauVertexVariables::executeVertexVariables(xAOD::TauJet& pTau, xAOD::
   pTau.setDetail(xAOD::TauJetParameters::trFlightPathSig, (float)(-1111.));
   
   //try to find secondary vertex if more than 1 track and the tau vertex is available
-  if ( pTau.nTracks() < 2 ||  !pTau.vertexLink() ) {
+  if ( pTau.nTracks() < 2 ||  !pTau.vertexLink().isValid() ) {
     return StatusCode::SUCCESS;
   }
 
@@ -171,12 +171,11 @@ StatusCode TauVertexVariables::executeVertexVariables(xAOD::TauJet& pTau, xAOD::
 //-------------------------------------------------------------------------
 double TauVertexVariables::trFlightPathSig(const xAOD::TauJet& pTau, const xAOD::Vertex& secVertex) const {
 
-  const xAOD::Vertex* pVertex = nullptr;
-  if (pTau.vertexLink()) pVertex = pTau.vertex();
-  if (!pVertex) {
+  if (! pTau.vertexLink().isValid()) {
     ATH_MSG_WARNING("No primary vertex information for calculation of transverse flight path significance");
     return -11111.;
   }
+  const xAOD::Vertex* pVertex = pTau.vertex();
 
   double fpx = secVertex.position().x() - pVertex->position().x();
   double fpy = secVertex.position().y() - pVertex->position().y();
diff --git a/Reconstruction/tauRecTools/src/components/tauRecTools_entries.cxx b/Reconstruction/tauRecTools/src/components/tauRecTools_entries.cxx
index e7ff8455c94823a6f068975cc473c419509b0cc6..207cd195446f90782ffd7e3206aa6fd5626f8dca 100644
--- a/Reconstruction/tauRecTools/src/components/tauRecTools_entries.cxx
+++ b/Reconstruction/tauRecTools/src/components/tauRecTools_entries.cxx
@@ -28,6 +28,7 @@
 #include "tauRecTools/TauIDVarCalculator.h"
 #include "tauRecTools/TauJetRNNEvaluator.h"
 #include "tauRecTools/TauDecayModeNNClassifier.h"
+#include "tauRecTools/TauVertexCorrection.h"
 
 #ifndef XAOD_ANALYSIS
 DECLARE_COMPONENT( JetSeedBuilder )
@@ -61,3 +62,4 @@ DECLARE_COMPONENT( TauEleOLRDecorator )
 DECLARE_COMPONENT( TauIDVarCalculator )
 DECLARE_COMPONENT( TauJetRNNEvaluator )
 DECLARE_COMPONENT( TauDecayModeNNClassifier )
+DECLARE_COMPONENT( TauVertexCorrection )
diff --git a/Reconstruction/tauRecTools/tauRecTools/CaloClusterVariables.h b/Reconstruction/tauRecTools/tauRecTools/CaloClusterVariables.h
index 32fc490e512f4fd88040c3de0cd910bd59182294..cad3ea1d67893239d70369a897aeea56f402a0e2 100644
--- a/Reconstruction/tauRecTools/tauRecTools/CaloClusterVariables.h
+++ b/Reconstruction/tauRecTools/tauRecTools/CaloClusterVariables.h
@@ -5,18 +5,14 @@
 #ifndef CALOCLUSTERVARIABLES_H
 #define CALOCLUSTERVARIABLES_H
 
-#include <vector>
-#include "xAODCaloEvent/CaloVertexedTopoCluster.h"
-#ifndef XAOD_ANALYSIS
-#include "CaloUtils/CaloVertexedCluster.h"
-typedef xAOD::CaloVertexedCluster CaloVertexedClusterType;
-#else
-typedef xAOD::CaloVertexedTopoCluster CaloVertexedClusterType;
-#endif
-#include "CxxUtils/fpcompare.h"
+#include "tauRecTools/ITauVertexCorrection.h"
+
 #include "xAODTau/TauJet.h"
+#include "AsgTools/ToolHandle.h"
+#include "CxxUtils/fpcompare.h"
 
 #include "TLorentzVector.h"
+#include <vector>
 
 
 /** Provide calculations of cluster based variables using the clusters associated to the jet seed of the tau candidate. */
@@ -30,9 +26,8 @@ public:
     ~CaloClusterVariables() {
     }
 
-    bool update(const xAOD::TauJet& pTau); //!< update the internal variables for the given tau
+    bool update(const xAOD::TauJet& pTau, const ToolHandle<ITauVertexCorrection>& handle); //!< update the internal variables for the given tau
 
-    void setVertexCorrection(bool flag) {m_doVertexCorrection=flag;}
     void setIncSub(bool flag) {m_incShowerSubtr=flag;}
 
     // ID Variables
@@ -63,25 +58,20 @@ private:
     double m_effEnergy;
 
     // Calculate the geometrical center of the tau constituents
-    TLorentzVector calculateTauCentroid(int nConst, const std::vector<CaloVertexedClusterType>& constituents);
-
-    // Enable cell origin correction.
-    // Eta and phi of the cells are corrected wrt to the origin of the tau vertex
-    bool m_doVertexCorrection;
+    TLorentzVector calculateTauCentroid(int nConst, const std::vector<TLorentzVector>& clusterP4Vector);
 
     // use shower subtracted clusters with PFlow jet seeds
     bool m_incShowerSubtr;
-
 };
 
 //-------------------------------------------------------------------------
 //! Descending order by energy
 //-------------------------------------------------------------------------
 struct CaloClusterCompare { 
-  bool operator()(const CaloVertexedClusterType& left, const CaloVertexedClusterType& right) {
+  bool operator()(const TLorentzVector& left, const TLorentzVector& right) {
     //volatile double leftE = left.e();
     //volatile double rightE = right.e();
-    return CxxUtils::fpcompare::greater (left.e(),right.e());
+    return CxxUtils::fpcompare::greater (left.E(),right.E());
   }
 };
 
diff --git a/Reconstruction/tauRecTools/tauRecTools/HelperFunctions.h b/Reconstruction/tauRecTools/tauRecTools/HelperFunctions.h
index 0dfd6a8180709e7e7042225282fa25c305c1a257..7768759f70106b283adea6c6489f23d358eab07b 100644
--- a/Reconstruction/tauRecTools/tauRecTools/HelperFunctions.h
+++ b/Reconstruction/tauRecTools/tauRecTools/HelperFunctions.h
@@ -5,29 +5,33 @@
 #ifndef TAURECTOOLS_HELPERFUNCTIONS_H
 #define TAURECTOOLS_HELPERFUNCTIONS_H
 
-#include "MVAUtils/BDT.h"
 #include "AsgMessaging/MessageCheck.h"
+#include "xAODTracking/VertexContainer.h"
+#include "xAODTau/TauJet.h"
+#include "xAODCaloEvent/CaloCluster.h"
+#include "xAODPFlow/PFO.h"
 
-#include <vector>
-#include <map>
+#include "MVAUtils/BDT.h"
 
-// ROOT include(s)
 #include "TLorentzVector.h"
 #include "TString.h"
 
-// EDM include(s):
-#include "xAODTau/TauJet.h"
+#include <vector>
+#include <map>
+
 
 namespace tauRecTools
 {
   ANA_MSG_HEADER(msgHelperFunction)
 
-    const StatusCode GetJetClusterList(const xAOD::Jet* jet, std::vector<const xAOD::CaloCluster*> &clusterList, bool incShowerSubtracted, TLorentzVector dRVector = TLorentzVector(0.,0.,0.,0.), double dRCut = -1);
+  const StatusCode GetJetClusterList(const xAOD::Jet* jet, std::vector<const xAOD::CaloCluster*> &clusterList, bool incShowerSubtracted);
 
   xAOD::TauTrack::TrackFlagType isolateClassifiedBits(xAOD::TauTrack::TrackFlagType flag);
   bool sortTracks(const ElementLink<xAOD::TauTrackContainer> &l1, const ElementLink<xAOD::TauTrackContainer> &l2);
 
   std::unique_ptr<MVAUtils::BDT> configureMVABDT( std::map<TString, float*> &availableVars, const TString& weightFile);
+  // initialise the BDT and return the list of input variable names
+  std::unique_ptr<MVAUtils::BDT> configureMVABDT(std::vector<TString>& variableNames, const TString& weightFile);
 
   std::vector<TString> parseString(const TString& str, const TString& delim=",");
   std::vector<TString> parseStringMVAUtilsBDT(const TString& str, const TString& delim=",");
diff --git a/Reconstruction/tauRecTools/tauRecTools/ITauToolBase.h b/Reconstruction/tauRecTools/tauRecTools/ITauToolBase.h
index e5770929a71efa8a0b702255f32edec443287ee5..24c33d823fb3b29532a31b0a32e0d05aafcee310 100644
--- a/Reconstruction/tauRecTools/tauRecTools/ITauToolBase.h
+++ b/Reconstruction/tauRecTools/tauRecTools/ITauToolBase.h
@@ -68,7 +68,7 @@ class ITauToolBase : virtual public asg::IAsgTool
   virtual StatusCode executeDev(xAOD::TauJet& pTau) = 0;
 #else
   // CaloCellContainer not available in AnalysisBase
-  virtual StatusCode executePi0CreateROI(xAOD::TauJet& pTau, CaloCellContainer& caloCellContainer, std::vector<CaloCell*>& map ) = 0;
+  virtual StatusCode executePi0CreateROI(xAOD::TauJet& pTau, CaloCellContainer& caloCellContainer, std::vector<CaloCell*>& map ) const = 0;
 #endif
   
   //-----------------------------------------------------------------
diff --git a/Reconstruction/tauRecTools/tauRecTools/ITauVertexCorrection.h b/Reconstruction/tauRecTools/tauRecTools/ITauVertexCorrection.h
new file mode 100644
index 0000000000000000000000000000000000000000..35fa425b67bca528de1558217d051be7a6ec28e3
--- /dev/null
+++ b/Reconstruction/tauRecTools/tauRecTools/ITauVertexCorrection.h
@@ -0,0 +1,83 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef ITAUVERTEXCORRECTION_H
+#define ITAUVERTEXCORRECTION_H
+
+#include "AsgTools/IAsgTool.h"
+
+#include "xAODTracking/VertexContainer.h"
+#include "xAODPFlow/PFOContainer.h"
+#include "xAODCaloEvent/CaloClusterContainer.h"
+#include "xAODTau/TauJet.h"
+
+
+/**
+ * @brief Tool to perform the vertex correction for the tau candidate
+ */
+
+class ITauVertexCorrection : virtual public asg::IAsgTool {
+ 
+public:
+
+  ASG_TOOL_INTERFACE(ITauVertexCorrection) 
+
+  virtual ~ITauVertexCorrection() = default;
+
+  virtual StatusCode initialize() = 0;
+  
+  /** Get the jet vertex */
+  virtual const xAOD::Vertex* getJetVertex(const xAOD::Jet& jet) const = 0;
+
+  /** Get the tau axis */
+  virtual TLorentzVector getTauAxis(const xAOD::TauJet& tau) const = 0;
+  
+  /**@brief Get the vertex corrected four momentum, the position of 
+   *        the tau vertex relative to the jet vertex is used
+   * @param cluster input cluster
+   * @param vertex the vertex of the tau candidate
+   * @param relativeVertex the vertex of the jet seed
+   */
+  virtual TLorentzVector getVertexCorrectedP4(const xAOD::CaloCluster& cluster, 
+                                      const xAOD::Vertex* vertex,
+                                      const xAOD::Vertex* relativeVertex = nullptr) const = 0;
+  
+  /**@brief Get the vertex corrected four momentum, the position of 
+   *        the tau vertex relative to the jet vertex is used
+   * @param pfo input PFO
+   * @param vertex the vertex of the tau candidate
+   * @param relativeVertex the vertex of the jet seed
+   */
+  virtual TLorentzVector getVertexCorrectedP4(const xAOD::PFO& pfo, 
+                                      const xAOD::Vertex* vertex, 
+                                      const xAOD::Vertex* relativeVertex = nullptr) const = 0; 
+
+  /**@brief Get the vertex corrected four momentum, the position of 
+   *        the tau vertex relative to the jet vertex is used
+   * @param constituent input constituent
+   * @param vertex the vertex of the tau candiate
+   * @param relativeVertex the vertex of the jet seed
+   */
+  virtual TLorentzVector getVertexCorrectedP4(const xAOD::JetConstituent& constituent, 
+                                      const xAOD::Vertex* vertex, 
+                                      const xAOD::Vertex* relativeVertex = nullptr) const = 0; 
+
+private:
+
+  /**@brief Get the vertex corrected four momentum
+   * @param cluster input cluster
+   * @param position position of the vertex
+   */
+  virtual TLorentzVector getVertexCorrectedP4(const xAOD::CaloCluster& cluster, 
+                                      const Amg::Vector3D& position) const = 0;
+  
+  /**@brief Get the vertex corrected four momentum
+   * @param pfo input PFO
+   * @param position position of the vertex
+   */
+  virtual TLorentzVector getVertexCorrectedP4(const xAOD::PFO& pfo, 
+                                      const Amg::Vector3D& position) const = 0;
+};
+
+#endif // ITAUVERTEXCORRECTION_H
diff --git a/Reconstruction/tauRecTools/tauRecTools/MvaTESEvaluator.h b/Reconstruction/tauRecTools/tauRecTools/MvaTESEvaluator.h
index 9278fce1243eb80a241db5742d52beb12a4429c8..c1f438416a1b9cbc473c5ae931d041c33a96849d 100644
--- a/Reconstruction/tauRecTools/tauRecTools/MvaTESEvaluator.h
+++ b/Reconstruction/tauRecTools/tauRecTools/MvaTESEvaluator.h
@@ -23,7 +23,6 @@ class MvaTESEvaluator
     
   virtual StatusCode initialize() override;
   virtual StatusCode execute(xAOD::TauJet& xTau) const override;
-  virtual StatusCode finalize() override { return StatusCode::SUCCESS; }
   
  private:
   // MVA input variables (provide all variables in float)
diff --git a/Reconstruction/tauRecTools/tauRecTools/MvaTESVariableDecorator.h b/Reconstruction/tauRecTools/tauRecTools/MvaTESVariableDecorator.h
index d59716827b4b296ce4cf69b92bf21013949aa0cd..2ca20797ba6276727435aeaf9ef84cbd13ea4b28 100644
--- a/Reconstruction/tauRecTools/tauRecTools/MvaTESVariableDecorator.h
+++ b/Reconstruction/tauRecTools/tauRecTools/MvaTESVariableDecorator.h
@@ -6,10 +6,12 @@
 #define TAURECTOOLSDEV_MVATESVARIABLEDECORATOR_H
 
 #include "tauRecTools/TauRecToolBase.h"
+#include "tauRecTools/ITauVertexCorrection.h"
 
+#include "xAODEventInfo/EventInfo.h"
 #include "AsgDataHandles/ReadHandleKey.h"
 #include "AsgDataHandles/ReadDecorHandleKey.h"
-#include "xAODEventInfo/EventInfo.h"
+#include "AsgTools/ToolHandle.h"
 
 
 class MvaTESVariableDecorator
@@ -27,17 +29,20 @@ class MvaTESVariableDecorator
 
  private:
 
+  bool m_incShowerSubtr;
+
   SG::ReadDecorHandleKey<xAOD::EventInfo> m_aveIntPerXKey {this, 
       "AveIntPerXKey", 
       "EventInfo.AveIntPerXDecor",
       "Decoration for Average Interaction Per Crossing"};
   
-  SG::ReadHandleKey<xAOD::VertexContainer> m_vertexInputContainer {this,
+  SG::ReadHandleKey<xAOD::VertexContainer> m_vertexContainerKey {this,
       "Key_vertexInputContainer",
       "PrimaryVertices",
       "input vertex container key"};
 
-  bool m_incShowerSubtr;
+  ToolHandle<ITauVertexCorrection> m_tauVertexCorrection { this, 
+      "TauVertexCorrection", "TauVertexCorrection", "Tool to perform the vertex correction"};
 };
 
 
diff --git a/Reconstruction/tauRecTools/tauRecTools/TauIDVarCalculator.h b/Reconstruction/tauRecTools/tauRecTools/TauIDVarCalculator.h
index b474b597504e1ad0f1f4621e004516eafeab62b6..aba97746476e7a106ce79f6614f21d9e56cf0045 100644
--- a/Reconstruction/tauRecTools/tauRecTools/TauIDVarCalculator.h
+++ b/Reconstruction/tauRecTools/tauRecTools/TauIDVarCalculator.h
@@ -13,8 +13,11 @@
 #define TAUIDVARCALCULATOR_H
 
 #include "tauRecTools/TauRecToolBase.h"
+#include "tauRecTools/ITauVertexCorrection.h"
 
-class TauIDVarCalculator: public TauRecToolBase
+#include "AsgTools/ToolHandle.h"
+
+class TauIDVarCalculator: public TauRecToolBase 
 {
   ASG_TOOL_CLASS2(TauIDVarCalculator, TauRecToolBase, ITauToolBase)
 
@@ -24,6 +27,8 @@ class TauIDVarCalculator: public TauRecToolBase
   
   virtual ~TauIDVarCalculator() {}
 
+  virtual StatusCode initialize() override;
+
   virtual StatusCode execute(xAOD::TauJet&) const override;
 
   static const float LOW_NUMBER;
@@ -31,6 +36,9 @@ class TauIDVarCalculator: public TauRecToolBase
  private:
 
   bool m_incShowerSubtr;
+
+  ToolHandle<ITauVertexCorrection> m_tauVertexCorrection { this, 
+      "TauVertexCorrection", "TauVertexCorrection", "Tool to perform the vertex correction"};
 };
 
 #endif
diff --git a/Reconstruction/tauRecTools/tauRecTools/TauJetRNNEvaluator.h b/Reconstruction/tauRecTools/tauRecTools/TauJetRNNEvaluator.h
index ecc5b89fcbc6bff56d133e6acccb74d80153f4bd..18eac022bc2e5e52442105bbfe4146f655d09659 100644
--- a/Reconstruction/tauRecTools/tauRecTools/TauJetRNNEvaluator.h
+++ b/Reconstruction/tauRecTools/tauRecTools/TauJetRNNEvaluator.h
@@ -5,14 +5,15 @@
 #ifndef TAUREC_TAUJETRNNEVALUATOR_H
 #define TAUREC_TAUJETRNNEVALUATOR_H
 
-#include <memory>
-
 #include "tauRecTools/TauRecToolBase.h"
+#include "tauRecTools/ITauVertexCorrection.h"
 
-// xAOD includes
 #include "xAODTau/TauJet.h"
 
-// Forward declarations
+#include "AsgTools/ToolHandle.h"
+
+#include <memory>
+
 class TauJetRNN;
 
 /**
@@ -70,6 +71,9 @@ private:
     std::unique_ptr<TauJetRNN> m_net_3p; //!
 
     bool m_incShowerSubtr;
+
+    ToolHandle<ITauVertexCorrection> m_tauVertexCorrection { this, 
+      "TauVertexCorrection", "TauVertexCorrection", "Tool to perform the vertex correction"};
 };
 
 
diff --git a/Reconstruction/tauRecTools/tauRecTools/TauJetRNNUtils.h b/Reconstruction/tauRecTools/tauRecTools/TauJetRNNUtils.h
index 74ef77af82fbd92c5aacaa3ec3831cabb980d6ed..1b5b3665864c0a24705c8aa448a3030d6100acc7 100644
--- a/Reconstruction/tauRecTools/tauRecTools/TauJetRNNUtils.h
+++ b/Reconstruction/tauRecTools/tauRecTools/TauJetRNNUtils.h
@@ -105,6 +105,22 @@ bool ptDetectorAxis(const xAOD::TauJet &tau, double &out);
 
 bool ptIntermediateAxis(const xAOD::TauJet &tau, double &out);
 
+//functions to calculate input variables needed for the eVeto RNN
+bool ptJetSeed_log             (const xAOD::TauJet &tau, double &out);
+bool absleadTrackEta           (const xAOD::TauJet &tau, double &out);
+bool leadTrackDeltaEta         (const xAOD::TauJet &tau, double &out);
+bool leadTrackDeltaPhi         (const xAOD::TauJet &tau, double &out);
+bool EMFracFixed               (const xAOD::TauJet &tau, double &out);
+bool etHotShotWinOverPtLeadTrk (const xAOD::TauJet &tau, double &out);
+bool hadLeakFracFixed          (const xAOD::TauJet &tau, double &out);
+bool PSFrac                    (const xAOD::TauJet &tau, double &out);
+bool ClustersMeanCenterLambda  (const xAOD::TauJet &tau, double &out);
+bool ClustersMeanEMProbability (const xAOD::TauJet &tau, double &out);
+bool ClustersMeanFirstEngDens  (const xAOD::TauJet &tau, double &out);
+bool ClustersMeanPresamplerFrac(const xAOD::TauJet &tau, double &out);
+bool ClustersMeanSecondLambda  (const xAOD::TauJet &tau, double &out);
+bool EMPOverTrkSysP            (const xAOD::TauJet &tau, double &out);
+
 
 namespace Track {
 
@@ -148,6 +164,9 @@ bool nPixelHitsPlusDeadSensors (
 bool nSCTHitsPlusDeadSensors (
     const xAOD::TauJet &tau, const xAOD::TauTrack &track, double &out);
 
+bool eProbabilityHT(
+    const xAOD::TauJet &tau, const xAOD::TauTrack &track, double &out);
+
 } // namespace Track
 
 
@@ -177,6 +196,10 @@ bool SECOND_LAMBDA(
 bool CENTER_LAMBDA(
     const xAOD::TauJet &tau, const xAOD::CaloCluster &cluster, double &out);
 
+bool SECOND_LAMBDAOverClustersMeanSecondLambda   (const xAOD::TauJet &tau, const xAOD::CaloCluster &cluster, double &out);
+bool CENTER_LAMBDAOverClustersMeanCenterLambda   (const xAOD::TauJet &tau, const xAOD::CaloCluster &cluster, double &out);
+bool FirstEngDensOverClustersMeanFirstEngDens    (const xAOD::TauJet &tau, const xAOD::CaloCluster &cluster, double &out);
+
 } // namespace Cluster
 } // namespace Variables
 } // namespace TauJetRNNUtils
diff --git a/Reconstruction/tauRecTools/tauRecTools/TauRecToolBase.h b/Reconstruction/tauRecTools/tauRecTools/TauRecToolBase.h
index 578ca89cdfc5777103e271c9422651f0ddc1ba8f..b762e5252867bb961b4c40336029da68e9b6f4b6 100644
--- a/Reconstruction/tauRecTools/tauRecTools/TauRecToolBase.h
+++ b/Reconstruction/tauRecTools/tauRecTools/TauRecToolBase.h
@@ -43,7 +43,7 @@ class TauRecToolBase : public asg::AsgTool, virtual public ITauToolBase {
 #ifdef XAOD_ANALYSIS
   virtual StatusCode executeDev(xAOD::TauJet& pTau) override;
 #else
-  virtual StatusCode executePi0CreateROI(xAOD::TauJet& pTau, CaloCellContainer& caloCellContainer, std::vector<CaloCell*>& map ) override;
+  virtual StatusCode executePi0CreateROI(xAOD::TauJet& pTau, CaloCellContainer& caloCellContainer, std::vector<CaloCell*>& map ) const override;
 #endif
   virtual StatusCode executeVertexFinder(xAOD::TauJet& pTau, 
                                          const xAOD::VertexContainer* vertexContainer = nullptr, 
diff --git a/Reconstruction/tauRecTools/tauRecTools/TauSubstructureVariables.h b/Reconstruction/tauRecTools/tauRecTools/TauSubstructureVariables.h
index 3530a60331afc8e7515e683ad080a1f6adf94138..c515d3bf61070ba54257d1d62b626be54223f809 100644
--- a/Reconstruction/tauRecTools/tauRecTools/TauSubstructureVariables.h
+++ b/Reconstruction/tauRecTools/tauRecTools/TauSubstructureVariables.h
@@ -6,6 +6,9 @@
 #define TAUREC_TAUSUBSTRUCTUREBUILDER_H
 
 #include "tauRecTools/TauRecToolBase.h"
+#include "tauRecTools/ITauVertexCorrection.h"
+
+#include "AsgTools/ToolHandle.h"
 
 /**
  * @brief Calculate variables from the tau substructure.
@@ -26,16 +29,15 @@ class TauSubstructureVariables : public TauRecToolBase
 
         ~TauSubstructureVariables();
 
+        virtual StatusCode initialize() override;
         virtual StatusCode execute(xAOD::TauJet& pTau) const override;
 
     private:
-        // enable cell origin correction
-        // eta and phi of the cells are corrected wrt to the origin of the tau vertex
-	bool m_doVertexCorrection;
-
 	// use shower subtracted clusters with PFlow jet seeds
 	bool m_incShowerSubtr;
-
+  
+    ToolHandle<ITauVertexCorrection> m_tauVertexCorrection { this, 
+      "TauVertexCorrection", "TauVertexCorrection", "Tool to perform the vertex correction"};
 };
 
 #endif
diff --git a/Reconstruction/tauRecTools/tauRecTools/TauTrackClassifier.h b/Reconstruction/tauRecTools/tauRecTools/TauTrackClassifier.h
index 219c1a34a6b1e410d1528919c816b60526791c40..6fbb507d49422f49955ae55e5596a66aaaa71569 100644
--- a/Reconstruction/tauRecTools/tauRecTools/TauTrackClassifier.h
+++ b/Reconstruction/tauRecTools/tauRecTools/TauTrackClassifier.h
@@ -68,13 +68,12 @@ class TrackMVABDT
   // for possible MVA inputs. Only Variables defined in the root weights file
   // are passed to the MVA object
   StatusCode initialize() override;
-  StatusCode finalize() override;
   
   // executes MVA object to get the BDT score, makes the decision and resets
   // classification flags
-  StatusCode classifyTrack(xAOD::TauTrack& xTrack, const xAOD::TauJet& xTau);
-  // set BDT input variables in the corresponding map entries
-  StatusCode setVars(const xAOD::TauTrack& xTrack, const xAOD::TauJet& xTau);
+  StatusCode classifyTrack(xAOD::TauTrack& xTrack, const xAOD::TauJet& xTau) const;
+  // calculate all input variables
+  StatusCode calculateVariables(const xAOD::TauTrack& xTrack, const xAOD::TauJet& xTau, std::vector<float>& values) const;
 
   // load the root weights file and configure the MVA object with the correct
   // variable addresses
@@ -89,9 +88,8 @@ private:
   int m_iExpectedFlag;
   
   std::unique_ptr<MVAUtils::BDT> m_rReader; //!
-  
-  std::map<TString, float*> m_mAvailableVars; //!
-  inline float& setVar(const TString& var) { return *(m_mAvailableVars[var]); } //!< not-stateless, many such examples need to be fixed for r22
+
+  std::vector<TString> m_inputVariableNames; //!
 
 }; // class TrackMVABDT
 
diff --git a/Reconstruction/tauRecTools/tauRecTools/TauVertexCorrection.h b/Reconstruction/tauRecTools/tauRecTools/TauVertexCorrection.h
new file mode 100644
index 0000000000000000000000000000000000000000..d28681b59d854c8a3253396c8e76d68fe0a78d59
--- /dev/null
+++ b/Reconstruction/tauRecTools/tauRecTools/TauVertexCorrection.h
@@ -0,0 +1,98 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef TAUVERTEXCORRECTION_H
+#define TAUVERTEXCORRECTION_H
+
+#include "tauRecTools/ITauVertexCorrection.h"
+
+#include "AsgTools/AsgTool.h"
+#include "AsgDataHandles/ReadHandleKey.h"
+
+/**
+ * @brief Tool to perform the vertex correction for the tau candidate
+ * @author Xiaozhong Huang <xiaozhong.huang@cern.ch>  
+ */
+
+class TauVertexCorrection : public asg::AsgTool, virtual public ITauVertexCorrection {
+ 
+public:
+
+  ASG_TOOL_INTERFACE(TauVertexCorrection)
+  ASG_TOOL_CLASS1(TauVertexCorrection, ITauVertexCorrection)
+
+  TauVertexCorrection(const std::string& name);
+  virtual ~TauVertexCorrection() = default;
+
+  virtual StatusCode initialize() override;
+  
+  /** Get the jet vertex */
+  virtual const xAOD::Vertex* getJetVertex(const xAOD::Jet& jet) const override;
+  
+  /** Get the tau axis */
+  virtual TLorentzVector getTauAxis(const xAOD::TauJet& tau) const override;
+  
+  /**@brief Get the vertex corrected four momentum, the position of 
+   *        the tau vertex relative to the jet vertex is used
+   * @param cluster input cluster
+   * @param tauVertex the vertex of the tau candidate
+   * @param jetVertex the vertex of the jet seed
+   */
+  virtual TLorentzVector getVertexCorrectedP4(const xAOD::CaloCluster& cluster, 
+                                      const xAOD::Vertex* tauVertex,
+                                      const xAOD::Vertex* jetVertex = nullptr) const override;
+  
+  /**@brief Get the vertex corrected four momentum, the position of 
+   *        the tau vertex relative to the jet vertex is used
+   * @param pfo input PFO
+   * @param tauVertex the vertex of the tau candidate
+   * @param jetVertex the vertex of the jet seed
+   */
+  virtual TLorentzVector getVertexCorrectedP4(const xAOD::PFO& pfo, 
+                                      const xAOD::Vertex* tauVertex, 
+                                      const xAOD::Vertex* jetVertex = nullptr) const override; 
+
+  /**@brief Get the vertex corrected four momentum, the position of 
+   *        the tau vertex relative to the jet vertex is used
+   * @param constituent input constituent
+   * @param tauVertex the vertex of the tau candiate
+   * @param jetVertex the vertex of the jet seed
+   */
+  virtual TLorentzVector getVertexCorrectedP4(const xAOD::JetConstituent& constituent, 
+                                      const xAOD::Vertex* tauVertex, 
+                                      const xAOD::Vertex* jetVertex = nullptr) const override; 
+
+private:
+  
+  /**@brief Get the vertex corrected four momentum
+   * @param cluster input cluster
+   * @param position position of the vertex
+   */
+  virtual TLorentzVector getVertexCorrectedP4(const xAOD::CaloCluster& cluster, 
+                                      const Amg::Vector3D& position) const override;
+  
+  /**@brief Get the vertex corrected four momentum
+   * @param pfo input PFO
+   * @param position position of the vertex
+   */
+  virtual TLorentzVector getVertexCorrectedP4(const xAOD::PFO& pfo, 
+                                      const Amg::Vector3D& position) const override;
+  
+  /// Name of the seed jet
+  std::string m_seedJet;
+
+  /// Switch of the tau vertex correction
+  bool m_doVertexCorrection; 
+
+  /// Switch of the jet vertex correction
+  bool m_doJetVertexCorrection;
+
+  /// Whether the seed jet is at EM scale 
+  bool m_isEMScale = false; //!
+
+  /// Whehter the seed jet is PFO 
+  bool m_isPFO = false; //!
+};
+
+#endif // ITAUVERTEXCORRECTION_H
diff --git a/Simulation/BeamEffects/share/BeamEffectsAlg_test.ref b/Simulation/BeamEffects/share/BeamEffectsAlg_test.ref
index bb42b8c5d058ead706100c086d766af36c514a12..6c7319f09e73a164aa4559136f4c94aa35e1a029 100644
--- a/Simulation/BeamEffects/share/BeamEffectsAlg_test.ref
+++ b/Simulation/BeamEffects/share/BeamEffectsAlg_test.ref
@@ -1,37 +1,36 @@
-[==========] Running 7 tests from 1 test case.
+[==========] Running 7 tests from 1 test suite.
 [----------] Global test environment set-up.
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
-                                                   Welcome to ApplicationMgr (GaudiCoreSvc v27r1p99)
-                                          running on karma on Fri Feb 17 22:54:02 2017
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v34r0)
+                                          running on 36d5a1e47246 on Sat Sep 12 19:55:44 2020
 ====================================================================================================================================
 ApplicationMgr       INFO Application Manager Configured successfully
 EventLoopMgr      WARNING Unable to locate service "EventSelector" 
 EventLoopMgr      WARNING No events will be processed from external input.
-HistogramPersis...WARNING Histograms saving not required.
 ApplicationMgr       INFO Application Manager Initialized successfully
 ApplicationMgr Ready
 [----------] 7 tests from BeamEffectsAlg_test
 [ RUN      ] BeamEffectsAlg_test.empty_alg_execute
-ClassIDSvc           INFO  getRegistryEntries: read 1507 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 2101 CLIDRegistry entries for module ALL
 BeamEffectsAlg      FATAL No input McEventCollection called GEN_EVENT in StoreGate.
-[       OK ] BeamEffectsAlg_test.empty_alg_execute (179 ms)
+[       OK ] BeamEffectsAlg_test.empty_alg_execute (16 ms)
 [ RUN      ] BeamEffectsAlg_test.set_properties
-ClassIDSvc           INFO  getRegistryEntries: read 359 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 430 CLIDRegistry entries for module ALL
 [       OK ] BeamEffectsAlg_test.set_properties (1 ms)
 [ RUN      ] BeamEffectsAlg_test.patchSignalProcessVertex_empty_GenEvent
 BeamEffectsAlg    WARNING No signal_process_vertex found. Empty GenEvent!
 [       OK ] BeamEffectsAlg_test.patchSignalProcessVertex_empty_GenEvent (0 ms)
 [ RUN      ] BeamEffectsAlg_test.signal_process_vertex_exists
-[       OK ] BeamEffectsAlg_test.signal_process_vertex_exists (1 ms)
+[       OK ] BeamEffectsAlg_test.signal_process_vertex_exists (0 ms)
 [ RUN      ] BeamEffectsAlg_test.add_signal_process_vertex_atlasG4
 [       OK ] BeamEffectsAlg_test.add_signal_process_vertex_atlasG4 (0 ms)
 [ RUN      ] BeamEffectsAlg_test.add_signal_process_vertex_isfG4
 [       OK ] BeamEffectsAlg_test.add_signal_process_vertex_isfG4 (0 ms)
 [ RUN      ] BeamEffectsAlg_test.execute_pass_through
-[       OK ] BeamEffectsAlg_test.execute_pass_through (0 ms)
-[----------] 7 tests from BeamEffectsAlg_test (19 ms total)
+[       OK ] BeamEffectsAlg_test.execute_pass_through (1 ms)
+[----------] 7 tests from BeamEffectsAlg_test (18 ms total)
 
 [----------] Global test environment tear-down
-[==========] 7 tests from 1 test case ran. (75 ms total)
+[==========] 7 tests from 1 test suite ran. (244 ms total)
 [  PASSED  ] 7 tests.
diff --git a/Simulation/Digitization/python/PileUpMergeSvcConfigNew.py b/Simulation/Digitization/python/PileUpMergeSvcConfigNew.py
index c89acc0eba5653a2d55919c1d1f40bb7c8af1ed5..c19d73763523ddea7932bdcc02c7dbf3be0d0e1d 100644
--- a/Simulation/Digitization/python/PileUpMergeSvcConfigNew.py
+++ b/Simulation/Digitization/python/PileUpMergeSvcConfigNew.py
@@ -6,22 +6,19 @@ from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
 from AthenaConfiguration.ComponentFactory import CompFactory
 
 
-def PileUpMergeSvcCfg(flags, name="PileUpMergeSvc", **kwargs):
+def PileUpMergeSvcCfg(flags, name="PileUpMergeSvc", Intervals=[], **kwargs):
     """Return ComponentAccumulator with PileUpMergeSvc
 
-    If doing XingByXingPileUp, the "Intervals" keyword argument should
-    be set with PileUpXingFolder tools.
-    Otherwise, "Intervals" is should be empty, and we enforce that here.
+    If doing XingByXingPileUp, Intervals should contian PileUpXingFolder tools.
+    Otherwise it should be empty, and we enforce that here.
     """
     acc = ComponentAccumulator()
 
     if flags.Digitization.DoXingByXingPileUp:
         # handle input type variety
-        Intervals = kwargs.setdefault("Intervals", [])
         if not isinstance(Intervals, list):
-            kwargs["Intervals"] = [Intervals]
-    else:
-        kwargs["Intervals"] = []
+            Intervals = [Intervals]
+        kwargs["Intervals"] = Intervals
 
     acc.addService(CompFactory.PileUpMergeSvc(name, **kwargs))
     return acc
diff --git a/Simulation/Digitization/python/RunDependentConfigNew.py b/Simulation/Digitization/python/RunDependentConfigNew.py
index 6b2b24b0bb8ec4b5aa9b5e06c5052a4ddea20dc5..8aa31ec86093535dd3e094d90c7bae1e60fa1c11 100644
--- a/Simulation/Digitization/python/RunDependentConfigNew.py
+++ b/Simulation/Digitization/python/RunDependentConfigNew.py
@@ -111,7 +111,7 @@ def EvtIdModifierSvcCfg(flags, name="EvtIdModifierSvc", **kwargs):
     if len(Modifiers) > 0:
         kwargs.setdefault("Modifiers", Modifiers)
 
-    acc.addService(CompFactory.EvtIdModifierSvc(name, **kwargs))
+    acc.addService(CompFactory.EvtIdModifierSvc(name, **kwargs), create=True)
     return acc
 
 
diff --git a/Simulation/Digitization/test/DigitizationComparisonNew_test.py b/Simulation/Digitization/test/DigitizationComparisonNew_test.py
index 0f0dd4d13dc7aaac691c0816e99ae6ea43a6c673..d98f9518b78ded1e7113337c434107e527a9d781 100755
--- a/Simulation/Digitization/test/DigitizationComparisonNew_test.py
+++ b/Simulation/Digitization/test/DigitizationComparisonNew_test.py
@@ -23,7 +23,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 OverlayConfiguration.OverlayTestHelpers import JobOptsDumperCfg
+from AthenaConfiguration.JobOptsDumper import JobOptsDumperCfg
 from xAODEventInfoCnv.xAODEventInfoCnvConfig import EventInfoCnvAlgCfg
 
 # Set up logging and new style config
@@ -103,7 +103,7 @@ TileRChMaker.TileRawChannelBuilderFitOverflow.TimeMaxForAmpCorrection = 25.
 TileRChMaker.TileRawChannelBuilderFitOverflow.TimeMinForAmpCorrection = -25.
 
 # Dump config
-acc.merge(JobOptsDumperCfg(ConfigFlags))
+acc.merge(JobOptsDumperCfg(ConfigFlags, FileName="DigiComparisonConfig.txt"))
 acc.getService("StoreGateSvc").Dump = True
 acc.getService("ConditionStore").Dump = True
 acc.printConfig(withDetails=True, summariseProps=True)
diff --git a/Simulation/Digitization/test/DigitizationPUConfigNew_test.py b/Simulation/Digitization/test/DigitizationPUConfigNew_test.py
index 0260498c9b6708637f99be64213108d347a9359e..c224fe37e8f4bc52d431094c8eee8e05a2c63bdf 100755
--- a/Simulation/Digitization/test/DigitizationPUConfigNew_test.py
+++ b/Simulation/Digitization/test/DigitizationPUConfigNew_test.py
@@ -15,6 +15,7 @@ from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
 from AthenaPoolCnvSvc.PoolWriteConfig import PoolWriteCfg
 from Digitization.DigitizationParametersConfig import writeDigitizationMetadata
 from MCTruthSimAlgs.RecoTimingConfig import MergeRecoTimingObjCfg
+from AthenaConfiguration.JobOptsDumper import JobOptsDumperCfg
 from xAODEventInfoCnv.xAODEventInfoCnvConfig import EventInfoCnvAlgCfg
 from DigitizationPUConfigNew_test_setup import (
     test_HighPtMinbiasHitsFile,
@@ -72,6 +73,9 @@ ConfigFlags.Digitization.PU.LowPtMinBiasInputCols = cols
 
 ConfigFlags.lock()
 
+# test this flag
+ConfigFlags.Sim.RunToTimestampDict
+
 # Core components
 acc = MainServicesCfg(ConfigFlags)
 acc.merge(PoolReadCfg(ConfigFlags))
@@ -106,6 +110,7 @@ acc.merge(MergeCalibHitsCfg(ConfigFlags))
 #acc.getEventAlgo("OutputStreamRDO").AcceptAlgs = ["StandardPileUpToolsAlg"]
 
 # Dump config
+acc.merge(JobOptsDumperCfg(ConfigFlags, FileName="DigiPUConfig.txt"))
 acc.getService("StoreGateSvc").Dump = True
 acc.getService("ConditionStore").Dump = True
 acc.printConfig(withDetails=True)
diff --git a/Simulation/G4Atlas/G4AtlasAlg/test/G4AtlasAlgConfigNew_Test.py b/Simulation/G4Atlas/G4AtlasAlg/test/G4AtlasAlgConfigNew_Test.py
index 5fba79a6e60cc938c9a597cfc52b079ea4379d4e..2673b77bffd3fab587b2e16f8ecc9556882dc861 100755
--- a/Simulation/G4Atlas/G4AtlasAlg/test/G4AtlasAlgConfigNew_Test.py
+++ b/Simulation/G4Atlas/G4AtlasAlg/test/G4AtlasAlgConfigNew_Test.py
@@ -153,7 +153,7 @@ if __name__ == '__main__':
     eventSelector.InitialTimeStamp = myInitialTimeStamp # Necessary to avoid a crash
     if hasattr(eventSelector, "OverrideRunNumberFromInput"):
         eventSelector.OverrideRunNumberFromInput = True
-    cfg.addService(evtIdModifierSvc)
+    cfg.addService(evtIdModifierSvc, create=True)
     # ... up to here?
 
     # add BeamEffectsAlg
diff --git a/Simulation/G4Atlas/G4AtlasApps/python/SimConfigFlags.py b/Simulation/G4Atlas/G4AtlasApps/python/SimConfigFlags.py
index 00129b473b64e00ca3072d59213cd7e0f8a3b7fe..07c6cb6083c27950eee75a1541f5d8a3025a2583 100644
--- a/Simulation/G4Atlas/G4AtlasApps/python/SimConfigFlags.py
+++ b/Simulation/G4Atlas/G4AtlasApps/python/SimConfigFlags.py
@@ -131,7 +131,7 @@ def createSimConfigFlags():
     # map from runNumber to timestamp; migrated from RunDMCFlags.py
     def getRunToTimestampDict():
         # this wrapper is intended to avoid an initial import
-        from RunToTimestampData import RunToTimestampDict
+        from G4AtlasApps.RunToTimestampData import RunToTimestampDict
         return RunToTimestampDict
     scf.addFlag("Sim.RunToTimestampDict", lambda prevFlags: getRunToTimestampDict())
 
diff --git a/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IDetectorGeometryTool.h b/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IDetectorGeometryTool.h
index 07cc9a9e830f7aa5fd88de32a85104256d5f645e..40ad9ab57c79bc5020b496228958b231d530d6c5 100644
--- a/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IDetectorGeometryTool.h
+++ b/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IDetectorGeometryTool.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 G4ATLASINTERFACES_IDETECTORGEOMETRYTOOL_H
@@ -53,7 +53,7 @@ class IDetectorGeometryTool : virtual public IAlgTool {
   
   virtual std::string GetDetectorName() const = 0;
   
-  virtual void SetDetectorName(std::string) = 0;
+  virtual void SetDetectorName(const std::string&) = 0;
   
   virtual void SetParent(IDetectorGeometryTool*) = 0;
   
diff --git a/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/DetectorGeometryBase.h b/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/DetectorGeometryBase.h
index e62faf61727de0493fe5d03df7bb5a1d6e4316ce..7c46b8eb3157f89c2cadec3c97a39eb70fe711ad 100644
--- a/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/DetectorGeometryBase.h
+++ b/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/DetectorGeometryBase.h
@@ -52,7 +52,7 @@ public:
 
   std::string GetDetectorName() const override;
 
-  void SetDetectorName(const std::string) override;
+  void SetDetectorName(const std::string&) override;
 
   void SetParent(IDetectorGeometryTool*) override;
 
diff --git a/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/G4FieldManagerToolBase.h b/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/G4FieldManagerToolBase.h
index 64e3149c22bf16ba230780895af6d40a53677040..dc62378f8b2d6470b068e85bf32b75e6d4b67dc2 100644
--- a/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/G4FieldManagerToolBase.h
+++ b/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/G4FieldManagerToolBase.h
@@ -55,7 +55,7 @@ class G4FieldManagerToolBase : public extends<AthAlgTool, IFieldManagerTool>
 #if G4VERSION_NUMBER < 1040
     /// Common method to construct a stepper of requested type.
     G4MagIntegratorStepper*
-    getStepper(std::string stepperType, G4MagneticField* field) const;
+    getStepper(const std::string& stepperType, G4MagneticField* field) const;
 #endif
 
     /// Common method to apply configuredfield parameters
diff --git a/Simulation/G4Atlas/G4AtlasTools/src/DetectorGeometryBase.cxx b/Simulation/G4Atlas/G4AtlasTools/src/DetectorGeometryBase.cxx
index ed9f7ada0b82111331bb190f3a570c1d1fecbc14..f3b716184fd095e15d1613c4706904dc5656122e 100644
--- a/Simulation/G4Atlas/G4AtlasTools/src/DetectorGeometryBase.cxx
+++ b/Simulation/G4Atlas/G4AtlasTools/src/DetectorGeometryBase.cxx
@@ -162,7 +162,7 @@ void DetectorGeometryBase::ResetEnvelope()
 {
 }
 
-void DetectorGeometryBase::SetDetectorName(const std::string s)
+void DetectorGeometryBase::SetDetectorName(const std::string& s)
 {
   m_detectorName=s;
 }
diff --git a/Simulation/G4Atlas/G4AtlasTools/src/G4FieldManagerToolBase.cxx b/Simulation/G4Atlas/G4AtlasTools/src/G4FieldManagerToolBase.cxx
index 57d0e2281df9560ecee615f2b474a8d5d9cad761..72c9ba445d1d3452f832c3846ada6a243e5b593c 100644
--- a/Simulation/G4Atlas/G4AtlasTools/src/G4FieldManagerToolBase.cxx
+++ b/Simulation/G4Atlas/G4AtlasTools/src/G4FieldManagerToolBase.cxx
@@ -190,7 +190,7 @@ G4FieldManagerToolBase::createDriverAndStepper(std::string name, G4MagneticField
 // Create the stepper (Geant4 < 10.4)
 //=============================================================================
 G4MagIntegratorStepper*
-G4FieldManagerToolBase::getStepper(std::string name, G4MagneticField* field) const
+G4FieldManagerToolBase::getStepper(const std::string& name, G4MagneticField* field) const
 {
   ATH_MSG_DEBUG("getStepper");
   G4Mag_EqRhs* eqRhs(nullptr);
diff --git a/Simulation/G4Sim/MCTruth/MCTruth/ATLAS_CHECK_THREAD_SAFETY b/Simulation/G4Sim/MCTruth/MCTruth/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..ab4fc576a3986a2532f18e7ae3d73591694c6b02
--- /dev/null
+++ b/Simulation/G4Sim/MCTruth/MCTruth/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Simulation/G4Sim/MCTruth
diff --git a/Simulation/G4Sim/MCTruth/MCTruth/AtlasG4EventUserInfo.h b/Simulation/G4Sim/MCTruth/MCTruth/AtlasG4EventUserInfo.h
index c706742692f3eda962f05e8376fa5b41b9a8ed4b..cfda36acc877d5eda3ecf00fbeafc13dd45b08a1 100644
--- a/Simulation/G4Sim/MCTruth/MCTruth/AtlasG4EventUserInfo.h
+++ b/Simulation/G4Sim/MCTruth/MCTruth/AtlasG4EventUserInfo.h
@@ -31,9 +31,10 @@ public:
 
         void SetCurrentlyTraced(HepMC::GenParticlePtr p) {m_currentlyTraced=p;}
 
-        HepMC::GenParticlePtr GetCurrentPrimary() const {return m_currentPrimary;}
+        HepMC::ConstGenParticlePtr GetCurrentPrimary() const {return m_currentPrimary;}
 
-        HepMC::GenParticlePtr GetCurrentlyTraced() const {return m_currentlyTraced;}
+        HepMC::GenParticlePtr GetCurrentlyTraced() {return m_currentlyTraced;}
+        HepMC::ConstGenParticlePtr GetCurrentlyTraced() const {return m_currentlyTraced;}
         int SecondaryParticleBarCode() {m_secondaryParticleBarCode++;
                                         return m_secondaryParticleBarCode;}
         int SecondaryVertexBarCode() {m_secondaryVertexBarCode--;
diff --git a/Simulation/G4Sim/MCTruth/MCTruth/TruthController.h b/Simulation/G4Sim/MCTruth/MCTruth/TruthController.h
index a43cadba15e627f2f10943bb3d41bb603d766d3c..14d3729710ea8e366b5ddfeb76831c092a650394 100644
--- a/Simulation/G4Sim/MCTruth/MCTruth/TruthController.h
+++ b/Simulation/G4Sim/MCTruth/MCTruth/TruthController.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 TruthController_H
@@ -9,18 +9,17 @@ class TrackVisualizationHelper;
 
 class TruthController {
 public:
-  static TruthController *getTruthController();
+  static const TruthController *getTruthController();
   void setVisualizationHelper(TrackVisualizationHelper *);
-  TrackVisualizationHelper* getVisualizationHelper() const
+  const TrackVisualizationHelper* getVisualizationHelper() const
   {
     return m_theVisHelper;
   }
 private:
   // this is a singleton
-  static TruthController *s_thePointer;
   TruthController();
-  TruthController(const TruthController&) {}
-  TruthController& operator= (const TruthController&);
+  TruthController(const TruthController&) = delete;
+  TruthController& operator= (const TruthController&) = delete;
   ~TruthController();
   TrackVisualizationHelper *m_theVisHelper;
 };
diff --git a/Simulation/G4Sim/MCTruth/src/TruthController.cxx b/Simulation/G4Sim/MCTruth/src/TruthController.cxx
index 7a1886ac06af12c84f34fd2e4d71ed255ef27d56..953f24f736deb2284acde5eec0af3fa86d05d622 100644
--- a/Simulation/G4Sim/MCTruth/src/TruthController.cxx
+++ b/Simulation/G4Sim/MCTruth/src/TruthController.cxx
@@ -1,16 +1,14 @@
 /*
-  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 "MCTruth/TruthController.h"
 #include "SimHelpers/TrackVisualizationHelper.h"
 
-TruthController* TruthController::s_thePointer=TruthController::getTruthController() ;
-
-TruthController* TruthController::getTruthController()
+const TruthController* TruthController::getTruthController()
 {
-  if (!s_thePointer) s_thePointer = new TruthController;
-  return s_thePointer;
+  static const TruthController tc;
+  return &tc;
 }
 
 TruthController::TruthController()
diff --git a/Simulation/G4Utilities/MCTruthSimAlgs/python/MCTruthSimAlgsConfigNew.py b/Simulation/G4Utilities/MCTruthSimAlgs/python/MCTruthSimAlgsConfigNew.py
index e020d2997f14c9a860b33589ebe9e5dcd78170b4..a32b0552f4507b2b81a1584b9c55f81d7fc4b522 100644
--- a/Simulation/G4Utilities/MCTruthSimAlgs/python/MCTruthSimAlgsConfigNew.py
+++ b/Simulation/G4Utilities/MCTruthSimAlgs/python/MCTruthSimAlgsConfigNew.py
@@ -7,7 +7,6 @@ from AthenaConfiguration.ComponentFactory import CompFactory
 from Digitization.PileUpToolsConfig import PileUpToolsCfg
 from Digitization.PileUpMergeSvcConfigNew import PileUpMergeSvcCfg, PileUpXingFolderCfg
 
-
 # Note: various experimentalDigi uses not migrated
 
 def GenericMergeMcEventCollCfg(flags, name="MergeMcEventCollTool", **kwargs):
@@ -119,7 +118,7 @@ def TrackRecord_LastXing():
     return 1
 
 
-def TrackRangeCfg(flags, name="TrackRange" , **kwargs):
+def TrackRangeCfg(flags, name="TrackRange", **kwargs):
     """Return a Track configured PileUpXingFolder tool"""
     # this is the time of the xing in ns
     kwargs.setdefault("FirstXing", TrackRecord_FirstXing())
@@ -226,7 +225,7 @@ def TimingObj_LastXing():
     return 1
 
 
-def TimingObjRangeCfg(flags, name="TimingObjRange" , **kwargs):
+def TimingObjRangeCfg(flags, name="TimingObjRange", **kwargs):
     """Return a RecoTiming configured PileUpXingFolder tool"""
     #this is the time of the xing in ns
     kwargs.setdefault("FirstXing", TimingObj_FirstXing())
diff --git a/Simulation/G4Utilities/TrackWriteFastSim/src/NeutronFastSim.cxx b/Simulation/G4Utilities/TrackWriteFastSim/src/NeutronFastSim.cxx
index 0e49b78b3285d17a2051eac3bb5c34512957243d..80473b6ece8faf76e83e3a07bb63d247288eadc1 100644
--- a/Simulation/G4Utilities/TrackWriteFastSim/src/NeutronFastSim.cxx
+++ b/Simulation/G4Utilities/TrackWriteFastSim/src/NeutronFastSim.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 "TrackWriteFastSim/NeutronFastSim.h"
@@ -51,7 +51,7 @@ G4bool NeutronFastSim::ModelTrigger(const G4FastTrack& fastTrack)
 
   // Not a neutron... Pick it up if the primary had eta>6.0
   AtlasG4EventUserInfo *atlasG4EvtUserInfo=static_cast<AtlasG4EventUserInfo*>(G4EventManager::GetEventManager()->GetConstCurrentEvent()->GetUserInformation());
-  HepMC::GenParticlePtr gp = atlasG4EvtUserInfo->GetCurrentPrimary();
+  HepMC::ConstGenParticlePtr gp = atlasG4EvtUserInfo->GetCurrentPrimary();
   if (std::abs(gp->momentum().eta())>m_etaCut && HepMC::barcode(gp)<200000){
     return true;
   } else {
diff --git a/Simulation/G4Utilities/TrackWriteFastSim/src/TrackRecorderSDTool.cxx b/Simulation/G4Utilities/TrackWriteFastSim/src/TrackRecorderSDTool.cxx
index 9801b10977507617786eded91a5a612028d07452..8b29c7ca8988f64abfef6f631fdef0c3adcfbc9b 100644
--- a/Simulation/G4Utilities/TrackWriteFastSim/src/TrackRecorderSDTool.cxx
+++ b/Simulation/G4Utilities/TrackWriteFastSim/src/TrackRecorderSDTool.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
 */
 
 // Track Recorder Sensitive Detector Tool.
@@ -18,8 +18,6 @@ TrackRecorderSDTool::TrackRecorderSDTool(const std::string& type, const std::str
   , m_SD_type(1)
 {
   declareProperty("SD_type", m_SD_type);
-  std::cout << "TrackRecorderSDTool Constructor: name" << name << std::endl;
-
 }
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
diff --git a/Simulation/ISF/ISF_Config/test/ISF_MainConfigNew_Test.py b/Simulation/ISF/ISF_Config/test/ISF_MainConfigNew_Test.py
index fa38e4d8acb54fe3f1b6f91cbe78591420ed65e9..441273c0e6424dff4bad5335fc072fd16f4cf7e8 100644
--- a/Simulation/ISF/ISF_Config/test/ISF_MainConfigNew_Test.py
+++ b/Simulation/ISF/ISF_Config/test/ISF_MainConfigNew_Test.py
@@ -157,7 +157,7 @@ if __name__ == '__main__':
     eventSelector.InitialTimeStamp = myInitialTimeStamp # Necessary to avoid a crash
     if hasattr(eventSelector, "OverrideRunNumberFromInput"):
         eventSelector.OverrideRunNumberFromInput = True
-    cfg.addService(evtIdModifierSvc)
+    cfg.addService(evtIdModifierSvc, create=True)
     # ... up to here?
 
     # add BeamEffectsAlg
diff --git a/Simulation/ISF/ISF_Core/ISF_Services/python/ISF_ServicesConfig.py b/Simulation/ISF/ISF_Core/ISF_Services/python/ISF_ServicesConfig.py
index 464c668b7a4b33c5d2b06174d8fff85c36c7fef0..185d371fab45174201296a17a1b542f6fc281a15 100644
--- a/Simulation/ISF/ISF_Core/ISF_Services/python/ISF_ServicesConfig.py
+++ b/Simulation/ISF/ISF_Core/ISF_Services/python/ISF_ServicesConfig.py
@@ -164,7 +164,7 @@ def getMC12LLPTruthService(name="ISF_MC12TruthLLPService", **kwargs):
 
 
 def getMC12PlusTruthService(name="ISF_MC12PlusTruthService", **kwargs):
-    AtlasRegion = ROOT.AtlasDetDescr
+    AtlasRegion = ROOT.AtlasDetDescr.AtlasRegion
     kwargs.setdefault('ForceEndVtxInRegions', [AtlasRegion.fAtlasID] )
     return getMC12TruthService(name, **kwargs)
 
@@ -190,7 +190,7 @@ def getMC15MSTruthStrategies():
 
 
 def getMC15TruthService(name="ISF_MC15TruthService", **kwargs):
-    AtlasRegion = ROOT.AtlasDetDescr
+    AtlasRegion = ROOT.AtlasDetDescr.AtlasRegion
     kwargs.setdefault('TruthStrategies', ['ISF_MCTruthStrategyGroupID_MC15',
                                           'ISF_MCTruthStrategyGroupIDHadInt_MC15',
                                           'ISF_MCTruthStrategyGroupCaloMuBrem', #FIXME this should be ISF_MCTruthStrategyGroupCaloMuBrem_MC15!!
@@ -207,7 +207,7 @@ def getMC15aTruthService(name="ISF_MC15aTruthService", **kwargs):
 
 
 def getMC15aPlusTruthService(name="ISF_MC15aPlusTruthService", **kwargs):
-    AtlasRegion = ROOT.AtlasDetDescr
+    AtlasRegion = ROOT.AtlasDetDescr.AtlasRegion
     kwargs.setdefault('ForceEndVtxInRegions', [AtlasRegion.fAtlasID])
     return getMC15TruthService(name, **kwargs)
 
diff --git a/Simulation/ISF/ISF_Core/ISF_Services/python/ISF_ServicesConfigNew.py b/Simulation/ISF/ISF_Core/ISF_Services/python/ISF_ServicesConfigNew.py
index 10a5e25c35d514537f61f656f70fd8259d8effe4..d791a274b2a67b59407023f2961f7fef038db655 100644
--- a/Simulation/ISF/ISF_Core/ISF_Services/python/ISF_ServicesConfigNew.py
+++ b/Simulation/ISF/ISF_Core/ISF_Services/python/ISF_ServicesConfigNew.py
@@ -217,7 +217,7 @@ def MC12LLPTruthServiceCfg(ConfigFlags, name="ISF_MC12TruthLLPService", **kwargs
 
 
 def MC12PlusTruthServiceCfg(ConfigFlags, name="ISF_MC12PlusTruthService", **kwargs):
-    AtlasRegion = ROOT.AtlasDetDescr
+    AtlasRegion = ROOT.AtlasDetDescr.AtlasRegion
     kwargs.setdefault("ForceEndVtxInRegions", [AtlasRegion.fAtlasID] )
     return MC12TruthServiceCfg(ConfigFlags, name, **kwargs)
 
@@ -240,7 +240,7 @@ def MC15MSTruthStrategies():
 
 def MC15TruthServiceCfg(ConfigFlags, name="ISF_MC15TruthService", **kwargs):
     result = ComponentAccumulator()
-    AtlasRegion = ROOT.AtlasDetDescr
+    AtlasRegion = ROOT.AtlasDetDescr.AtlasRegion
 
     if "TruthStrategies" not in kwargs:
         truthCfgs = [
@@ -267,7 +267,7 @@ def MC15aTruthServiceCfg(ConfigFlags, name="ISF_MC15aTruthService", **kwargs):
 
 
 def MC15aPlusTruthServiceCfg(ConfigFlags, name="ISF_MC15aPlusTruthService", **kwargs):
-    AtlasRegion = ROOT.AtlasDetDescr
+    AtlasRegion = ROOT.AtlasDetDescr.AtlasRegion
 
     kwargs.setdefault("ForceEndVtxInRegions", [AtlasRegion.fAtlasID])
     result = MC15TruthServiceCfg(ConfigFlags, name, **kwargs)
diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSEnergyAndHitGAN.cxx b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSEnergyAndHitGAN.cxx
index d81cdb21dc988ddac382436f289ef86da40ac783..35513eaf9aa2d835334682042e92aee2f65a86ed 100644
--- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSEnergyAndHitGAN.cxx
+++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSEnergyAndHitGAN.cxx
@@ -325,7 +325,7 @@ bool TFCSEnergyAndHitGAN::fillEnergy(TFCSSimulationState& simulstate, const TFCS
           nHitsAlpha = ceil(2 * TMath::Pi() * r / binResolution);
         }
         else{
-          //d = 2•r•sin (a/2r) this distance at the upper r must be 1mm for layer 1 or 5, 5mm otherwise. 
+          //d = 2*r*sin (a/2r) this distance at the upper r must be 1mm for layer 1 or 5, 5mm otherwise. 
           TAxis* y = (TAxis*)h->GetYaxis();
           double angle = y->GetBinUpEdge(iy) - y->GetBinLowEdge(iy);
           double r = x->GetBinUpEdge(ix);
diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_PunchThroughTools/src/PunchThroughTool.cxx b/Simulation/ISF/ISF_FastCaloSim/ISF_PunchThroughTools/src/PunchThroughTool.cxx
index 36bf78563c3fc063f1e2bab8a483715e84524d33..f75ac5915aa3da3b0317b3c887c7df7cdd69c1d2 100644
--- a/Simulation/ISF/ISF_FastCaloSim/ISF_PunchThroughTools/src/PunchThroughTool.cxx
+++ b/Simulation/ISF/ISF_FastCaloSim/ISF_PunchThroughTools/src/PunchThroughTool.cxx
@@ -263,8 +263,8 @@ StatusCode ISF::PunchThroughTool::initialize()
 
   // get the calo-MS border coordinates. Look at calo and MS geometry definitions, if same R and Z -> boundary surface
 
-  RZPairVector* rzMS = &(m_envDefSvc->getMuonRZValues());
-  RZPairVector* rzCalo = &(m_envDefSvc->getCaloRZValues());
+  const RZPairVector* rzMS = &(m_envDefSvc->getMuonRZBoundary());
+  const RZPairVector* rzCalo = &(m_envDefSvc->getCaloRZBoundary());
 
   bool found1, found2;
   found1=false; found2=false;
diff --git a/Simulation/Overlay/OverlayConfiguration/python/OverlayTestHelpers.py b/Simulation/Overlay/OverlayConfiguration/python/OverlayTestHelpers.py
index 9c7db234860a37a1804c9a7fba374c21c3fdceae..3b2b330a25f579d135f400af6c48facfbd3ff447 100644
--- a/Simulation/Overlay/OverlayConfiguration/python/OverlayTestHelpers.py
+++ b/Simulation/Overlay/OverlayConfiguration/python/OverlayTestHelpers.py
@@ -6,17 +6,13 @@ Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 from argparse import ArgumentParser
 
-from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
-from AthenaConfiguration.ComponentFactory import CompFactory
 from OverlayConfiguration.OverlayHelpers import setupOverlayDetectorFlags
+from AthenaConfiguration.JobOptsDumper import JobOptsDumperCfg
 
 
-def JobOptsDumperCfg(flags):
+def OverlayJobOptsDumperCfg(flags):
     """Configure event loop for overlay"""
-    JobOptsDumperAlg = CompFactory.JobOptsDumperAlg
-    acc = ComponentAccumulator()
-    acc.addEventAlgo(JobOptsDumperAlg(FileName="OverlayTestConfig.txt"))
-    return acc
+    return JobOptsDumperCfg(flags, FileName="OverlayTestConfig.txt")
 
 
 def CommonTestArgumentParser(prog):
diff --git a/Simulation/Overlay/OverlayConfiguration/test/OverlayMetadataConfig_test.py b/Simulation/Overlay/OverlayConfiguration/test/OverlayMetadataConfig_test.py
index 8e3740ede83999b3cc29c8fcd816a8394418ebe8..c71c2ef052e0e615514b91c672879be9cb96f5df 100755
--- a/Simulation/Overlay/OverlayConfiguration/test/OverlayMetadataConfig_test.py
+++ b/Simulation/Overlay/OverlayConfiguration/test/OverlayMetadataConfig_test.py
@@ -25,7 +25,8 @@ args = parser.parse_args()
 defaultTestFlags(ConfigFlags, args)
 overlayMetadataCheck(ConfigFlags)
 postprocessAndLockFlags(ConfigFlags, args)
-
+ConfigFlags.initAll()
+ConfigFlags.dump()
 # Construct our accumulator to run
 acc = MainServicesCfg(ConfigFlags)
 acc.merge(PoolReadCfg(ConfigFlags))
diff --git a/Simulation/Overlay/OverlayConfiguration/test/OverlayTest.py b/Simulation/Overlay/OverlayConfiguration/test/OverlayTest.py
index e166ed0bed144ea0d06ab78fd9407b98fd3a42fc..76bb9784aeb433fbdab0fc353094c4b66545b16e 100755
--- a/Simulation/Overlay/OverlayConfiguration/test/OverlayTest.py
+++ b/Simulation/Overlay/OverlayConfiguration/test/OverlayTest.py
@@ -13,7 +13,7 @@ from AthenaConfiguration.AllConfigFlags import ConfigFlags
 from OverlayConfiguration.OverlayHelpers import OverlayMessageSvcCfg
 from OverlayConfiguration.OverlaySteering import OverlayMainCfg
 from OverlayConfiguration.OverlayTestHelpers import \
-    CommonTestArgumentParser, JobOptsDumperCfg, \
+    CommonTestArgumentParser, OverlayJobOptsDumperCfg, \
     defaultTestFlags, postprocessAndLockFlags, printAndRun
 
 # Set up logging and new style config
@@ -49,7 +49,7 @@ acc = OverlayMainCfg(ConfigFlags)
 if args.profile:
     from PerfMonVTune.PerfMonVTuneConfig import VTuneProfilerServiceCfg
     acc.merge(VTuneProfilerServiceCfg(ConfigFlags))
-acc.merge(JobOptsDumperCfg(ConfigFlags))
+acc.merge(OverlayJobOptsDumperCfg(ConfigFlags))
 acc.merge(OverlayMessageSvcCfg(ConfigFlags))
 
 # dump pickle
diff --git a/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu.sh b/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu.sh
index a72500534453c3880d39e6a2f2cc65e4463f80dc..0f5569b30a19d5f0aab48a4daa6ad7632f487071 100755
--- a/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu.sh
+++ b/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu.sh
@@ -57,7 +57,7 @@ then
     --outputRDOFile dataOverlayRDO.pool.root \
     --maxEvents $events \
     --conditionsTag CONDBR2-BLKPA-2016-12 \
-    --postInclude 'OverlayConfiguration.OverlayTestHelpers.JobOptsDumperCfg' \
+    --postInclude 'OverlayConfiguration.OverlayTestHelpers.OverlayJobOptsDumperCfg' \
     --postExec 'with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)' \
     --imf False \
     --athenaopts="--threads=1"
diff --git a/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_BCM.sh b/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_BCM.sh
index c8705d707309a9bb52eb43d56f029d6c517150f8..45674f1124c32f404006566e2584fa3a595a0a34 100755
--- a/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_BCM.sh
+++ b/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_BCM.sh
@@ -58,7 +58,7 @@ then
     --outputRDOFile dataOverlayRDO.pool.root \
     --maxEvents $events \
     --conditionsTag CONDBR2-BLKPA-2016-12 \
-    --postInclude 'OverlayConfiguration.OverlayTestHelpers.JobOptsDumperCfg' \
+    --postInclude 'OverlayConfiguration.OverlayTestHelpers.OverlayJobOptsDumperCfg' \
     --postExec 'with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)' \
     --imf False \
     --athenaopts="--threads=1"
diff --git a/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_LAr.sh b/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_LAr.sh
index dffd006687e487e649a7f1b54bc75f69c506b5c4..218bad3223ad26830d3c6f5d22003610b3c734ea 100755
--- a/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_LAr.sh
+++ b/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_LAr.sh
@@ -60,7 +60,7 @@ then
     --outputRDOFile dataOverlayRDO.pool.root \
     --maxEvents $events \
     --conditionsTag CONDBR2-BLKPA-2016-12 \
-    --postInclude 'OverlayConfiguration.OverlayTestHelpers.JobOptsDumperCfg' \
+    --postInclude 'OverlayConfiguration.OverlayTestHelpers.OverlayJobOptsDumperCfg' \
     --postExec 'with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)' \
     --imf False \
     --athenaopts="--threads=1"
diff --git a/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_Muon.sh b/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_Muon.sh
index 298f30bc0eed725875f5f2ce38cfc982ca43bef0..85a06a9f1e9022dbbc2e446c90f50248347729c8 100755
--- a/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_Muon.sh
+++ b/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_Muon.sh
@@ -58,7 +58,7 @@ then
     --outputRDOFile dataOverlayRDO.pool.root \
     --maxEvents $events \
     --conditionsTag CONDBR2-BLKPA-2016-12 \
-    --postInclude 'OverlayConfiguration.OverlayTestHelpers.JobOptsDumperCfg' \
+    --postInclude 'OverlayConfiguration.OverlayTestHelpers.OverlayJobOptsDumperCfg' \
     --postExec 'with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)' \
     --imf False \
     --athenaopts="--threads=1"
diff --git a/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_Pixel.sh b/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_Pixel.sh
index 2f4452b84c51d6d8a66ec512d4038fcf5d3ede7e..731a983326b535e3ed3180cbcec87101dae49a87 100755
--- a/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_Pixel.sh
+++ b/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_Pixel.sh
@@ -58,7 +58,7 @@ then
     --outputRDOFile dataOverlayRDO.pool.root \
     --maxEvents $events \
     --conditionsTag CONDBR2-BLKPA-2016-12 \
-    --postInclude 'OverlayConfiguration.OverlayTestHelpers.JobOptsDumperCfg' \
+    --postInclude 'OverlayConfiguration.OverlayTestHelpers.OverlayJobOptsDumperCfg' \
     --postExec 'with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)' \
     --imf False \
     --athenaopts="--threads=1"
diff --git a/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_SCT.sh b/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_SCT.sh
index 49d46e585043b26d5bd42f88282b062b42266a4b..951ae1b5d28085db674eefba1f4f9cce631929b3 100755
--- a/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_SCT.sh
+++ b/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_SCT.sh
@@ -58,7 +58,7 @@ then
     --outputRDOFile dataOverlayRDO.pool.root \
     --maxEvents $events \
     --conditionsTag CONDBR2-BLKPA-2016-12 \
-    --postInclude 'OverlayConfiguration.OverlayTestHelpers.JobOptsDumperCfg' \
+    --postInclude 'OverlayConfiguration.OverlayTestHelpers.OverlayJobOptsDumperCfg' \
     --postExec 'with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)' \
     --imf False \
     --athenaopts="--threads=1"
diff --git a/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_TRT.sh b/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_TRT.sh
index 1ba8e0728185d65a587642594637fd8e9e1e1ab4..23c4d193328d4a445091c7dcbf48195d51b39cb9 100755
--- a/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_TRT.sh
+++ b/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_TRT.sh
@@ -58,7 +58,7 @@ then
     --outputRDOFile dataOverlayRDO.pool.root \
     --maxEvents $events \
     --conditionsTag CONDBR2-BLKPA-2016-12 \
-    --postInclude 'OverlayConfiguration.OverlayTestHelpers.JobOptsDumperCfg' \
+    --postInclude 'OverlayConfiguration.OverlayTestHelpers.OverlayJobOptsDumperCfg' \
     --postExec 'with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)' \
     --imf False \
     --athenaopts="--threads=1"
diff --git a/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_Tile.sh b/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_Tile.sh
index 734297ccd6fb0cc3873232af53b126a18baa48db..9447175a33bb6be71363977fe776e65c51456ff7 100755
--- a/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_Tile.sh
+++ b/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_Tile.sh
@@ -60,7 +60,7 @@ then
     --outputRDOFile dataOverlayRDO.pool.root \
     --maxEvents $events \
     --conditionsTag CONDBR2-BLKPA-2016-12 \
-    --postInclude 'OverlayConfiguration.OverlayTestHelpers.JobOptsDumperCfg' \
+    --postInclude 'OverlayConfiguration.OverlayTestHelpers.OverlayJobOptsDumperCfg' \
     --postExec 'with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)' \
     --imf False \
     --athenaopts="--threads=1"
diff --git a/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_Truth.sh b/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_Truth.sh
index 34f8e15218c443440c98a0ff81c97bf803abe444..16fc718780979bc742e945f95663f06eeabb8b0a 100755
--- a/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_Truth.sh
+++ b/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_Truth.sh
@@ -58,7 +58,7 @@ then
     --outputRDOFile dataOverlayRDO.pool.root \
     --maxEvents $events \
     --conditionsTag CONDBR2-BLKPA-2016-12 \
-    --postInclude 'OverlayConfiguration.OverlayTestHelpers.JobOptsDumperCfg' \
+    --postInclude 'OverlayConfiguration.OverlayTestHelpers.OverlayJobOptsDumperCfg' \
     --postExec 'with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)' \
     --imf False \
     --athenaopts="--threads=1"
diff --git a/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_sequential.sh b/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_sequential.sh
index 9ffa8d802c0958152e143f71801728740fc8ac12..ee3ba7315466bf083bd4ca351cc98657cb550b98 100755
--- a/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_sequential.sh
+++ b/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_sequential.sh
@@ -19,7 +19,7 @@ Overlay_tf.py \
 --outputRDOFile dataOverlayRDO.pool.root \
 --maxEvents 10 \
 --conditionsTag CONDBR2-BLKPA-2016-12 \
---postInclude 'OverlayConfiguration.OverlayTestHelpers.JobOptsDumperCfg' \
+--postInclude 'OverlayConfiguration.OverlayTestHelpers.OverlayJobOptsDumperCfg' \
 --postExec 'with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)' \
 --imf False
 
diff --git a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar.sh b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar.sh
index 695791ba9ab52b91d7c4a0ee2a97ccc5dd9856e0..ac1a0d292654f88c22761f0c95251ca9a77c7b0a 100755
--- a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar.sh
+++ b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar.sh
@@ -54,7 +54,7 @@ then
     --maxEvents $events \
     --conditionsTag OFLCOND-MC16-SDR-20 \
     --geometryVersion ATLAS-R2-2016-01-00-01 \
-    --postInclude 'OverlayConfiguration.OverlayTestHelpers.JobOptsDumperCfg' \
+    --postInclude 'OverlayConfiguration.OverlayTestHelpers.OverlayJobOptsDumperCfg' \
     --postExec 'with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)' \
     --imf False \
     --athenaopts="--threads=1"
diff --git a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_BCM.sh b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_BCM.sh
index 3146eab4e25018323ae59ce420134b2b20b4b179..e18715077086f8a5d1f8349fc738539a5c403e0b 100755
--- a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_BCM.sh
+++ b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_BCM.sh
@@ -57,7 +57,7 @@ then
     --maxEvents $events \
     --conditionsTag OFLCOND-MC16-SDR-20 \
     --geometryVersion ATLAS-R2-2016-01-00-01 \
-    --postInclude 'OverlayConfiguration.OverlayTestHelpers.JobOptsDumperCfg' \
+    --postInclude 'OverlayConfiguration.OverlayTestHelpers.OverlayJobOptsDumperCfg' \
     --postExec 'with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)' \
     --imf False \
     --athenaopts="--threads=1"
diff --git a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_L1Calo.sh b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_L1Calo.sh
index d834df674906dabc3bbfa2974dc952de6e2cb630..b3b33d265c88fa65d6b698a9fa84b2345a6a7c8c 100755
--- a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_L1Calo.sh
+++ b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_L1Calo.sh
@@ -57,7 +57,7 @@ then
     --maxEvents $events \
     --conditionsTag OFLCOND-MC16-SDR-20 \
     --geometryVersion ATLAS-R2-2016-01-00-01 \
-    --postInclude 'OverlayConfiguration.OverlayTestHelpers.JobOptsDumperCfg' \
+    --postInclude 'OverlayConfiguration.OverlayTestHelpers.OverlayJobOptsDumperCfg' \
     --postExec 'with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)' \
     --imf False \
     --athenaopts="--threads=1"
diff --git a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_LAr.sh b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_LAr.sh
index 5f56e46cfb9e80396b1bf1620757bf8b3311fbbd..a8aaba5f092704546e9b315f4c6db517d2028a26 100755
--- a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_LAr.sh
+++ b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_LAr.sh
@@ -57,7 +57,7 @@ then
     --maxEvents $events \
     --conditionsTag OFLCOND-MC16-SDR-20 \
     --geometryVersion ATLAS-R2-2016-01-00-01 \
-    --postInclude 'OverlayConfiguration.OverlayTestHelpers.JobOptsDumperCfg' \
+    --postInclude 'OverlayConfiguration.OverlayTestHelpers.OverlayJobOptsDumperCfg' \
     --postExec 'with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)' \
     --imf False \
     --athenaopts="--threads=1"
diff --git a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Muon.sh b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Muon.sh
index 4650a1c984a2917454fcc93dd21e3c728050a1fe..44e81b1def54165c4f0fd161ef3a469009b7b593 100755
--- a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Muon.sh
+++ b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Muon.sh
@@ -57,7 +57,7 @@ then
     --maxEvents $events \
     --conditionsTag OFLCOND-MC16-SDR-20 \
     --geometryVersion ATLAS-R2-2016-01-00-01 \
-    --postInclude 'OverlayConfiguration.OverlayTestHelpers.JobOptsDumperCfg' \
+    --postInclude 'OverlayConfiguration.OverlayTestHelpers.OverlayJobOptsDumperCfg' \
     --postExec 'with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)' \
     --imf False \
     --athenaopts="--threads=1"
diff --git a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Pixel.sh b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Pixel.sh
index a263754792b2354874f9162e1cc8e2c53a981497..a383bf4a038cf0ded5be3221f45ad021aa2297d2 100755
--- a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Pixel.sh
+++ b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Pixel.sh
@@ -57,7 +57,7 @@ then
     --maxEvents $events \
     --conditionsTag OFLCOND-MC16-SDR-20 \
     --geometryVersion ATLAS-R2-2016-01-00-01 \
-    --postInclude 'OverlayConfiguration.OverlayTestHelpers.JobOptsDumperCfg' \
+    --postInclude 'OverlayConfiguration.OverlayTestHelpers.OverlayJobOptsDumperCfg' \
     --postExec 'with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)' \
     --imf False \
     --athenaopts="--threads=1"
diff --git a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_SCT.sh b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_SCT.sh
index 3f51c4028ed339eab0f9a293e7b494d293339a36..ce8b070a432617848299b4ece86f65dcb0e6efaf 100755
--- a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_SCT.sh
+++ b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_SCT.sh
@@ -57,7 +57,7 @@ then
     --maxEvents $events \
     --conditionsTag OFLCOND-MC16-SDR-20 \
     --geometryVersion ATLAS-R2-2016-01-00-01 \
-    --postInclude 'OverlayConfiguration.OverlayTestHelpers.JobOptsDumperCfg' \
+    --postInclude 'OverlayConfiguration.OverlayTestHelpers.OverlayJobOptsDumperCfg' \
     --postExec 'with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)' \
     --imf False \
     --athenaopts="--threads=1"
diff --git a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_TRT.sh b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_TRT.sh
index f24e9bc69b512dbd3255ea756ebe81eedfc68da6..08c99763a9b971aa675f64dc07a97eeb0d01822c 100755
--- a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_TRT.sh
+++ b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_TRT.sh
@@ -57,7 +57,7 @@ then
     --maxEvents $events \
     --conditionsTag OFLCOND-MC16-SDR-20 \
     --geometryVersion ATLAS-R2-2016-01-00-01 \
-    --postInclude 'OverlayConfiguration.OverlayTestHelpers.JobOptsDumperCfg' \
+    --postInclude 'OverlayConfiguration.OverlayTestHelpers.OverlayJobOptsDumperCfg' \
     --postExec 'with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)' \
     --imf False \
     --athenaopts="--threads=1"
diff --git a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Tile.sh b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Tile.sh
index dfda47534efa0d42eb24a3935a19ace0df47ac9c..475ce82276509340f997fad12cbd7ee0f13120eb 100755
--- a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Tile.sh
+++ b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Tile.sh
@@ -57,7 +57,7 @@ then
     --maxEvents $events \
     --conditionsTag OFLCOND-MC16-SDR-20 \
     --geometryVersion ATLAS-R2-2016-01-00-01 \
-    --postInclude 'OverlayConfiguration.OverlayTestHelpers.JobOptsDumperCfg' \
+    --postInclude 'OverlayConfiguration.OverlayTestHelpers.OverlayJobOptsDumperCfg' \
     --postExec 'with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)' \
     --imf False \
     --athenaopts="--threads=1"
diff --git a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Truth.sh b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Truth.sh
index 8b6bccd776735f6651d3bdadf0303493047c0d3b..4ea7787c22d92c8440b3675fa2c9741d4a02d400 100755
--- a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Truth.sh
+++ b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Truth.sh
@@ -57,7 +57,7 @@ then
     --maxEvents $events \
     --conditionsTag OFLCOND-MC16-SDR-20 \
     --geometryVersion ATLAS-R2-2016-01-00-01 \
-    --postInclude 'OverlayConfiguration.OverlayTestHelpers.JobOptsDumperCfg' \
+    --postInclude 'OverlayConfiguration.OverlayTestHelpers.OverlayJobOptsDumperCfg' \
     --postExec 'with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)' \
     --imf False \
     --athenaopts="--threads=1"
diff --git a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_sequential.sh b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_sequential.sh
index 3a6bc9adc05121912c40920e752d2393a1bfd68d..c72fee4c90423303092bfa8bd06a4b2e105520d3 100755
--- a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_sequential.sh
+++ b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_sequential.sh
@@ -20,7 +20,7 @@ Overlay_tf.py \
 --maxEvents 10 \
 --conditionsTag OFLCOND-MC16-SDR-20 \
 --geometryVersion ATLAS-R2-2016-01-00-01 \
---postInclude 'OverlayConfiguration.OverlayTestHelpers.JobOptsDumperCfg' \
+--postInclude 'OverlayConfiguration.OverlayTestHelpers.OverlayJobOptsDumperCfg' \
 --postExec 'with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)' \
 --imf False
 
diff --git a/Simulation/Tests/OverlayTestsMT/test/test_DataOverlay_MT_Zmumu_8threads_NewConfig.sh b/Simulation/Tests/OverlayTestsMT/test/test_DataOverlay_MT_Zmumu_8threads_NewConfig.sh
index c485c9b2f7a196416e4a625c0dbe057595b7f609..3cf75227136a7ca499b04ddbab821e3d08e8f259 100755
--- a/Simulation/Tests/OverlayTestsMT/test/test_DataOverlay_MT_Zmumu_8threads_NewConfig.sh
+++ b/Simulation/Tests/OverlayTestsMT/test/test_DataOverlay_MT_Zmumu_8threads_NewConfig.sh
@@ -23,7 +23,7 @@ Overlay_tf.py \
 --outputRDOFile dataOverlayRDO.pool.root \
 --maxEvents 100 \
 --conditionsTag CONDBR2-BLKPA-2016-12 \
---postInclude 'OverlayConfiguration.OverlayTestHelpers.JobOptsDumperCfg' \
+--postInclude 'OverlayConfiguration.OverlayTestHelpers.OverlayJobOptsDumperCfg' \
 --postExec 'with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)' \
 --imf False
 
diff --git a/Simulation/Tests/OverlayTestsMT/test/test_MCOverlay_MT_ttbar_8threads_NewConfig.sh b/Simulation/Tests/OverlayTestsMT/test/test_MCOverlay_MT_ttbar_8threads_NewConfig.sh
index 16988c951df7d4ae19a3762ac82fd983f86f5bba..4cdf44b15b7aebfaf1235f8744e2b1525530d3c8 100755
--- a/Simulation/Tests/OverlayTestsMT/test/test_MCOverlay_MT_ttbar_8threads_NewConfig.sh
+++ b/Simulation/Tests/OverlayTestsMT/test/test_MCOverlay_MT_ttbar_8threads_NewConfig.sh
@@ -24,7 +24,7 @@ Overlay_tf.py \
 --maxEvents 50 --skipEvents 10 --digiSeedOffset1 511 --digiSeedOffset2 727 \
 --conditionsTag OFLCOND-MC16-SDR-20 \
 --geometryVersion ATLAS-R2-2016-01-00-01 \
---postInclude 'OverlayConfiguration.OverlayTestHelpers.JobOptsDumperCfg' \
+--postInclude 'OverlayConfiguration.OverlayTestHelpers.OverlayJobOptsDumperCfg' \
 --postExec 'with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)' \
 --imf False
 
diff --git a/TestBeam/TBEvent/TBEvent/ATLAS_CHECK_THREAD_SAFETY b/TestBeam/TBEvent/TBEvent/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..509c4777fb7707c594897c3bc6a70685a19a30b2
--- /dev/null
+++ b/TestBeam/TBEvent/TBEvent/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+TestBeam/TBEvent
diff --git a/TileCalorimeter/TileConditions/python/TileConditionsConfig.py b/TileCalorimeter/TileConditions/python/TileConditionsConfig.py
index 39020d50af26774201b1ca7d5574a5a2ce3b648f..1de3f861de64e73d1fdb35dfc32c48439b16b76c 100644
--- a/TileCalorimeter/TileConditions/python/TileConditionsConfig.py
+++ b/TileCalorimeter/TileConditions/python/TileConditionsConfig.py
@@ -111,7 +111,7 @@ def tileCondCfg( flags ):
     TileInfoLoader, TileCablingSvc=CompFactory.getComps("TileInfoLoader","TileCablingSvc",)
     infoLoaderSvc = TileInfoLoader()
     infoLoaderSvc.NoiseScaleIndex= 2
-    acc.addService( infoLoaderSvc ) 
+    acc.addService(infoLoaderSvc, create = True)
 #    acc.addToAppProperty('CreateSvc', [infoLoaderSvc.getFullName()] )
 
 
diff --git a/TileCalorimeter/TileConditions/python/TileInfoConfigurator.py b/TileCalorimeter/TileConditions/python/TileInfoConfigurator.py
index cdc26888927730087c9fc352544a624c34ba6904..15455299d151c55db73ee5a7403f1b05e36618fc 100644
--- a/TileCalorimeter/TileConditions/python/TileInfoConfigurator.py
+++ b/TileCalorimeter/TileConditions/python/TileInfoConfigurator.py
@@ -381,11 +381,11 @@ class _TileInfoConfigurator( TileInfoLoader ):
             dbConnStr = 'DCS_OFL'
             from IOVDbSvc.CondDB import conddb
             if useHV:
-                conddb.addFolder(dbConnStr, "/TILE/DCS/HV", className = 'CondAttrListCollection')
+                conddb.addFolder(dbConnStr, "/TILE/DCS/HV<key>/TILE/DCS/HV</key>", className = 'CondAttrListCollection')
             if useHVSET:
-                conddb.addFolder(dbConnStr, "/TILE/DCS/HVSET", className = 'CondAttrListCollection')
+                conddb.addFolder(dbConnStr, "/TILE/DCS/HVSET<key>/TILE/DCS/HVSET</key>", className = 'CondAttrListCollection')
             if useSTATUS:
-                conddb.addFolder(dbConnStr, "/TILE/DCS/STATES", className = 'CondAttrListCollection')
+                conddb.addFolder(dbConnStr, "/TILE/DCS/STATES<key>/TILE/DCS/STATES</key>", className = 'CondAttrListCollection')
 
             from TileConditions.TileConditionsConf import TileDCSCondAlg
             condSequence += TileDCSCondAlg(name = dcsCondAlg,
diff --git a/TileCalorimeter/TileConditions/python/TileInfoLoaderConfig.py b/TileCalorimeter/TileConditions/python/TileInfoLoaderConfig.py
index be971c6d2dbbd03a084683119ab651ce7e30f61d..966587c1cb1157a7da141c5a747dc0054914da07 100644
--- a/TileCalorimeter/TileConditions/python/TileInfoLoaderConfig.py
+++ b/TileCalorimeter/TileConditions/python/TileInfoLoaderConfig.py
@@ -72,7 +72,7 @@ def TileInfoLoaderCfg(flags, **kwargs):
 
 
     TileInfoLoader=CompFactory.TileInfoLoader
-    acc.addService(TileInfoLoader(**kwargs), primary = True)
+    acc.addService(TileInfoLoader(**kwargs), primary = True, create=True)
 
     return acc
 
diff --git a/TileCalorimeter/TileConditions/share/TileConditions_jobOptions.py b/TileCalorimeter/TileConditions/share/TileConditions_jobOptions.py
index 83b62e933e583965a483e13379b8ce75a5510809..502cc03b192a45f444d9d8e7200c2d6c2fcb22d6 100644
--- a/TileCalorimeter/TileConditions/share/TileConditions_jobOptions.py
+++ b/TileCalorimeter/TileConditions/share/TileConditions_jobOptions.py
@@ -143,12 +143,7 @@ if not 'TileCommissioning' in dir():
     if jobproperties.Beam.beamType != 'collisions':
         TileCommissioning = True
     else:
-        try:
-            from RecExConfig.RecFlags import rec
-            TileCommissioning = rec.Commissioning()
-        except:
-            msg.info("No RecFlags available - looks like a simulation job")
-            TileCommissioning = False
+        TileCommissioning = False
         
 if TileCommissioning:
     msg.info("Adjusting TileInfo to return cell noise for Opt.Filter with iterations")
diff --git a/TileCalorimeter/TileMonitoring/src/TileCellMonitorAlgorithm.cxx b/TileCalorimeter/TileMonitoring/src/TileCellMonitorAlgorithm.cxx
index 8b08b2b976ca4755eafdcc68b25e0e29c0c5f640..8fe1238535fde0035dfb90ef0d3d242af89ee095 100644
--- a/TileCalorimeter/TileMonitoring/src/TileCellMonitorAlgorithm.cxx
+++ b/TileCalorimeter/TileMonitoring/src/TileCellMonitorAlgorithm.cxx
@@ -210,16 +210,16 @@ StatusCode TileCellMonitorAlgorithm::fillHistograms( const EventContext& ctx ) c
     detailOccupEnergies[partition].reserve(nChannelsInPartition);
   }
 
-  std::vector<float> occupEta[MAX_SAMP];
-  std::vector<float> occupPhi[MAX_SAMP];
-  std::vector<float> occupEnergy[MAX_SAMP];
+  std::vector<float> occupEta[SAMP_ALL];
+  std::vector<float> occupPhi[SAMP_ALL];
+  std::vector<float> occupEnergy[SAMP_ALL];
 
-  std::vector<float> overThrOccupEta[MAX_SAMP];
-  std::vector<float> overThrOccupPhi[MAX_SAMP];
+  std::vector<float> overThrOccupEta[SAMP_ALL];
+  std::vector<float> overThrOccupPhi[SAMP_ALL];
 
   std::vector<float> sampChanTime[Tile::MAX_ROS - 1][SAMP_ALL];
-  std::vector<float> sampEnergyDiff[Tile::MAX_ROS - 1][MAX_SAMP];
-  std::vector<float> sampTimeDiff[Tile::MAX_ROS - 1][MAX_SAMP];
+  std::vector<float> sampEnergyDiff[Tile::MAX_ROS - 1][SAMP_ALL];
+  std::vector<float> sampTimeDiff[Tile::MAX_ROS - 1][SAMP_ALL];
 
   PairBuilder moduleCorr[MAX_PART];
 
diff --git a/TileCalorimeter/TileSimAlgs/python/TileHitVecToCntConfig.py b/TileCalorimeter/TileSimAlgs/python/TileHitVecToCntConfig.py
index c38fe1c4f3e9430ce554ae9b1138e0e5e2bcdce4..6997178703148bc9fc04d83b753cdaffd88c71b2 100644
--- a/TileCalorimeter/TileSimAlgs/python/TileHitVecToCntConfig.py
+++ b/TileCalorimeter/TileSimAlgs/python/TileHitVecToCntConfig.py
@@ -5,6 +5,7 @@
 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
 from AthenaConfiguration.ComponentFactory import CompFactory
 from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
+from Digitization.PileUpMergeSvcConfigNew import PileUpMergeSvcCfg, PileUpXingFolderCfg
 
 def getTileFirstXing():
     """Return the earliest bunch crossing time for which interactions will be sent to the TileHitVecToCntTool"""
@@ -16,14 +17,12 @@ def getTileLastXing():
     return 150
 
 
-def getTileRange(name = 'TileRange', **kwargs):
+def TileRangeCfg(flags, name = 'TileRange', **kwargs):
     """Return a PileUpXingFolder tool for Tile"""
     kwargs.setdefault('FirstXing', getTileFirstXing() )
     kwargs.setdefault('LastXing',  getTileLastXing() )
     kwargs.setdefault('ItemList', ['TileHitVector#TileHitVec', 'TileHitVector#MBTSHits'] )
-
-    PileUpXingFolder=CompFactory.PileUpXingFolder
-    return PileUpXingFolder(name, **kwargs)
+    return PileUpXingFolderCfg(flags, name, **kwargs)
 
 
 def TileHitVecToCntToolCfg(flags, **kwargs):
@@ -78,6 +77,10 @@ def TileHitVecToCntToolCfg(flags, **kwargs):
         kwargs.setdefault("FirstXing", getTileFirstXing() )
         kwargs.setdefault("LastXing",  getTileLastXing() )
 
+    if flags.Detector.OverlayTile:
+        rangetool = acc.popToolsAndMerge(TileRangeCfg(flags))
+        acc.merge(PileUpMergeSvcCfg(flags, Intervals=rangetool))
+
     TileHitVecToCntTool=CompFactory.TileHitVecToCntTool
     acc.setPrivateTools(TileHitVecToCntTool(**kwargs))
 
diff --git a/Tools/PyJobTransforms/python/trfArgs.py b/Tools/PyJobTransforms/python/trfArgs.py
index 854fd04b7382791eab85131bc15ddb1aa0a76f09..b4c94be325b781520b830dd2b5a68506c39e653c 100644
--- a/Tools/PyJobTransforms/python/trfArgs.py
+++ b/Tools/PyJobTransforms/python/trfArgs.py
@@ -16,7 +16,8 @@ from PyJobTransforms.trfLogger import stdLogLevels
 
 ## Add standard transform arguments to an argparse ArgumentParser
 def addStandardTrfArgs(parser):
-    parser.add_argument('--CA', action='store_true', help='Use ComponentAccumulator base configuration')
+    parser.add_argument('--CA', type=argFactory(trfArgClasses.argSubstepBool, runarg=False), nargs='?',
+                        help='Use ComponentAccumulator base configuration')
     parser.add_argument('--verbose', '--debug', action='store_true', help='Set transform loglevel to DEBUG')
     parser.add_argument('--loglevel', choices=list(stdLogLevels), help='Set transform logging level')
     parser.add_argument('--argJSON', '--argjson', metavar='FILE', help='File containing JSON serialised argument dictionary')
diff --git a/Tools/PyJobTransforms/python/trfExe.py b/Tools/PyJobTransforms/python/trfExe.py
index 05a017c984d9c86e14e3b400097def28d66653aa..8c961cee0bf7f0232112c79c05e92e5eb8da345a 100755
--- a/Tools/PyJobTransforms/python/trfExe.py
+++ b/Tools/PyJobTransforms/python/trfExe.py
@@ -1205,6 +1205,22 @@ class athenaExecutor(scriptExecutor):
         self._valStop = os.times()
         msg.debug('valStop time is {0}'.format(self._valStop))
 
+    ## @brief Check if running with CA
+    def _isCAEnabled(self):
+        # CA not present, not running with CA
+        if 'CA' not in self.conf.argdict:
+            return False
+
+        # CA present but None, all substeps running with CA
+        if self.conf.argdict['CA'] is None:
+            return True
+
+        # CA enabled for a substep, running with CA
+        if self.conf.argdict['CA'].returnMyValue(name=self.name, substep=self.substep) is True:
+            return True
+
+        return False
+
     ## @brief Prepare the correct command line to be used to invoke athena
     def _prepAthenaCommandLine(self):
         ## Start building up the command line
@@ -1307,7 +1323,7 @@ class athenaExecutor(scriptExecutor):
                 self._cmd.append('--nprocs=%s' % str(self._athenaMP))
 
         #Switch to ComponentAccumulator based config if requested
-        if 'CA' in self.conf.argdict:
+        if self._isCAEnabled():
             self._cmd.append("--CA")
 
         # Add topoptions
diff --git a/Tools/PyJobTransforms/python/trfJobOptions.py b/Tools/PyJobTransforms/python/trfJobOptions.py
index 624f3dffb610374d1a8dca14e5bd1fa2ecb39cfa..e5f437839e648afcd2f5556b20fa7ffa1343f460 100644
--- a/Tools/PyJobTransforms/python/trfJobOptions.py
+++ b/Tools/PyJobTransforms/python/trfJobOptions.py
@@ -58,12 +58,12 @@ class JobOptionsTemplate(object):
         msg.info('Writing runArgs to file \"%s\"', self._runArgsFile)
 
         ## Check consistency btw --CA flag and provided skeletons:
-        if 'CA' in self._exe.conf.argdict:
+        if self._exe._isCAEnabled():
             if self._exe._skeletonCA is None:
                 errMsg = "Got the --CA option but this transform doesn't supply a ComponentAccumulator-based skeleton file"
                 msg.error(errMsg)
                 raise  trfExceptions.TransformExecutionException(trfExit.nameToCode('TRF_EXEC_RUNARGS_ERROR'),errMsg)
-        else: # 'CA' not in self._exe.conf.argdict
+        else: # not self._exe._isCAEnabled():
             if self._exe._skeleton is None:
                 errMsg = "No --CA option given, but this transform doesn't supply old-style skeleton file"
                 msg.error(errMsg)
@@ -203,7 +203,7 @@ class JobOptionsTemplate(object):
                             raise trfExceptions.TransformExecutionException(trfExit.nameToCode("TRF_EXEC_RUNARGS_ERROR"), "Failed to find file: {0} required by athenaMP option: --athenaMPUseEventOrders true".format(self._exe._athenaMPEventOrdersFile))
                     if 'athenaMPEventsBeforeFork' in self._exe.conf.argdict:
                         print('AthenaMPJobProps.AthenaMPFlags.EventsBeforeFork={0}'.format(self._exe.conf.argdict['athenaMPEventsBeforeFork'].value), file=runargsFile)
-                if 'CA' in self._exe.conf.argdict:
+                if self._exe._isCAEnabled():
                     print(os.linesep, '# Threading flags', file=runargsFile)
                     #Pass the number of threads
                     threads = self._exe._athenaMT
@@ -251,7 +251,7 @@ class JobOptionsTemplate(object):
         self.writeRunArgs(input = input, output = output)
         # Make sure runArgs and skeleton are valid
         self.ensureJobOptions()
-        if 'CA' in self._exe.conf.argdict:
+        if self._exe._isCAEnabled():
             #ComponentAccumulator based config, use only runargs file
             return [ self._runArgsFile ]
         else:
diff --git a/Tools/PyJobTransforms/scripts/HelloWorld_tf.py b/Tools/PyJobTransforms/scripts/HelloWorld_tf.py
index caa2a6afff4b2c79c6b9fd18909a836f1d23ba83..24a55b0b2a045f2e75c232845921b20ad16f192c 100755
--- a/Tools/PyJobTransforms/scripts/HelloWorld_tf.py
+++ b/Tools/PyJobTransforms/scripts/HelloWorld_tf.py
@@ -33,6 +33,7 @@ def main():
 ## Get the base transform with all arguments added
 def getTransform():
     trf = transform(executor = athenaExecutor(name = 'athena', 
+                                              substep='HelloWorld',
                                               skeletonFile=None,
                                               skeletonCA="PyJobTransforms.HelloWorldSkeleton"))
     addAthenaArguments(trf.parser)
diff --git a/Tools/PyJobTransforms/test/test_HelloWorldTrf.sh b/Tools/PyJobTransforms/test/test_HelloWorldTrf.sh
index f5f19a3993001ca00d64d842dd9b831f10c13a41..989703b84fb3081e8da2dd58237c54d63bd5d0c4 100755
--- a/Tools/PyJobTransforms/test/test_HelloWorldTrf.sh
+++ b/Tools/PyJobTransforms/test/test_HelloWorldTrf.sh
@@ -19,3 +19,13 @@ ATHENA_CORE_NUMBER=2 HelloWorld_tf.py --maxEvents=5 --CA --multithreaded
 
 grep 'runArgs.threads = 2' runargs.athena.py
 grep 'runArgs.concurrentEvents = 2' runargs.athena.py
+
+# CA arg test 1
+HelloWorld_tf.py --maxEvents=5 --CA HelloWorld:True
+
+# CA arg test 2
+set +e
+
+if HelloWorld_tf.py --maxEvents=5; then
+  exit 1
+fi
diff --git a/Tools/PyUtils/bin/checkxAOD.py b/Tools/PyUtils/bin/checkxAOD.py
index c694d0a0bcd59f35ab836410a45c3de32c8f8af3..39a718b689185dfb9f3c62ddfc1a9a0991dfd05d 100755
--- a/Tools/PyUtils/bin/checkxAOD.py
+++ b/Tools/PyUtils/bin/checkxAOD.py
@@ -36,7 +36,6 @@ if __name__ == "__main__":
        help = "Output CSV file name, to use with spreadsheets" )
     ( options, args ) = parser.parse_args()
 
-    # Set up categorization matching strings:
     # Set up categorization matching strings:
     categoryStrings = {
         "MetaData" : ["^DataHeader", "(.*)_mems$", "(.*)_timings$", "^Token$", "^RawInfoSummaryForTag$", "^index_ref$"],
@@ -49,10 +48,11 @@ if __name__ == "__main__":
         "Muon"     : ["^Muon", "^TileMuObj", "^MS", "^SlowMuons", "^Staus", "(.*)MuonTrackParticles$", "MUCTPI_RDO", "^RPC", "^TGC", "^MDT", "^CSC", ".*MuonMeasurements$", "^ExtrapolatedMuonTracks", "^CombinedMuonTracks", "^NCB_MuonSegments"],
         "BTag"     : ["^BTag"],
         "InDet"    : ["^InDet", "^PrimaryVertices", "^ComTime_TRT", "^Pixel", "^TRT", "^SCT", "^BCM", "^CTP", "^Tracks", "^ResolvedForwardTracks", "^SplitClusterAmbiguityMap"],
-        "Jet"      : ["^CamKt", "^AntiKt", "^Jet","^LCOriginTopoClusters","^EMOriginTopoClusters"],
+        "Jet"      : ["^CamKt", "^AntiKt", "^Jet(?!.*ParticleFlowObjects$)","^LCOriginTopoClusters","^EMOriginTopoClusters"],
         "CaloTopo" : ["CaloCalTopoCluster"],
         "Calo"     : ["^LAr", "^AllCalo", "^AODCellContainer", "^MBTSContainer", "^CaloCompactCellContainer", "^E4prContainer", "^TileCellVec", "^TileDigits"],
-        "Truth"    : ["^Truth", "Truth$", "TruthMap$", "TruthCollection$", "^PRD_MultiTruth", "TracksTruth$", ".*TrackTruth$", "TrackTruthCollection"]
+        "Truth"    : ["^Truth", "Truth$", "TruthMap$", "TruthCollection$", "^PRD_MultiTruth", "TracksTruth$", ".*TrackTruth$", "TrackTruthCollection"],
+        "AFP"      : ["^AFP"]
         }
     
     fileNames = []
diff --git a/Tools/PyUtils/python/Helpers.py b/Tools/PyUtils/python/Helpers.py
index 3bb6d39c358ef9452a7a2df7b5b62e53944c6b4a..372334917715f101956307186284cba19ed1bce9 100644
--- a/Tools/PyUtils/python/Helpers.py
+++ b/Tools/PyUtils/python/Helpers.py
@@ -4,52 +4,53 @@
 # @date:   March 2007
 #
 #
-from __future__ import with_statement, print_function
-
-__author__  = "Sebastien Binet <binet@cern.ch>"
 
 import sys
 import os
-import six
 
 from AthenaCommon.Logging import log
 
-# import xml before ROOT to prevent crashes (LCG_96): ATEAM-597
-# should be OK to remove from LCG_97 on
-import xml.etree.cElementTree  # noqa: F401
-
-def ROOT6Setup():
+def ROOT6Setup(batch=False):
    log.info('executing ROOT6Setup')
-   if six.PY3:
-      import builtins as builtin_mod
-   else:
-      import __builtin__ as builtin_mod
+   import builtins as builtin_mod
    oldimporthook = builtin_mod.__import__
    autoload_var_name = 'ROOT6_NamespaceAutoloadHook'
-   
-   def root6_importhook(name, globals={}, locals={}, fromlist=[], level=-1):
-       if six.PY3 and level < 0: level = 0
+   batch_mode = bool(batch)
+
+   def root6_importhook(name, globals={}, locals={}, fromlist=[], level=0):
+       nonlocal batch_mode
+       isroot = False
+       bm = batch_mode
+       if name=='ROOT' or (name[0:4]=='ROOT' and name!='ROOT.pythonization'):
+          isroot = True
+          batch_mode = None  # only set it on first ROOT import
+
        m = oldimporthook(name, globals, locals, fromlist, level)
-       if m and (m.__name__== 'ROOT' or name[0:4]=='ROOT') \
-             and (name!='ROOT' or fromlist is not None): # prevent triggering on just 'import ROOT'; see ATEAM-597
-          log.debug('Python import module=%s  fromlist=%s', name, str(fromlist))
+
+       if m and isroot:
+          log.debug('Python import module=%s, fromlist=%s', name, fromlist)
+          if bm is not None:
+             log.debug('Setting ROOT batch mode to %s', bm)
+             m.gROOT.SetBatch(bm)
+
           if fromlist:
-             #MN: in this case 'm' is the final nested module already, don't walk the full 'name'
+             # in this case 'm' is the final nested module already, don't walk the full 'name'
              vars = [ '.'.join(['', fl, autoload_var_name]) for fl in fromlist]
           else:
              vars = [ '.'.join([name, autoload_var_name]) ]
+
           for v in vars:
              try:
                 mm = m
-                #MN: walk the module chain and try to touch 'autoload_var_name' to trigger ROOT autoloading of namespaces
+                # walk the module chain and try to touch 'autoload_var_name' to trigger ROOT autoloading of namespaces
                 for comp in v.split('.')[1:]:
                    mm = getattr(mm, comp)
              except Exception:
                 pass
+
        return m
-   
+
    builtin_mod.__import__ = root6_importhook
-      
 
 
 import re
@@ -116,8 +117,7 @@ class ShutUp(object):
     def __filterRootMessages(self, fd):
         fd.seek(0)
         for l in fd.readlines():
-            if six.PY3:
-               l = l.decode()
+            l = l.decode()
             printOut = True
             for filter in self.filters:
                 if re.match(filter, l):
diff --git a/Tracking/TrkAlignment/TrkAlignGenTools/src/MatrixTool.cxx b/Tracking/TrkAlignment/TrkAlignGenTools/src/MatrixTool.cxx
index 7ebc45249224d3c7717cf2947b1e9d4d1ba63af2..14484dd0c273d3aca29fb8e4c958af1c73afb1e8 100644
--- a/Tracking/TrkAlignment/TrkAlignGenTools/src/MatrixTool.cxx
+++ b/Tracking/TrkAlignment/TrkAlignGenTools/src/MatrixTool.cxx
@@ -860,7 +860,7 @@ namespace Trk {
   void MatrixTool::storeInTFile(TString filename)
   {
     //Store reults in a single TFile....
-    //Including Matrix Vector Hitmap.. Soluton EV’s etc.
+    //Including Matrix Vector Hitmap.. Soluton EVs etc.
     
     ATH_MSG_INFO("Writing Results to a TFile");
     
diff --git a/Tracking/TrkDetDescr/TrkDetDescrTestTools/src/MaterialMapper.cxx b/Tracking/TrkDetDescr/TrkDetDescrTestTools/src/MaterialMapper.cxx
index 62f34f118ebdd21dce14621eb82ce11439486a7e..09bf5c434a27184fe3dcf82b7e826fa2a49f5c99 100755
--- a/Tracking/TrkDetDescr/TrkDetDescrTestTools/src/MaterialMapper.cxx
+++ b/Tracking/TrkDetDescr/TrkDetDescrTestTools/src/MaterialMapper.cxx
@@ -636,8 +636,8 @@ void Trk::MaterialMapper::bookValidationTree()
     m_validationTree->Branch("Path",                   &m_mappedPath,            "path/F");
     m_validationTree->Branch("PathInX0",               &m_mappedPathInX0,        "pathInX0/F");
     m_validationTree->Branch("PathInL0",               &m_mappedPathInL0,        "pathInL0/F");
-    m_validationTree->Branch("PathRho",                &m_mappedPathRho,         "pathRho/F¯");
-    m_validationTree->Branch("PathZARho",              &m_mappedPathZARho,       "pathZARho/F¯");
+    m_validationTree->Branch("PathRho",                &m_mappedPathRho,         "pathRho/F");
+    m_validationTree->Branch("PathZARho",              &m_mappedPathZARho,       "pathZARho/F");
     m_validationTree->Branch("UnmappedPathInX0",       &m_unmappedPathInX0,      "unmappedPathInX0/F");
     m_validationTree->Branch("MaterialSteps",          &m_materialSteps,         "steps/I");
     m_validationTree->Branch("Mapped",                 m_mapped,                 "mapped[steps]/I");
diff --git a/Tracking/TrkDetDescr/TrkDetDescrTools/src/GenericGeometryBuilder.cxx b/Tracking/TrkDetDescr/TrkDetDescrTools/src/GenericGeometryBuilder.cxx
index dc1188ec97cc62f007a71250d6aa8da84bf59655..1681a09595f823a3ab80bef7fbe723307dcf390e 100644
--- a/Tracking/TrkDetDescr/TrkDetDescrTools/src/GenericGeometryBuilder.cxx
+++ b/Tracking/TrkDetDescr/TrkDetDescrTools/src/GenericGeometryBuilder.cxx
@@ -111,25 +111,22 @@ const Trk::TrackingGeometry* Trk::GenericGeometryBuilder::trackingGeometry(const
     // vacuum
     Trk::Material vacuum;
     
-    RZPairVector envelopeDefs;  
-    // build the inner detector if configured
-    if (m_geometrySignature == Trk::ID){
-        // get the dimensions from the envelope service 
-        envelopeDefs = m_enclosingEnvelopeSvc->getInDetRZValues();
-        ATH_MSG_VERBOSE("       -> retrieved Inner Detector envelope definitions at size " << envelopeDefs.size());
-    } else if ( m_geometrySignature == Trk::Calo  ){
-        // get the dimensions from the envelope service 
-        envelopeDefs = m_enclosingEnvelopeSvc->getCaloRZValues();
-        ATH_MSG_VERBOSE("       -> retrieved Calorimeter envelope definitions at size " << envelopeDefs.size());
-    } else if ( m_geometrySignature == Trk::MS ) {
-        // get the dimensions from the envelope service 
-        envelopeDefs = m_enclosingEnvelopeSvc->getMuonRZValues();
-        ATH_MSG_VERBOSE("       -> retrieved Muon System envelope definitions at size " << envelopeDefs.size());
-    } else {
-        ATH_MSG_WARNING("No geometry signature found, return 0.");
-        return 0;
+    const std::map<int,AtlasDetDescr::AtlasRegion> trk2DetDesc{
+      {Trk::ID,AtlasDetDescr::fAtlasID},
+      {Trk::Calo,AtlasDetDescr::fAtlasCalo},
+      {Trk::MS,AtlasDetDescr::fAtlasMS}
+    };
+
+    const auto addId=trk2DetDesc.find(m_geometrySignature);
+    if (addId==trk2DetDesc.end()) {
+      ATH_MSG_WARNING("No geometry signature found, return 0.");
+      //dummy infinite range
+      EventIDRange range;
+      return nullptr;
     }
 
+    const RZPairVector& envelopeDefs=m_enclosingEnvelopeSvc->getRZBoundary(addId->second);
+
     // ------------------------------- overall dimensions ----------------------------------------------
     // get the maximum extend in R
     for ( auto& rzIter : envelopeDefs){
diff --git a/Tracking/TrkDetDescr/TrkDetDescrTools/src/GenericGeometryBuilderCond.cxx b/Tracking/TrkDetDescr/TrkDetDescrTools/src/GenericGeometryBuilderCond.cxx
index f65cdef1ce26412622aa5a9a53f2284ab16266c7..6ffd400006ea46d1f1b02e0ff7a15c206408ca3c 100644
--- a/Tracking/TrkDetDescr/TrkDetDescrTools/src/GenericGeometryBuilderCond.cxx
+++ b/Tracking/TrkDetDescr/TrkDetDescrTools/src/GenericGeometryBuilderCond.cxx
@@ -111,27 +111,22 @@ std::pair<EventIDRange, const Trk::TrackingGeometry*> Trk::GenericGeometryBuilde
     // vacuum
     Trk::Material vacuum;
     
-    RZPairVector envelopeDefs;  
-    // build the inner detector if configured
-    if (m_geometrySignature == Trk::ID){
-        // get the dimensions from the envelope service 
-        envelopeDefs = m_enclosingEnvelopeSvc->getInDetRZValues();
-        ATH_MSG_VERBOSE("       -> retrieved Inner Detector envelope definitions at size " << envelopeDefs.size());
-    } else if ( m_geometrySignature == Trk::Calo  ){
-        // get the dimensions from the envelope service 
-        envelopeDefs = m_enclosingEnvelopeSvc->getCaloRZValues();
-        ATH_MSG_VERBOSE("       -> retrieved Calorimeter envelope definitions at size " << envelopeDefs.size());
-    } else if ( m_geometrySignature == Trk::MS ) {
-        // get the dimensions from the envelope service 
-        envelopeDefs = m_enclosingEnvelopeSvc->getMuonRZValues();
-        ATH_MSG_VERBOSE("       -> retrieved Muon System envelope definitions at size " << envelopeDefs.size());
-    } else {
-        ATH_MSG_WARNING("No geometry signature found, return 0.");
-        //dummy infinite range
-        EventIDRange range;
-        return std::make_pair(range,tGeometry);
+    const std::map<int,AtlasDetDescr::AtlasRegion> trk2DetDesc{
+      {Trk::ID,AtlasDetDescr::fAtlasID},
+      {Trk::Calo,AtlasDetDescr::fAtlasCalo},
+      {Trk::MS,AtlasDetDescr::fAtlasMS}
+    };
+
+    const auto addId=trk2DetDesc.find(m_geometrySignature);
+    if (addId==trk2DetDesc.end()) {
+      ATH_MSG_WARNING("No geometry signature found, return 0.");
+      //dummy infinite range
+      EventIDRange range;
+      return std::make_pair(range,tGeometry);
     }
 
+    const RZPairVector& envelopeDefs=m_enclosingEnvelopeSvc->getRZBoundary(addId->second);
+
     // ------------------------------- overall dimensions ----------------------------------------------
     // get the maximum extend in R
     for ( auto& rzIter : envelopeDefs){
diff --git a/Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h b/Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h
index 427d843a059fa74ccd9c9634b7047744eaa7f6de..24ed209335f3e748e1c5a7b0956bd622a12ead3d 100755
--- a/Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h
+++ b/Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h
@@ -36,6 +36,7 @@ namespace Trk {
     class Track;
     class InDetTrackSummary;
     class MuonTrackSummary;
+    class TrackSummaryTool;
 
 /** enumerates the different types of information stored in Summary. Use in get(const SummaryType type), for for example, summary.get(numOfPixelHits)
 When adding a new transient information type, please make sure to increase numberOfTrackSummaryTypes.*/
@@ -197,6 +198,7 @@ class TrackSummary
 public:
     friend class InDet::InDetTrackSummaryHelperTool;
     friend class Muon::MuonTrackSummaryHelperTool;
+    friend class Trk::TrackSummaryTool;
 
     /** Value set in the cxx file to -1. If any of the values returned by get(const SummaryType& type)==SummaryTypeNotSet then this means that 
     the information has not been filled. i.e. ID information cannot be filled if the TrackSummaryTool does not have access to the InDetTrackSummaryHelperTool*/
diff --git a/Tracking/TrkEvent/VxMultiVertex/VxMultiVertex/MVFVxContainer.h b/Tracking/TrkEvent/VxMultiVertex/VxMultiVertex/MVFVxContainer.h
index eacf58c8f3bdef8e4728f4c670b26890404d355e..6f25ad8e721cd298f087997a9b43c62a9f2e88ed 100755
--- a/Tracking/TrkEvent/VxMultiVertex/VxMultiVertex/MVFVxContainer.h
+++ b/Tracking/TrkEvent/VxMultiVertex/VxMultiVertex/MVFVxContainer.h
@@ -18,7 +18,7 @@
  *  MVFVxCandidate objects alone would beed to be 
  *  stored. In the resent reconstruction, the 
  *  VxContainer is used to store any kind of
- *  Trk::VxCandidate´s.
+ *  Trk::VxCandidate.
  *
  *  begin   : 18-08-2006
  *  authors  Giacinto Piacquadio (Freiburg University)
diff --git a/Tracking/TrkExtrapolation/TrkExTools/TrkExTools/EnergyLossUpdator.h b/Tracking/TrkExtrapolation/TrkExTools/TrkExTools/EnergyLossUpdator.h
index 7c0bfec4c263f1ccd0b7db528fbb3991c21f9722..05d9d36f5a75d70f8d9d6dda2ad52f56b75b62d7 100755
--- a/Tracking/TrkExtrapolation/TrkExTools/TrkExTools/EnergyLossUpdator.h
+++ b/Tracking/TrkExtrapolation/TrkExTools/TrkExTools/EnergyLossUpdator.h
@@ -106,13 +106,8 @@ namespace Trk {
       EnergyLossUpdator(const std::string&,const std::string&,const IInterface*);
 
       /**Virtual destructor*/
-      virtual ~EnergyLossUpdator();
+      virtual ~EnergyLossUpdator() = default;
        
-      /** AlgTool initailize method.*/
-      virtual StatusCode initialize() override;
-      /** AlgTool finalize method */
-      virtual StatusCode finalize() override;
-        
       /** dEdX calculation when providing MaterialProperties,
         a momentum, a pathlength, and a ParicleHypothesis:
         
diff --git a/Tracking/TrkExtrapolation/TrkExTools/TrkExTools/MultipleScatteringUpdator.h b/Tracking/TrkExtrapolation/TrkExTools/TrkExTools/MultipleScatteringUpdator.h
index 601ee9fae845311f38eba344c4736cbab3b29807..4ad913d3d599dc65d10622f68fbafa35d7271123 100755
--- a/Tracking/TrkExtrapolation/TrkExTools/TrkExTools/MultipleScatteringUpdator.h
+++ b/Tracking/TrkExtrapolation/TrkExTools/TrkExTools/MultipleScatteringUpdator.h
@@ -52,9 +52,6 @@ namespace Trk {
       /** AlgTool initailize method.*/
       virtual StatusCode initialize() override;
       
-      /** AlgTool finalize method */
-      virtual StatusCode finalize() override;
-        
       /** Calculate the sigma on theta introduced by multiple scattering,
           according to the RutherFord-Scott Formula           
       */
diff --git a/Tracking/TrkExtrapolation/TrkExTools/src/EnergyLossUpdator.cxx b/Tracking/TrkExtrapolation/TrkExTools/src/EnergyLossUpdator.cxx
index e061f15c21647cb58474da23ad0e38524e7dbad0..3b3cde267df7da852be6439b9df2ee9e237646fa 100755
--- a/Tracking/TrkExtrapolation/TrkExTools/src/EnergyLossUpdator.cxx
+++ b/Tracking/TrkExtrapolation/TrkExTools/src/EnergyLossUpdator.cxx
@@ -57,24 +57,6 @@ Trk::EnergyLossUpdator::EnergyLossUpdator(const std::string &t, const std::strin
   declareProperty("OptimalRadiation", m_optimalRadiation);
 }
 
-// destructor
-Trk::EnergyLossUpdator::~EnergyLossUpdator() {
-}
-
-// Athena standard methods
-// initialize
-StatusCode
-Trk::EnergyLossUpdator::initialize() {
-  ATH_MSG_INFO("initialize()");
-  return StatusCode::SUCCESS;
-}
-
-// finalize
-StatusCode
-Trk::EnergyLossUpdator::finalize() {
-  ATH_MSG_INFO("finalize() successful");
-  return StatusCode::SUCCESS;
-}
 
 // public interface method
 double
diff --git a/Tracking/TrkExtrapolation/TrkExTools/src/Extrapolator.cxx b/Tracking/TrkExtrapolation/TrkExTools/src/Extrapolator.cxx
index f2b290f555451bfe22414bb05708f1f98b4d329f..5340f8a854f4de4af46e332b1bae155c9ba9ae13 100755
--- a/Tracking/TrkExtrapolation/TrkExTools/src/Extrapolator.cxx
+++ b/Tracking/TrkExtrapolation/TrkExTools/src/Extrapolator.cxx
@@ -447,7 +447,6 @@ Trk::Extrapolator::finalize()
                  << Trk::Extrapolator::Cache::s_containerSizeMax.val());
   }
 
-  ATH_MSG_INFO("finalize() successful");
   return StatusCode::SUCCESS;
 }
 
diff --git a/Tracking/TrkExtrapolation/TrkExTools/src/MaterialEffectsUpdator.cxx b/Tracking/TrkExtrapolation/TrkExTools/src/MaterialEffectsUpdator.cxx
index 808554d4883920bbb04c4ab02cf6fc61a09ce6ab..0db3e8be12ecca5a7fa1991ef72be35b47135893 100755
--- a/Tracking/TrkExtrapolation/TrkExTools/src/MaterialEffectsUpdator.cxx
+++ b/Tracking/TrkExtrapolation/TrkExTools/src/MaterialEffectsUpdator.cxx
@@ -90,7 +90,7 @@ StatusCode
 Trk::MaterialEffectsUpdator::initialize()
 {
 
-  ATH_MSG_INFO("Minimal momentum cut for material update : " << m_momentumCut << " MeV");
+  ATH_MSG_DEBUG("Minimal momentum cut for material update : " << m_momentumCut << " MeV");
 
   // retrieve the EnergyLoss Updator and Material Effects updator
   if (m_doEloss) {
diff --git a/Tracking/TrkExtrapolation/TrkExTools/src/MultipleScatteringUpdator.cxx b/Tracking/TrkExtrapolation/TrkExTools/src/MultipleScatteringUpdator.cxx
index 37cc7d4c732765b8f88bb73e909973a555001a2a..1478dc36f732f7cbdec2b19f292e2952223ebc4a 100755
--- a/Tracking/TrkExtrapolation/TrkExTools/src/MultipleScatteringUpdator.cxx
+++ b/Tracking/TrkExtrapolation/TrkExTools/src/MultipleScatteringUpdator.cxx
@@ -97,13 +97,6 @@ Trk::MultipleScatteringUpdator::initialize() {
   return StatusCode::SUCCESS;
 }
 
-// finalize
-StatusCode
-Trk::MultipleScatteringUpdator::finalize() {
-  ATH_MSG_INFO("finalize() successful");
-  return StatusCode::SUCCESS;
-}
-
 double
 Trk::MultipleScatteringUpdator::sigmaSquare(const MaterialProperties &mat,
                                             double p,
diff --git a/Tracking/TrkExtrapolation/TrkExTools/src/Navigator.cxx b/Tracking/TrkExtrapolation/TrkExTools/src/Navigator.cxx
index 3ab740e92dba2ade05b5cfd46cbc633eddb52f1a..591357e4341a1099e1b62e6fc45b847d2f036e39 100755
--- a/Tracking/TrkExtrapolation/TrkExTools/src/Navigator.cxx
+++ b/Tracking/TrkExtrapolation/TrkExTools/src/Navigator.cxx
@@ -90,7 +90,7 @@ Trk::Navigator::initialize() {
   // get the TrackingGeometrySvc
   if (!m_useConditions) {
     if (m_trackingGeometrySvc.retrieve().isSuccess()) {
-      ATH_MSG_INFO("Successfully retrieved " << m_trackingGeometrySvc);
+      ATH_MSG_DEBUG("Successfully retrieved " << m_trackingGeometrySvc);
       m_trackingGeometryName = m_trackingGeometrySvc->trackingGeometryName();
     } else {
       ATH_MSG_WARNING("Couldn't retrieve " << m_trackingGeometrySvc << ". ");
@@ -108,7 +108,6 @@ Trk::Navigator::initialize() {
   //This is no-op for the Navigator only relevant for
   //derivated Validation for now
   validationInitialize();
-  ATH_MSG_DEBUG("initialize() successful");
   return StatusCode::SUCCESS;
 }
 
@@ -614,7 +613,6 @@ Trk::Navigator::finalize() {
     ATH_MSG_DEBUG(" ---------------------------------------------------------------------");
   }
 
-  ATH_MSG_INFO("finalize() successful");
   return StatusCode::SUCCESS;
 }
 
diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/CMakeLists.txt b/Tracking/TrkFitter/TrkGaussianSumFilter/CMakeLists.txt
index ddbed75050f15477daff17c495cd4040f6bde11b..8d8288fd72e6aa61493d53d922bc5ab629840e07 100644
--- a/Tracking/TrkFitter/TrkGaussianSumFilter/CMakeLists.txt
+++ b/Tracking/TrkFitter/TrkGaussianSumFilter/CMakeLists.txt
@@ -25,14 +25,19 @@ atlas_install_runtime( Data/*.par )
 #Executables for tests
 atlas_add_executable( GSF_testFindMinimumIndex
 	test/testFindMinimumIndex.cxx src/KLGaussianMixtureReduction.cxx
-        LINK_LIBRARIES CxxUtils )
+  LINK_LIBRARIES CxxUtils )
 
 atlas_add_executable( GSF_testAlignedDynArray
 	test/testAlignedDynArray.cxx)
 
 atlas_add_executable( GSF_testMergeComponents
 	test/testMergeComponents.cxx src/KLGaussianMixtureReduction.cxx
-        LINK_LIBRARIES CxxUtils )
+  LINK_LIBRARIES CxxUtils )
+
+atlas_add_executable( GSF_testFindMode
+	test/testFindMode.cxx src/MultiComponentStateModeCalculator.cxx
+  LINK_LIBRARIES CxxUtils TrkMultiComponentStateOnSurface)
+
 
 #Tests
 atlas_add_test(ut_GSF_testFindMinimumIndex
@@ -44,3 +49,6 @@ atlas_add_test(ut_GSF_testAlignedDynArray
 atlas_add_test(ut_GSF_testMergeComponents
 	SCRIPT GSF_testMergeComponents)
 
+atlas_add_test(ut_GSF_testFindMode
+	SCRIPT GSF_testFindMode)
+
diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GaussianSumFitter.h b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GaussianSumFitter.h
index 5e29de448805524cdd7c1e21f87ea312216269fa..4d1492a70378b11d97c4ddfd5532fda0062709a8 100644
--- a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GaussianSumFitter.h
+++ b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GaussianSumFitter.h
@@ -114,14 +114,15 @@ private:
   const MultiComponentStateOnSurface* makePerigee(
     const EventContext& ctx,
     Trk::IMultiStateExtrapolator::Cache&,
-    const SmoothedTrajectory*,
+    const SmoothedTrajectory&,
     const ParticleHypothesis particleHypothesis = nonInteracting) const;
 
   //* Calculate the fit quality */
-  const Trk::FitQuality* buildFitQuality(const Trk::SmoothedTrajectory&) const;
+  std::unique_ptr<Trk::FitQuality> buildFitQuality(
+    const Trk::SmoothedTrajectory&) const;
 
   /** Gsf smoothe trajectory*/
-  SmoothedTrajectory* fit(
+  std::unique_ptr<SmoothedTrajectory> fit(
     const EventContext& ctx,
     Trk::IMultiStateExtrapolator::Cache&,
     const ForwardTrajectory&,
@@ -137,7 +138,7 @@ private:
     const EventContext& ctx,
     const Trk::TrackStateOnSurface* currentState,
     const Trk::CaloCluster_OnTrack* ccot,
-    Trk::SmoothedTrajectory* smoothedTrajectory) const;
+    Trk::SmoothedTrajectory& smoothedTrajectory) const;
 
   /** Forward GSF fit using PrepRawData */
   std::unique_ptr<ForwardTrajectory> fitPRD(
diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GsfBetheHeitlerEffects.h b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GsfBetheHeitlerEffects.h
index 6b2c5c8d28ae7046996b17e5970a7be1653ac6bc..591ad30217889a8f39e992dd4ff593c09791be76 100644
--- a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GsfBetheHeitlerEffects.h
+++ b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GsfBetheHeitlerEffects.h
@@ -26,7 +26,7 @@ class GsfBetheHeitlerEffects
   , virtual public IBetheHeitlerEffects
 {
 
-private:
+public:
   /** Helper class for construction and evaluation of polynomial */
   class Polynomial
   {
@@ -76,7 +76,6 @@ private:
     double variance;
   };
 
-public:
   GsfBetheHeitlerEffects(const std::string&,
                          const std::string&,
                          const IInterface*);
@@ -86,9 +85,6 @@ public:
   /** AlgTool initialise method */
   virtual StatusCode initialize() override final;
 
-  /** AlgTool finalise method */
-  virtual StatusCode finalize() override final;
-
   virtual void compute(Trk::GSFEnergyLossCache& cache,
                        const ComponentParameters& componentParameters,
                        const MaterialProperties& materialProperties,
@@ -106,37 +102,31 @@ private:
   // Read coeffients for a single polynomial fit
   Polynomial readPolynomial(std::ifstream&, const int);
 
-  // Get mixture parameters
-  void getMixtureParameters(const double, MixtureParameters&) const;
-
-  // Get mixture parameters
-  void getMixtureParametersHighX0(const double, MixtureParameters&) const;
-
-private:
-  std::string m_parameterisationFileName;
 
-  int m_numberOfComponents;
-  int m_transformationCode;
   std::vector<Polynomial> m_polynomialWeights;
   std::vector<Polynomial> m_polynomialMeans;
   std::vector<Polynomial> m_polynomialVariances;
+  std::vector<Polynomial> m_polynomialWeightsHighX0;
+  std::vector<Polynomial> m_polynomialMeansHighX0;
+  std::vector<Polynomial> m_polynomialVariancesHighX0;
 
-  int m_correctionFlag;
-
-  std::string m_parameterisationFileNameHighX0;
 
+  int m_numberOfComponents;
+  int m_transformationCode;
+  int m_correctionFlag;
   int m_numberOfComponentsHighX0;
   int m_transformationCodeHighX0;
-  std::vector<Polynomial> m_polynomialWeightsHighX0;
-  std::vector<Polynomial> m_polynomialMeansHighX0;
-  std::vector<Polynomial> m_polynomialVariancesHighX0;
 
   double m_singleGaussianRange;
   double m_lowerRange;
   double m_xOverRange;
   double m_upperRange;
-  bool m_useHighX0;
   double m_componentMeanCut;
+  
+  bool m_useHighX0;
+  std::string m_parameterisationFileName;
+  std::string m_parameterisationFileNameHighX0;
+
 };
 
 }
diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GsfMaterialMixtureConvolution.h b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GsfMaterialMixtureConvolution.h
index 815240b3e929d9da392143ac5c1b2bef64c2e633..7eb271c1cf365e9199eb10899620fa25bb2daf72 100644
--- a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GsfMaterialMixtureConvolution.h
+++ b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GsfMaterialMixtureConvolution.h
@@ -47,10 +47,8 @@ public:
   virtual ~GsfMaterialMixtureConvolution();
 
   //!< AlgTool initialise method
-  virtual StatusCode initialize() override;
+  virtual StatusCode initialize() override final;
 
-  //!< AlgTool finalize method
-  virtual StatusCode finalize() override;
 
   //!< Convolution with full material properties
   virtual MultiComponentState update(
diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/MultiComponentStateModeCalculator.h b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/MultiComponentStateModeCalculator.h
index 1f1096cd9e250a0a9eae01774ce3c96147322f11..d330191b8c12f66eff9f142a5aed3a2f7abd4182 100644
--- a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/MultiComponentStateModeCalculator.h
+++ b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/MultiComponentStateModeCalculator.h
@@ -21,9 +21,9 @@
 namespace Trk {
 namespace MultiComponentStateModeCalculator {
 
+// Simple representation of 1D component
 struct Component
 {
-  // Default ctors/dtor/assignment operators
   Component() = default;
   ~Component() = default;
   Component(const Component&) = default;
@@ -41,36 +41,14 @@ struct Component
   double sigma = 0;
 };
 
-/** @brief  Method to calculate mode*/
+/** @brief  Method to calculate mode with MultiComponentState
+ * state as input */
 std::array<double, 10>
 calculateMode(const MultiComponentState&);
 
-/**
- * method to extract the weight, mean and sigma values from the
-  multi-component state*/
-void
-fillMixture(const MultiComponentState&,
-            std::array<std::vector<Component>, 5>& mixture);
-
-/**
- * method to find the mode using the Newton-Raphson method based on a
- *   starting guess
- */
-double
-findMode(double, int, const std::array<std::vector<Component>, 5>& mixture);
-
-double
-findModeGlobal(double,
-               int,
-               const std::array<std::vector<Component>, 5>& mixture);
-
-double
-findRoot(double& result,
-         double xlo,
-         double xhi,
-         double value,
-         double i,
-         const std::array<std::vector<Component>, 5>& mixture);
+/** @brief  Method to calculate mode*/
+std::array<double, 10>
+calculateMode(const std::array<std::vector<Component>, 5>& mixture);
 
 } // namespace MultiComponentStateModeCalculator
 
diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/share/ut_GSF_testFindMode.ref b/Tracking/TrkFitter/TrkGaussianSumFilter/share/ut_GSF_testFindMode.ref
new file mode 100644
index 0000000000000000000000000000000000000000..7834719fda33d13509d62f605f803b9b18be2b9f
--- /dev/null
+++ b/Tracking/TrkFitter/TrkGaussianSumFilter/share/ut_GSF_testFindMode.ref
@@ -0,0 +1,10 @@
+-27.9078
+38.4943
+-1.0267
+2.94981
+-7.99292e-05
+0.0539087
+0.758757
+0.000448727
+0.0011341
+1.23707e-05
diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/share/ut_GSF_testMergeComponents b/Tracking/TrkFitter/TrkGaussianSumFilter/share/ut_GSF_testMergeComponents.ref
similarity index 100%
rename from Tracking/TrkFitter/TrkGaussianSumFilter/share/ut_GSF_testMergeComponents
rename to Tracking/TrkFitter/TrkGaussianSumFilter/share/ut_GSF_testMergeComponents.ref
diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/src/GaussianSumFitter.cxx b/Tracking/TrkFitter/TrkGaussianSumFilter/src/GaussianSumFitter.cxx
index 63b782bfba7780e0052daea5ed6102705ef94c82..afef29f20f45ef69d7c37a7b60ecd1811255d6af 100644
--- a/Tracking/TrkFitter/TrkGaussianSumFilter/src/GaussianSumFitter.cxx
+++ b/Tracking/TrkFitter/TrkGaussianSumFilter/src/GaussianSumFitter.cxx
@@ -10,10 +10,10 @@
  */
 
 #include "TrkGaussianSumFilter/GaussianSumFitter.h"
-#include "TrkGaussianSumFilter/IMultiStateExtrapolator.h"
-#include "TrkGaussianSumFilter/MultiComponentStateCombiner.h"
 #include "TrkEventUtils/MeasurementBaseComparisonFunction.h"
 #include "TrkEventUtils/PrepRawDataComparisonFunction.h"
+#include "TrkGaussianSumFilter/IMultiStateExtrapolator.h"
+#include "TrkGaussianSumFilter/MultiComponentStateCombiner.h"
 #include "TrkParameters/TrackParameters.h"
 
 #include "TrkCaloCluster_OnTrack/CaloCluster_OnTrack.h"
@@ -69,10 +69,8 @@ Trk::GaussianSumFitter::initialize()
   StatusCode sc;
   // Request the GSF extrapolator
   ATH_CHECK(m_extrapolator.retrieve());
-
   // Request the RIO_OnTrack creator
   // No need to return if RioOnTrack creator tool, only if PrepRawData is used
-  // in fit
   if (m_rioOnTrackCreator.retrieve().isFailure()) {
     if (!m_refitOnMeasurementBase) {
       ATH_MSG_FATAL("Attempting to use PrepRawData with no RIO_OnTrack creator "
@@ -83,7 +81,16 @@ Trk::GaussianSumFitter::initialize()
       "Request to retrieve the RIO_OnTrack Creator"
       << "failed but track is fit at the MeasurementBase level... Continuing!");
   }
-
+  if (m_overideMaterialEffectsSwitch) {
+    ATH_MSG_INFO("Material effects in forwards fitter have been overiden by "
+                 "jobOptions... New "
+                 "Trk::ParticleHypothesis: "
+                 << m_overideMaterialEffects);
+  }
+  if( m_maximumNumberOfComponents > 16){
+      ATH_MSG_FATAL("Requested MaximumNumberOfComponents > 16");
+      return StatusCode::FAILURE;
+  }
   // Initialise the closest track parameters search algorithm
   Amg::Vector3D referencePosition(m_sortingReferencePoint[0],
                                   m_sortingReferencePoint[1],
@@ -91,19 +98,11 @@ Trk::GaussianSumFitter::initialize()
 
   m_trkParametersComparisonFunction =
     std::make_unique<Trk::TrkParametersComparisonFunction>(referencePosition);
-
   Trk::ParticleSwitcher particleSwitcher;
   m_overideParticleHypothesis =
     particleSwitcher.particle[m_overideMaterialEffects];
-  if (m_overideMaterialEffectsSwitch) {
-    ATH_MSG_INFO("Material effects in forwards fitter have been overiden by "
-                 "jobOptions... New "
-                 "Trk::ParticleHypothesis: "
-                 << m_overideMaterialEffects);
-  }
-
   m_inputPreparator = std::make_unique<TrackFitInputPreparator>();
-  ATH_MSG_INFO("Initialisation of " << name() << " was successful");
+
   return StatusCode::SUCCESS;
 }
 
@@ -286,52 +285,42 @@ Trk::GaussianSumFitter::fit(
   Trk::IMultiStateExtrapolator::Cache extrapolatorCache;
 
   // Perform GSF forwards fit
-  ForwardTrajectory* forwardTrajectory = fitPRD(ctx,
-                                                extrapolatorCache,
-                                                sortedPrepRawDataSet,
-                                                estimatedParametersNearOrigin,
-                                                particleHypothesis)
-                                           .release();
-
-  if (!forwardTrajectory) {
+  std::unique_ptr<ForwardTrajectory> forwardTrajectory =
+    fitPRD(ctx,
+           extrapolatorCache,
+           sortedPrepRawDataSet,
+           estimatedParametersNearOrigin,
+           particleHypothesis);
+
+  if (!forwardTrajectory || forwardTrajectory->empty()) {
     ATH_MSG_DEBUG("Forward GSF fit failed... Exiting!");
     ++m_ForwardFailure;
     return nullptr;
   }
 
-  if (forwardTrajectory->empty()) {
-    ATH_MSG_DEBUG("No states in forward trajectory... Exiting!");
-    ++m_ForwardFailure;
-    delete forwardTrajectory;
-    return nullptr;
-  }
-
   // Perform GSF smoother operation
-  SmoothedTrajectory* smoothedTrajectory =
+  std::unique_ptr<SmoothedTrajectory> smoothedTrajectory =
     fit(ctx, extrapolatorCache, *forwardTrajectory, particleHypothesis);
 
   // Protect against failed smoother fit
   if (!smoothedTrajectory) {
     ATH_MSG_DEBUG("Smoother GSF fit failed... Exiting!");
     ++m_SmootherFailure;
-    delete forwardTrajectory;
     return nullptr;
   }
 
   // Outlier m_logic and track finalisation
-  const FitQuality* fitQuality = buildFitQuality(*smoothedTrajectory);
+  std::unique_ptr<FitQuality> fitQuality = buildFitQuality(*smoothedTrajectory);
   if (!fitQuality) {
     ATH_MSG_DEBUG("Chi squared could not be calculated... Bailing");
     ++m_fitQualityFailure;
-    delete forwardTrajectory;
-    delete smoothedTrajectory;
     return nullptr;
   }
 
   if (m_makePerigee) {
     const Trk::MultiComponentStateOnSurface* perigeeMultiStateOnSurface =
       makePerigee(
-        ctx, extrapolatorCache, smoothedTrajectory, particleHypothesis);
+        ctx, extrapolatorCache, *smoothedTrajectory, particleHypothesis);
     ATH_MSG_DEBUG(
       "perigeeMultiStateOnSurface  :" << perigeeMultiStateOnSurface);
     if (perigeeMultiStateOnSurface) {
@@ -339,15 +328,10 @@ Trk::GaussianSumFitter::fit(
     } else {
       ATH_MSG_DEBUG("Perigee asked to be created but failed.....Exiting");
       ++m_PerigeeFailure;
-      delete smoothedTrajectory;
-      delete forwardTrajectory;
-      delete fitQuality;
       return nullptr;
     }
   }
 
-  // Delete forward trajectory. New memory was assigned in ForwardGsfFitter.
-  delete forwardTrajectory;
   // Reverse the order of the TSOS's to make be order flow from inside to out
   std::reverse(smoothedTrajectory->begin(), smoothedTrajectory->end());
 
@@ -358,14 +342,13 @@ Trk::GaussianSumFitter::fit(
     for (const Trk::TrackStateOnSurface* tsos : *smoothedTrajectory) {
       slimmedSmoothedTrajectory->push_back(new Trk::TrackStateOnSurface(*tsos));
     }
-    delete smoothedTrajectory;
     // Create new track
     Trk::TrackInfo info(Trk::TrackInfo::GaussianSumFilter, particleHypothesis);
     info.setTrackProperties(TrackInfo::BremFit);
     info.setTrackProperties(TrackInfo::BremFitSuccessful);
     ++m_fitSuccess;
     return std::make_unique<Track>(
-      info, slimmedSmoothedTrajectory.release(), fitQuality);
+      info, slimmedSmoothedTrajectory.release(), fitQuality.release());
   }
 
   // Create new track
@@ -373,7 +356,8 @@ Trk::GaussianSumFitter::fit(
   info.setTrackProperties(TrackInfo::BremFit);
   info.setTrackProperties(TrackInfo::BremFitSuccessful);
   ++m_fitSuccess;
-  return std::make_unique<Track>(info, smoothedTrajectory, fitQuality);
+  return std::make_unique<Track>(
+    info, smoothedTrajectory.release(), fitQuality.release());
 }
 
 /*
@@ -444,13 +428,12 @@ Trk::GaussianSumFitter::fit(
   Trk::IMultiStateExtrapolator::Cache extrapolatorCache;
 
   // Perform GSF forwards fit - new memory allocated in forwards fitter
-  ForwardTrajectory* forwardTrajectory =
+  std::unique_ptr<ForwardTrajectory> forwardTrajectory =
     fitMeasurements(ctx,
                     extrapolatorCache,
                     sortedMeasurementSet,
                     estimatedParametersNearOrigin,
-                    particleHypothesis)
-      .release();
+                    particleHypothesis);
 
   if (!forwardTrajectory) {
     ATH_MSG_DEBUG("Forward GSF fit failed... Exiting!");
@@ -460,39 +443,35 @@ Trk::GaussianSumFitter::fit(
 
   if (forwardTrajectory->empty()) {
     ATH_MSG_DEBUG("No states in forward trajectory... Exiting!");
-    delete forwardTrajectory;
     ++m_ForwardFailure;
     return nullptr;
   }
 
   // Perform GSF smoother operation
 
-  SmoothedTrajectory* smoothedTrajectory =
+  std::unique_ptr<SmoothedTrajectory> smoothedTrajectory =
     fit(ctx, extrapolatorCache, *forwardTrajectory, particleHypothesis, ccot);
 
   // Protect against failed smoother fit
   if (!smoothedTrajectory) {
     ATH_MSG_DEBUG("Smoother GSF fit failed... Exiting!");
     ++m_SmootherFailure;
-    delete forwardTrajectory;
     return nullptr;
   }
 
   // Outlier m_logic and track finalisation
-  const FitQuality* fitQuality = buildFitQuality(*smoothedTrajectory);
+  std::unique_ptr<FitQuality> fitQuality = buildFitQuality(*smoothedTrajectory);
 
   if (!fitQuality) {
     ATH_MSG_DEBUG("Chi squared could not be calculated... Bailing");
     ++m_fitQualityFailure;
-    delete forwardTrajectory;
-    delete smoothedTrajectory;
     return nullptr;
   }
 
   if (m_makePerigee) {
     const Trk::MultiComponentStateOnSurface* perigeeMultiStateOnSurface =
       makePerigee(
-        ctx, extrapolatorCache, smoothedTrajectory, particleHypothesis);
+        ctx, extrapolatorCache, *smoothedTrajectory, particleHypothesis);
     ATH_MSG_DEBUG(
       "perigeeMultiStateOnSurface  :" << perigeeMultiStateOnSurface);
 
@@ -501,16 +480,10 @@ Trk::GaussianSumFitter::fit(
     } else {
       ATH_MSG_DEBUG("Perigee asked to be created but failed.....Exiting");
       ++m_PerigeeFailure;
-      delete fitQuality;
-      delete forwardTrajectory;
-      delete smoothedTrajectory;
       return nullptr;
     }
   }
 
-  // Delete forward trajectory. New memory was assigned in ForwardGsfFitter.
-  delete forwardTrajectory;
-
   // Reverse the order of the TSOS's to make be order flow from inside to out
   std::reverse(smoothedTrajectory->begin(), smoothedTrajectory->end());
 
@@ -521,14 +494,13 @@ Trk::GaussianSumFitter::fit(
     for (const Trk::TrackStateOnSurface* tsos : *smoothedTrajectory) {
       slimmedSmoothedTrajectory->push_back(new Trk::TrackStateOnSurface(*tsos));
     }
-    delete smoothedTrajectory;
     // Create new track
     Trk::TrackInfo info(Trk::TrackInfo::GaussianSumFilter, particleHypothesis);
     info.setTrackProperties(TrackInfo::BremFit);
     info.setTrackProperties(TrackInfo::BremFitSuccessful);
     ++m_fitSuccess;
     return std::make_unique<Track>(
-      info, slimmedSmoothedTrajectory.release(), fitQuality);
+      info, slimmedSmoothedTrajectory.release(), fitQuality.release());
   }
 
   // Create new track
@@ -536,7 +508,8 @@ Trk::GaussianSumFitter::fit(
   info.setTrackProperties(TrackInfo::BremFit);
   info.setTrackProperties(TrackInfo::BremFitSuccessful);
   ++m_fitSuccess;
-  return std::make_unique<Track>(info, smoothedTrajectory, fitQuality);
+  return std::make_unique<Track>(
+    info, smoothedTrajectory.release(), fitQuality.release());
 }
 
 std::unique_ptr<Trk::Track>
@@ -696,14 +669,14 @@ const Trk::MultiComponentStateOnSurface*
 Trk::GaussianSumFitter::makePerigee(
   const EventContext& ctx,
   Trk::IMultiStateExtrapolator::Cache& extrapolatorCache,
-  const Trk::SmoothedTrajectory* smoothedTrajectory,
+  const Trk::SmoothedTrajectory& smoothedTrajectory,
   const Trk::ParticleHypothesis particleHypothesis) const
 {
 
   // Propagate track to perigee
   const Trk::PerigeeSurface perigeeSurface;
   const Trk::TrackStateOnSurface* stateOnSurfaceNearestOrigin =
-    smoothedTrajectory->back();
+    smoothedTrajectory.back();
   const Trk::MultiComponentStateOnSurface*
     multiComponentStateOnSurfaceNearestOrigin = nullptr;
 
@@ -782,27 +755,23 @@ Trk::GaussianSumFitter::makePerigee(
   return perigeeMultiStateOnSurface;
 }
 
-const Trk::FitQuality*
+std::unique_ptr<Trk::FitQuality>
 Trk::GaussianSumFitter::buildFitQuality(
   const Trk::SmoothedTrajectory& smoothedTrajectory) const
 {
 
   double chiSquared = 0.;
   int numberDoF = -5;
-
   // Loop over all TrackStateOnSurface objects in trajectory
   SmoothedTrajectory::const_iterator stateOnSurface =
     smoothedTrajectory.begin();
-
   for (; stateOnSurface != smoothedTrajectory.end(); ++stateOnSurface) {
-
     if (!(*stateOnSurface)->type(TrackStateOnSurface::Measurement)) {
       continue;
     }
     if ((*stateOnSurface)->fitQualityOnSurface() == nullptr) {
       continue;
     }
-
     chiSquared += (*stateOnSurface)->fitQualityOnSurface()->chiSquared();
     numberDoF += (*stateOnSurface)->fitQualityOnSurface()->numberDoF();
   }
@@ -811,9 +780,7 @@ Trk::GaussianSumFitter::buildFitQuality(
     return nullptr;
   }
 
-  const FitQuality* fitQuality = new FitQuality(chiSquared, numberDoF);
-
-  return fitQuality;
+  return std::make_unique<FitQuality>(chiSquared, numberDoF);
 }
 
 /*
@@ -1083,7 +1050,7 @@ Trk::GaussianSumFitter::stepForwardFit(
   return true;
 }
 
-Trk::SmoothedTrajectory*
+std::unique_ptr<Trk::SmoothedTrajectory>
 Trk::GaussianSumFitter::fit(
   const EventContext& ctx,
   Trk::IMultiStateExtrapolator::Cache& extrapolatorCache,
@@ -1384,14 +1351,14 @@ Trk::GaussianSumFitter::fit(
       if (ccot && trackStateOnSurface == secondLastTrackStateOnSurface) {
 
         Trk::MultiComponentState ccotState =
-          addCCOT(ctx, updatedStateOnSurface, ccot, smoothedTrajectory.get());
+          addCCOT(ctx, updatedStateOnSurface, ccot, *smoothedTrajectory);
         if (!ccotState.empty()) {
           updatedState = std::move(ccotState);
         }
       }
     }
   } // End for loop over all components
-  return smoothedTrajectory.release();
+  return smoothedTrajectory;
 }
 
 Trk::MultiComponentState
@@ -1497,7 +1464,7 @@ Trk::GaussianSumFitter::addCCOT(
   const EventContext& ctx,
   const Trk::TrackStateOnSurface* currentState,
   const Trk::CaloCluster_OnTrack* ccot,
-  Trk::SmoothedTrajectory* smoothedTrajectory) const
+  Trk::SmoothedTrajectory& smoothedTrajectory) const
 {
 
   const Trk::MultiComponentStateOnSurface* currentMultiStateOS = nullptr;
@@ -1594,8 +1561,8 @@ Trk::GaussianSumFitter::addCCOT(
       combinedState.release(),
       MultiComponentStateHelpers::clone(extrapolatedState).release(),
       combinedFitQuality.release());
-  smoothedTrajectory->push_back(updatedMCSOS);
-  smoothedTrajectory->push_back(finalSOS);
+  smoothedTrajectory.push_back(updatedMCSOS);
+  smoothedTrajectory.push_back(finalSOS);
 
   return extrapolatedState;
 }
diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfBetheHeitlerEffects.cxx b/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfBetheHeitlerEffects.cxx
index 062fb266825cdade36f3361fc3f83a910ea4a21e..3c6063f1c849aa314188a699efce428357dcf5ff 100644
--- a/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfBetheHeitlerEffects.cxx
+++ b/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfBetheHeitlerEffects.cxx
@@ -119,19 +119,61 @@ correctedFirstVariance(
   return std::max(varianceBH / mixture[0].weight, 0.);
 }
 
+Trk::GsfBetheHeitlerEffects::MixtureParameters
+getTranformedMixtureParameters(
+  const std::vector<Trk::GsfBetheHeitlerEffects::Polynomial>& polynomialWeights,
+  const std::vector<Trk::GsfBetheHeitlerEffects::Polynomial>& polynomialMeans,
+  const std::vector<Trk::GsfBetheHeitlerEffects::Polynomial>& polynomialVariances,
+  const double pathlengthInX0,
+  const int numberOfComponents)
+{
+
+  Trk::GsfBetheHeitlerEffects::MixtureParameters mixture;
+  mixture.reserve(numberOfComponents);
+  for (int i = 0; i < numberOfComponents; ++i) {
+    const double updatedWeight = polynomialWeights[i](pathlengthInX0);
+    const double updatedMean = polynomialMeans[i](pathlengthInX0);
+    const double updatedVariance = polynomialVariances[i](pathlengthInX0);
+    mixture.emplace_back(logisticFunction(updatedWeight),
+                         logisticFunction(updatedMean),
+                         exp(updatedVariance));
+  }
+  return mixture;
+}
+
+Trk::GsfBetheHeitlerEffects::MixtureParameters
+getMixtureParameters(
+  const std::vector<Trk::GsfBetheHeitlerEffects::Polynomial>& polynomialWeights,
+  const std::vector<Trk::GsfBetheHeitlerEffects::Polynomial>& polynomialMeans,
+  const std::vector<Trk::GsfBetheHeitlerEffects::Polynomial>& polynomialVariances,
+  const double pathlengthInX0,
+  const int numberOfComponents)
+{
+
+  Trk::GsfBetheHeitlerEffects::MixtureParameters mixture;
+  mixture.reserve(numberOfComponents);
+  for (int i = 0; i < numberOfComponents; ++i) {
+    const double updatedWeight = polynomialWeights[i](pathlengthInX0);
+    const double updatedMean = polynomialMeans[i](pathlengthInX0);
+    const double updatedVariance = polynomialVariances[i](pathlengthInX0);
+    mixture.emplace_back(
+      updatedWeight, updatedMean, updatedVariance * updatedVariance);
+  }
+  return mixture;
+}
 } // end of Anonymous namespace for Helper methods
 
 Trk::GsfBetheHeitlerEffects::GsfBetheHeitlerEffects(const std::string& type,
                                                     const std::string& name,
                                                     const IInterface* parent)
   : AthAlgTool(type, name, parent)
-  , m_parameterisationFileName("GeantSim_LT01_cdf_nC6_O5.par")
   , m_numberOfComponents(0)
   , m_transformationCode(0)
   , m_correctionFlag(0)
-  , m_parameterisationFileNameHighX0("GeantSim_GT01_cdf_nC6_O5.par")
   , m_numberOfComponentsHighX0(0)
   , m_transformationCodeHighX0(0)
+  , m_parameterisationFileName("GeantSim_LT01_cdf_nC6_O5.par")
+  , m_parameterisationFileNameHighX0("GeantSim_GT01_cdf_nC6_O5.par")
 {
 
   declareInterface<IBetheHeitlerEffects>(this);
@@ -152,7 +194,6 @@ Trk::GsfBetheHeitlerEffects::GsfBetheHeitlerEffects(const std::string& type,
 StatusCode
 Trk::GsfBetheHeitlerEffects::initialize()
 {
-
   if (m_correctionFlag == 1) {
     ATH_MSG_INFO("1st moment of mixture will be corrected");
   } else if (m_correctionFlag == 2) {
@@ -160,29 +201,19 @@ Trk::GsfBetheHeitlerEffects::initialize()
   } else if (m_correctionFlag == 0) {
     ATH_MSG_INFO("Moments of mixture will not be corrected");
   } else {
-    ATH_MSG_INFO("Inappropriate setting for Bethe-Heitler mixture correction! "
-                 "...Exiting!");
+    ATH_MSG_ERROR("Inappropriate setting for Bethe-Heitler mixture correction! "
+                  "...Exiting!");
     return StatusCode::FAILURE;
   }
-
   if (this->readParameters()) {
     ATH_MSG_INFO("Parameters successfully imported from file");
     ATH_MSG_INFO("Initialisation of " << name() << " was successful");
     return StatusCode::SUCCESS;
   }
-
   ATH_MSG_ERROR("Parameters could NOT be successfully imported from file");
   return StatusCode::FAILURE;
 }
 
-StatusCode
-Trk::GsfBetheHeitlerEffects::finalize()
-{
-
-  ATH_MSG_INFO("Finalisation of " << name() << " was successful");
-  return StatusCode::SUCCESS;
-}
-
 bool
 Trk::GsfBetheHeitlerEffects::readParameters()
 {
@@ -207,8 +238,8 @@ Trk::GsfBetheHeitlerEffects::readParameters()
   fin >> orderPolynomial;
   fin >> m_transformationCode;
   //
-  if (not inRange(m_numberOfComponents, 0, 100)) {
-    ATH_MSG_ERROR("numberOfComponents Parameter out of range 0-100: "
+  if (not inRange(m_numberOfComponents, 0, 8)) {
+    ATH_MSG_ERROR("numberOfComponents Parameter out of range 0-8: "
                   << m_numberOfComponents);
     return false;
   }
@@ -257,8 +288,8 @@ Trk::GsfBetheHeitlerEffects::readParameters()
     fin >> orderPolynomial;
     fin >> m_transformationCodeHighX0;
     //
-    if (not inRange(m_numberOfComponentsHighX0, 0, 100)) {
-      ATH_MSG_ERROR("numberOfComponents Parameter out of range 0-100: "
+    if (not inRange(m_numberOfComponentsHighX0, 0, 8)) {
+      ATH_MSG_ERROR("numberOfComponents Parameter out of range 0-8: "
                     << m_numberOfComponentsHighX0);
       return false;
     }
@@ -291,11 +322,8 @@ Trk::GsfBetheHeitlerEffects::readParameters()
 Trk::GsfBetheHeitlerEffects::Polynomial
 Trk::GsfBetheHeitlerEffects::readPolynomial(std::ifstream& fin, const int order)
 {
-
   std::vector<double> coefficients(order + 1);
-
   int orderIndex = 0;
-
   for (; orderIndex < (order + 1); ++orderIndex) {
     if (!fin) {
       throw std::runtime_error(
@@ -303,7 +331,6 @@ Trk::GsfBetheHeitlerEffects::readPolynomial(std::ifstream& fin, const int order)
     }
     fin >> coefficients[orderIndex];
   }
-
   return Polynomial(coefficients);
 }
 
@@ -322,166 +349,138 @@ Trk::GsfBetheHeitlerEffects::compute(
   const Trk::TrackParameters* trackParameters = componentParameters.first.get();
   const Amg::Vector3D& globalMomentum = trackParameters->momentum();
 
-  double radiationLength = materialProperties.x0();
+  const double radiationLength = materialProperties.x0();
+  const double momentum = globalMomentum.mag();
   double pathlengthInX0 = pathLength / radiationLength;
-  double momentum = globalMomentum.mag();
-
-  // Produce a multi-component State
-  if (pathlengthInX0 > m_singleGaussianRange) {
-
-    // If the amount of material is between 0.0001 and 0.01 return the gaussian
-    // approximation to the Bethe-Heitler distribution
-    if (pathlengthInX0 < m_lowerRange) {
-
-      const double meanZ = exp(-1. * pathlengthInX0);
-      const double sign = (direction == Trk::oppositeMomentum) ? 1. : -1.;
-      const double varZ = exp(-1. * pathlengthInX0 * log(3.) / log(2.)) -
-                          exp(-2. * pathlengthInX0);
-      double deltaP(0.);
-      double varQoverP(0.);
-      if (direction == Trk::alongMomentum) {
-        deltaP = sign * momentum * (1. - meanZ);
-        varQoverP = 1. / (meanZ * meanZ * momentum * momentum) * varZ;
-      } else {
-        deltaP = sign * momentum * (1. / meanZ - 1.);
-        varQoverP = varZ / (momentum * momentum);
-      }
-      cache.deltaPs.push_back(deltaP);
-      cache.weights.push_back(1.);
-      cache.deltaQOvePCov.push_back(varQoverP);
-      ATH_MSG_VERBOSE("Weight / deltaP / var (delta q/p) "
-                      << 1. << "\t" << deltaP << "\t" << varQoverP);
-      return;
-    }
 
-    if (pathlengthInX0 > m_upperRange) {
-      pathlengthInX0 = m_upperRange;
-    }
-
-    MixtureParameters mixture;
-    mixture.reserve(m_numberOfComponents);
-    if (m_useHighX0 && pathlengthInX0 > m_xOverRange) {
-      getMixtureParametersHighX0(pathlengthInX0, mixture);
-    } else {
-      getMixtureParameters(pathlengthInX0, mixture);
-    }
-    correctWeights(mixture);
-
-    if (m_correctionFlag == 1) {
-      mixture[0].mean = correctedFirstMean(pathlengthInX0, mixture);
-    }
-    if (m_correctionFlag == 2) {
-      mixture[0].mean = correctedFirstMean(pathlengthInX0, mixture);
-      mixture[0].variance = correctedFirstVariance(pathlengthInX0, mixture);
-    }
-
-    int componentIndex = 0;
-    double weightToBeRemoved(0.);
-    int componentWithHighestMean(0);
-
-    for (; componentIndex < m_numberOfComponents; ++componentIndex) {
-      if (mixture[componentIndex].mean >
-          mixture[componentWithHighestMean].mean) {
-        componentWithHighestMean = componentIndex;
-      }
-      if (mixture[componentIndex].mean >= m_componentMeanCut) {
-        continue;
-      }
-      weightToBeRemoved += mixture[componentIndex].weight;
-    }
-    componentIndex = 0;
-    for (; componentIndex < m_numberOfComponents; ++componentIndex) {
-      double varianceInverseMomentum;
-      // This is not mathematically correct but it does stabilize the GSF
-      if (mixture[componentIndex].mean < m_componentMeanCut) {
-        continue;
-      }
-      if (componentIndex == componentWithHighestMean) {
-        cache.weights.push_back(mixture[componentIndex].weight +
-                                weightToBeRemoved);
-      } else {
-        cache.weights.push_back(mixture[componentIndex].weight);
-      }
-
-      double deltaP(0.);
-      if (direction == alongMomentum) {
-        // For forward propagation
-        deltaP = momentum * (mixture[componentIndex].mean - 1.);
-        cache.deltaPs.push_back(deltaP);
-        double f = 1. / (momentum * mixture[componentIndex].mean);
-        varianceInverseMomentum = f * f * mixture[componentIndex].variance;
-      } // end forward propagation if clause
-      else {
-        // For backwards propagation
-        deltaP = momentum * (1. / mixture[componentIndex].mean - 1.);
-        cache.deltaPs.push_back(deltaP);
-        varianceInverseMomentum =
-          mixture[componentIndex].variance / (momentum * momentum);
-      } // end backwards propagation if clause
-
-      AmgSymMatrix(5) newCovarianceMatrix;
-      newCovarianceMatrix.setZero();
-      newCovarianceMatrix(Trk::qOverP, Trk::qOverP) = varianceInverseMomentum;
-      cache.deltaQOvePCov.push_back(varianceInverseMomentum);
-    } // end for loop over all components
-
-  } // end material limiting if clause
-
-  else {
+  if (pathlengthInX0 < m_singleGaussianRange) {
     ATH_MSG_DEBUG("Trying to apply energy loss to "
                   << pathlengthInX0
                   << " x/x0. No Bethe-Heitler effects applied");
     cache.weights.push_back(1.);
     cache.deltaPs.push_back(0.);
     cache.deltaQOvePCov.push_back(0.);
+    return;
   }
-}
 
-void
-Trk::GsfBetheHeitlerEffects::getMixtureParameters(
-  const double pathlengthInX0,
-  Trk::GsfBetheHeitlerEffects::MixtureParameters& mixture) const
-{
+  // If the amount of material is between 0.0001 and 0.01 return the gaussian
+  // approximation to the Bethe-Heitler distribution
+  if (pathlengthInX0 < m_lowerRange) {
+    const double meanZ = exp(-1. * pathlengthInX0);
+    const double sign = (direction == Trk::oppositeMomentum) ? 1. : -1.;
+    const double varZ =
+      exp(-1. * pathlengthInX0 * log(3.) / log(2.)) - exp(-2. * pathlengthInX0);
+    double deltaP(0.);
+    double varQoverP(0.);
+    if (direction == Trk::alongMomentum) {
+      deltaP = sign * momentum * (1. - meanZ);
+      varQoverP = 1. / (meanZ * meanZ * momentum * momentum) * varZ;
+    } else {
+      deltaP = sign * momentum * (1. / meanZ - 1.);
+      varQoverP = varZ / (momentum * momentum);
+    }
+    cache.deltaPs.push_back(deltaP);
+    cache.weights.push_back(1.);
+    cache.deltaQOvePCov.push_back(varQoverP);
+    return;
+  }
 
-  int componentIndex = 0;
-  for (; componentIndex < m_numberOfComponents; ++componentIndex) {
-    double updatedWeight = m_polynomialWeights[componentIndex](pathlengthInX0);
-    double updatedMean = m_polynomialMeans[componentIndex](pathlengthInX0);
-    double updatedVariance =
-      m_polynomialVariances[componentIndex](pathlengthInX0);
+  // Now we do the full calculation
+  if (pathlengthInX0 > m_upperRange) {
+    pathlengthInX0 = m_upperRange;
+  }
+
+  // Get proper mixture parameters
+  MixtureParameters mixture;
+  if (m_useHighX0 && pathlengthInX0 > m_xOverRange) {
+    if (m_transformationCodeHighX0) {
+      mixture = getTranformedMixtureParameters(m_polynomialWeightsHighX0,
+                                               m_polynomialMeansHighX0,
+                                               m_polynomialVariancesHighX0,
+                                               pathlengthInX0,
+                                               m_numberOfComponents);
+    } else {
+      mixture = getMixtureParameters(m_polynomialWeightsHighX0,
+                                     m_polynomialMeansHighX0,
+                                     m_polynomialVariancesHighX0,
+                                     pathlengthInX0,
+                                     m_numberOfComponents);
+    }
+  } else {
     if (m_transformationCode) {
-      updatedWeight = logisticFunction(updatedWeight);
-      updatedMean = logisticFunction(updatedMean);
-      updatedVariance = exp(updatedVariance);
+      mixture = getTranformedMixtureParameters(m_polynomialWeights,
+                                               m_polynomialMeans,
+                                               m_polynomialVariances,
+                                               pathlengthInX0,
+                                               m_numberOfComponents);
     } else {
-      updatedVariance = updatedVariance * updatedVariance;
+      mixture = getMixtureParameters(m_polynomialWeights,
+                                     m_polynomialMeans,
+                                     m_polynomialVariances,
+                                     pathlengthInX0,
+                                     m_numberOfComponents);
     }
-    mixture.emplace_back(updatedWeight, updatedMean, updatedVariance);
   }
-}
 
-void
-Trk::GsfBetheHeitlerEffects::getMixtureParametersHighX0(
-  const double pathlengthInX0,
-  Trk::GsfBetheHeitlerEffects::MixtureParameters& mixture) const
-{
+  // Correct the mixture
+  correctWeights(mixture);
+
+  if (m_correctionFlag == 1) {
+    mixture[0].mean = correctedFirstMean(pathlengthInX0, mixture);
+  }
+  if (m_correctionFlag == 2) {
+    mixture[0].mean = correctedFirstMean(pathlengthInX0, mixture);
+    mixture[0].variance = correctedFirstVariance(pathlengthInX0, mixture);
+  }
 
+  //
   int componentIndex = 0;
-  for (; componentIndex < m_numberOfComponentsHighX0; ++componentIndex) {
-    double updatedWeight =
-      m_polynomialWeightsHighX0[componentIndex](pathlengthInX0);
-    double updatedMean =
-      m_polynomialMeansHighX0[componentIndex](pathlengthInX0);
-    double updatedVariance =
-      m_polynomialVariancesHighX0[componentIndex](pathlengthInX0);
-    if (m_transformationCodeHighX0) {
-      updatedWeight = logisticFunction(updatedWeight);
-      updatedMean = logisticFunction(updatedMean);
-      updatedVariance = exp(updatedVariance);
-    } else {
-      updatedVariance = updatedVariance * updatedVariance;
+  double weightToBeRemoved(0.);
+  int componentWithHighestMean(0);
+  for (; componentIndex < m_numberOfComponents; ++componentIndex) {
+    if (mixture[componentIndex].mean > mixture[componentWithHighestMean].mean) {
+      componentWithHighestMean = componentIndex;
+    }
+    if (mixture[componentIndex].mean >= m_componentMeanCut) {
+      continue;
     }
-    mixture.emplace_back(updatedWeight, updatedMean, updatedVariance);
+    weightToBeRemoved += mixture[componentIndex].weight;
   }
+  // Fill the cache to be returned
+  componentIndex = 0;
+  for (; componentIndex < m_numberOfComponents; ++componentIndex) {
+    double varianceInverseMomentum;
+    // This is not mathematically correct but it does stabilize the GSF
+    if (mixture[componentIndex].mean < m_componentMeanCut) {
+      continue;
+    }
+    if (componentIndex == componentWithHighestMean) {
+      cache.weights.push_back(mixture[componentIndex].weight +
+                              weightToBeRemoved);
+    } else {
+      cache.weights.push_back(mixture[componentIndex].weight);
+    }
+
+    double deltaP(0.);
+    if (direction == alongMomentum) {
+      // For forward propagation
+      deltaP = momentum * (mixture[componentIndex].mean - 1.);
+      cache.deltaPs.push_back(deltaP);
+      const double f = 1. / (momentum * mixture[componentIndex].mean);
+      varianceInverseMomentum = f * f * mixture[componentIndex].variance;
+    } // end forward propagation if clause
+    else {
+      // For backwards propagation
+      deltaP = momentum * (1. / mixture[componentIndex].mean - 1.);
+      cache.deltaPs.push_back(deltaP);
+      varianceInverseMomentum =
+        mixture[componentIndex].variance / (momentum * momentum);
+    } // end backwards propagation if clause
+
+    AmgSymMatrix(5) newCovarianceMatrix;
+    newCovarianceMatrix.setZero();
+    newCovarianceMatrix(Trk::qOverP, Trk::qOverP) = varianceInverseMomentum;
+    cache.deltaQOvePCov.push_back(varianceInverseMomentum);
+  } // end for loop over all components
 }
 
diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfMaterialMixtureConvolution.cxx b/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfMaterialMixtureConvolution.cxx
index 480069ee1be259ca09d55abc12736151f2f9a13d..b7b99c9aafa1c171deee23a8b927cfcaee1a470e 100644
--- a/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfMaterialMixtureConvolution.cxx
+++ b/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfMaterialMixtureConvolution.cxx
@@ -39,15 +39,11 @@ Trk::GsfMaterialMixtureConvolution::~GsfMaterialMixtureConvolution() = default;
 StatusCode
 Trk::GsfMaterialMixtureConvolution::initialize()
 {
-
+  if( m_maximumNumberOfComponents > 16){
+      ATH_MSG_FATAL("Requested MaximumNumberOfComponents > 16");
+      return StatusCode::FAILURE;
+  }
   ATH_CHECK(m_materialEffects.retrieve());
-
-  return StatusCode::SUCCESS;
-}
-
-StatusCode
-Trk::GsfMaterialMixtureConvolution::finalize()
-{
   return StatusCode::SUCCESS;
 }
 
diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/src/MultiComponentStateModeCalculator.cxx b/Tracking/TrkFitter/TrkGaussianSumFilter/src/MultiComponentStateModeCalculator.cxx
index 8a64b86d297fd2f54ed8026117a1c45f3855933b..0a9d1e11a2b43301597f0274e532ca08880c55dd 100644
--- a/Tracking/TrkFitter/TrkGaussianSumFilter/src/MultiComponentStateModeCalculator.cxx
+++ b/Tracking/TrkFitter/TrkGaussianSumFilter/src/MultiComponentStateModeCalculator.cxx
@@ -13,7 +13,6 @@
 #include "TrkGaussianSumFilter/MultiComponentStateModeCalculator.h"
 #include "CxxUtils/phihelper.h"
 #include "TrkMultiComponentStateOnSurface/MultiComponentState.h"
-#include "TrkParameters/TrackParameters.h"
 #include <cmath>
 
 namespace {
@@ -63,7 +62,6 @@ d1pdf(double x, int i, const std::array<std::vector<Component>, 5>& mixture)
   }
   return result;
 }
-
 /** @brief method to determine the second order derivative of the pdf at a given
  * value*/
 double
@@ -93,94 +91,10 @@ width(int i, const std::array<std::vector<Component>, 5>& mixture)
   return pdf;
 }
 
-} // end of anonymous namespace
-
-std::array<double, 10>
-Trk::MultiComponentStateModeCalculator::calculateMode(
-  const Trk::MultiComponentState& multiComponentState)
-{
-  std::array<double, 10> modes{};
-  // Check to see if the multi-component state is measured
-  if (!MultiComponentStateHelpers::isMeasured(multiComponentState)) {
-    return modes;
-  }
-
-  std::array<std::vector<Component>, 5> mixture;
-
-  fillMixture(multiComponentState, mixture);
-
-  /* loop over the 5 direction , d0,z0,phi,theta,qOverP*/
-
-  for (int i = 0; i < 5; i++) {
-
-    double largerPdfComponent = 0.0;
-    double largerMeanComponent = 0.0;
-    /*
-     * Loop over the mixture in the ith direction and find the  component
-     * whose mean give the larger value for the Gaussian Mixture pdf.
-     * This should be a good enough starting point for the mode
-     * finding in this direction
-     */
-    for (const Component& component : mixture[i]) {
-      double pdfValue = pdf(component.mean, i, mixture);
-      if (pdfValue > largerPdfComponent) {
-        largerPdfComponent = pdfValue;
-        largerMeanComponent = component.mean;
-      }
-    }
-    modes[i] = findMode(largerMeanComponent, i, mixture);
-    // Calculate the FWHM and return this back so that it can be used to correct
-    // the covariance matrix
-    if (largerMeanComponent != modes[i]) {
-      // mode calculation was successful now calulate FWHM
-      double currentWidth = width(i, mixture);
-      modes[i + 5] = -1; // Failure is flagged with a value less than 0;
-
-      double pdfVal = pdf(modes[i], i, mixture);
-      double highX(0);
-      double lowX(0);
-
-      double upperbound = modes[i] + 1.5 * currentWidth;
-      while (true) {
-        if (pdf(upperbound, i, mixture) > pdfVal * 0.5) {
-          upperbound += currentWidth;
-        } else {
-          break;
-        }
-      }
-
-      bool highXFound =
-        findRoot(highX, modes[i], upperbound, pdfVal * 0.5, i, mixture);
-
-      double lowerbound = modes[i] - 1.5 * currentWidth;
-      while (true) {
-        if (pdf(lowerbound, i, mixture) > pdfVal * 0.5) {
-          lowerbound -= currentWidth;
-        } else {
-          break;
-        }
-      }
-      bool lowXFound =
-        findRoot(lowX, lowerbound, modes[i], pdfVal * 0.5, i, mixture);
-      if (highXFound && lowXFound) {
-        double FWHM = highX - lowX;
-        modes[i + 5] = FWHM / 2.35482; // 2 * sqrt( 2* log(2))
-      }
-      // Ensure that phi is between -pi and pi
-      if (i == 2) {
-        modes[i] = CxxUtils::wrapToPi(modes[i]);
-      }
-    }
-  }
-  return modes;
-}
-
 void
-Trk::MultiComponentStateModeCalculator::fillMixture(
-  const Trk::MultiComponentState& multiComponentState,
-  std::array<std::vector<Component>, 5>& mixture)
+fillMixture(const Trk::MultiComponentState& multiComponentState,
+            std::array<std::vector<Component>, 5>& mixture)
 {
-
   constexpr Trk::ParamDefs parameter[5] = {
     Trk::d0, Trk::z0, Trk::phi, Trk::theta, Trk::qOverP
   };
@@ -209,9 +123,8 @@ Trk::MultiComponentStateModeCalculator::fillMixture(
       // FIXME ATLASRECTS-598 this std::abs() should not be necessary... for
       // some reason cov(qOverP,qOverP) can be negative
       double sigma = sqrt(std::abs((*measuredCov)(parameter[i], parameter[i])));
-
-      // Ensure that we don't have any problems with the cyclical nature of phi
-      // Use first state as reference point
+      // Ensure that we don't have any problems with the cyclical nature of
+      // phi Use first state as reference point
       if (i == 2) { // phi
         double deltaPhi =
           multiComponentState.begin()->first->parameters()[2] - mean;
@@ -223,14 +136,14 @@ Trk::MultiComponentStateModeCalculator::fillMixture(
       }
       mixture[i].emplace_back(weight, mean, sigma);
     }
+
   }
 }
 
 double
-Trk::MultiComponentStateModeCalculator::findMode(
-  double xStart,
-  int i,
-  const std::array<std::vector<Component>, 5>& mixture)
+findMode(double xStart,
+         int i,
+         const std::array<std::vector<Component>, 5>& mixture)
 {
 
   int iteration(0);
@@ -271,49 +184,17 @@ Trk::MultiComponentStateModeCalculator::findMode(
 }
 
 double
-Trk::MultiComponentStateModeCalculator::findModeGlobal(
-  double mean,
-  int i,
-  const std::array<std::vector<Component>, 5>& mixture)
+findRoot(double& result,
+         double xlo,
+         double xhi,
+         double value,
+         double i,
+         const std::array<std::vector<Component>, 5>& mixture)
 {
-
-  double start(-1);
-  double end(1);
-  if (mean > 0.0) {
-    start = mean / 2;
-    end = 3 * mean / 2;
-  } else if (mean < 0.0) {
-    start = 3 * mean / 2;
-    end = mean / 2;
-  }
-
-  double mode(0);
-  double maximum(-1);
-  double iterate(std::abs(mean / 1000));
-
-  for (double counter(start); counter < end; counter += iterate) {
-    double value(pdf(counter, i, mixture));
-    if (value > maximum) {
-      maximum = value;
-      mode = counter;
-    }
-  }
-  return mode;
-}
-
-double
-Trk::MultiComponentStateModeCalculator::findRoot(
-  double& result,
-  double xlo,
-  double xhi,
-  double value,
-  double i,
-  const std::array<std::vector<Component>, 5>& mixture)
-{
-  // Do the root finding using the Brent-Decker method. Returns a boolean status
-  // and loads 'result' with our best guess at the root if true. Prints a
-  // warning if the initial interval does not bracket a single root or if the
-  // root is not found after a fixed number of iterations.
+  // Do the root finding using the Brent-Decker method. Returns a boolean
+  // status and loads 'result' with our best guess at the root if true. Prints
+  // a warning if the initial interval does not bracket a single root or if
+  // the root is not found after a fixed number of iterations.
 
   double a(xlo);
   double b(xhi);
@@ -416,3 +297,91 @@ Trk::MultiComponentStateModeCalculator::findRoot(
 
   return false;
 }
+
+} // end of anonymous namespace
+
+std::array<double, 10>
+Trk::MultiComponentStateModeCalculator::calculateMode(
+  const Trk::MultiComponentState& multiComponentState)
+{
+  // Check to see if the multi-component state is measured
+  if (!MultiComponentStateHelpers::isMeasured(multiComponentState)) {
+    return {};
+  }
+
+  std::array<std::vector<Component>, 5> mixture;
+
+  fillMixture(multiComponentState, mixture);
+  return calculateMode(mixture);
+}
+
+std::array<double, 10>
+Trk::MultiComponentStateModeCalculator::calculateMode(
+  const std::array<std::vector<Component>, 5>& mixture)
+{
+  std::array<double, 10> modes{};
+  /* loop over the 5 direction , d0,z0,phi,theta,qOverP*/
+
+  for (int i = 0; i < 5; i++) {
+
+    double largerPdfComponent = 0.0;
+    double largerMeanComponent = 0.0;
+    /*
+     * Loop over the mixture in the ith direction and find the  component
+     * whose mean give the larger value for the Gaussian Mixture pdf.
+     * This should be a good enough starting point for the mode
+     * finding in this direction
+     */
+    for (const Component& component : mixture[i]) {
+      double pdfValue = pdf(component.mean, i, mixture);
+      if (pdfValue > largerPdfComponent) {
+        largerPdfComponent = pdfValue;
+        largerMeanComponent = component.mean;
+      }
+    }
+    modes[i] = findMode(largerMeanComponent, i, mixture);
+    // Calculate the FWHM and return this back so that it can be used to correct
+    // the covariance matrix
+    if (largerMeanComponent != modes[i]) {
+      // mode calculation was successful now calulate FWHM
+      double currentWidth = width(i, mixture);
+      modes[i + 5] = -1; // Failure is flagged with a value less than 0;
+
+      double pdfVal = pdf(modes[i], i, mixture);
+      double highX(0);
+      double lowX(0);
+
+      double upperbound = modes[i] + 1.5 * currentWidth;
+      while (true) {
+        if (pdf(upperbound, i, mixture) > pdfVal * 0.5) {
+          upperbound += currentWidth;
+        } else {
+          break;
+        }
+      }
+
+      bool highXFound =
+        findRoot(highX, modes[i], upperbound, pdfVal * 0.5, i, mixture);
+
+      double lowerbound = modes[i] - 1.5 * currentWidth;
+      while (true) {
+        if (pdf(lowerbound, i, mixture) > pdfVal * 0.5) {
+          lowerbound -= currentWidth;
+        } else {
+          break;
+        }
+      }
+      bool lowXFound =
+        findRoot(lowX, lowerbound, modes[i], pdfVal * 0.5, i, mixture);
+      if (highXFound && lowXFound) {
+        double FWHM = highX - lowX;
+        modes[i + 5] = FWHM / 2.35482; // 2 * sqrt( 2* log(2))
+      }
+      // Ensure that phi is between -pi and pi
+      if (i == 2) {
+        modes[i] = CxxUtils::wrapToPi(modes[i]);
+      }
+    }
+  }
+  return modes;
+}
diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/test/testFindMode.cxx b/Tracking/TrkFitter/TrkGaussianSumFilter/test/testFindMode.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..c43854aef3dd01afd4933bb9f69770beb394b1dd
--- /dev/null
+++ b/Tracking/TrkFitter/TrkGaussianSumFilter/test/testFindMode.cxx
@@ -0,0 +1,76 @@
+
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+#include "TrkGaussianSumFilter/MultiComponentStateModeCalculator.h"
+#include <iostream>
+
+int
+main()
+{
+
+  using namespace Trk::MultiComponentStateModeCalculator;
+
+  std::vector<Component> vec0 = {
+    { 0.973657, -27.9079, 0.0538001 },    { 0.024202, -27.9023, 0.0580491 },
+    { 0.00146762, -27.9063, 0.0594736 },  { 0.000452399, -27.8908, 0.0591268 },
+    { 0.000152378, -27.8987, 0.0604233 }, { 5.65349e-05, -27.9603, 0.0517557 },
+    { 5.81047e-06, -27.9495, 0.0553466 }, { 5.21863e-06, -27.9006, 0.0603241 },
+    { 6.61547e-07, -27.9117, 0.0626188 }, { 1.19371e-07, -27.8984, 0.060867 },
+    { 1.11035e-07, -27.9323, 0.0585395 }
+  };
+
+  std::vector<Component> vec1 = {
+    { 0.973657, 38.4958, 0.757618 },    { 0.024202, 38.4292, 0.801337 },
+    { 0.00146762, 38.4686, 0.814726 },  { 0.000452399, 38.285, 0.811128 },
+    { 0.000152378, 38.382, 0.826285 },  { 5.65349e-05, 39.137, 0.728419 },
+    { 5.81047e-06, 39.0091, 0.763217 }, { 5.21863e-06, 38.3888, 0.824838 },
+    { 6.61547e-07, 38.5323, 0.858115 }, { 1.19371e-07, 38.2937, 0.834079 },
+    { 1.11035e-07, 38.7643, 0.802247 }
+  };
+
+  std::vector<Component> vec2 = { { 0.973657, -1.0267, 0.000445822 },
+                                  { 0.024202, -1.02727, 0.000738283 },
+                                  { 0.00146762, -1.03185, 0.000786109 },
+                                  { 0.000452399, -1.02815, 0.000729393 },
+                                  { 0.000152378, -1.03015, 0.00159626 },
+                                  { 5.65349e-05, -1.03469, 0.000698825 },
+                                  { 5.81047e-06, -1.04587, 0.00150398 },
+                                  { 5.21863e-06, -1.03862, 0.00246934 },
+                                  { 6.61547e-07, -1.05081, 0.00301325 },
+                                  { 1.19371e-07, -1.08593, 0.0072159 },
+                                  { 1.11035e-07, -1.07377, 0.0038744 } };
+
+  std::vector<Component> vec3 = {
+    { 0.973657, 2.94981, 0.00113228 },    { 0.024202, 2.94985, 0.00120513 },
+    { 0.00146762, 2.94994, 0.00120203 },  { 0.000452399, 2.95008, 0.00122586 },
+    { 0.000152378, 2.94981, 0.00140487 }, { 5.65349e-05, 2.94921, 0.00108731 },
+    { 5.81047e-06, 2.94948, 0.00113324 }, { 5.21863e-06, 2.95005, 0.00141219 },
+    { 6.61547e-07, 2.9482, 0.00391511 },  { 1.19371e-07, 2.94952, 0.00241575 },
+    { 1.11035e-07, 2.94963, 0.0014292 }
+  };
+
+  std::vector<Component> vec4 = { { 0.973657, -7.99235e-05, 1.2352e-05 },
+                                  { 0.024202, -0.000165865, 6.85227e-05 },
+                                  { 0.00146762, -0.000731881, 4.43473e-05 },
+                                  { 0.000452399, -0.000297975, 2.98129e-05 },
+                                  { 0.000152378, -0.000534431, 0.00017548 },
+                                  { 5.65349e-05, -0.000996226, 5.45339e-05 },
+                                  { 5.81047e-06, -0.00246959, 0.00014759 },
+                                  { 5.21863e-06, -0.0015881, 0.000274361 },
+                                  { 6.61547e-07, -0.00321585, 0.000282572 },
+                                  { 1.19371e-07, -0.00750016, 0.000670315 },
+                                  { 1.11035e-07, -0.0059806, 0.000365448 } };
+
+  std::array<std::vector<Component>, 5> mixture = {
+    vec0, vec1, vec2, vec3, vec4
+  };
+
+  std::array<double, 10> result =
+    Trk::MultiComponentStateModeCalculator::calculateMode(mixture);
+  for (double i : result) {
+    std::cout << i << '\n';
+  }
+
+  return 0;
+}
diff --git a/Tracking/TrkFitter/TrkGlobalChi2Fitter/TrkGlobalChi2Fitter/GlobalChi2Fitter.h b/Tracking/TrkFitter/TrkGlobalChi2Fitter/TrkGlobalChi2Fitter/GlobalChi2Fitter.h
index 6822055ca363ee01ef4c585925b3b41148dbde1e..50928716eec88438c9a5a52d2014c9074f22ed66 100755
--- a/Tracking/TrkFitter/TrkGlobalChi2Fitter/TrkGlobalChi2Fitter/GlobalChi2Fitter.h
+++ b/Tracking/TrkFitter/TrkGlobalChi2Fitter/TrkGlobalChi2Fitter/GlobalChi2Fitter.h
@@ -790,6 +790,7 @@ namespace Trk {
     Gaudi::Property<bool> m_asymeloss {this, "AsymmetricEnergyLoss", true};
     Gaudi::Property<bool> m_useCaloTG {this, "UseCaloTG", false};
     Gaudi::Property<bool> m_rejectLargeNScat {this, "RejectLargeNScat", false};
+    Gaudi::Property<bool> m_createSummary {this, "CreateTrackSummary", true};
 
     Gaudi::Property<double> m_outlcut {this, "OutlierCut", 5.0};
     Gaudi::Property<double> m_p {this, "Momentum", 0.0};
diff --git a/Tracking/TrkFitter/TrkGlobalChi2Fitter/src/GlobalChi2Fitter.cxx b/Tracking/TrkFitter/TrkGlobalChi2Fitter/src/GlobalChi2Fitter.cxx
index b73626e76205825cbed9297243b04e01a2d23df6..d85eb877e0d52f18944125975d53610ee4f0b3c1 100644
--- a/Tracking/TrkFitter/TrkGlobalChi2Fitter/src/GlobalChi2Fitter.cxx
+++ b/Tracking/TrkFitter/TrkGlobalChi2Fitter/src/GlobalChi2Fitter.cxx
@@ -33,6 +33,7 @@
 #include "TrkGeometry/MaterialProperties.h"
 #include "TrkTrack/TrackStateOnSurface.h"
 #include "TrkTrack/Track.h"
+#include "TrkTrackSummary/TrackSummary.h"
 #include "TrkEventPrimitives/FitQuality.h"
 
 #include "TrkRIO_OnTrack/RIO_OnTrack.h"
@@ -7188,7 +7189,21 @@ namespace Trk {
       info.setTrackProperties(TrackInfo::StraightTrack);
     }
 
-    return std::make_unique<Track>(info, trajectory.release(), qual.release());
+    std::unique_ptr<Track> rv = std::make_unique<Track>(info, trajectory.release(), qual.release());
+
+    /*
+     * Here, we create a track summary and attach it to our newly created
+     * track. Note that this code only runs if the m_createSummary Gaudi
+     * property is set. In cases where having a track summary on the track is
+     * not desired, such as for compatibility with other tools, this can be
+     * turned off.
+     */
+    if (m_createSummary.value()) {
+      std::unique_ptr<TrackSummary> ts = std::make_unique<TrackSummary>();
+      rv->setTrackSummary(std::move(ts));
+    }
+
+    return rv;
   }
 
   GlobalChi2Fitter::~GlobalChi2Fitter() {
diff --git a/Tracking/TrkTools/TrkMaterialProvider/TrkMaterialProvider/TrkMaterialProviderTool.h b/Tracking/TrkTools/TrkMaterialProvider/TrkMaterialProvider/TrkMaterialProviderTool.h
index 636a4cc0938fdab44c4ae1aa3e208a5bc3fa0f11..bd2f19258197decc8d355e05d418812aaa0f25e4 100644
--- a/Tracking/TrkTools/TrkMaterialProvider/TrkMaterialProvider/TrkMaterialProviderTool.h
+++ b/Tracking/TrkTools/TrkMaterialProvider/TrkMaterialProvider/TrkMaterialProviderTool.h
@@ -118,8 +118,8 @@ namespace Trk{
 
     /** update the TSOS vector for the Muon Spectrometer applying X0 and Eloss scaling*/
     void updateVectorMS(DataVector<const Trk::TrackStateOnSurface>* inputTSOS,
-                                                  DataVector<const Trk::TrackStateOnSurface>::iterator firstMS,
-                                                  double X0ScaleMS, double ElossScaleMS) const;
+                        const DataVector<const Trk::TrackStateOnSurface>::iterator& firstMS,
+                        double X0ScaleMS, double ElossScaleMS) const;
 
     //* Helper to indentify detector volume**/
     unsigned int getVolumeByGeo(const Trk::TrackStateOnSurface* m) const;
diff --git a/Tracking/TrkTools/TrkMaterialProvider/src/TrkMaterialProviderTool.cxx b/Tracking/TrkTools/TrkMaterialProvider/src/TrkMaterialProviderTool.cxx
index 104596fc7ba29648c9e38e8d2fc4f59ca4079f98..87ac7c1ed8331b205d73ab0bb0011dc5dfbd3beb 100644
--- a/Tracking/TrkTools/TrkMaterialProvider/src/TrkMaterialProviderTool.cxx
+++ b/Tracking/TrkTools/TrkMaterialProvider/src/TrkMaterialProviderTool.cxx
@@ -1002,7 +1002,7 @@ CaloEnergy* Trk::TrkMaterialProviderTool::getParamCaloELoss(Trk::Track* track) c
 }
 
 
-//////////////////////////////////////////////// Privé //////////////////////////////////////////////////////
+//////////////////////////////////////////////// Privat //////////////////////////////////////////////////////
  
 /**Helper to get last calo TSOS with TP*/
 const Trk::TrackStateOnSurface* Trk::TrkMaterialProviderTool::getCaloExitTSOS(const std::vector<const Trk::TrackStateOnSurface*>* caloTSOS, Trk::PropDirection dir) const
@@ -1142,8 +1142,8 @@ void Trk::TrkMaterialProviderTool::updateVector(DataVector<const Trk::TrackState
   // delete the view container
   delete caloTSOS;
 }
-void Trk::TrkMaterialProviderTool::updateVectorMS(DataVector<const Trk::TrackStateOnSurface>* inputTSOS, 
-						  DataVector<const Trk::TrackStateOnSurface>::iterator firstMS, 
+void Trk::TrkMaterialProviderTool::updateVectorMS(DataVector<const Trk::TrackStateOnSurface>* inputTSOS,
+						  const DataVector<const Trk::TrackStateOnSurface>::iterator& firstMS, 
                                                   double X0ScaleMS, double ElossScaleMS) const
 {
 
diff --git a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/KitManager.cxx b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/KitManager.cxx
index ef3026908652352ef3eb53b267c8e1affbeb77d4..6dc17028dd38ce0308aeb22b9f226354a44a8898 100644
--- a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/KitManager.cxx
+++ b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/KitManager.cxx
@@ -9,10 +9,12 @@ KitManagerBase::KitManagerBase() {}
 KitManagerBase::~KitManagerBase() {}
 
 const void *KitManagerBase::kitPtr(const std::string &name) const {
+  std::lock_guard<std::mutex> lock (m_mutex);
   return m_registry.at(name);
 }
 
 bool KitManagerBase::registerKit(const std::string& name, const void *a_kit) {
+  std::lock_guard<std::mutex> lock (m_mutex);
   std::pair<std::string, const void *> elm = std::make_pair(name, a_kit);
   if (!m_registry.insert(elm).second) {
     std::stringstream message;
@@ -23,6 +25,7 @@ bool KitManagerBase::registerKit(const std::string& name, const void *a_kit) {
 }
 
 void KitManagerBase::dumpKits(std::ostream &out) const {
+  std::lock_guard<std::mutex> lock (m_mutex);
   for(const std::pair<const std::string, const void *> &elm: m_registry) {
     out << " " << elm.first;
   }
diff --git a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/KitManager.h b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/KitManager.h
index dae3f24c8fee8c677190b63f9b738f12cf6dc916..3c1a7d4bfd7e4cc6e6b4b695451884ab6efae0e9 100644
--- a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/KitManager.h
+++ b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/KitManager.h
@@ -1,12 +1,13 @@
 /*
   Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
-#ifndef _KitManager_H_
-#define _KitManager_H_
+#ifndef TRKRIO_ONTRACKCREATOR_KITMANAGER_H
+#define TRKRIO_ONTRACKCREATOR_KITMANAGER_H
 
 #include <ostream>
 #include <map>
 #include <memory>
+#include <mutex>
 #include "CxxUtils/checker_macros.h"
 
 class KitManagerBase
@@ -19,6 +20,7 @@ protected:
 
   bool registerKit(const std::string& name, const void *a_kit);
 
+  mutable std::mutex m_mutex;
   std::map<std::string, const void * > m_registry;
 public:
   void dumpKits(std::ostream &out) const;
@@ -45,11 +47,12 @@ public:
   }
 
   static
-  KitManager<T_KitInterface>& instance ATLAS_NOT_THREAD_SAFE () {
+  KitManager<T_KitInterface>& instance() {
     /* in C++11 this is to happen once the issue is that we return a ref
      * rather than const ref. To be thread safe we need to have static const */
-    static std::unique_ptr<KitManager<T_KitInterface>> s_instance = std::make_unique<KitManager<T_KitInterface>>();
-    return *s_instance;
+    // Map is protected with a lock.
+    static KitManager<T_KitInterface> s_instance ATLAS_THREAD_SAFE;
+    return s_instance;
   }
 };
 
diff --git a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackCreator.cxx b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackCreator.cxx
index c77d174f2a0932fe14e16cfd8fb5dab871313c7d..e76ff4a5a3596ae4630c97cabf2ef9df9df4bf27 100755
--- a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackCreator.cxx
+++ b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackCreator.cxx
@@ -34,12 +34,12 @@ Trk::RIO_OnTrackCreator::RIO_OnTrackCreator(const std::string& t,
      m_muonDriftCircleCor("Muon::MdtDriftCircleOnTrackCreator/MdtDriftCircleOnTrackTool", this),
      m_muonClusterCor    ("Muon::MuonClusterOnTrackCreator/MuonClusterOnTrackTool", this),
      m_mmClusterCor      ("Muon::MMClusterOnTrackCreator/MMClusterOnTrackTool", this),
+     m_mode ("all"),
+     m_nwarning (new int(0)),
      m_doPixel(true),
      m_doSCT(true),
      m_doTRT(true)
  {
-   m_mode     = "all";
-   m_nwarning = new int(0);
    declareInterface<IRIO_OnTrackCreator>(this);
    declareProperty("ToolPixelCluster"   ,m_pixClusCor);
    declareProperty("ToolSCT_Cluster"    ,m_sctClusCor);
diff --git a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingCondAlg.cxx b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingCondAlg.cxx
index f416658192141e7719bc35c8b0cb6335885b1bcb..96c0c89fa6c29db0771e1c5d5f4ecafd816ac6f8 100644
--- a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingCondAlg.cxx
+++ b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingCondAlg.cxx
@@ -15,7 +15,7 @@ RIO_OnTrackErrorScalingCondAlg::RIO_OnTrackErrorScalingCondAlg(const std::string
 {
 }
 
-StatusCode RIO_OnTrackErrorScalingCondAlg::initialize ATLAS_NOT_THREAD_SAFE() {
+StatusCode RIO_OnTrackErrorScalingCondAlg::initialize() {
   ATH_CHECK(m_condSvc.retrieve());
   ATH_CHECK(m_readKey.initialize());
 
@@ -61,13 +61,13 @@ StatusCode RIO_OnTrackErrorScalingCondAlg::addErrorScaling (const std::string &t
   catch (std::runtime_error &err) {
     std::stringstream types;
     RIO_OnTrackErrorScalingKitManager::instance().dumpKits(types);
-    ATH_MSG_FATAL( "Invalide ErrorScalking type name : " << type_name << ". Registered types:" << types.str() );
+    ATH_MSG_FATAL( "Invalid ErrorScaling type name : " << type_name << ". Registered types:" << types.str() );
     return StatusCode::FAILURE;
   }
   catch (std::exception &err) {
     std::stringstream types;
     RIO_OnTrackErrorScalingKitManager::instance().dumpKits(types);
-    ATH_MSG_FATAL( "Caught exception: " << err.what() << " Invalide ErrorScalking type name : " << type_name << ". Registered types:" << types.str() );
+    ATH_MSG_FATAL( "Caught exception: " << err.what() << " Invalid ErrorScaling type name : " << type_name << ". Registered types:" << types.str() );
     return StatusCode::FAILURE;
   }
   m_kits.push_back(the_kit);
@@ -87,10 +87,10 @@ public:
   }
 
   template <typename T_Obj>
-  std::string dumpKeys ATLAS_NOT_THREAD_SAFE () const {
+  std::string dumpKeys() const {
     std::stringstream out;
     std::vector<std::string> keys_out;
-    const_cast<StoreGateSvc *>(this->getCS())->keys<T_Obj>(keys_out,true,false);
+    this->getCS()->template keys<T_Obj>(keys_out,true,false);
     for(const std::string &a_key : keys_out) {
       out << " " << a_key;
     }
@@ -134,6 +134,7 @@ StatusCode RIO_OnTrackErrorScalingCondAlg::execute() {
         std::pair<unsigned int, unsigned int> idx = m_attributeMap.at(attr_name);
         if (idx.first != std::numeric_limits<unsigned int>::max()) {
           assert( idx.first < error_scaling.size());
+          // cppcheck-suppress assertWithSideEffect
           assert( idx.second < error_scaling[idx.first]->params().size());
 
           const int nvals=alist[att_i++].data<int>();
diff --git a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingCondAlg.h b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingCondAlg.h
index fd4c86c764d3a105a8421d79709cc3d9f67fbacc..8b616737e0419f5e96de4ffb396d104db8a1502b 100644
--- a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingCondAlg.h
+++ b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingCondAlg.h
@@ -29,7 +29,7 @@ class RIO_OnTrackErrorScalingCondAlg : public AthAlgorithm
 
  private:
 
-  StatusCode addErrorScaling ATLAS_NOT_THREAD_SAFE (const std::string &type_name);
+  StatusCode addErrorScaling(const std::string &type_name);
   void registerAttribute(const std::string& name, unsigned int type_idx, unsigned int param_idx);
 
   SG::ReadCondHandleKey<CondAttrListCollection> m_readKey
diff --git a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingDbOverrideCondAlg.cxx b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingDbOverrideCondAlg.cxx
index af9494ba61eeee1af12358c42a2ea8bc2e9f8673..693719367af6947c6dc5f2310f6dc05cf75e5436 100644
--- a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingDbOverrideCondAlg.cxx
+++ b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingDbOverrideCondAlg.cxx
@@ -13,7 +13,7 @@ RIO_OnTrackErrorScalingDbOverrideCondAlg::RIO_OnTrackErrorScalingDbOverrideCondA
 {
 }
 
-StatusCode RIO_OnTrackErrorScalingDbOverrideCondAlg::initialize ATLAS_NOT_THREAD_SAFE () {
+StatusCode RIO_OnTrackErrorScalingDbOverrideCondAlg::initialize() {
   ATH_CHECK(m_condSvc.retrieve());
   if (m_writeKey.key().empty()) {
     ATH_MSG_FATAL("No conditions data write key specified.");
@@ -98,6 +98,7 @@ StatusCode RIO_OnTrackErrorScalingDbOverrideCondAlg::execute() {
     std::vector<float>::const_iterator  param_iter = m_errorScalingParameters.begin();
     unsigned int set_i=0;
     for (unsigned int n_params : m_useNParametersPerSet ) {
+      // cppcheck-suppress assertWithSideEffect
       assert( set_i < error_scaling->params().size() );
       error_scaling->params()[set_i].clear();
       error_scaling->params()[set_i].reserve(n_params);
diff --git a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingIDKits.cxx b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingIDKits.cxx
index 81871ac93b0e059cc3d397111ee2e68943129d65..0011bb440f258894a2edd626695cf03b901cc089 100644
--- a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingIDKits.cxx
+++ b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingIDKits.cxx
@@ -58,7 +58,7 @@ public:
 
 namespace {
   // register all kits with the help of a dumm function which sets a global anonymous bool
-  bool registered = ( []() ATLAS_NOT_THREAD_SAFE-> bool {
+  bool registered = ( []() -> bool {
     return
          RIO_OnTrackErrorScalingKitManager::instance().registerKit("PixelRIO_OnTrackErrorScaling",    new PixelRIO_OnTrackErrorScalingKit)
       && RIO_OnTrackErrorScalingKitManager::instance().registerKit("PixelRIO_OnTrackErrorScalingRun1",new PixelRIO_OnTrackErrorScalingRun1Kit)
diff --git a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingMuonKits.cxx b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingMuonKits.cxx
index 743c37f3b2f5cca9f9dc83b4e5e21133565c3cba..2189d6471f31c2ecae18a90f5947c4bbd3808a22 100644
--- a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingMuonKits.cxx
+++ b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingMuonKits.cxx
@@ -25,6 +25,10 @@ public:
     }
     delete [] m_names;
   }
+
+  MuonEtaPhiRIO_OnTrackErrorScalingKit (const MuonEtaPhiRIO_OnTrackErrorScalingKit&) = delete;
+  MuonEtaPhiRIO_OnTrackErrorScalingKit& operator= (const MuonEtaPhiRIO_OnTrackErrorScalingKit&) = delete;
+
   virtual unsigned int nParametres() const override {
     return MuonEtaPhiRIO_OnTrackErrorScaling::kNParamTypes;
   }
@@ -55,7 +59,7 @@ public:
 
 namespace {
   // register all kits with the help of a dummy function which sets a global anonymous bool
-  bool registered = ( [] () ATLAS_NOT_THREAD_SAFE -> bool {
+  bool registered = ( [] () -> bool {
     return
          RIO_OnTrackErrorScalingKitManager::instance().registerKit("RPCRIO_OnTrackErrorScaling",    new MuonEtaPhiRIO_OnTrackErrorScalingKit("RPC"))
       && RIO_OnTrackErrorScalingKitManager::instance().registerKit("TGCRIO_OnTrackErrorScaling",    new MuonEtaPhiRIO_OnTrackErrorScalingKit("TGC"))
diff --git a/Tracking/TrkTools/TrkToolInterfaces/CMakeLists.txt b/Tracking/TrkTools/TrkToolInterfaces/CMakeLists.txt
index 7bec323927963b5ffd0707117915a91e24e2cd6f..c72223fa9523879f333b01a47219c4f0ae44914a 100644
--- a/Tracking/TrkTools/TrkToolInterfaces/CMakeLists.txt
+++ b/Tracking/TrkTools/TrkToolInterfaces/CMakeLists.txt
@@ -5,28 +5,8 @@
 # Declare the package name:
 atlas_subdir( TrkToolInterfaces )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Control/AthContainers
-                          Control/AthLinks
-                          Event/EventPrimitives
-                          Event/xAOD/xAODTracking
-                          Event/xAOD/xAODTruth
-                          GaudiKernel
-                          Tracking/TrkDetDescr/TrkSurfaces
-                          Tracking/TrkEvent/TrkCompetingRIOsOnTrack
-                          Tracking/TrkEvent/TrkEventPrimitives
-                          Tracking/TrkEvent/TrkEventUtils
-                          Tracking/TrkEvent/TrkMaterialOnTrack
-                          Tracking/TrkEvent/TrkParameters
-                          Tracking/TrkEvent/TrkParticleBase
-                          Tracking/TrkEvent/TrkSegment
-                          Tracking/TrkEvent/TrkTrack
-                          Tracking/TrkEvent/TrkTrackSummary
-                          Tracking/TrkEvent/TrkEventUtils )
-
 # Component(s) in the package:
 atlas_add_library( TrkToolInterfaces
                    PUBLIC_HEADERS TrkToolInterfaces
-                   LINK_LIBRARIES AthContainers AthLinks EventPrimitives xAODTracking xAODTruth GaudiKernel TrkSurfaces TrkCompetingRIOsOnTrack TrkEventPrimitives TrkEventUtils TrkMaterialOnTrack TrkParameters TrkParticleBase TrkSegment TrkTrack TrkTrackSummary TrkEventUtils )
+                   LINK_LIBRARIES AthContainers AthLinks EventPrimitives xAODTracking xAODTruth GaudiKernel TrkSurfaces TrkCompetingRIOsOnTrack TrkEventPrimitives TrkEventUtils TrkMaterialOnTrack TrkParameters TrkParticleBase TrkSegment TrkTrack TrkTrackSummary TrkEventUtils CxxUtils )
 
diff --git a/Tracking/TrkTools/TrkToolInterfaces/TrkToolInterfaces/ATLAS_CHECK_THREAD_SAFETY b/Tracking/TrkTools/TrkToolInterfaces/TrkToolInterfaces/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..ebc8e8153e0f1ab9c9d30e1276fe51ff8e9964b3
--- /dev/null
+++ b/Tracking/TrkTools/TrkToolInterfaces/TrkToolInterfaces/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Tracking/TrkTools/TrkToolInterfaces
diff --git a/Tracking/TrkTools/TrkToolInterfaces/TrkToolInterfaces/IAmbiTrackSelectionTool.h b/Tracking/TrkTools/TrkToolInterfaces/TrkToolInterfaces/IAmbiTrackSelectionTool.h
index 9f6274ddef650ab99934b9361b3e53f30fdccdf0..9bedd6c2317b65b5bc6af6add0e227814b25e0b8 100755
--- a/Tracking/TrkTools/TrkToolInterfaces/TrkToolInterfaces/IAmbiTrackSelectionTool.h
+++ b/Tracking/TrkTools/TrkToolInterfaces/TrkToolInterfaces/IAmbiTrackSelectionTool.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
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -10,6 +10,7 @@
 
 #include "GaudiKernel/IAlgTool.h"
 #include "TrkEventPrimitives/TrackScore.h"
+#include "CxxUtils/checker_macros.h"
 #include <vector>
 
 namespace Trk 
@@ -18,8 +19,6 @@ namespace Trk
   class PrepRawData;
   class PRDtoTrackMap;
   
-  static const InterfaceID IID_IAmbiTrackSelectionTool("InDet::IAmbiTrackSelectionTool", 1, 0);
-
   /** @class Trk::IAmbiTrackSelectionTool
       @brief Interface for building new tracks using information about shared and already associated hits.
 
@@ -28,7 +27,7 @@ namespace Trk
 
   class IAmbiTrackSelectionTool : virtual public IAlgTool {
   public:
-    static const InterfaceID& interfaceID( ) ;
+    DeclareInterfaceID( IAmbiTrackSelectionTool, 1, 0 );
 
     /** Performs cleaning of a track from already used hits.
         @param track the input track to be checked and cleaned.
@@ -40,16 +39,14 @@ namespace Trk
         replacing the input track. The second element of the returned tuple is true if the input track does not
         reuire cleaning, fulfils the quality criteria and should be kept.
     */
-    virtual std::tuple<Trk::Track*,bool> getCleanedOutTrack(const Trk::Track *track,
-                                                            const Trk::TrackScore score,
-                                                            Trk::PRDtoTrackMap &prd_to_track_map) const =0;
+    // Implementation in InDetDenseEnvAmbiTrackSelectionTool
+    // is not thread-safe.
+    virtual std::tuple<Trk::Track*,bool> getCleanedOutTrack ATLAS_NOT_THREAD_SAFE
+      (const Trk::Track *track,
+       const Trk::TrackScore score,
+       Trk::PRDtoTrackMap &prd_to_track_map) const =0;
   };
 
-  inline const InterfaceID& Trk::IAmbiTrackSelectionTool::interfaceID()
-    { 
-      return IID_IAmbiTrackSelectionTool; 
-    }
-
 } // end of namespace
 
 #endif 
diff --git a/Tracking/TrkTools/TrkToolInterfaces/TrkToolInterfaces/IExtendedTrackSummaryTool.h b/Tracking/TrkTools/TrkToolInterfaces/TrkToolInterfaces/IExtendedTrackSummaryTool.h
index a079f8ac11c6925df26521d42501b56858b46954..da1c39a339ddbd99184aaab8bbcc8a3eca6c0f58 100644
--- a/Tracking/TrkTools/TrkToolInterfaces/TrkToolInterfaces/IExtendedTrackSummaryTool.h
+++ b/Tracking/TrkTools/TrkToolInterfaces/TrkToolInterfaces/IExtendedTrackSummaryTool.h
@@ -47,14 +47,21 @@ public:
     Track& track,
     const Trk::PRDtoTrackMap* prd_to_track_map,
     bool suppress_hole_search = false) const = 0;
-
-  /** create a summary object from passed Track.*/
+  
+   /* Start from a copy of the existing input track summary if there,
+    * otherwise start from a new one. Fill it and return it.
+    * Does not modify the const track.
+    */
   virtual std::unique_ptr<Trk::TrackSummary> summary(
     const Track& track,
     const Trk::PRDtoTrackMap* prd_to_track_map) const = 0;
 
-  /** create a summary object of passed track without doing the tedious hole
-   * search. */
+
+  /* Start from a copy of the existing input track summary if there,
+   * otherwise start from a new one. Fill it and return it.
+   * but without doing the hole search.
+   * Does not modify the const track.
+   */
   virtual std::unique_ptr<Trk::TrackSummary> summaryNoHoleSearch(
     const Track& track,
     const Trk::PRDtoTrackMap* prd_to_track_map) const = 0;
diff --git a/Tracking/TrkTools/TrkToolInterfaces/TrkToolInterfaces/ITrackSummaryTool.h b/Tracking/TrkTools/TrkToolInterfaces/TrkToolInterfaces/ITrackSummaryTool.h
index 75616e5fb9b6be2120b410b8077e9acf4c7f6f41..7417ae0e0a3e0323a1c837533edba1ec437ca219 100755
--- a/Tracking/TrkTools/TrkToolInterfaces/TrkToolInterfaces/ITrackSummaryTool.h
+++ b/Tracking/TrkTools/TrkToolInterfaces/TrkToolInterfaces/ITrackSummaryTool.h
@@ -27,26 +27,35 @@ class ITrackSummaryTool : virtual public IAlgTool
 public:
   static const InterfaceID& interfaceID();
 
-  /** Create a  new summary object from a passed Track or clone
-   * the existing.
+  /* Start from a copy of the existing input track summary if there,
+   * otherwise start from a new one. Fill it and return it.
+   * Does not modify the const track.
    */
   virtual std::unique_ptr<Trk::TrackSummary> summary(
     const Track& track) const = 0;
-
-  /** create a summary object from a passed track, without doing the tedious
-   hole search, or clone the existing.*/
+  
+  /* Start from a copy of the existing input track summary if there,
+   * otherwise start from a new one. Fill it and return it.
+   * but without doing the hole search.
+   * Does not modify the const track.
+   */
   virtual std::unique_ptr<Trk::TrackSummary> summaryNoHoleSearch(
     const Track& track) const = 0;
 
-  /** Method which can be used to update the track and add a summary to it.
-      This can be used to add a summary to a track and then retrieve it from it
-     without the need to clone. */
+  /** Same behavious as
+   * IExtendedTrackSummaryTool:computeAndReplaceTrackSummary
+   * but without the need to pass
+   * Trk::PRDtoTrackMap
+   * Does hole search
+   */
   virtual void updateTrack(Track& track) const = 0;
 
-  /** method which can be used to update a refitted track and add a summary to
-   * it, without doing shard hit/ or hole search. Adds a summary to a track and
-   * then retrieve it from it without the need to clone. */
-  virtual void updateRefittedTrack(Track& track) const = 0;
+  /** method which can be used to update the summary of a track
+   * it, without doing shared hit/ or hole search. 
+   * If a summary is present is modified in place
+   * otherwise a new one is created.
+   */
+  virtual void updateTrackSummary(Track& track) const = 0;
 
   /** method to update the shared hit content only, this is optimised for track
    * collection merging. */
diff --git a/Tracking/TrkTools/TrkTrackSummaryTool/TrkTrackSummaryTool/TrackSummaryTool.h b/Tracking/TrkTools/TrkTrackSummaryTool/TrkTrackSummaryTool/TrackSummaryTool.h
index c134eb940a35b34f6d488c16a22499b30d307d48..f0d51ac8888fb304c7294fea1abe5047e032abf4 100755
--- a/Tracking/TrkTools/TrkTrackSummaryTool/TrkTrackSummaryTool/TrackSummaryTool.h
+++ b/Tracking/TrkTools/TrkTrackSummaryTool/TrkTrackSummaryTool/TrackSummaryTool.h
@@ -72,26 +72,63 @@ public:
     const Trk::PRDtoTrackMap* prd_to_track_map,
     bool suppress_hole_search = false) const override;
 
-  /** create a summary object from passed Track or clone the existing*/
+  /** Same behavious as
+   * IExtendedTrackSummaryTool:computeAndReplaceTrackSummary
+   * but without the need to pass
+   * Trk::PRDtoTrackMap
+   * Does hole search
+   */
+  virtual void updateTrack(Track& track) const override
+  {
+   computeAndReplaceTrackSummary(track,nullptr,false /*DO NOT suppress hole search*/);
+  }
+  
+  /* Start from a copy of the existing input track summary if there,
+   * otherwise start from a new one. Fill it and return it.
+   * Does not modify the const track.
+   */
   virtual std::unique_ptr<Trk::TrackSummary> summary(
     const Track& track) const override;
 
-  /** create a summary object of passed track, without doing the tedious hole
-   * search, or clone the existing*/
+  /* Start from a copy of the existing input track summary if there,
+   * otherwise start from a new one. Fill it and return it.
+   * but without doing the hole search.
+   * Does not modify the const track.
+   */
   virtual std::unique_ptr<Trk::TrackSummary> summaryNoHoleSearch(
     const Track& track) const override;
 
-  /** create a summary object from passed Track,*/
+  /* Start from a copy of the existing input track summary if there,
+   * otherwise start from a new one. Fill it and return it.
+   * Does not modify the const track.
+   */
   virtual std::unique_ptr<Trk::TrackSummary> summary(
     const Track& track,
     const Trk::PRDtoTrackMap* prd_to_track_map) const override;
-
-  /** create a summary object of passed track without doing the tedious hole
-   * search. */
+  
+  /* Start from a copy of the existing input track summary if there,
+   * otherwise start from a new one. Fill it and return it.
+   * but without doing the hole search.
+   * Does not modify the const track.
+   */
   virtual std::unique_ptr<Trk::TrackSummary> summaryNoHoleSearch(
     const Track& track,
     const Trk::PRDtoTrackMap* prd_to_track_map) const override;
 
+  /** method which can be used to update the summary of a track
+   * it, without doing shared hit/ or hole search. 
+   * If a summary is present it is  modified in place.
+   * Otherwise a new one is created and filled.
+   */
+  virtual void updateTrackSummary(Track& track) const override
+  {
+    /*suppress hole search*/
+    UpdateSummary(track, nullptr, true);
+    /*Needed for expected B-Layer*/
+    m_idTool->updateExpectedHitInfo(track, *track.trackSummary());
+  }
+
+ 
   /** method to update the shared hit content only, this is optimised for track
    * collection merging. */
   virtual void updateSharedHitCount(
@@ -125,23 +162,6 @@ public:
     }
   }
 
-  /** use this method to update a track. this means a tracksummary is created
-  for this track but not returned. the summary can then be obtained from the
-  track. Because it is taken from the track the ownership stays with the track
-*/
-  virtual void updateTrack(Track& track) const override
-  {
-    updateTrack(track, nullptr);
-  }
-
-  /** method which can be used to update a refitted track and add a summary to
-   * it, without doing shard hit/ or hole search. Adds a summary to a track and
-   * then retrieve it from it without the need to clone. */
-  virtual void updateRefittedTrack(Track& track) const override
-  {
-    updateTrackNoHoleSearch(track, nullptr);
-  }
-
   /** Update the shared hit count of the given track summary.
    * @param summary the summary to be updated i.e. a copy of the track summary
    * of the given track.
@@ -207,6 +227,33 @@ public:
   }
 
 private:
+
+  /*
+   * Fill the summary info for a Track*/
+  void fillSummary(Trk::TrackSummary& ts,
+                   const Trk::Track& track,
+                   const Trk::PRDtoTrackMap *prd_to_track_map,
+                   bool doHolesInDet,
+                   bool doHolesMuon) const;
+
+  /*
+   * If a summary is there Update it with the required info.
+   * If not there create a new one with the required info.
+   */
+  void UpdateSummary(Track& track,
+                     const Trk::PRDtoTrackMap* prd_to_track_map,
+                     bool suppress_hole_search) const
+  {
+    if (!track.trackSummary()) {
+      track.setTrackSummary(std::make_unique<Trk::TrackSummary>());
+    }
+    fillSummary(*(track.trackSummary()),
+                track,
+                prd_to_track_map,
+                m_doHolesInDet && !suppress_hole_search,
+                m_doHolesMuon && !suppress_hole_search);
+  }
+
   void updateAdditionalInfo(const Track& track,
                             const Trk::PRDtoTrackMap* prd_to_track_map,
                             TrackSummary& summary,
@@ -219,10 +266,6 @@ private:
   void updateTrack(Track& track,
                    const Trk::PRDtoTrackMap* prd_to_track_map) const;
 
-  void updateTrackNoHoleSearch(
-    Track& track,
-    const Trk::PRDtoTrackMap* prd_to_track_map) const;
-
   std::unique_ptr<Trk::TrackSummary> createSummary(
     const Track& track,
     const Trk::PRDtoTrackMap* prd_to_track_map,
@@ -280,6 +323,10 @@ private:
                                                1,
                                                "" };
 
+  Gaudi::Property<bool> m_alwaysRecomputeHoles {
+    this, "AlwaysRecomputeHoles", false, ""
+  };
+
   /**atlas id helper*/
   const AtlasDetectorID* m_detID;
 
diff --git a/Tracking/TrkTools/TrkTrackSummaryTool/src/TrackSummaryTool.cxx b/Tracking/TrkTools/TrkTrackSummaryTool/src/TrackSummaryTool.cxx
index b7fc117d42e1f91ac198dc5b6b2b7e166234c85a..3b081fddc069fdf13312167a890a80ff53d15ab3 100755
--- a/Tracking/TrkTools/TrkTrackSummaryTool/src/TrackSummaryTool.cxx
+++ b/Tracking/TrkTools/TrkTrackSummaryTool/src/TrackSummaryTool.cxx
@@ -117,109 +117,134 @@ StatusCode
 }
 
 /*
- * First the methods to create a new or clone the existing
+ * Method that creates a new summary for the track.
+ * First calculates a summary according to job options.
+ * If one is present it uses it as starting point (cloning it).
+ * But adds relavant info.
+ * And then sets the Track Summary for the non-const
+ * track.
  */
-void Trk::TrackSummaryTool::computeAndReplaceTrackSummary(Trk::Track &track,
-                                                          const Trk::PRDtoTrackMap *prd_to_track_map,
-                                                          bool suppress_hole_search) const {
-  track.setTrackSummary(
-    createSummary(
-      track,
-      prd_to_track_map,
-      m_doHolesInDet & !suppress_hole_search,
-      m_doHolesMuon  & !suppress_hole_search
-    )
-  );
+void
+Trk::TrackSummaryTool::computeAndReplaceTrackSummary(
+  Trk::Track& track,
+  const Trk::PRDtoTrackMap* prd_to_track_map,
+  bool suppress_hole_search) const
+{
+  track.setTrackSummary(createSummary(track,
+                                      prd_to_track_map,
+                                      m_doHolesInDet & !suppress_hole_search,
+                                      m_doHolesMuon & !suppress_hole_search));
 }
 
-std::unique_ptr<Trk::TrackSummary> Trk::TrackSummaryTool::summary( const Track& track) const
+std::unique_ptr<Trk::TrackSummary>
+Trk::TrackSummaryTool::summary(const Track& track) const
 {
-  return createSummary(track, nullptr, m_doHolesInDet, m_doHolesMuon );
+  return createSummary(track, nullptr, m_doHolesInDet, m_doHolesMuon);
 }
 
-std::unique_ptr<Trk::TrackSummary> Trk::TrackSummaryTool::summary( const Track& track,
-                                                                   const Trk::PRDtoTrackMap *prd_to_track_map) const
+std::unique_ptr<Trk::TrackSummary>
+Trk::TrackSummaryTool::summary(const Track& track,
+                               const Trk::PRDtoTrackMap* prd_to_track_map) const
 {
-  return createSummary(track, prd_to_track_map, m_doHolesInDet, m_doHolesMuon );
+  return createSummary(track, prd_to_track_map, m_doHolesInDet, m_doHolesMuon);
 }
 
-std::unique_ptr<Trk::TrackSummary> Trk::TrackSummaryTool::summaryNoHoleSearch( const Track& track) const
+std::unique_ptr<Trk::TrackSummary>
+Trk::TrackSummaryTool::summaryNoHoleSearch(const Track& track) const
 {
-  return createSummary(track, nullptr, false, false );
+  return createSummary(track, nullptr, false, false);
 }
 
-std::unique_ptr<Trk::TrackSummary> Trk::TrackSummaryTool::summaryNoHoleSearch( const Track& track,
-                                                                               const Trk::PRDtoTrackMap *prd_to_track_map) const
+std::unique_ptr<Trk::TrackSummary>
+Trk::TrackSummaryTool::summaryNoHoleSearch(
+  const Track& track,
+  const Trk::PRDtoTrackMap* prd_to_track_map) const
 {
-  return createSummary(track, prd_to_track_map, false, false );
+  return createSummary(track, prd_to_track_map, false, false);
 }
 
+//Method to create a new summary
 std::unique_ptr<Trk::TrackSummary>
 Trk::TrackSummaryTool::createSummary( const Track& track,
                                       const Trk::PRDtoTrackMap *prd_to_track_map,
                                       bool doHolesInDet,
                                       bool doHolesMuon) const
 {
-  // first check if track has summary already and then return a clone
+  std::unique_ptr<Trk::TrackSummary> ts;
+
+  // first check if track has summary already and then clone it.
   if (track.trackSummary()!=nullptr) {
     ATH_MSG_DEBUG ("Return cached summary for author : "<<track.info().dumpInfo());
-    return std::make_unique<Trk::TrackSummary>(*(track.trackSummary()));
+    ts = std::make_unique<Trk::TrackSummary>(*(track.trackSummary()));
+  } else {
+    ts = std::make_unique<Trk::TrackSummary>();
   }
-  // Create and initialize information vector and bit pattern
-  unsigned int numberOfTrackSummaryTypes = Trk::numberOfTrackSummaryTypes+1;
-  // put values to -1 of they are not evaluated
-  std::vector<int> information(numberOfTrackSummaryTypes,-1);
+  //fill the summary
+  fillSummary(*ts, track, prd_to_track_map, doHolesInDet, doHolesMuon);
+  return ts;
+}
 
-  // Troels.Petersen@cern.ch:
-  unsigned int numberOfeProbabilityTypes = Trk::numberOfeProbabilityTypes+1;
-  std::vector<float> eProbability(numberOfeProbabilityTypes,0.5);
+// Method filling the summary with information
+void
+Trk::TrackSummaryTool::fillSummary(Trk::TrackSummary& ts,
+                                   const Trk::Track& track,
+                                   const Trk::PRDtoTrackMap *prd_to_track_map,
+                                   bool doHolesInDet,
+                                   bool doHolesMuon) const {
+
+std::vector<int>& information = ts.m_information;
+information.resize(std::min(information.size(),
+                            static_cast<size_t>(numberOfTrackSummaryTypes)));
 
-  float dedx=-1;
-  int nhitsuseddedx=-1;
-  int noverflowhitsdedx=-1;
+// Troels.Petersen@cern.ch:
+unsigned int numberOfeProbabilityTypes = Trk::numberOfeProbabilityTypes + 1;
+std::vector<float> eProbability(numberOfeProbabilityTypes, 0.5);
+
+  float dedx = -1;
+  int nhitsuseddedx = -1;
+  int noverflowhitsdedx = -1;
 
   // Now set values to 0 for the ones we evaluate
   if (!m_idTool.empty()) {
-    if (m_pixelExists)
-    {
-      information [numberOfContribPixelLayers]   = 0;
-      information [numberOfInnermostPixelLayerHits] = 0;
-      information [numberOfInnermostPixelLayerOutliers] = 0;
-      information [numberOfNextToInnermostPixelLayerHits] = 0;
-      information [numberOfNextToInnermostPixelLayerOutliers] = 0;
-      information [numberOfPixelHits]            = 0;
-      information [numberOfPixelOutliers]        = 0;
-      information [numberOfGangedPixels]         = 0;
-      information [numberOfGangedFlaggedFakes]   = 0;
-      information [numberOfPixelSpoiltHits]      = 0;
-      information [numberOfGangedFlaggedFakes]   = 0;
-      information [numberOfPixelSplitHits]       = 0;
-      information [numberOfInnermostLayerSplitHits] = 0;
-      information [numberOfNextToInnermostLayerSplitHits] = 0;
-      if (track.info().trackFitter() != TrackInfo::Unknown && !m_dedxtool.empty()) {
+    if (m_pixelExists) {
+      information[numberOfContribPixelLayers] = 0;
+      information[numberOfInnermostPixelLayerHits] = 0;
+      information[numberOfInnermostPixelLayerOutliers] = 0;
+      information[numberOfNextToInnermostPixelLayerHits] = 0;
+      information[numberOfNextToInnermostPixelLayerOutliers] = 0;
+      information[numberOfPixelHits] = 0;
+      information[numberOfPixelOutliers] = 0;
+      information[numberOfGangedPixels] = 0;
+      information[numberOfGangedFlaggedFakes] = 0;
+      information[numberOfPixelSpoiltHits] = 0;
+      information[numberOfGangedFlaggedFakes] = 0;
+      information[numberOfPixelSplitHits] = 0;
+      information[numberOfInnermostLayerSplitHits] = 0;
+      information[numberOfNextToInnermostLayerSplitHits] = 0;
+      if (track.info().trackFitter() != TrackInfo::Unknown &&
+          !m_dedxtool.empty()) {
         dedx = m_dedxtool->dEdx(track, nhitsuseddedx, noverflowhitsdedx);
       }
-      information [Trk::numberOfDBMHits]                  = 0;
+      information[Trk::numberOfDBMHits] = 0;
     }
-    information [numberOfSCTHits]                  = 0;
-    information [numberOfSCTSpoiltHits]            = 0;
-    information [numberOfSCTOutliers]              = 0;
-    information [numberOfTRTHits]                  = 0;
-    information [numberOfTRTXenonHits]             = 0;
-    information [numberOfTRTHighThresholdHits]     = 0;
-    information [numberOfTRTHighThresholdHitsTotal]= 0;
-    information [numberOfTRTOutliers]              = 0;
-    information [numberOfTRTHighThresholdOutliers] = 0;
-    information [numberOfTRTTubeHits]              = 0;
-    information [numberOfTRTSharedHits]            = 0;
+    information[numberOfSCTHits] = 0;
+    information[numberOfSCTSpoiltHits] = 0;
+    information[numberOfSCTOutliers] = 0;
+    information[numberOfTRTHits] = 0;
+    information[numberOfTRTXenonHits] = 0;
+    information[numberOfTRTHighThresholdHits] = 0;
+    information[numberOfTRTHighThresholdHitsTotal] = 0;
+    information[numberOfTRTOutliers] = 0;
+    information[numberOfTRTHighThresholdOutliers] = 0;
+    information[numberOfTRTTubeHits] = 0;
+    information[numberOfTRTSharedHits] = 0;
 
     // Troels.Petersen@cern.ch:
-    if ( !m_eProbabilityTool.empty() ) {
+    if (!m_eProbabilityTool.empty()) {
       eProbability = m_eProbabilityTool->electronProbability(track);
     }
   }
 
-
   if (m_doSharedHits) {
     information [numberOfSCTSharedHits]      = 0;
     if (m_pixelExists) {
@@ -267,7 +292,15 @@ Trk::TrackSummaryTool::createSummary( const Track& track,
       <<track.info().dumpInfo()<<"). This should never happen! ");
   }
 
-  if (doHolesInDet || doHolesMuon)
+  bool hole_search_done = (
+    information[Trk::numberOfPixelHoles] != -1 &&
+    information[Trk::numberOfSCTHoles] != -1 &&
+    information[Trk::numberOfSCTDoubleHoles] != -1 &&
+    information[Trk::numberOfPixelDeadSensors] != -1 &&
+    information[Trk::numberOfSCTDeadSensors] != -1
+  );
+
+  if ((doHolesInDet || doHolesMuon) && (!hole_search_done || m_alwaysRecomputeHoles.value()))
   {
     if (m_pixelExists)
     {
@@ -294,43 +327,22 @@ Trk::TrackSummaryTool::createSummary( const Track& track,
     eProbability.push_back(0.0);
   }
 
-  std::unique_ptr<TrackSummary> ts=std::make_unique<TrackSummary>(information,
-                                                                  eProbability,
-                                                                  hitPattern,
-                                                                  dedx,
-                                                                  nhitsuseddedx,
-                                                                  noverflowhitsdedx);
+  ts.m_eProbability = eProbability;
+  ts.m_idHitPattern = hitPattern.to_ulong();
+  ts.m_dedx = dedx;
+  ts.m_nhitsdedx = nhitsuseddedx;
+  ts.m_nhitsoverflowdedx = noverflowhitsdedx;
+
   // add detailed summary for indet
   if( m_addInDetDetailedSummary && !m_idTool.empty() ){
-    m_idTool->addDetailedTrackSummary(track,*ts);
+    m_idTool->addDetailedTrackSummary(track,ts);
   }
   // add detailed summary for muons
   if( m_addMuonDetailedSummary && !m_muonTool.empty() ){
-    m_muonTool->addDetailedTrackSummary(track,*ts);
+    m_muonTool->addDetailedTrackSummary(track,ts);
   }
   // move this part to VERBOSE
-  ATH_MSG_VERBOSE ( *ts << endmsg << "Finished!");
-
-  return ts;
-}
-
-/*
- * The the update methods
- */
-
-void Trk::TrackSummaryTool::updateTrack(Track& track,const Trk::PRDtoTrackMap *prd_to_track_map) const
-{
-  // first check if track has summary already.
-  computeAndReplaceTrackSummary(track,prd_to_track_map,false /*DO NOT suppress hole search*/);
-}
-
-void
-Trk::TrackSummaryTool::updateTrackNoHoleSearch(Track& track,
-                                               const Trk::PRDtoTrackMap* prd_to_track_map) const
-{
-  // first check if track has summary already.
-  computeAndReplaceTrackSummary(track, prd_to_track_map, true /*suppress hole search*/);
-  m_idTool->updateExpectedHitInfo(track, *track.trackSummary()); /*Needed for expected B-Layer*/
+  ATH_MSG_VERBOSE ( ts << endmsg << "Finished!");
 }
 
 void Trk::TrackSummaryTool::updateSharedHitCount(const Track& track, const Trk::PRDtoTrackMap *prd_to_track_map,TrackSummary &summary) const
diff --git a/Tracking/TrkVertexFitter/TrkVertexBilloirTools/TrkVertexBilloirTools/FastVertexFitter.h b/Tracking/TrkVertexFitter/TrkVertexBilloirTools/TrkVertexBilloirTools/FastVertexFitter.h
index ba763e34b386ed511853fe778bd3a4f9d6f537e6..09eff0b9df5463ba1b129c3ce87248b9f244904b 100755
--- a/Tracking/TrkVertexFitter/TrkVertexBilloirTools/TrkVertexBilloirTools/FastVertexFitter.h
+++ b/Tracking/TrkVertexFitter/TrkVertexBilloirTools/TrkVertexBilloirTools/FastVertexFitter.h
@@ -33,8 +33,7 @@ EDM Migration to xAOD - from Trk::VxCandidate to xAOD::Vertex,
                         from Trk::Vertex      to Amg::Vector3D
 */
 
-class ATLAS_NOT_THREAD_SAFE FastVertexFitter //const_cast the extrapolator result
-  : public extends<AthAlgTool, IVertexFitter>
+class FastVertexFitter : public extends<AthAlgTool, IVertexFitter>
 {
 public:
   // The following 'using' can be removed when IVertexFitter::fit has been fully
diff --git a/Tracking/TrkVertexFitter/TrkVertexBilloirTools/src/FastVertexFitter.cxx b/Tracking/TrkVertexFitter/TrkVertexBilloirTools/src/FastVertexFitter.cxx
index a35a85d78b886b8c0ae461e9c8847e43d0cb49c6..3de822d35296e74fa4b975c05f810549f55c8472 100755
--- a/Tracking/TrkVertexFitter/TrkVertexBilloirTools/src/FastVertexFitter.cxx
+++ b/Tracking/TrkVertexFitter/TrkVertexBilloirTools/src/FastVertexFitter.cxx
@@ -318,14 +318,15 @@ namespace Trk
 					// you need to extrapolate the original perigee ((*BTIter).originalPerigee) really to the
 					// found vertex. The first propagation above is only to the starting point. But here we
 					// want to store it wrt. to the last fitted vertex
-					Trk::TrackParameters * extrapolatedPerigee = const_cast<Trk::TrackParameters*> ( m_extrapolator->extrapolate ( * ( *BTIter ).originalPerigee, perigeeSurface ) );
+					auto extrapolatedPerigee = std::unique_ptr<const Trk::TrackParameters> ( m_extrapolator->extrapolate ( * ( *BTIter ).originalPerigee, perigeeSurface ) );
 					if ( extrapolatedPerigee==nullptr )
 					{
-						extrapolatedPerigee = ( ( *BTIter ).originalPerigee )->clone();
+						extrapolatedPerigee = std::unique_ptr<const Trk::TrackParameters>(((*BTIter).originalPerigee)->clone());
 						ATH_MSG_DEBUG("Could not extrapolate these track parameters to final vertex position! Storing original position as final one ...");
 					}
-
-					Trk::VxTrackAtVertex* tmpVxTrkAtVtx = new Trk::VxTrackAtVertex ( ( *BTIter ).chi2, extrapolatedPerigee, ( *BTIter ).originalPerigee ) ;
+          //VxTrackAtVertex will own the clone of the extrapolatedPerigee
+					Trk::VxTrackAtVertex* tmpVxTrkAtVtx = new Trk::VxTrackAtVertex ( ( *BTIter ).chi2, extrapolatedPerigee->clone(), 
+                                                                           ( *BTIter ).originalPerigee ) ;
 					tracksAtVertex.push_back ( *tmpVxTrkAtVtx );
 					// TODO: here is where the vxTracksAtVertex pointers are deleted
 					delete tmpVxTrkAtVtx; // TODO: is this ok?
diff --git a/Tracking/TrkVertexFitter/TrkVertexFitterInterfaces/TrkVertexFitterInterfaces/ATLAS_CHECK_THREAD_SAFETY b/Tracking/TrkVertexFitter/TrkVertexFitterInterfaces/TrkVertexFitterInterfaces/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..415ac0cee8d0757f5a6d481ee3230b36c496556a
--- /dev/null
+++ b/Tracking/TrkVertexFitter/TrkVertexFitterInterfaces/TrkVertexFitterInterfaces/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Tracking/TrkVertexFitter/TrkVertexFitterInterfaces
diff --git a/Tracking/TrkVertexFitter/TrkVertexFitterUtils/share/ImpactPoint3dEstimator_test.ref b/Tracking/TrkVertexFitter/TrkVertexFitterUtils/share/ImpactPoint3dEstimator_test.ref
index 3c785584c0fa8756412a6edeea2d3ff0c3b74d75..1f10c9c8f9880470c83d7437c43ddd68c5498b39 100644
--- a/Tracking/TrkVertexFitter/TrkVertexFitterUtils/share/ImpactPoint3dEstimator_test.ref
+++ b/Tracking/TrkVertexFitter/TrkVertexFitterUtils/share/ImpactPoint3dEstimator_test.ref
@@ -1,18 +1,29 @@
 TrkVertexFitterUtils/ImpactPoint3dEstimator_test
 
 
+Initializing Gaudi ApplicationMgr using job opts /afs/cern.ch/user/s/ssnyder/atlas-work3/build-x86_64-centos7-gcc8-opt/x86_64-centos7-gcc8-opt/jobOptions/TrkVertexFitterUtils/TrkVertexFitterUtils_tests.txt
+JobOptionsSvc        INFO # =======> /afs/cern.ch/user/s/ssnyder/atlas-work3/build-x86_64-centos7-gcc8-opt/x86_64-centos7-gcc8-opt/jobOptions/TrkVertexFitterUtils/TrkVertexFitterUtils_tests.txt
+JobOptionsSvc        INFO # (1,1): ToolSvc.Trk::DetAnnealingMaker.SetOfTemperatures = [3, 2, 1]
+JobOptionsSvc        INFO Job options successfully read in from /afs/cern.ch/user/s/ssnyder/atlas-work3/build-x86_64-centos7-gcc8-opt/x86_64-centos7-gcc8-opt/jobOptions/TrkVertexFitterUtils/TrkVertexFitterUtils_tests.txt
+ApplicationMgr    SUCCESS 
+====================================================================================================================================
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v34r0)
+                                          running on lxplus750.cern.ch on Wed Sep 23 18:13:22 2020
+====================================================================================================================================
 ApplicationMgr       INFO Application Manager Configured successfully
 EventLoopMgr      WARNING Unable to locate service "EventSelector" 
 EventLoopMgr      WARNING No events will be processed from external input.
 ApplicationMgr       INFO Application Manager Initialized successfully
 ApplicationMgr Ready
+ClassIDSvc           INFO  getRegistryEntries: read 1476 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 379 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 2769 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 652 CLIDRegistry entries for module ALL
 ServiceManager      FATAL No Service factory for AtlasTrackingGeometrySvc available.
 ToolSvc.Trk::Ex...  ERROR ServiceLocatorHelper::service: can not locate service AtlasTrackingGeometrySvc
 ToolSvc.Trk::Ex...WARNING Couldn't retrieve TrackingGeometrySvc = ServiceHandle('AtlasTrackingGeometrySvc'). 
 ToolSvc.Trk::Ex...WARNING  -> Trying to retrieve default 'AtlasTrackingGeometry' from DetectorStore.
-ToolSvc.Trk::Ex...   INFO Minimal momentum cut for material update : 50 MeV
-ToolSvc.AtlasEn...   INFO initialize()
 ToolSvc.AtlasMu...   INFO initialize() successful
+ClassIDSvc           INFO  getRegistryEntries: read 113 CLIDRegistry entries for module ALL
 ToolSvc.Trk::Ex...   INFO initialize() successful
-ToolSvc.Trk::Ex...   INFO initialize()
 test1
diff --git a/Tracking/TrkVertexFitter/TrkVertexFitters/TrkVertexFitters/DummyVertexSmoother.h b/Tracking/TrkVertexFitter/TrkVertexFitters/TrkVertexFitters/DummyVertexSmoother.h
index a48d3de9e74cf5fd741de83ea170ef20a6ef01df..4e4fc91aad7c4a8fc2d9f2a7f4c4c37d9915282e 100755
--- a/Tracking/TrkVertexFitter/TrkVertexFitters/TrkVertexFitters/DummyVertexSmoother.h
+++ b/Tracking/TrkVertexFitter/TrkVertexFitters/TrkVertexFitters/DummyVertexSmoother.h
@@ -40,7 +40,7 @@ namespace Trk
    */ 
 
   //Not THREAD_SAFE due to const_cast 
-  class ATLAS_NOT_THREAD_SAFE DummyVertexSmoother : public AthAlgTool, virtual public IVertexSmoother
+  class DummyVertexSmoother : public AthAlgTool, virtual public IVertexSmoother
   {
   public:
   
diff --git a/Tracking/TrkVertexFitter/TrkVertexFitters/src/DummyVertexSmoother.cxx b/Tracking/TrkVertexFitter/TrkVertexFitters/src/DummyVertexSmoother.cxx
index bad68a45f101d3626c6ddf1a8a4e67ace2c13ef6..03a19f720072a13553612999bf98802cc50dde75 100755
--- a/Tracking/TrkVertexFitter/TrkVertexFitters/src/DummyVertexSmoother.cxx
+++ b/Tracking/TrkVertexFitter/TrkVertexFitters/src/DummyVertexSmoother.cxx
@@ -75,14 +75,13 @@ namespace Trk
 
           if(initPar != nullptr)
           {
-            //This does not play well with const correctness
             //Either we should return non-const parameters from the extrapolator
             //as the owner here has to delete them
             //Or we need to clone  
-            const Trk::TrackParameters* extrapolatedPerigee(m_extrapolator->extrapolate(*initPar,perigeeSurface));
+            auto extrapolatedPerigee = std::unique_ptr<const Trk::TrackParameters>(m_extrapolator->extrapolate(*initPar,perigeeSurface));
             if(extrapolatedPerigee != nullptr)
             {
-              (*t_it).setPerigeeAtVertex(const_cast<Trk::TrackParameters*>(extrapolatedPerigee));
+              (*t_it).setPerigeeAtVertex(extrapolatedPerigee->clone());
             } else {
               msg(MSG::ERROR)  << " Extrapolation failed; VxTrackAtertex will not be updated" << endmsg;
             }//end of successfull extrapolation check
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/CMakeLists.txt b/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/CMakeLists.txt
index 4108623f450918093bca52bac653f92d17edf295..0a438476f2522267d7888e46bedb2d98983c4ac2 100644
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/CMakeLists.txt
+++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/CMakeLists.txt
@@ -33,14 +33,16 @@ atlas_add_library( TrkVertexSeedFinderToolsLib
                    TrkVertexSeedFinderTools/*.h
                    INTERFACE
                    PUBLIC_HEADERS TrkVertexSeedFinderTools
-                   LINK_LIBRARIES GaudiKernel AthenaBaseComps TrkVertexFitterInterfaces TrkVertexSeedFinderUtilsLib xAODEventInfo GeneratorObjects AtlasHepMCLib CxxUtils )
+                   LINK_LIBRARIES GaudiKernel AthenaBaseComps TrkVertexFitterInterfaces TrkVertexSeedFinderUtilsLib 
+		   xAODEventInfo GeneratorObjects AtlasHepMCLib CxxUtils )
 
 # Component(s) in the package:
 atlas_add_component( TrkVertexSeedFinderTools
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${HEPPDT_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} 
-                     LINK_LIBRARIES ${HEPPDT_LIBRARIES} ${ROOT_LIBRARIES} ${EIGEN_LIBRARIES} TrkVertexSeedFinderToolsLib GeoPrimitives EventPrimitives  TruthHelper  TrkEventPrimitives TrkParameters TrkTrack VxVertex  )
+                     LINK_LIBRARIES ${HEPPDT_LIBRARIES} ${ROOT_LIBRARIES} ${EIGEN_LIBRARIES} TrkVertexSeedFinderToolsLib GeoPrimitives EventPrimitives  
+		     TruthHelper  TrkEventPrimitives TrkParameters TrkTrack VxVertex  )
 
 # Install files from the package:
 atlas_install_joboptions( share/*.py )
@@ -77,5 +79,4 @@ run_seed_test( ZScanSeedFinder )
 run_seed_test( CrossDistancesSeedFinder )
 run_seed_test( IndexedCrossDistancesSeedFinder )
 run_seed_test( TrackDensitySeedFinder )
-run_seed_test( ImagingSeedFinder )
 run_seed_test( MCTrueSeedFinder )
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/TrkVertexSeedFinderTools/ImagingSeedFinder.h b/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/TrkVertexSeedFinderTools/ImagingSeedFinder.h
deleted file mode 100644
index 0692475a33b1a9bd3967510c3eddfdd2af2e9718..0000000000000000000000000000000000000000
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/TrkVertexSeedFinderTools/ImagingSeedFinder.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef TRKVERTEXSEEDFINDERTOOLS_IMAGINGSEEDFINDER_H
-#define TRKVERTEXSEEDFINDERTOOLS_IMAGINGSEEDFINDER_H
-
-#include "AthenaBaseComps/AthAlgTool.h"
-#include "GaudiKernel/ToolHandle.h"
-#include "TrkVertexFitterInterfaces/IVertexSeedFinder.h"
-#include "TrkVertexSeedFinderUtils/VertexImage.h"
-#include "xAODEventInfo/EventInfo.h"
-
-//class IBeamCondSvc; //Beam spot constraint from here
-
-namespace Trk
-{
-
-  class Track;
-  class IVertexImageMaker;
-  class IVertexClusterFinder;
-  class VertexCluster;
-
-  // @author Matt Rudolph (matthew.scott.rudolph@cern.ch) Lars Egholm Pedersen (egholm...)
-  // This class implements a multiseed finder using a filtering technique inspired by imaging algorithms
-  // As a backup, the single findSeed methods are implemented using a cache of the result from findMultiSeed
-  // @ATLAS software
-  // 
-  // ----------------------------------------
-  // Changes:
-  //
-  // David Shope <david.richard.shope@cern.ch> (2016-04-19)
-  //
-  // EDM Migration to xAOD - from Trk::VxCandidate to xAOD::Vertex, 
-  //                         from Trk::RecVertex   to xAOD::Vertex,
-  //                         from Trk::Vertex      to Amg::Vector3D
-
-  class ImagingSeedFinder : public extends<AthAlgTool, IVertexSeedFinder>
-  {
-  public:
-    // Standard Gaudi constructor.
-    ImagingSeedFinder (const std::string& t,
-                       const std::string& n,
-                       const IInterface*  p);
-
-
-    virtual ~ImagingSeedFinder();
-
-
-    virtual StatusCode initialize() override;
-    virtual StatusCode finalize() override;
-
-
-    using IVertexSeedFinder::findSeed;
-
-    /**
-     *  Finds a linearization point out of a vector of tracks
-     *  and returns it as an Amg::Vector3D object. If you want an 
-     *  additional constraint can be taken into account.
-     */
-    virtual Amg::Vector3D
-    findSeed(const std::vector<const Trk::Track*> & vectorTrk,
-             const xAOD::Vertex * constraint=0) const override;
-    
-
-    /** 
-     * Finds a linearization point out of a vector of TrackParameters
-     *  and returns it as an Amg::Vector3D object. If you want an 
-     * additional constraint can be taken into account.
-     */
-    virtual Amg::Vector3D
-    findSeed (const std::vector<const Trk::TrackParameters*> &parametersList,
-              const xAOD::Vertex * constraint=0) const override;
-
-
-    /**
-     * Finds full vector of linearization points from a vector of tracks
-     *  and returns it as an Amg::Vector3D object.  Intended for seed finders that produce all at once.
-     *  If you want an additional constraint can be taken into account.
-     */
-    virtual std::vector<Amg::Vector3D>
-    findMultiSeeds (const std::vector<const Trk::Track*>& vectorTrk,
-                    const xAOD::Vertex * constraint=0) const override;
-
-
-    /**
-     * Finds full vector of linearization points from a vector
-     * of TrackParameters and returns it as an Amg::Vector3D object.
-     * Intended for seed finders that produce all at once.
-     * If you want an additional constraint can be taken into account.
-     */
-    virtual std::vector<Amg::Vector3D>
-    findMultiSeeds(const std::vector<const Trk::TrackParameters*>& parametersList,
-                   const xAOD::Vertex * constraint=0) const override;
-
-
-  private:
-    //Tool that actually makes the image to process
-    ToolHandle< Trk::IVertexImageMaker > m_vertexImageMaker;
-
-    //Clustering util
-    ToolHandle< Trk::IVertexClusterFinder > m_VertexClusterFinder;
-  };
-}
-#endif
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/share/ImagingSeedFinder.ref b/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/share/ImagingSeedFinder.ref
deleted file mode 100644
index 57d37f6313a426d9fe670dda37586cb2ed8a2f5c..0000000000000000000000000000000000000000
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/share/ImagingSeedFinder.ref
+++ /dev/null
@@ -1,430 +0,0 @@
-Sat Mar  7 19:21:22 CET 2020
-Preloading tcmalloc_minimal.so
-Py:Athena            INFO including file "AthenaCommon/Preparation.py"
-Py:Athena            INFO using release [WorkDir-22.0.12] [x86_64-centos7-gcc8-dbg] [atlas-work3/d935ebad997] -- built on [2020-03-07T1715]
-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 "TrkVertexSeedFinderTools/ImagingSeedFinder_test.py"
-Py:Athena            INFO including file "TrkVertexSeedFinderTools/VertexSeedFinderTestCommon.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 5514 configurables from 60 genConfDb files
-Py:ConfigurableDb    INFO No duplicates have been found: that's good !
-EventInfoMgtInit: Got release version  Athena-22.0.12
-Py:IOVDbSvc.CondDB    INFO Setting up conditions DB access to instance OFLP200
-Py:ConfiguredFactory    INFO imported 138 confDb modules in 1.54 seconds
-Py:Athena            INFO Importing MagFieldServices.SetupField
-Py:Athena            INFO Importing MagFieldServices.MagFieldServicesSetup
-[ TrackingGeometrySvc ]     base material tag :  AtlasLayerMat_v21_
-[ TrackingGeometrySvc ]     translated to COOL:  /GLOBAL/TrackingGeo/LayerMaterialV2<tag>TagInfoMajor/AtlasLayerMat_v21_/GeoAtlas</tag>
-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 v33r0)
-                                          running on lxplus7100.cern.ch on Sat Mar  7 19:21:36 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 3736 CLIDRegistry entries for module ALL
-CoreDumpSvc          INFO install f-a-t-a-l handler... (flag = -1)
-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://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/2020-03-06T2143/Athena/22.0.12/InstallArea/x86_64-centos7-gcc8-dbg/share/dbreplica.config
-DBReplicaSvc         INFO Total of 10 servers found for host lxplus7100.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              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
-PoolSvc           WARNING Unable to locate catalog for apcfile:poolcond/PoolCat_oflcond.xml check your ATLAS_POOLCOND_PATH and DATAPATH variables
-PoolSvc              INFO Resolved path (via ATLAS_POOLCOND_PATH) is /cvmfs/atlas-condb.cern.ch/repo/conditions/poolcond/PoolFileCatalog.xml
-PoolSvc              INFO POOL WriteCatalog is xmlcatalog_file:PoolFileCatalog.xml
-DbSession            INFO     Open     DbSession    
-Domain[ROOT_All]     INFO >   Access   DbDomain     READ      [ROOT_All] 
-MetaDataSvc          INFO Found MetaDataTools = PublicToolHandleArray([])
-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
-IOVDbSvc             INFO Global tag: OFLCOND-RUN12-SDR-35 set from joboptions
-IOVDbFolder          INFO Read from meta data only for folder /TagInfo
-IOVDbFolder          INFO Inputfile tag override disabled for /GLOBAL/BField/Maps
-IOVDbSvc             INFO Initialised with 5 connections and 8 folders
-IOVDbSvc             INFO Service IOVDbSvc initialised successfully
-ClassIDSvc           INFO  getRegistryEntries: read 1914 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_INDET/OFLP200
-IOVSvc               INFO No IOVSvcTool associated with store "StoreGateSvc"
-IOVSvc.IOVSvcTool    INFO IOVRanges will be checked at every Event
-IOVDbSvc             INFO Opening COOL connection for COOLOFL_TRT/OFLP200
-IOVDbSvc             INFO Disconnecting from COOLOFL_INDET/OFLP200
-IOVDbSvc             INFO Opening COOL connection for COOLOFL_GLOBAL/OFLP200
-IOVDbSvc             INFO Disconnecting from COOLOFL_TRT/OFLP200
-IOVDbSvc             INFO Opening COOL connection for COOLOFL_DCS/OFLP200
-IOVDbSvc             INFO Disconnecting from COOLOFL_GLOBAL/OFLP200
-IOVDbSvc             INFO Disconnecting from COOLOFL_DCS/OFLP200
-IOVDbSvc             INFO Added taginfo remove for /EXT/DCS/MAGNETS/SENSORDATA
-IOVDbSvc             INFO Added taginfo remove for /GLOBAL/BField/Maps
-IOVDbSvc             INFO Added taginfo remove for /GLOBAL/TrackingGeo/LayerMaterialV2
-IOVDbSvc             INFO Added taginfo remove for /Indet/Align
-IOVDbSvc             INFO Added taginfo remove for /Indet/IBLDist
-IOVDbSvc             INFO Added taginfo remove for /Indet/PixelDist
-IOVDbSvc             INFO Added taginfo remove for /TRT/Align
-ClassIDSvc           INFO  getRegistryEntries: read 268 CLIDRegistry entries for module ALL
-ClassIDSvc           INFO  getRegistryEntries: read 35 CLIDRegistry entries for module ALL
-DetDescrCnvSvc       INFO  initializing 
-DetDescrCnvSvc       INFO Found DetectorStore service
-DetDescrCnvSvc       INFO  filling proxies for detector managers 
-DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for SCT_ID with CLID 2517 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for TRT_ID with CLID 2518 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for SiliconID with CLID 129452393 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArEM_ID with CLID 163583365 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArEM_SuperCell_ID with CLID 99488227 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArHEC_ID with CLID 3870484 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArHEC_SuperCell_ID with CLID 254277678 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArFCAL_ID with CLID 45738051 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArFCAL_SuperCell_ID with CLID 12829437 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArMiniFCAL_ID with CLID 79264204 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArOnlineID with CLID 158698068 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for TTOnlineID with CLID 38321944 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArOnline_SuperCellID with CLID 115600394 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArHVLineID with CLID 27863673 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArElectrodeID with CLID 80757351 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for TileID with CLID 2901 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for Tile_SuperCell_ID with CLID 49557789 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for TileHWID with CLID 2902 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for TileTBID with CLID 2903 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for MDTIDHELPER with CLID 4170 and storage type 68 to detector store 
-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 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 
-DetDescrCnvSvc       INFO  filling address for CaloDM_ID with CLID 167756483 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for ZdcID with CLID 190591643 and storage type 68 to detector store 
-GeoModelSvc::RD...WARNING  Getting PixTBMatComponents with default tag
-GeoModelSvc::RD...WARNING  Getting PixTBMaterials with default tag
-GeoModelSvc::RD...WARNING  Getting InDetMatComponents with default tag
-GeoModelSvc::RD...WARNING  Getting InDetMaterials with default tag
-IBLParameterSvc      INFO IBL geometry
-EventPersistenc...   INFO Added successfully Conversion service:DetDescrCnvSvc
-PixelIDDetDescrCnv   INFO in createObj: creating a PixelID helper object in the detector store
-IdDictDetDescrCnv    INFO in initialize
-IdDictDetDescrCnv    INFO in createObj: creating a IdDictManager object in the detector store
-IdDictDetDescrCnv    INFO IdDictName:  IdDictParser/ATLAS_IDS.xml
-IdDictDetDescrCnv    INFO Reading InnerDetector    IdDict file InDetIdDictFiles/IdDictInnerDetector_IBL3D25-03.xml
-IdDictDetDescrCnv    INFO Reading LArCalorimeter   IdDict file IdDictParser/IdDictLArCalorimeter_DC3-05-Comm-01.xml
-IdDictDetDescrCnv    INFO Reading TileCalorimeter  IdDict file IdDictParser/IdDictTileCalorimeter.xml
-IdDictDetDescrCnv    INFO Reading Calorimeter      IdDict file IdDictParser/IdDictCalorimeter_L1Onl.xml
-IdDictDetDescrCnv    INFO Reading MuonSpectrometer IdDict file IdDictParser/IdDictMuonSpectrometer_R.03.xml
-IdDictDetDescrCnv    INFO Reading ForwardDetectors IdDict file IdDictParser/IdDictForwardDetectors_2010.xml
-IdDictDetDescrCnv    INFO Found id dicts:
-IdDictDetDescrCnv    INFO Using dictionary tag: null
-IdDictDetDescrCnv    INFO Dictionary ATLAS                version default              DetDescr tag (using default) file 
-IdDictDetDescrCnv    INFO Dictionary Calorimeter          version default              DetDescr tag CaloIdentifier-LVL1-02 file IdDictParser/IdDictCalorimeter_L1Onl.xml
-IdDictDetDescrCnv    INFO Dictionary ForwardDetectors     version default              DetDescr tag ForDetIdentifier-01       file IdDictParser/IdDictForwardDetectors_2010.xml
-IdDictDetDescrCnv    INFO Dictionary InnerDetector        version IBL-DBM              DetDescr tag InDetIdentifier-IBL3D25-02 file InDetIdDictFiles/IdDictInnerDetector_IBL3D25-03.xml
-IdDictDetDescrCnv    INFO Dictionary LArCalorimeter       version fullAtlas            DetDescr tag LArIdentifier-DC3-05-Comm file IdDictParser/IdDictLArCalorimeter_DC3-05-Comm-01.xml
-IdDictDetDescrCnv    INFO Dictionary LArElectrode         version fullAtlas            DetDescr tag (using default) file 
-IdDictDetDescrCnv    INFO Dictionary LArHighVoltage       version fullAtlas            DetDescr tag (using default) file 
-IdDictDetDescrCnv    INFO Dictionary MuonSpectrometer     version R.03                 DetDescr tag MuonIdentifier-08         file IdDictParser/IdDictMuonSpectrometer_R.03.xml
-IdDictDetDescrCnv    INFO Dictionary TileCalorimeter      version fullAtlasAndTestBeam DetDescr tag TileIdentifier-00         file IdDictParser/IdDictTileCalorimeter.xml
-PixelID              INFO Initialize from dictionary
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-indet 1 2,4,5,7,10,11,12,13 7 1fffffffffffffff 61 3 0 min/max 2 13 values  2 4 5 7 10 11 12 13 indexes  0 0 1 2 0 3 0 0 4 5 6 7 indices  8 prev  0 next  0 mode  enumerated  cont mode  none  
-pixel 1 1:3 3 e7ffffffffffffff 59 2 3 min/max 1 3 values  indexes  indices  3 prev  0 next  0 mode  both_bounded  cont mode  none  
-bec 1 -4,-2,0,2,4 7 f8ffffffffffffff 56 3 5 min/max -4 4 values  -4 -2 0 2 4 indexes  0 0 1 0 2 0 3 0 4 indices  5 prev  0 next  0 mode  enumerated  cont mode  none  
-bec_shift 0 0 0 0 0 0 0 min/max 0 0 values  indexes  indices  0 prev  0 next  0 mode  both_bounded  cont mode  none  
-lay_disk 0 0:3 3 ff3fffffffffffff 54 2 8 min/max 0 3 values  indexes  indices  4 prev  0 next  0 mode  both_bounded  cont mode  none  
-lay_disk_shift 0 0 0 0 0 0 0 min/max 0 0 values  indexes  indices  0 prev  0 next  0 mode  both_bounded  cont mode  none  
-phi_mod 0 0:63 3f ffc0ffffffffffff 48 6 10 min/max 0 63 values  indexes  indices  64 prev  0 next  0 mode  both_bounded  cont mode  none  
-phi_mod_shift 0 0 0 0 0 0 0 min/max 0 0 values  indexes  indices  0 prev  0 next  0 mode  both_bounded  cont mode  none  
-eta_mod 1 -10:9 1f ffff07ffffffffff 43 5 16 min/max -10 9 values  indexes  indices  20 prev  0 next  0 mode  both_bounded  cont mode  none  
-eta_mod_shift 0 0 0 0 0 0 0 min/max 0 0 values  indexes  indices  0 prev  0 next  0 mode  both_bounded  cont mode  none  
-phi_index 0 0:376 1ff fffff803ffffffff 34 9 21 min/max 0 376 values  indexes  indices  377 prev  0 next  0 mode  both_bounded  cont mode  none  
-eta_index 0 0:335 1ff fffffffc01ffffff 25 9 30 min/max 0 335 values  indexes  indices  336 prev  0 next  0 mode  both_bounded  cont mode  none  
-bec_eta_mod 0 0 0 0 0 0 0 min/max 0 0 values  indexes  indices  0 prev  0 next  0 mode  both_bounded  cont mode  none  
-PixelID::initLevelsFromDict - found levels 
-subdet        0
-part          1
-barrel_endcap 2
-layer or disk 3
-phi_module    4
-eta_module    5
-phi_index     6
-eta_index     7
-InDetGeometryDBSvc   INFO GeometryDBSvc Initialized
-PixelGeoModel        INFO Retrieving Record Sets from database ...
-PixelGeoModel        INFO Key = ATLAS-R2-2016-01-00-01 Node = ATLAS
-PixelGeoModel        INFO ... Record Sets retrieved.
-PixelGeoModel        INFO DBM switch = SetDBMFlag: 1
-PixelGeoModel        INFO Building Pixel Detector
-PixelGeoModel        INFO  Version: Pixel-IBL3D25-33, Name: IBL, Layout: IBL, Code Version: 5.01.00, Description: IBL_Geometry
-GEOPIXELSERVICES pixel : 28.995 245 //  3460
-GEOPIXELSERVICES barrel : 28.997 143 //  -460 460
-GEOPIXELSERVICES endcap : 82 175 //  484 670
-PixelGeoModel        INFO Build detailed stave support description :  layout 5
-PixelGeoModel        INFO Si3D/SiPl radial shift : -0.015
-PixelGeoModel        INFO Module thicknesses :  SiPl P/N 0.31 0.44 20.86  SiPl P/N 0.31 1.72 20.86  //  0.325 1.705
-PixelGeoModel        INFO Pixel modules 12 -> planar/3D : 12 8
-PixelGeoModel        INFO Module length/gap : 41.3 / 20.45 0.205  -> Stave length : 748
-PixelGeoModel        INFO    planar/3D/endblock/NonActive lengths : 497.855 165.24 69.8 7.5525
-PixelGeoModel        INFO Flex thickness (max) : 0.45 computed for 16 modules 
-PixelGeoModel        INFO  Omega MidStaveCenterX  = 1.55
-PixelGeoModel        INFO  Omega MidStaveAngle  = 0.296706
-PixelGeoModel        INFO  Omega MidStaveRadius  = 1.655
-PixelGeoModel        INFO  Omega EndStaveCenterX  = -1.25
-PixelGeoModel        INFO  Omega EndStaveCenterY  = 7.45
-PixelGeoModel        INFO  Omega EndStaveAngle  = 2.35619
-PixelGeoModel        INFO  Omega EndStaveRadius  = 2.155
-PixelGeoModel        INFO  Omega Thickness  = 0.145
-PixelGeoModel        INFO  MechanicalStaveWidth  = 18.8
-PixelGeoModel        INFO  MechanicalStaveLength = 748
-PixelGeoModel        INFO  MechanicalStaveOffset = -0.95
-PixelGeoModel        INFO  StaveModuleOffset     = 0.01
-PixelGeoModel        INFO  MechanicalStaveEndBlockLength = 34.9
-PixelGeoModel        INFO  FacePlateThick  = 0.215
-PixelGeoModel        INFO  TubeOuterDiam   = 1.75
-PixelGeoModel        INFO  TubeInnerDiam   = 1.5
-PixelGeoModel        INFO  TubeMiddlePos   = 1.3
-PixelGeoModel        INFO  FlexBaseThick   = 0.45
-PixelGeoModel        INFO  FlexLayerThick  = 0.02
-PixelGeoModel        INFO  FlexWidth       = 11.5
-PixelGeoModel        INFO  FlexOffset      = 0.6
-PixelGeoModel        INFO  XOffset / ladder = 0.01
-PixelGeoModel        INFO ** OMEGA : with Stycast 0.1
-PixelGeoModel        INFO ***> new material : OmegaGlue_IBL 3.31517
-PixelGeoModel        INFO  ** FacePlate : with Stycast 0.1  grease : 0.07
-PixelGeoModel        INFO ***> new material : FacePlateGlue_IBL 3.31517
-PixelGeoModel        INFO ** FacePlate : with grease
-PixelGeoModel        INFO ***> new material : FacePlateGlueGrease_IBL 3.04977
-PixelGeoModel        INFO Flex angle : 0.296641  Flex pos. in Z : (2.60312,4.19227,22.9025) 0.45 / (2.60312,4.19227,62.2575) 0.45 / (2.60312,4.19227,103.762) 0.45 / (2.60312,4.19227,145.267) 0.45 / (2.60312,4.19227,186.772) 0.45 / (2.60312,4.19227,228.277) 0.45 / (2.60312,4.19227,269.782) 0.45 / (2.60312,4.19227,314.817) 0.45 / 
-PixelGeoModel        INFO ** TUBE : with Stycast 0.1  diam 0.875 0.75
-PixelGeoModel        INFO ***> new material : CoolingPipeGlue_IBL 6.72585
-PixelGeoModel        INFO IBL EOS : mechanical stave length : 374
-PixelGeoModel        INFO IBL EOS :            service Zpos : 366.552
-PixelGeoModel        INFO IBL EOS :           endblock Zpos : 356.552
-PixelGeoModel        INFO IBL EOS :         endblock length : 34.896
-PixelGeoModel        INFO IBL EOS :     endblock srv length : 20
-PixelGeoModel        INFO Flex half thickness srv : 0.45
-PixelGeoModel        INFO  stave xoffset = 0.32
-PixelGeoModel        INFO  stave yoffset = -0.95
-PixelGeoModel        INFO Stave envelop length : 748 ->  339.101
-PixelGeoModel        INFO *** LAYER 0  planar/3D modules : 12 8
-PixelGeoModel        INFO Layer IBL / stave ring :  outer radius max  42.001
-PixelGeoModel        INFO Layer 0 in/out radius 29.7573  42.001
-PixelGeoModel        INFO IBL stave ring support
-PixelGeoModel        INFO Build IBL stave ring services
-PixelGeoModel        INFO Build detailed stave ring support : Brl0A_StaveRing  AC
-PixelGeoModel        INFO Build detailed stave ring support - logVol : Brl0A_StaveRing
-PixelGeoModel        INFO Build detailed stave ring support : Brl0C_StaveRing  AC
-PixelGeoModel        INFO Build detailed stave ring support - logVol : Brl0C_StaveRing
-PixelGeoModel        INFO Build detailed stave ring support : Brl0M_StaveRing  Mid
-PixelGeoModel        INFO Build detailed stave ring support - logVol : Brl0M_StaveRing
-PixelGeoModel        INFO Build IBL I-Flex services
-PixelGeoModel        INFO *** LAYER 1  planar/3D modules : 0 0
-PixelGeoModel        INFO Layer 1 in/out radius 46.2723  64.1329
-PixelGeoModel        INFO *** LAYER 2  planar/3D modules : 0 0
-PixelGeoModel        INFO Layer 2 in/out radius 83.7078  102.132
-PixelGeoModel        INFO *** LAYER 3  planar/3D modules : 0 0
-PixelGeoModel        INFO Layer 3 in/out radius 117.51  136.132
-PixelGeoModel        INFO Build IBL I-Flex services
-PixelGeoModel        INFO Build IBL I-Flex services
-PixelGeoModel        INFO Build IBL I-Flex services
-PixelGeoModel        INFO Build IBL fwd services - CAD tool design / S. model1 : 0/0
-PixelDetectorMa...   INFO Registering alignment channel with key /Indet/Align/ID, level 2, with frame global.
-PixelDetectorMa...   INFO Registering alignment channel with key /Indet/Align/PIX, level 1, with frame global.
-PixelDetectorMa...   INFO Registering alignment channel with key /Indet/Align/PIXB1, level 0, with frame local.
-PixelDetectorMa...   INFO Registering alignment channel with key /Indet/Align/PIXB2, level 0, with frame local.
-PixelDetectorMa...   INFO Registering alignment channel with key /Indet/Align/PIXB3, level 0, with frame local.
-PixelDetectorMa...   INFO Registering alignment channel with key /Indet/Align/PIXB4, level 0, with frame local.
-PixelDetectorMa...   INFO Registering alignment channel with key /Indet/Align/PIXEA1, level 0, with frame local.
-PixelDetectorMa...   INFO Registering alignment channel with key /Indet/Align/PIXEA2, level 0, with frame local.
-PixelDetectorMa...   INFO Registering alignment channel with key /Indet/Align/PIXEA3, level 0, with frame local.
-PixelDetectorMa...   INFO Registering alignment channel with key /Indet/Align/PIXEC1, level 0, with frame local.
-PixelDetectorMa...   INFO Registering alignment channel with key /Indet/Align/PIXEC2, level 0, with frame local.
-PixelDetectorMa...   INFO Registering alignment channel with key /Indet/Align/PIXEC3, level 0, with frame local.
-PixelGeoModel        INFO Doing consistency checks.
-PixelGeoModel        INFO Number of barrel elements       : 1736
-PixelGeoModel        INFO Number of endcap elements       : 288
-PixelGeoModel        INFO Number of endcap elements (DBM) : 24
-PixelGeoModel        INFO Total                           : 2048
-PixelGeoModel        INFO MaxHash                         : 2048
-SCT_IDDetDescrCnv    INFO in createObj: creating a SCT_ID helper object in the detector store
-SCT_ID               INFO 
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-SCT_GeoModel         INFO Retrieving Record Sets from database ...
-SCT_GeoModel         INFO Building SCT Detector.
-SCT_GeoModel         INFO  Version: SCT-GEO-00, Name: GEO, Layout: Final, Code Version: 3.06.00, Description: Atlas Geometry 2008
-SCTDetectorManager   INFO Registering alignment channel with key /Indet/Align/ID, level 3, with frame global.
-SCTDetectorManager   INFO Registering alignment channel with key /Indet/Align/SCT, level 2, with frame global.
-SCTDetectorManager   INFO Registering alignment channel with key /Indet/Align/SCTB1, level 1, with frame local.
-SCTDetectorManager   INFO Registering alignment channel with key /Indet/Align/SCTB2, level 1, with frame local.
-SCTDetectorManager   INFO Registering alignment channel with key /Indet/Align/SCTB3, level 1, with frame local.
-SCTDetectorManager   INFO Registering alignment channel with key /Indet/Align/SCTB4, level 1, with frame local.
-SCTDetectorManager   INFO Registering alignment channel with key /Indet/Align/SCTEA1, level 1, with frame local.
-SCTDetectorManager   INFO Registering alignment channel with key /Indet/Align/SCTEA2, level 1, with frame local.
-SCTDetectorManager   INFO Registering alignment channel with key /Indet/Align/SCTEA3, level 1, with frame local.
-SCTDetectorManager   INFO Registering alignment channel with key /Indet/Align/SCTEA4, level 1, with frame local.
-SCTDetectorManager   INFO Registering alignment channel with key /Indet/Align/SCTEA5, level 1, with frame local.
-SCTDetectorManager   INFO Registering alignment channel with key /Indet/Align/SCTEA6, level 1, with frame local.
-SCTDetectorManager   INFO Registering alignment channel with key /Indet/Align/SCTEA7, level 1, with frame local.
-SCTDetectorManager   INFO Registering alignment channel with key /Indet/Align/SCTEA8, level 1, with frame local.
-SCTDetectorManager   INFO Registering alignment channel with key /Indet/Align/SCTEA9, level 1, with frame local.
-SCTDetectorManager   INFO Registering alignment channel with key /Indet/Align/SCTEC1, level 1, with frame local.
-SCTDetectorManager   INFO Registering alignment channel with key /Indet/Align/SCTEC2, level 1, with frame local.
-SCTDetectorManager   INFO Registering alignment channel with key /Indet/Align/SCTEC3, level 1, with frame local.
-SCTDetectorManager   INFO Registering alignment channel with key /Indet/Align/SCTEC4, level 1, with frame local.
-SCTDetectorManager   INFO Registering alignment channel with key /Indet/Align/SCTEC5, level 1, with frame local.
-SCTDetectorManager   INFO Registering alignment channel with key /Indet/Align/SCTEC6, level 1, with frame local.
-SCTDetectorManager   INFO Registering alignment channel with key /Indet/Align/SCTEC7, level 1, with frame local.
-SCTDetectorManager   INFO Registering alignment channel with key /Indet/Align/SCTEC8, level 1, with frame local.
-SCTDetectorManager   INFO Registering alignment channel with key /Indet/Align/SCTEC9, level 1, with frame local.
-ClassIDSvc           INFO  getRegistryEntries: read 3566 CLIDRegistry entries for module ALL
-AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00
-ClassIDSvc           INFO  getRegistryEntries: read 2837 CLIDRegistry entries for module ALL
-ClassIDSvc           INFO  getRegistryEntries: read 1169 CLIDRegistry entries for module ALL
-CondInputLoader      INFO Initializing CondInputLoader...
-CondInputLoader      INFO Adding base classes:
-  +  ( 'AlignableTransformContainer' , 'ConditionStore+/Indet/Align' )   -> no bases
-  +  ( 'AlignableTransformContainer' , 'ConditionStore+/TRT/Align' )   -> no bases
-  +  ( 'CondAttrListCollection' , 'ConditionStore+/EXT/DCS/MAGNETS/SENSORDATA' )   ->
-  +  ( 'CondAttrListCollection' , 'ConditionStore+/Indet/IBLDist' )   ->
-  +  ( 'DetCondCFloat' , 'ConditionStore+/Indet/PixelDist' )   -> no bases
-CondInputLoader      INFO Will create WriteCondHandle dependencies for the following DataObjects:
-    +  ( 'AlignableTransformContainer' , 'ConditionStore+/Indet/Align' ) 
-    +  ( 'AlignableTransformContainer' , 'ConditionStore+/TRT/Align' ) 
-    +  ( 'CondAttrListCollection' , 'ConditionStore+/EXT/DCS/MAGNETS/SENSORDATA' ) 
-    +  ( 'CondAttrListCollection' , 'ConditionStore+/Indet/IBLDist' ) 
-    +  ( 'DetCondCFloat' , 'ConditionStore+/Indet/PixelDist' ) 
-ClassIDSvc           INFO  getRegistryEntries: read 440 CLIDRegistry entries for module ALL
-ClassIDSvc           INFO  getRegistryEntries: read 764 CLIDRegistry entries for module ALL
-xAODMaker::Even...   INFO Initializing - Package version: xAODEventInfoCnv-00-00-00
-xAODMaker::Even...   INFO Initializing - Package version: xAODEventInfoCnv-00-00-00
-xAODMaker::Even...WARNING Beam conditions service not available
-xAODMaker::Even...WARNING Will not fill beam spot information into xAOD::EventInfo
-testalg1            DEBUG Property update for OutputLevel : new value = 1
-testalg1          VERBOSE ServiceLocatorHelper::service: found service EventDataSvc
-testalg1          VERBOSE ServiceLocatorHelper::service: found service TimelineSvc
-testalg1.Imagin...  DEBUG Property update for OutputLevel : new value = 1
-testalg1.Imagin...   INFO ImagingSeedFinder initialization...
-testalg1.Imagin...   INFO Initializing frequency space filter
-testalg1.Imagin...   INFO Allocating memory to fftw - Histogram size : 32 , 32 , 2048
-testalg1.Imagin...   INFO Setting up FFTW plans
-testalg1          VERBOSE ServiceLocatorHelper::service: found service AlgExecStateSvc
-testalg1            DEBUG input handles: 0
-testalg1            DEBUG output handles: 1
-testalg1            DEBUG Adding private ToolHandle tool testalg1.ImagingSeedFinder (Trk::ImagingSeedFinder)
-testalg1            DEBUG Data Deps for testalg1
-  + OUTPUT IGNORED  ( 'McEventCollection' , '' ) 
-ApplicationMgr       INFO Application Manager Initialized successfully
-ClassIDSvc           INFO  getRegistryEntries: read 953 CLIDRegistry entries for module ALL
-CondInputLoader      INFO created CondCont<AlignableTransformContainer> with key 'ConditionStore+/Indet/Align'
-CondInputLoader      INFO created CondCont<AlignableTransformContainer> with key 'ConditionStore+/TRT/Align'
-CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/EXT/DCS/MAGNETS/SENSORDATA'
-CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/Indet/IBLDist'
-CondInputLoader      INFO created CondCont<DetCondCFloat> with key 'ConditionStore+/Indet/PixelDist'
-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 118 CLIDRegistry entries for module ALL
-IOVDbSvc             INFO Opening COOL connection for COOLOFL_INDET/OFLP200
-IOVDbFolder          INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to InDetAlign_IOVDEP-03 for folder /Indet/Align
-IOVDbFolder          INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to IBLDist-NULL for folder /Indet/IBLDist
-IOVDbFolder          INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to InDetPixelDist-nominal for folder /Indet/PixelDist
-IOVDbSvc             INFO Disconnecting from COOLOFL_INDET/OFLP200
-Domain[ROOT_All]     INFO ->  Access   DbDatabase   READ      [ROOT_All] D0709FD7-6A55-E011-925D-002481043EC0
-Domain[ROOT_All]     INFO                           /cvmfs/atlas-condb.cern.ch/repo/conditions/cond09/cond09_mc.000029.gen.COND/cond09_mc.000029.gen.COND._0001.pool.root
-RootDatabase.open    INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/cond09/cond09_mc.000029.gen.COND/cond09_mc.000029.gen.COND._0001.pool.root File version:52600
-PixelDetectorMa...WARNING Cannot set AlignableTransform for identifier  [2.1.0.0.0] at level 2
-PixelDetectorMa...WARNING Subsequent WARNINGS will be printed at DEBUG level.
-PixelDetectorMa...   INFO Processing IBLDist alignment container with key (/Indet/IBLDist) and alignment folder pointing to /Indet/Align
-PixelDetectorMa...WARNING Invalid HashID for identifier [2.1.0.0.0]
-PixelDetectorMa...WARNING No IBLDist corrections can be applied for invalid HashID's - exiting 
-AthenaEventLoopMgr   INFO   ===>>>  start processing event #1, run #1 0 events processed so far  <<<===
-IOVDbSvc             INFO Opening COOL connection for COOLOFL_TRT/OFLP200
-IOVDbFolder          INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to TRTAlign_Nominal2 for folder /TRT/Align
-IOVDbSvc             INFO Disconnecting from COOLOFL_TRT/OFLP200
-Domain[ROOT_All]     INFO ->  Access   DbDatabase   READ      [ROOT_All] 0E3CF1E5-143D-DB11-92C7-000CF1DA62DD
-Domain[ROOT_All]     INFO                           /cvmfs/atlas-condb.cern.ch/repo/conditions/cmccond/cmccond.000001.conditions.simul.pool.v0000/oflcond.000002.conditions.simul.pool.v0000._0029.pool.root__DQ2-1250194490
-Warning in <TClass::Init>: no dictionary for class DataHeader_p1 is available
-Warning in <TClass::Init>: no dictionary for class DataHeaderElement_p1 is available
-RootDatabase.open    INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/cmccond/cmccond.000001.conditions.simul.pool.v0000/oflcond.000002.conditions.simul.pool.v0000._0029.pool.root__DQ2-1250194490 File version:51000
-IOVDbSvc             INFO Opening COOL connection for COOLOFL_DCS/OFLP200
-IOVDbFolder          INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to ExtDCSMagnetsSensorData-001 for folder /EXT/DCS/MAGNETS/SENSORDATA
-IOVDbSvc             INFO Disconnecting from COOLOFL_DCS/OFLP200
-Domain[ROOT_All]     INFO ->  Access   DbDatabase   READ      [ROOT_All] 8C5D7155-23E9-DC11-99B4-001320DCF58D
-Domain[ROOT_All]     INFO                           /cvmfs/atlas-condb.cern.ch/repo/conditions/cmccond/cmccond.000001.conditions.recon.pool.v0000/oflcond.000001.conditions.recon.pool.v0000._0058.pool.root
-Warning in <TClass::Init>: no dictionary for class DataHeader_p2 is available
-Warning in <TClass::Init>: no dictionary for class DataHeaderElement_p2 is available
-Warning in <TClass::Init>: no dictionary for class PoolToken_p1 is available
-RootDatabase.open    INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/cmccond/cmccond.000001.conditions.recon.pool.v0000/oflcond.000001.conditions.recon.pool.v0000._0058.pool.root File version:51400
-SCT_AlignCondAlg     INFO recorded new CDO SCTAlignmentStore with range {[INVALID] - [1,l:4294967294]} into Conditions Store
-SCT_DetectorEle...   INFO recorded new CDO SCT_DetectorElementCollection with range {[INVALID] - [1,l:4294967294]} with size of 8176 into Conditions Store
-PixelDetectorMa...   INFO Processing IBLDist alignment container with key /Indet/IBLDist
-PixelAlignCondAlg    INFO recorded new CDO PixelAlignmentStore with range {[0,t:0,l:0] - [1,l:4294967294]} into Conditions Store
-PixelDetectorEl...   INFO recorded new CDO PixelDetectorElementCollection with range {[0,t:0,l:0] - [1,l:4294967294]} with size of 2048 into Conditions Store
-testalg1          VERBOSE execute
-testalg1          VERBOSE testing 3
-AthenaEventLoopMgr   INFO   ===>>>  done processing event #1, run #1 1 events processed so far  <<<===
-AthenaEventLoopMgr   INFO   ===>>>  start processing event #2, run #1 1 events processed so far  <<<===
-testalg1          VERBOSE execute
-testalg1          VERBOSE testing 3
-AthenaEventLoopMgr   INFO   ===>>>  done processing event #2, run #1 2 events processed so far  <<<===
-/cvmfs/atlas-co...   INFO Database being retired...
-Domain[ROOT_All]     INFO ->  Deaccess DbDatabase   READ      [ROOT_All] 0E3CF1E5-143D-DB11-92C7-000CF1DA62DD
-/cvmfs/atlas-co...   INFO Database being retired...
-Domain[ROOT_All]     INFO ->  Deaccess DbDatabase   READ      [ROOT_All] D0709FD7-6A55-E011-925D-002481043EC0
-/cvmfs/atlas-co...   INFO Database being retired...
-Domain[ROOT_All]     INFO ->  Deaccess DbDatabase   READ      [ROOT_All] 8C5D7155-23E9-DC11-99B4-001320DCF58D
-Domain[ROOT_All]     INFO >   Deaccess DbDomain     READ      [ROOT_All] 
-ApplicationMgr       INFO Application Manager Stopped successfully
-IncidentProcAlg1     INFO Finalize
-CondInputLoader      INFO Finalizing CondInputLoader...
-IncidentProcAlg2     INFO Finalize
-IdDictDetDescrCnv    INFO in finalize
-IOVDbFolder          INFO Folder /EXT/DCS/MAGNETS/SENSORDATA (AttrListColl) db-read 1/1 objs/chan/bytes 4/4/20 ((     0.04 ))s
-IOVDbFolder          INFO Folder /GLOBAL/BField/Maps (AttrListColl) db-read 0/0 objs/chan/bytes 0/3/0 ((     0.00 ))s
-IOVDbFolder          INFO Folder /GLOBAL/TrackingGeo/LayerMaterialV2 (PoolRef) db-read 0/0 objs/chan/bytes 0/1/0 ((     0.00 ))s
-IOVDbFolder          INFO Folder /Indet/Align (PoolRefColl) db-read 1/2 objs/chan/bytes 34/43/5440 ((     0.05 ))s
-IOVDbFolder          INFO Folder /Indet/IBLDist (AttrListColl) db-read 1/2 objs/chan/bytes 14/14/280 ((     0.02 ))s
-IOVDbFolder          INFO Folder /Indet/PixelDist (PoolRef) db-read 1/1 objs/chan/bytes 1/1/179 ((     0.02 ))s
-IOVDbFolder          INFO Folder /TRT/Align (PoolRefColl) db-read 1/1 objs/chan/bytes 32/32/5120 ((     1.39 ))s
-IOVDbSvc             INFO  bytes in ((      1.52 ))s
-IOVDbSvc             INFO Connection sqlite://;schema=mycool.db;dbname=OFLP200 : nConnect: 0 nFolders: 0 ReadTime: ((     0.00 ))s
-IOVDbSvc             INFO Connection COOLOFL_INDET/OFLP200 : nConnect: 2 nFolders: 3 ReadTime: ((     0.09 ))s
-IOVDbSvc             INFO Connection COOLOFL_TRT/OFLP200 : nConnect: 2 nFolders: 1 ReadTime: ((     1.39 ))s
-IOVDbSvc             INFO Connection COOLOFL_GLOBAL/OFLP200 : nConnect: 1 nFolders: 2 ReadTime: ((     0.00 ))s
-IOVDbSvc             INFO Connection COOLOFL_DCS/OFLP200 : nConnect: 2 nFolders: 1 ReadTime: ((     0.04 ))s
-AthDictLoaderSvc     INFO in finalize...
-ToolSvc              INFO Removing all tools created by ToolSvc
-testalg1.Imagin...   INFO Finalize ImageingSeedFinder successful
-*****Chrono*****     INFO ****************************************************************************************************
-*****Chrono*****     INFO  The Final CPU consumption ( Chrono ) Table (ordered)
-*****Chrono*****     INFO ****************************************************************************************************
-cObjR_ALL            INFO Time User   : Tot=  220 [ms] Ave/Min/Max= 2.18(+- 17.1)/    0/  170 [ms] #=101
-cObj_ALL             INFO Time User   : Tot=  270 [ms] Ave/Min/Max= 38.6(+- 66.6)/    0/  200 [ms] #=  7
-ChronoStatSvc        INFO Time User   : Tot= 24.4  [s]                                             #=  1
-*****Chrono*****     INFO ****************************************************************************************************
-ChronoStatSvc.f...   INFO  Service finalized successfully 
-ApplicationMgr       INFO Application Manager Finalized successfully
-ApplicationMgr       INFO Application Manager Terminated successfully
-Py:Athena            INFO leaving with code 0: "successful run"
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/share/ImagingSeedFinder_test.py b/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/share/ImagingSeedFinder_test.py
deleted file mode 100644
index 624ce890a4fdeaa3a28183d05be8e9458a6a2b61..0000000000000000000000000000000000000000
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/share/ImagingSeedFinder_test.py
+++ /dev/null
@@ -1,28 +0,0 @@
-#
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration.
-#
-# File: TrkVertexSeedFinderTools/share/ImagingSeedFinder_test.py
-# Author: scott snyder <snyder@bnl.gov>
-# Data: Jun, 2019
-# Brief: Unit test for ImagingSeedFinder.  Incomplete!
-#
-
-
-from __future__ import print_function
-
-
-include ('TrkVertexSeedFinderTools/VertexSeedFinderTestCommon.py')
-
-
-from TrkVertexSeedFinderTools.TrkVertexSeedFinderToolsConf import \
-    Trk__VertexSeedFinderTestAlg, Trk__ImagingSeedFinder
-finder = Trk__ImagingSeedFinder ('ImagingSeedFinder', OutputLevel = INFO)
-testalg1 = Trk__VertexSeedFinderTestAlg ('testalg1',
-                                         OutputLevel = VERBOSE,
-                                         VertexSeedFinderTool = finder,
-                                         Expected3 = [ 0.933924,  -0.748513,  7.17455,
-                                                       -0.741989, -0.419237, -2.64877,
-                                                        1.73866,  -1.80412, 11.608,
-                                                       -0.124825,  0.14802, 13.4766,
-                                                        0.817835,  0.747413, 11.0648])
-topSequence += testalg1
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/src/ImagingSeedFinder.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/src/ImagingSeedFinder.cxx
deleted file mode 100644
index d680b119127f3cfadcdd2d88c446d07dd2f49334..0000000000000000000000000000000000000000
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/src/ImagingSeedFinder.cxx
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-/*********************************************************************
-          ImagingSeedFinder.cxx - Description in header file
-*********************************************************************/
-//#define ImagingSeedFinder
-
-#include "TrkVertexSeedFinderTools/ImagingSeedFinder.h"
-
-#include "TrkVertexSeedFinderUtils/IVertexImageMaker.h"
-#include "TrkVertexSeedFinderUtils/IVertexClusterFinder.h"
-
-#include "TrkParameters/TrackParameters.h"
-#include "TrkTrack/Track.h"
-#include "GaudiKernel/PhysicalConstants.h"
-
-//Amg
-#include "GeoPrimitives/GeoPrimitives.h"
-
-namespace Trk
-{
-
-  // --------------------------------------------------------------------------------
-  // ImagingSeedFinder constructor
-  ImagingSeedFinder::ImagingSeedFinder(const std::string& t, const std::string& n, const IInterface*  p) : 
-    base_class(t,n,p),
-    m_vertexImageMaker("Trk::VertexImageMaker", this),
-    m_VertexClusterFinder( "Trk::SimpleVertexClusterFinder", this)
-  {   
-
-    declareProperty("VertexImageMaker"        , m_vertexImageMaker         );
-    declareProperty("VertexCluster"           , m_VertexClusterFinder      );
-  } //End ImagingSeedFinder constructor
-
-
-  ImagingSeedFinder::~ImagingSeedFinder()
-  {
-  }
-
-
-  // --------------------------------------------------------------------------------
-  // ImagingSeedFinder inistialize
-  StatusCode ImagingSeedFinder::initialize() 
-  { 
-    ATH_MSG_INFO( "ImagingSeedFinder initialization..."  );
-
-    ATH_CHECK( m_vertexImageMaker.retrieve() );
-    ATH_CHECK( m_VertexClusterFinder.retrieve() );
-
-    return StatusCode::SUCCESS;
-
-  }// End ImagingSeedFinder initialize
-
-
-  // --------------------------------------------------------------------------------
-  // ImagingSeedFinder finalize
-  StatusCode ImagingSeedFinder::finalize() 
-  {
-
-    return StatusCode::SUCCESS;
-  }// End ImagingSeedFinder finalize
-
-
-  // --------------------------------------------------------------------------------
-  // ImagingSeedFinder find seed - based on vector of Trk::Track's
-  Amg::Vector3D ImagingSeedFinder::findSeed(const std::vector<const Trk::Track*> & vectorTrk,const xAOD::Vertex * constraint) const
-  {
-    std::vector<Amg::Vector3D> seeds =
-      findMultiSeeds( vectorTrk, constraint);
-
-    if (seeds.empty()) {
-      return Amg::Vector3D(0.,0.,0.);
-    }
-    return seeds[0];
-  } // End ImagingSeedFinder find seed - based on vector of Trk::Track's
-
-
-  // --------------------------------------------------------------------------------
-  // ImagingSeedFinder find seed - based on vector of Trk::ParametersBase
-  Amg::Vector3D ImagingSeedFinder::findSeed(const std::vector<const Trk::TrackParameters*> & parametersList,const xAOD::Vertex * constraint) const
-  {
-    std::vector<Amg::Vector3D> seeds =
-      findMultiSeeds( parametersList, constraint);
-
-    if (seeds.empty()) {
-      return Amg::Vector3D(0.,0.,0.);
-    }
-    return seeds[0];
-  } // End  ImagingSeedFinder find seed - based on vector of Trk::ParametersBase
-
-  // --------------------------------------------------------------------------------
-  // ImagingSeedFinder find multiseed - based on vector of Trk::Track's
-  std::vector<Amg::Vector3D> ImagingSeedFinder::findMultiSeeds(const std::vector<const Trk::Track*>&  vectorTrk ,const xAOD::Vertex *  constraint ) const {
- 
-    //create perigees from track list
-    std::vector<const Trk::TrackParameters*> perigeeList;
-    perigeeList.reserve (vectorTrk.size());
-
-    for (const Trk::Track* track : vectorTrk) {
-      if (isnan(track->perigeeParameters()->parameters()[Trk::d0])) {
-	continue;
-      }  
-      perigeeList.push_back(track->perigeeParameters());
-    }
-   
-    //create seed from perigee list
-    return findMultiSeeds(perigeeList,constraint);
-
-  } // End ImagingSeedFinder find multiseed - based on vector of Trk::Track's
-
-
-  // --------------------------------------------------------------------------------
-  // ImagingSeedFinder find multiseed - based on vector of Trk::ParametersBase
-  std::vector<Amg::Vector3D>
-  ImagingSeedFinder::findMultiSeeds(const std::vector<const Trk::TrackParameters*>& parametersList,
-                                    const xAOD::Vertex * constraint) const
-  {
-    ATH_MSG_DEBUG( "findMultiSeeds using ImagingSeedFinder has been called"  );
-
-    // Make the image from tracks, and immediately
-    std::unique_ptr<VertexImage> image =
-      m_vertexImageMaker->makeVertexImage( parametersList, constraint );
-
-    //Run clustering tool to find vertices
-    //Coordinates are relative to the center of the histogram (constraint or (0,0,0) if no constraint)
-    std::vector<Amg::Vector3D> vertices =
-      m_VertexClusterFinder->findVertexClusters( *image );
-
-    ATH_MSG_DEBUG( "Found " << vertices.size() << " candidate clusters"  );
- 
-    // Loop through the vertices in relative coordinate space, and set x,y to constraint if we have one.
-
-    int counter=0;
-    for (Amg::Vector3D& v : vertices) {
-      if(constraint) {
-        v = Amg::Vector3D (constraint->position().x(),
-                           constraint->position().y(),
-                           constraint->position().z() + v.z());
-      }		
-      ATH_MSG_DEBUG( "  Seed " << counter << " = ( " << v.x() << ", " << v.y() << ", " << v.z() << " )"  );
-
-      counter++;
-    }
-
-
-    return vertices;
-
-  } // End ImagingSeedFinder find multiseed - based on vector of Trk::ParametersBase
-
-
-} //End Trk namespace
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/src/components/TrkVertexSeedFinderTools_entries.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/src/components/TrkVertexSeedFinderTools_entries.cxx
index fcf71843aa5f255e937aeaf058aa4b159ec53dd7..61c159223e0990c09c75334c80a54770f97c51ce 100644
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/src/components/TrkVertexSeedFinderTools_entries.cxx
+++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/src/components/TrkVertexSeedFinderTools_entries.cxx
@@ -2,7 +2,6 @@
 #include "TrkVertexSeedFinderTools/CrossDistancesSeedFinder.h"
 #include "TrkVertexSeedFinderTools/DummySeedFinder.h"
 #include "TrkVertexSeedFinderTools/ZScanSeedFinder.h"
-#include "TrkVertexSeedFinderTools/ImagingSeedFinder.h"
 #include "TrkVertexSeedFinderTools/TrackDensitySeedFinder.h"
 #include "TrkVertexSeedFinderTools/IndexedCrossDistancesSeedFinder.h"
 #include "../VertexSeedFinderTestAlg.h"
@@ -13,7 +12,6 @@ DECLARE_COMPONENT( MCTrueSeedFinder )
 DECLARE_COMPONENT( CrossDistancesSeedFinder )
 DECLARE_COMPONENT( DummySeedFinder )
 DECLARE_COMPONENT( ZScanSeedFinder )
-DECLARE_COMPONENT( ImagingSeedFinder )
 DECLARE_COMPONENT( TrackDensitySeedFinder )
 DECLARE_COMPONENT( IndexedCrossDistancesSeedFinder )
 DECLARE_COMPONENT( VertexSeedFinderTestAlg )
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/CMakeLists.txt b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/CMakeLists.txt
index f16fc669b538b0500f89020f43c288b74020ffd5..a1aea6ce2a85ced9711a987b661fb689da18a4fc 100644
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/CMakeLists.txt
+++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/CMakeLists.txt
@@ -1,38 +1,9 @@
-# $Id: CMakeLists.txt 769975 2016-08-25 07:41:26Z krasznaa $
-################################################################################
-# Package: TrkVertexSeedFinderUtils
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( TrkVertexSeedFinderUtils )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs(
-   PUBLIC
-   Control/AthenaBaseComps
-   DetectorDescription/GeoPrimitives
-   Event/xAOD/xAODTracking
-   GaudiKernel
-   MagneticField/MagFieldConditions   # Exposed by NewtonTrkDistanceFinder.h and Trk2dDistanceSeeder.h
-   Tracking/TrkEvent/TrkParameters
-   Tracking/TrkEvent/TrkParticleBase
-   Tracking/TrkEvent/VxVertex
-   InnerDetector/InDetConditions/BeamSpotConditionsData
-   PRIVATE
-   AtlasTest/TestTools
-   Event/EventPrimitives
-   Event/xAOD/xAODTruth
-   InnerDetector/InDetConditions/InDetBeamSpotService
-   InnerDetector/InDetRecTools/InDetTrackSelectionTool
-   MagneticField/MagFieldElements
-   Tracking/TrkEvent/TrkEventPrimitives
-   Tracking/TrkEvent/TrkLinks
-   Tracking/TrkEvent/TrkTrack
-   Tracking/TrkVertexFitter/TrkVertexFitterInterfaces 
-   Tools/PathResolver )
-
 # External dependencies:
-find_package( FFTW )
 find_package( ROOT COMPONENTS Core Tree Hist )
 
 # Component(s) in the package:
@@ -40,87 +11,84 @@ atlas_add_library( TrkVertexSeedFinderUtilsLib
    TrkVertexSeedFinderUtils/*.h
    INTERFACE
    PUBLIC_HEADERS TrkVertexSeedFinderUtils
-   LINK_LIBRARIES AthenaBaseComps GaudiKernel TrkParameters GeoPrimitives
-   VxVertex TrkParticleBase xAODTracking BeamSpotConditionsData )
+   LINK_LIBRARIES  GaudiKernel AthenaBaseComps
+   TrkVertexFitterInterfaces TrkParameters GeoPrimitives xAODTracking
+   MagFieldConditions )
 
 atlas_add_component( TrkVertexSeedFinderUtils
-   src/*.cxx src/components/*.cxx
-   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${FFTW_INCLUDE_DIRS}
-   LINK_LIBRARIES ${ROOT_LIBRARIES} ${FFTW_LIBRARIES} EventPrimitives
-   xAODTruth InDetTrackSelectionToolLib MagFieldConditions MagFieldElements TrkEventPrimitives
-   TrkLinks TrkTrack TrkVertexFitterInterfaces TrkVertexSeedFinderUtilsLib )
-
-atlas_install_joboptions( share/*.py )
-atlas_install_joboptions( share/*.txt )
-
-
+   src/*.h src/*.cxx src/components/*.cxx
+   INCLUDE_DIRS  ${ROOT_INCLUDE_DIRS}
+   LINK_LIBRARIES  ${ROOT_LIBRARIES} GaudiKernel
+   AthenaBaseComps TrkParticleBase TrkParameters TrkLinks TrkTrack
+   TrkVertexFitterInterfaces TrkEventPrimitives xAODTracking xAODTruth
+   InDetTrackSelectionToolLib BeamSpotConditionsData EventPrimitives
+   GeoPrimitives MagFieldElements TrkVertexSeedFinderUtilsLib )
+
+# Test(s) in the package.
 atlas_add_test( NewtonTrkDistanceFinder_test
-                SOURCES test/NewtonTrkDistanceFinder_test.cxx
-                LINK_LIBRARIES ${ROOT_LIBRARIES} ${FFTW_LIBRARIES} TestTools
-                EventPrimitives
-                xAODTruth InDetTrackSelectionToolLib MagFieldConditions MagFieldElements PathResolver TrkEventPrimitives
-                TrkLinks TrkTrack TrkVertexFitterInterfaces TrkVertexSeedFinderUtilsLib
-                LOG_IGNORE_PATTERN "reading the map|field map" )
-
+   SOURCES test/NewtonTrkDistanceFinder_test.cxx
+           src/NewtonTrkDistanceFinder.cxx
+           src/PointOnTrack.cxx
+   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+   LINK_LIBRARIES ${ROOT_LIBRARIES} TestTools MagFieldConditions
+   MagFieldElements CxxUtils GaudiKernel PathResolver SGTools StoreGateLib
+   TrkEventPrimitives TrkVertexSeedFinderUtilsLib
+   LOG_IGNORE_PATTERN "reading the map|field map" )
 
 atlas_add_test( Trk2dDistanceSeeder_test
-                SOURCES test/Trk2dDistanceSeeder_test.cxx
-                LINK_LIBRARIES ${ROOT_LIBRARIES} ${FFTW_LIBRARIES} TestTools
-                EventPrimitives
-                xAODTruth InDetTrackSelectionToolLib MagFieldConditions MagFieldElements PathResolver TrkEventPrimitives
-                TrkLinks TrkTrack TrkVertexFitterInterfaces TrkVertexSeedFinderUtilsLib
-                LOG_IGNORE_PATTERN "reading the map|field map" )
+   SOURCES test/Trk2dDistanceSeeder_test.cxx
+           src/Trk2dDistanceSeeder.cxx
+           src/PointOnTrack.cxx
+           src/TwoTracks.cxx
+   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+   LINK_LIBRARIES ${ROOT_LIBRARIES} TestTools CxxUtils GaudiKernel PathResolver
+   SGTools StoreGateLib MagFieldConditions MagFieldElements TrkParameters
+   TrkVertexSeedFinderUtilsLib
+   LOG_IGNORE_PATTERN "reading the map|field map" )
 
 
 atlas_add_test( SeedNewtonTrkDistanceFinder_test
-                SOURCES test/SeedNewtonTrkDistanceFinder_test.cxx
-                LINK_LIBRARIES ${ROOT_LIBRARIES} ${FFTW_LIBRARIES} TestTools
-                EventPrimitives
-                xAODTruth InDetTrackSelectionToolLib MagFieldConditions MagFieldElements PathResolver TrkEventPrimitives
-                TrkLinks TrkTrack TrkVertexFitterInterfaces TrkVertexSeedFinderUtilsLib
-                LOG_IGNORE_PATTERN "reading the map|field map" )
-
+   SOURCES test/SeedNewtonTrkDistanceFinder_test.cxx
+   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+   LINK_LIBRARIES ${ROOT_LIBRARIES} TestTools CxxUtils GaudiKernel PathResolver
+   SGTools StoreGateLib MagFieldConditions MagFieldElements
+   TrkVertexSeedFinderUtilsLib
+   LOG_IGNORE_PATTERN "reading the map|field map" )
 
 atlas_add_test( Trk2DDistanceFinder_test
-                SOURCES test/Trk2DDistanceFinder_test.cxx
-                LINK_LIBRARIES ${ROOT_LIBRARIES} ${FFTW_LIBRARIES} TestTools
-                EventPrimitives
-                xAODTruth InDetTrackSelectionToolLib MagFieldConditions MagFieldElements PathResolver TrkEventPrimitives
-                TrkLinks TrkTrack TrkVertexFitterInterfaces TrkVertexSeedFinderUtilsLib
-                LOG_IGNORE_PATTERN "reading the map|field map" )
-
+   SOURCES test/Trk2DDistanceFinder_test.cxx
+   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+   LINK_LIBRARIES ${ROOT_LIBRARIES} TestTools CxxUtils GaudiKernel PathResolver
+   SGTools StoreGateLib MagFieldConditions MagFieldElements
+   TrkVertexSeedFinderUtilsLib
+   LOG_IGNORE_PATTERN "reading the map|field map" )
 
 atlas_add_test( GaussianTrackDensity_test
-                SOURCES test/GaussianTrackDensity_test.cxx
-                LINK_LIBRARIES ${ROOT_LIBRARIES} ${FFTW_LIBRARIES} TestTools
-                EventPrimitives
-                xAODTruth InDetTrackSelectionToolLib MagFieldConditions MagFieldElements TrkEventPrimitives
-                TrkLinks TrkTrack TrkVertexFitterInterfaces TrkVertexSeedFinderUtilsLib )
+   SOURCES test/GaussianTrackDensity_test.cxx
+           src/GaussianTrackDensity.cxx
+   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+   LINK_LIBRARIES ${ROOT_LIBRARIES} TestTools CxxUtils GaudiKernel TrkTrack
+   TrkEventPrimitives TrkVertexSeedFinderUtilsLib )
+
 # Needed to avoid spurious ubsan warnings.
 set_target_properties( TrkVertexSeedFinderUtils_GaussianTrackDensity_test PROPERTIES ENABLE_EXPORTS True )
 
-
-atlas_add_test( SimpleVertexClusterFinder_test
-                SOURCES test/SimpleVertexClusterFinder_test.cxx
-                LINK_LIBRARIES ${ROOT_LIBRARIES} ${FFTW_LIBRARIES} TestTools
-                EventPrimitives
-                xAODTruth InDetTrackSelectionToolLib MagFieldConditions MagFieldElements TrkEventPrimitives
-                TrkLinks TrkTrack TrkVertexFitterInterfaces TrkVertexSeedFinderUtilsLib )
-
-
 atlas_add_test( Mode3dFromFsmw1dFinder_test
-                SOURCES test/Mode3dFromFsmw1dFinder_test.cxx
-                LINK_LIBRARIES ${ROOT_LIBRARIES} ${FFTW_LIBRARIES} TestTools
-                EventPrimitives
-                xAODTruth InDetTrackSelectionToolLib MagFieldConditions MagFieldElements TrkEventPrimitives
-                TrkLinks TrkTrack TrkVertexFitterInterfaces TrkVertexSeedFinderUtilsLib )
+   SOURCES test/Mode3dFromFsmw1dFinder_test.cxx
+           src/Mode3dFromFsmw1dFinder.cxx
+   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+   LINK_LIBRARIES ${ROOT_LIBRARIES} TestTools CxxUtils GaudiKernel TrkParameters
+   TrkVertexSeedFinderUtilsLib )
+
 # Needed to avoid spurious ubsan warnings.
 set_target_properties( TrkVertexSeedFinderUtils_Mode3dFromFsmw1dFinder_test PROPERTIES ENABLE_EXPORTS True )
 
-
 atlas_add_test( Mode3dTo1dFinder_test
-                SOURCES test/Mode3dTo1dFinder_test.cxx
-                LINK_LIBRARIES ${ROOT_LIBRARIES} ${FFTW_LIBRARIES} TestTools
-                EventPrimitives
-                xAODTruth InDetTrackSelectionToolLib MagFieldConditions MagFieldElements TrkEventPrimitives
-                TrkLinks TrkTrack TrkVertexFitterInterfaces TrkVertexSeedFinderUtilsLib )
+   SOURCES test/Mode3dTo1dFinder_test.cxx
+           src/Mode3dTo1dFinder.cxx
+   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+   LINK_LIBRARIES ${ROOT_LIBRARIES} TestTools CxxUtils GaudiKernel TrkParameters
+   TrkVertexSeedFinderUtilsLib )
+
+# Install files from the package.
+atlas_install_joboptions( share/*.py share/*.txt )
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils/IVertexImageMaker.h b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils/IVertexImageMaker.h
deleted file mode 100644
index c52c9be6349b5e8e528c5ef965c6eb3725a90836..0000000000000000000000000000000000000000
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils/IVertexImageMaker.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-///////////////////////////////////////////////////////////////////
-//
-///////////////////////////////////////////////////////////////////
-
-#ifndef TRKVERTEXSEEDFINDERUTILS_IVERTEXIMAGEMAKER_H
-#define TRKVERTEXSEEDFINDERUTILS_IVERTEXIMAGEMAKER_H
-
-#include "GaudiKernel/IAlgTool.h"
-#include "TrkParameters/TrackParameters.h"
-#include "xAODTracking/Vertex.h"
-
-namespace Trk
-{
-  /**
-   @class IVertexImageMaker
-
-   Interface tool for vertex image maker
-
-   @author matthew.scott.rudolph@cern.ch
-
-   ------------------------------------
-   Changes:
-
-   David Shope <david.richard.shope@cern.ch> (2016-04-19)
-
-   EDM Migration to xAOD - from Trk::RecVertex to xAOD::Vertex
-
-   */
-
-  class VertexImage;
-
-  class IVertexImageMaker : virtual public IAlgTool {
-
-     public:
-       DeclareInterfaceID( IVertexImageMaker, 1, 0);
-
-
-       //Return a vertex image from the tracks centered around the constraint
-       virtual std::unique_ptr<VertexImage>
-       makeVertexImage( const std::vector<const Trk::TrackParameters*>& parametersList,
-                        const xAOD::Vertex * constraint ) const = 0;
-  };
-}
-
-#endif
-
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils/LocalMax1DClusterFinder.h b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils/LocalMax1DClusterFinder.h
deleted file mode 100644
index 72ed68d60aeec94ba827683a67b88f3530ae4429..0000000000000000000000000000000000000000
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils/LocalMax1DClusterFinder.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef TRKVERTEXSEEDFINDERUTILS_LOCALMAX1DCLUSTERFINDER_H
-#define TRKVERTEXSEEDFINDERUTILS_LOCALMAX1DCLUSTERFINDER_H
-
-#include "AthenaBaseComps/AthAlgTool.h"
-#include "TrkVertexSeedFinderUtils/IVertexClusterFinder.h"
-
-
-namespace Trk
-{
-
-  /**
-   @class LocalMax1DClusterFinder
-
-   Projection implementation of a cluster finder with interface IVertexClusterFinder for use with the imaging seed finder.  Adds all neighboring bins above threshold to cluster.
-
-   @author Matt Rudolph <matthew.scott.rudolph@cern.ch
-
-   ------------------------------------
-   Changes:
-
-   David Shope <david.richard.shope@cern.ch> (2016-04-19)
-
-   EDM Migration to xAOD - from Trk::Vertex to Amg::Vector3D
-
-   */
-
-  //Forward declarations.
-  class Vertex;
-  class VertexImage;
-
-  class LocalMax1DClusterFinder : public extends<AthAlgTool, IVertexClusterFinder>
-  {
-  public:
-    //default constructor due to Athena interface
-    LocalMax1DClusterFinder(const std::string& t, const std::string& n, const IInterface*  p);
-    
-    
-    virtual std::vector<Amg::Vector3D> findVertexClusters( const VertexImage & image ) const;
-
-    typedef std::pair<int, float> Projection;
-
-  private:
-
-    float m_weightThreshold;
-    float m_mergeParam;
-    float m_clusterWindowXY;
-    bool  m_refineZ;
-    bool  m_gaussianWindow;
-  };
-}
-#endif
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils/SimpleVertexClusterFinder.h b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils/SimpleVertexClusterFinder.h
deleted file mode 100644
index 3075ff9c3396d76300f50aa561518c7203f8eacb..0000000000000000000000000000000000000000
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils/SimpleVertexClusterFinder.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef TRKVERTEXSEEDFINDERUTILS_SIMPLEVERTEXCLUSTERFINDER_H
-#define TRKVERTEXSEEDFINDERUTILS_SIMPLEVERTEXCLUSTERFINDER_H
-
-#include "AthenaBaseComps/AthAlgTool.h"
-#include "TrkVertexSeedFinderUtils/IVertexClusterFinder.h"
-#include "TrkVertexSeedFinderUtils/VertexImage.h"
-
-namespace Trk
-{
-
-  /**
-   @class SimpleVertexClusterFinder
-
-   Simple implementation of a cluster finder with interface IVertexClusterFinder for use with the imaging seed finder.  Adds all neighboring bins above threshold to cluster.
-
-   @author Matt Rudolph <matthew.scott.rudolph@cern.ch
-   @author Lars ...
-
-   ------------------------------------
-   Changes:
-
-   David Shope <david.richard.shope@cern.ch> (2016-04-19)
-
-   EDM Migration to xAOD - from Trk::Vertex to Amg::Vector3D
-
-   */
-
-  class SimpleVertexClusterFinder : public extends<AthAlgTool, IVertexClusterFinder>
-  {
-  public:
-    //default constructor due to Athena interface
-    SimpleVertexClusterFinder(const std::string& t, const std::string& n, const IInterface*  p);
-    
-
-    //destructor
-    virtual ~SimpleVertexClusterFinder() = default;
-
-    
-    virtual std::vector<Amg::Vector3D> findVertexClusters( const VertexImage & image ) const override;
-
-  private:
-    float m_weightThreshold;
-    float m_seedCutScale;
-
-    typedef std::pair<int, float> binContent;
-    typedef std::vector<binContent> Cluster;
-
-    std::unique_ptr<Cluster>
-    highestCluster( const VertexImage& image,
-                    std::map<int, float>& binsRemaining ) const;
-
-    void addBinsToCluster( const VertexImage& image,
-                           Cluster& clust,
-                           Cluster::size_type oldEdge,
-                           std::map<int, float>& binsRemaining ) const;
-
-    void getCenter( const VertexImage& image,
-                    const Cluster& cl,
-                    float & xpos, float & ypos, float & zpos) const;
-
-  };
-}
-#endif
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils/VertexImage.h b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils/VertexImage.h
deleted file mode 100644
index e0fa2765d57aadf655ab912b5cce95e9af191767..0000000000000000000000000000000000000000
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils/VertexImage.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef TRKVERTEXSEEDFINDERUTILS_VERTEXIMAGE_H
-#define TRKVERTEXSEEDFINDERUTILS_VERTEXIMAGE_H
-
-#include <vector>
-
-namespace Trk {
-
-
-  // Class used to access vertex image resulting from track back-projection and filtering in ImagingSeedFinder
-
-  class VertexImage {
-
-  public:
-    typedef void arrayDeleter (void*);
-
-    // Construct with pointer to the array, numbers of bins in x,y,z
-    // and flag for whether fourier transforms were done in place.
-    // in-place filtering has extra padding in the array to fit the complex frequency space histogram
-    VertexImage( float* array,
-                 arrayDeleter* deleter,
-                 int nx, int ny, int nz, 
-                 float xrange, float yrange, float zrange);
-
-
-    ~VertexImage()
-    {
-      // Must be inline, because it may be called from another package,
-      // and this package makes only a component library.
-      m_deleter (m_hist_3d);
-    }
-
-    VertexImage (const VertexImage&) = delete;
-    VertexImage& operator= (const VertexImage&) = delete;
-
-    // Direct access to the histogram array
-          float * getHist()       { return m_hist_3d; }
-    const float * getHist() const { return m_hist_3d; }
-
-    // Get the row major index of an x,y,z bin
-    int getRMBin( const int & x, const int & y, const int & z ) const;
-    // Get the x,y,z values of bin index i
-    void getInvRMBin( const int & i, int & x, int & y, int &z ) const;
-
-    // Get the number of bins or array entries
-    int getNBinsX() const { return m_nbinsx; }
-    int getNBinsY() const { return m_nbinsy; }
-    int getNBinsZ() const { return m_nbinsz; }
-    int getNBins() const { return m_binstot; }
-    int getArraySize() const { return m_arraytot; }
-
-    // Get the actual relative (to histogram center) position
-    float getRelPosX(float binx) const { return -m_xrange + binx*m_wx; }
-    float getRelPosY(float biny) const { return -m_yrange + biny*m_wy; }
-    float getRelPosZ(float binz) const { return -m_zrange + binz*m_wz; } 
-
-    // Get the indices of all adjacent bins in 3D
-    std::vector<int> getAdjacentBins( int index ) const;
-
-    // -----------------------------------------------
-    // Get rectangular projections onto 1D z-direction
-    
-    // Project full range
-    std::vector<float> projectRectangleOnZ() const;
-    // Project specified rectangle from {x,y}min inclusive to {x,y}max exclusive
-    std::vector<float> projectRectangleOnZ( int xmin, int xmax, int ymin, int ymax ) const;
-    // Project bins within nsigma standard deviations of the mean of the image
-    std::vector<float> projectRectangleOnZ( float nsigmax, float nsigmay) const;
-
-    // -----------------------------------------------
-    // Fit centroid to 2D Gaussian by projecting onto xy-plane
-    // Returned values are in bins
-    void fitCentroid(float& x, float& y, float& sigmax, float& sigmay) const;
-    // Project on z using a Gaussian window
-    // Input parameters are in bins
-    std::vector<float> projectGaussianOnZ(float x, float y, float sigmax, float sigmay) const;
-    // Project on z using a Gaussian window
-    // Parameters of the Gaussian are found by fitting the xy-projection
-    std::vector<float> projectGaussianOnZ(float scaleFactor) const;
-
-  private:
-
-    // The actual histogram array
-    float * m_hist_3d;
-
-    // Function to delete the array.
-    arrayDeleter* m_deleter;
-
-    // Store number of bins in x,y,z
-    int m_nbinsx;
-    int m_nbinsy;
-    int m_nbinsz;
-    
-    // Physical (half) range of the histogram in x,y,z (spans from -range to +range)
-    float m_xrange;
-    float m_yrange;
-    float m_zrange;
-
-    // Total number of bins in the 3D histogram
-    int m_binstot;
-    // Total entries in the histogram array (different than binstot for in-place transforms)
-    int m_arraytot;
-
-    // Bin widths in the histogram
-    float m_wx;
-    float m_wy;
-    float m_wz;
-
-  };
-
-}
-
-#endif
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils/VertexImageMaker.h b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils/VertexImageMaker.h
deleted file mode 100644
index 299ca09828a81f90932dd4ffffaf7fd3a471a6a4..0000000000000000000000000000000000000000
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils/VertexImageMaker.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef TRKVERTEXSEEDFINDERUTILIS_SIMPLEVERTEXCLUSTERFINDER_H
-#define TRKVERTEXSEEDFINDERUTILIS_SIMPLEVERTEXCLUSTERFINDER_H
-
-#include "AthenaBaseComps/AthAlgTool.h"
-#include "TrkVertexSeedFinderUtils/IVertexImageMaker.h"
-#include "TrkVertexSeedFinderUtils/VertexImage.h"
-#include "xAODTracking/Vertex.h"
-
-//External library for fourier transforms
-#include "fftw3.h"
-
-namespace Trk
-{
-
-  /**
-   @class VertexImageMaker
-
-   Implementation of vertex imaging from tracks using fast fourier transform with FFTW3 and filtering
-
-   @author Matt Rudolph <matthew.scott.rudolph@cern.ch
-
-   ------------------------------------
-   Changes:
-
-   David Shope <david.richard.shope@cern.ch> (2016-04-19)
-
-   EDM Migration to xAOD - from Trk::RecVertex to xAOD::Vertex
-
-   */
-
-
-  class VertexImageMaker : public extends<AthAlgTool, IVertexImageMaker> {
-  public:
-    VertexImageMaker(const std::string& t, const std::string& n, const IInterface*  p);
-
-    virtual StatusCode initialize() override;
-    virtual StatusCode finalize() override;
-
-
-    virtual std::unique_ptr<VertexImage>
-    makeVertexImage( const std::vector<const Trk::TrackParameters*>& parametersList,
-                     const xAOD::Vertex * constraint ) const override;
-
-
-  private:
-    //------------
-    //Properties:
-
-    //Number of bins in histogram:
-    int    m_xbins;
-    int    m_ybins;
-    int    m_zbins;
-
-    float m_xrange; //Range around histogram center in position space
-    float m_yrange; 
-    float m_zrange;
-    
-    //Filter parameters
-    float m_a0Window;
-    float m_a1Window;
-    float m_a2Window;
-    float m_a3Window;
-    
-    int    m_cutoffFreqDenominator_xy;
-    int    m_cutoffFreqDenominator_z;
-
-    float  m_angularCutoffParameter;
-
-    //Other members:
-
-    //Widths of histogram bins
-    float m_wx;        
-    float m_wy;          
-    float m_wz;
-
-    //Total number of filter bins 
-    int m_filttot;
-
-    //The frequency space filter
-    std::vector<float> m_histFSFilter;
-
-    //the FFTW "plans" -- object that saves how the fourier transform is done
-    fftwf_plan m_plan_r2c;
-    fftwf_plan m_plan_c2r;
-
-    //Method implementing the backprojection into the real space histogram
-    void fillHist( VertexImage& image,
-                   const std::vector<const Trk::TrackParameters*>& parametersList,
-                   const xAOD::Vertex * constraint) const;
-
-    // Filtering methods   
-    void filterFSHist (VertexImage& image) const;
-    void initFSFilter();
-  };
-}
-#endif
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/share/SimpleVertexClusterFinder_test.ref b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/share/SimpleVertexClusterFinder_test.ref
deleted file mode 100644
index 421d4ce48025288b367d13e6de43fba00faff30d..0000000000000000000000000000000000000000
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/share/SimpleVertexClusterFinder_test.ref
+++ /dev/null
@@ -1,19 +0,0 @@
-TrkVertexSeedFinderUtils/SimpleVertexClusterFinder_test
-
-
-Initializing Gaudi ApplicationMgr using job opts /home/dcasper/Work/atlas/vtx/build/x86_64-centos7-gcc8-opt/jobOptions/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils_tests.txt
-JobOptionsSvc        INFO Job options successfully read in from /home/dcasper/Work/atlas/vtx/build/x86_64-centos7-gcc8-opt/jobOptions/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils_tests.txt
-ApplicationMgr    SUCCESS 
-====================================================================================================================================
-                                                   Welcome to ApplicationMgr (GaudiCoreSvc v33r1)
-                                          running on localhost.localdomain on Thu May 14 05:43:15 2020
-====================================================================================================================================
-ApplicationMgr       INFO Application Manager Configured successfully
-EventLoopMgr      WARNING Unable to locate service "EventSelector" 
-EventLoopMgr      WARNING No events will be processed from external input.
-ApplicationMgr       INFO Application Manager Initialized successfully
-ApplicationMgr Ready
-ToolSvc.Trk::Ve...   INFO Initializing frequency space filter
-ToolSvc.Trk::Ve...   INFO Allocating memory to fftw - Histogram size : 32 , 32 , 2048
-ToolSvc.Trk::Ve...   INFO Setting up FFTW plans
-test1
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/FsmwMode1dFinder.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/FsmwMode1dFinder.cxx
index 70338b49de7d0e86af05705279bb9c825ce31099..536899b89fadacad978cc85075352f4d97fea2f8 100644
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/FsmwMode1dFinder.cxx
+++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/FsmwMode1dFinder.cxx
@@ -9,9 +9,9 @@
 //#define FSMWMODE1DFINDER_DEBUG
 
 #include "TrkVertexSeedFinderUtils/FsmwMode1dFinder.h"
+#include <algorithm>
 #include <cmath>
 #include <vector>
-#include <algorithm>
 
 namespace Trk
 {
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/GaussianDensityTestAlg.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/GaussianDensityTestAlg.cxx
index acde5ef4f23b4213b60fc5346405849f8af563d1..67c1b5891bb78bdc03449c18a03be8ee8d9f7e3b 100644
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/GaussianDensityTestAlg.cxx
+++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/GaussianDensityTestAlg.cxx
@@ -15,8 +15,8 @@
 // FrameWork includes
 #include "Gaudi/Property.h"
 
-#include "xAODTracking/Vertex.h"
 #include "TrkLinks/LinkToXAODTrackParticle.h"
+#include "xAODTracking/Vertex.h"
 
 #include <limits>
 
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/GaussianTrackDensity.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/GaussianTrackDensity.cxx
index 146e7e668c011e8134bf8989217cfa14faacc421..7b8596274acf4db71c4235e13aada9ecb45d1841 100644
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/GaussianTrackDensity.cxx
+++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/GaussianTrackDensity.cxx
@@ -4,12 +4,12 @@
 
 #include "TrkVertexSeedFinderUtils/GaussianTrackDensity.h"
 
-#include "TrkTrack/Track.h"
-#include "TrkEventPrimitives/ParamDefs.h"
 #include "GaudiKernel/PhysicalConstants.h"
-#include <limits>
+#include "TrkEventPrimitives/ParamDefs.h"
+#include "TrkTrack/Track.h"
 #include <algorithm>
 #include <cmath>
+#include <limits>
 
 namespace Trk
 {
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/ImagingSeedTuningAlg.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/ImagingSeedTuningAlg.cxx
deleted file mode 100644
index c5582c8d102010cba204ecfc005227724e609671..0000000000000000000000000000000000000000
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/ImagingSeedTuningAlg.cxx
+++ /dev/null
@@ -1,615 +0,0 @@
-///////////////////////// -*- C++ -*- /////////////////////////////
-
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-// ImagingSeedTuningAlg.cxx 
-// Implementation file for class ImagingSeedTuningAlg
-// Author: Dave Casper <dcasper@uci.edu>
-/////////////////////////////////////////////////////////////////// 
-
-// TrkVertexSeedFinderUtils includes
-#include "ImagingSeedTuningAlg.h"
-
-// STL includes
-
-// FrameWork includes
-#include "Gaudi/Property.h"
-
-#include "InDetTrackSelectionTool/IInDetTrackSelectionTool.h"
-
-#include "TrkVertexFitterInterfaces/IVertexSeedFinder.h"
-#include "TrkVertexFitterInterfaces/IImpactPoint3dEstimator.h"
-
-#include "TrkVertexSeedFinderUtils/IVertexImageMaker.h"
-#include "TrkVertexSeedFinderUtils/IVertexClusterFinder.h"
-
-#include "TrkLinks/LinkToXAODTrackParticle.h"
-
-#include <limits>
-
-namespace Trk
-{
-/////////////////////////////////////////////////////////////////// 
-// Public methods: 
-/////////////////////////////////////////////////////////////////// 
-
-// Constructors
-////////////////
-ImagingSeedTuningAlg::ImagingSeedTuningAlg( const std::string& name, 
-			  ISvcLocator* pSvcLocator ) : 
-  ::AthAlgorithm( name, pSvcLocator ),
-  m_significanceTruthCut(3.0),
-  m_truthVertexTracks(2),
-  m_truthWindow(0.5),
-  m_useBeamConstraint(true),
-  m_trackFilter("InDet::InDetTrackSelectionTool"),
-  m_seedFinder("Trk::ImagingSeedFinder"),
-  m_impactPoint3dEstimator("Trk::ImpactPoint3dEstimator"),
-  m_iTHistSvc("THistSvc", name),
-  m_h_nTruthVertices(nullptr), m_h_zTruthVertices(nullptr), m_t_seeds(nullptr),
-  m_b_nTruth(0), m_b_nConditions(0), m_iCondition(0)
-{
-  //
-  // Property declaration
-  // 
-  declareProperty( "significanceTruthCut", m_significanceTruthCut );
-  declareProperty( "truthVertexTracks", m_truthVertexTracks );
-  declareProperty( "truthWindow", m_truthWindow );
-  declareProperty( "useBeamConstraint", m_useBeamConstraint );
-  declareProperty( "trackFilter", m_trackFilter );
-  declareProperty( "seedFinder", m_seedFinder );
-  declareProperty( "impactPoint3dEstimator", m_impactPoint3dEstimator );
-  declareProperty( "angularCutoffParameterValues", m_angularCutoffParameterValues );
-  declareProperty( "clusterWindowXYValues", m_clusterWindowXYValues );
-  declareProperty( "mergeParameterValues", m_mergeParameterValues );
-  declareProperty( "weightThresholdValues", m_weightThresholdValues );
-  declareProperty( "refineZValues", m_refineZValues );
-  declareProperty( "gaussianWindowValues", m_gaussianWindowValues );
-}
-
-// Destructor
-///////////////
-ImagingSeedTuningAlg::~ImagingSeedTuningAlg()
-= default;
-
-// Athena Algorithm's Hooks
-////////////////////////////
-StatusCode ImagingSeedTuningAlg::initialize()
-{
-  ATH_MSG_INFO ("Initializing " << name() << "...");
-
-  ATH_CHECK( m_trackParticlesKey.initialize() );
-  ATH_CHECK( m_truthEventsKey.initialize() );
-  ATH_CHECK( m_pileupEventsKey.initialize() );
-
-  Trk::IVertexSeedFinder* p_ivsf;
-  CHECK( m_seedFinder.retrieve(p_ivsf) );
-
-  SmartIF<IProperty> i_seedProp(p_ivsf);
-  if ( !i_seedProp.isValid() ) 
-  {
-    msg(MSG::FATAL) << "Failed to retrieve IProperty interface of " << m_seedFinder << endmsg;
-    return StatusCode::FAILURE;
-  }
-
-  std::string s_imageMaker;
-  CHECK( i_seedProp->getProperty("VertexImageMaker", s_imageMaker) );
-
-  std::string s_clusterFinder;
-  CHECK( i_seedProp->getProperty("VertexCluster", s_clusterFinder) );
-
-  Trk::IVertexImageMaker* p_ivim;
-  ToolHandle< Trk::IVertexImageMaker > h_imageMaker(s_imageMaker);
-  CHECK( h_imageMaker.retrieve(p_ivim) );
-
-  Trk::IVertexClusterFinder* p_ivcf;
-  ToolHandle< Trk::IVertexClusterFinder > h_clusterFinder(s_clusterFinder);
-  CHECK( h_clusterFinder.retrieve(p_ivcf) ); 
-
-  m_imageMakerProperty = SmartIF<IProperty>(p_ivim);
-  if ( !m_imageMakerProperty.isValid() ) 
-  {
-    msg(MSG::FATAL) << "Failed to retrieve IProperty interface for " << s_imageMaker << endmsg;
-    return StatusCode::FAILURE;
-  }
-
-  m_clusterFinderProperty = SmartIF<IProperty>(p_ivcf);
-  if ( !m_clusterFinderProperty.isValid() ) 
-  {
-    msg(MSG::FATAL) << "Failed to retrieve IProperty interface for " << s_clusterFinder << endmsg;
-    return StatusCode::FAILURE;
-  }
-
-  CHECK( m_impactPoint3dEstimator.retrieve() );
-
-  CHECK( m_trackFilter.retrieve() );
-
-  // setup histograms/trees
-  m_h_nTruthVertices = new TH1F("nTruthVtx", "N truth vertices", 60, 0.0, 60.0);
-  m_h_zTruthVertices = new TH1F("zTruthVtx","z (visible truth vertices)",100,-200.0,200.0);
-  m_t_seeds          = new TTree("seeds","seeds");
-
-  CHECK( m_iTHistSvc->regHist("/file1/h/truthVertices", m_h_nTruthVertices) );
-  CHECK( m_iTHistSvc->regHist("/file1/h/zTruthVtx", m_h_zTruthVertices) );
-  CHECK( m_iTHistSvc->regTree("/file1/t/seeds", m_t_seeds) );
-
-  m_t_seeds->Branch("nTruth", &m_b_nTruth, "nTruth/I");
-  m_t_seeds->Branch("nConditions", &m_b_nConditions, "nConditions/I");
-  m_t_seeds->Branch("nGoodTruth", &m_b_nGoodTruth, "nGoodTruth[nConditions]/I");
-  m_t_seeds->Branch("nSeeds", &m_b_nSeeds, "nSeeds[nConditions]/I");
-  m_t_seeds->Branch("nGoodSeeds", &m_b_nGoodSeeds, "nGoodSeeds[nConditions]/I");
-  m_t_seeds->Branch("nLost", &m_b_nLost, "nLost[nConditions]/I");
-  m_t_seeds->Branch("nFake", &m_b_nFake, "nFake[nConditions]/I");
-  m_t_seeds->Branch("nSplit", &m_b_nSplit, "nSplit[nConditions]/I");
-  m_t_seeds->Branch("nMerge", &m_b_nMerge, "nMerge[nConditions]/I");
-  m_t_seeds->Branch("angularCutoff", &m_b_angularCutoffParameter, "angularCutoff[nConditions]/F");
-  m_t_seeds->Branch("weightThreshold", &m_b_weightThreshold, "weightThreshold[nConditions]/F");
-  m_t_seeds->Branch("mergeParameter", &m_b_mergeParameter, "mergeParameter[nConditions]/F");
-  m_t_seeds->Branch("clusterWindowXY", &m_b_clusterWindowXY, "clusterWindowXY[nConditions]/F");
-  m_t_seeds->Branch("refineZ", &m_b_refineZ, "refineZ[nConditions]/I1");
-  m_t_seeds->Branch("gaussianWindow", &m_b_gaussianWindow, "gaussianWindow[nConditions]/I1");
-
-  m_b_nConditions = m_angularCutoffParameterValues.size() *
-    m_clusterWindowXYValues.size()*
-    m_mergeParameterValues.size()*
-    m_weightThresholdValues.size()*
-    m_refineZValues.size()*
-    m_gaussianWindowValues.size();
-
-  ATH_CHECK(m_beamSpotKey.initialize());
-    
-  return StatusCode::SUCCESS;
-}
-
-StatusCode ImagingSeedTuningAlg::finalize()
-{
-  ATH_MSG_INFO ("Finalizing " << name() << "...");
-
-  std::vector<std::pair<std::string, std::pair<float,float> > > performance;
-  typedef std::pair<std::string, std::pair<float, float> > performance_entry;
-  for (auto & allTruth : m_allTruth)
-  {
-    std::string desc = allTruth.first;
-    int nAllTruth = allTruth.second;
-    int nAllSeeds = m_allSeeds[desc];
-    int nFake = m_nFake[desc];
-    int nLost = m_nLost[desc];
-    int nSplit = m_nSplit[desc];
-    int nMerge = m_nMerge[desc];
-    float efficiency = ((float)(nAllTruth - nLost - nMerge))/((float)nAllTruth);
-    float purity = ((float)(nAllSeeds - nFake - nSplit))/((float)nAllSeeds);
-    std::pair<float,float> p(efficiency, purity);
-    performance.emplace_back(desc, p);
-  }
-  std::sort(performance.begin(), performance.end(), [](const performance_entry& a, const performance_entry& b) 
-	    {return a.second.first*a.second.second > b.second.first*b.second.second;});
-
-  int nPrint = 0;
-  for (auto & p : performance)
-  {
-    ATH_MSG_ALWAYS("SeedPerformance for: " << p.first);
-    ATH_MSG_ALWAYS("efficiency: " << p.second.first << ", purity:" << p.second.second << ", product: " << 
-		   p.second.first*p.second.second);
-    float lossRate = ((float)m_nLost[p.first])/m_allTruth[p.first];
-    float mergeRate = ((float)m_nMerge[p.first])/m_allTruth[p.first];
-    float fakeRate = ((float)m_nFake[p.first])/m_allSeeds[p.first];
-    float splitRate = ((float)m_nSplit[p.first])/m_allSeeds[p.first];
-    float simpleEfficiency = ((float)m_goodTruth[p.first]/m_allTruth[p.first]);
-    float simplePurity = ((float)m_goodSeeds[p.first]/m_allSeeds[p.first]);
-    ATH_MSG_ALWAYS("Simple efficiency: " << simpleEfficiency << ", Simple purity: " << simplePurity);
-    ATH_MSG_ALWAYS("Loss: " << lossRate << ", Merge: " << mergeRate << ", Fake: " << fakeRate << ", Split:" << splitRate);
-    ATH_MSG_ALWAYS("----------------------");
-    nPrint++;
-    if (nPrint >= 0.01*performance.size()) break;
-  }
-  return StatusCode::SUCCESS;
-}
-
-StatusCode ImagingSeedTuningAlg::execute()
-{  
-  ATH_MSG_DEBUG ("Executing " << name() << "...");
-
-  SG::ReadHandle<xAOD::TrackParticleContainer> trackParticles(m_trackParticlesKey);
-
-  std::vector<Trk::ITrackLink*> trackVector;
-  selectTracks(trackParticles.cptr(), trackVector);
-
-  std::vector<const Trk::TrackParameters*> perigeeList;
-  analyzeTracks(trackVector, perigeeList);
-
-  std::vector<Amg::Vector3D> truth;
-  CHECK( findTruth(trackVector, truth) );
-  m_h_nTruthVertices->Fill((float) truth.size());
-  m_b_nTruth = truth.size();
-  for (auto & v : truth) m_h_zTruthVertices->Fill(v[2]);
-
-  xAOD::Vertex theConstraint;
-  theConstraint.makePrivateStore();
-  if (m_useBeamConstraint)
-  {
-    SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey };
-    theConstraint.setPosition(beamSpotHandle->beamVtx().position());
-    theConstraint.setCovariancePosition(beamSpotHandle->beamVtx().covariancePosition());
-    theConstraint.setFitQuality(beamSpotHandle->beamVtx().fitQuality().chiSquared(), beamSpotHandle->beamVtx().fitQuality().doubleNumberDoF());
-  }
-
-  bool done = true;
-  std::string conditions;
-  CHECK( initializeConditions(conditions) );
-  do
-  {
-    std::vector<Amg::Vector3D> seeds;
-    if (m_useBeamConstraint)
-    {
-      seeds = m_seedFinder->findMultiSeeds(perigeeList, &theConstraint);
-    } else {
-      seeds = m_seedFinder->findMultiSeeds(perigeeList);
-    }
-    analyzeSeeds(conditions, seeds, truth);
-    CHECK( iterateConditions(conditions, done) );
-  } while (!done);
-
-  m_t_seeds->Fill();
-
-  return StatusCode::SUCCESS;
-}
-
-/////////////////////////////////////////////////////////////////// 
-// Non-const methods: 
-/////////////////////////////////////////////////////////////////// 
-
-StatusCode ImagingSeedTuningAlg::initializeConditions(std::string& conditions)
-{
-  m_i_angularCutoffParameter = m_angularCutoffParameterValues.begin();
-  m_i_clusterWindowXY        = m_clusterWindowXYValues.begin();
-  m_i_mergeParameter         = m_mergeParameterValues.begin();
-  m_i_weightThreshold        = m_weightThresholdValues.begin();
-  m_i_refineZ                = m_refineZValues.begin();
-  m_i_gaussianWindow         = m_gaussianWindowValues.begin();
-
-  m_iCondition = 0;
-
-  CHECK( setupConditions(conditions) );
-
-  return StatusCode::SUCCESS;
-}
-
-StatusCode ImagingSeedTuningAlg::iterateConditions(std::string& conditions, bool& done)
-{
-  done = true;
-  conditions = "done";
-  m_iCondition++;
-
-  if (++m_i_angularCutoffParameter == m_angularCutoffParameterValues.end())
-  {
-    m_i_angularCutoffParameter = m_angularCutoffParameterValues.begin();
-    if (++m_i_clusterWindowXY == m_clusterWindowXYValues.end())
-    {
-      m_i_clusterWindowXY = m_clusterWindowXYValues.begin();
-      if (++m_i_mergeParameter == m_mergeParameterValues.end())
-      {
-	m_i_mergeParameter = m_mergeParameterValues.begin();
-	if (++m_i_weightThreshold == m_weightThresholdValues.end())
-	{
-	  m_i_weightThreshold = m_weightThresholdValues.begin();
-	  if (++m_i_refineZ == m_refineZValues.end())
-	  {
-	    m_i_refineZ = m_refineZValues.begin();
-	    if (++m_i_gaussianWindow == m_gaussianWindowValues.end())
-	    {
-	      return StatusCode::SUCCESS;
-	    }
-	  }
-	}
-      }
-    }
-  }
-
-  CHECK( setupConditions(conditions) );
-  done = false;
-  return StatusCode::SUCCESS;
-}
-
-StatusCode ImagingSeedTuningAlg::setupConditions(std::string& conditions)
-{
-  m_b_gaussianWindow[m_iCondition] = *m_i_gaussianWindow;
-  m_b_refineZ[m_iCondition] = *m_i_refineZ;
-  m_b_weightThreshold[m_iCondition] = *m_i_weightThreshold;
-  m_b_mergeParameter[m_iCondition] = *m_i_mergeParameter;
-  m_b_clusterWindowXY[m_iCondition] = *m_i_clusterWindowXY;
-  m_b_angularCutoffParameter[m_iCondition] = *m_i_angularCutoffParameter;
-
-  std::string gaussianWindow = std::to_string(*m_i_gaussianWindow);
-  std::string refineZ = std::to_string(*m_i_refineZ);
-  std::string weightThreshold = std::to_string(*m_i_weightThreshold);
-  std::string mergeParameter = std::to_string(*m_i_mergeParameter);
-  std::string clusterWindowXY = std::to_string(*m_i_clusterWindowXY);
-  std::string angularCutoffParameter = std::to_string(*m_i_angularCutoffParameter);
-
-  CHECK( m_imageMakerProperty->setProperty("angularCutoffParameter", angularCutoffParameter) );
-  CHECK( m_clusterFinderProperty->setProperty("clusterWindowXY", clusterWindowXY) );
-  CHECK( m_clusterFinderProperty->setProperty("mergeParameter", mergeParameter) );
-  CHECK( m_clusterFinderProperty->setProperty("weightThreshold", weightThreshold) );
-  CHECK( m_clusterFinderProperty->setProperty("refineZ", refineZ) );
-  CHECK( m_clusterFinderProperty->setProperty("gaussianWindow", gaussianWindow) );
-
-  conditions = "\ngaussianWindow:";
-  conditions += gaussianWindow;
-  conditions += "\nrefineZ:";
-  conditions += refineZ;
-  conditions += "\nweightThreshold:";
-  conditions += weightThreshold;
-  conditions += "\nmergeParameter:";
-  conditions += mergeParameter;
-  conditions += "\nclusterWindowXY:";
-  conditions += clusterWindowXY;
-  conditions += "\nangularCutoffParameter:";
-  conditions += angularCutoffParameter;
-
-  return StatusCode::SUCCESS;
-}
-
-void ImagingSeedTuningAlg::analyzeSeeds(const std::string& conditions,
-					const std::vector<Amg::Vector3D>& seeds, 
-					const std::vector<Amg::Vector3D>& truth)
-{
-  // simple analysis - count seeds that have a true vertex close to them
-  m_allTruth[conditions] += truth.size();
-  m_allSeeds[conditions] += seeds.size();
-  m_b_nSeeds[m_iCondition] = seeds.size();
-  int goodSeeds = 0;
-  for (auto& seed : seeds) {
-    for (auto& tru : truth) {
-      if (std::abs(seed[2] - tru[2]) <= m_truthWindow) {
-	goodSeeds++;
-	break;
-      }
-    }
-  }
-  // simple analysis - count truth vertices that have a seed close to them
-  m_goodSeeds[conditions] += goodSeeds;
-  m_b_nGoodSeeds[m_iCondition] = goodSeeds;
-  int goodTruth = 0;
-  for (auto& tru : truth) {
-    for (auto& seed : seeds) {
-      if (std::abs(seed[2] - tru[2]) <= m_truthWindow){
-	goodTruth++;
-	break;
-      }
-    }
-  }
-  m_goodTruth[conditions] += goodTruth;
-  m_b_nGoodTruth[m_iCondition] = goodTruth;
-
-  // more careful analysis - match seeds and truth
-  std::map<float, float > nearestSeed;
-  std::map<float, float > nearestTruth;
-  m_b_nLost[m_iCondition] = 0;
-  m_b_nFake[m_iCondition] = 0;
-  m_b_nSplit[m_iCondition] = 0;
-  m_b_nMerge[m_iCondition] = 0;
-  for (auto & tru : truth) {
-    nearestSeed[tru[2]] = std::numeric_limits<float>::infinity();
-    for (auto & seed : seeds) {
-      if (std::abs(seed[2] - tru[2]) < 
-	  std::min(m_truthWindow, std::abs(nearestSeed[tru[2]] - tru[2])))
-      {
-	nearestSeed[tru[2]] = seed[2];
-      }
-    }
-    // if a true vertex is not close to any seed, it is "lost"
-    if (nearestSeed[tru[2]] == std::numeric_limits<float>::infinity())
-    {
-      m_b_nLost[m_iCondition]++;
-      m_nLost[conditions]++;
-    }
-  }
-  for (auto & seed : seeds) {
-    nearestTruth[seed[2]] = std::numeric_limits<float>::infinity();
-    for (auto & tru : truth) {
-      if (std::abs(tru[2] - seed[2]) < 
-	  std::min(m_truthWindow, std::abs(nearestTruth[seed[2]] - seed[2])))
-      {
-	nearestTruth[seed[2]] = tru[2];
-      }
-    }
-    // if a seed is not close to any true vertex, it is a "fake"
-    if (nearestTruth[seed[2]] == std::numeric_limits<float>::infinity())
-    {
-      m_b_nFake[m_iCondition]++;
-      m_nFake[conditions]++;
-    }
-  }
-  // if a true vertex is closest to > 1 seed, that true vertex has been "split"
-  for (auto & tru : truth)
-  {
-    if (nearestSeed[tru[2]] == std::numeric_limits<float>::infinity()) continue;
-    int nClosest = 0; // number of seeds that this true vertex is closest to
-    for (auto & seed : seeds)
-    {
-      if (nearestTruth[seed[2]] == tru[2]) nClosest++;
-    }
-    if (nClosest > 1) 
-    {
-      m_nSplit[conditions] += (nClosest - 1);
-      m_b_nSplit[m_iCondition] += (nClosest - 1);
-    }
-  }
-  // if a seed is closest to > 1 true vertex, those true vertices have been "merged"
-  for (auto & seed : seeds)
-  {
-    if (nearestTruth[seed[2]] == std::numeric_limits<float>::infinity()) continue;
-    int nClosest = 0; // number of truth vertices that this seed is closest to
-    for (auto & tru : truth)
-    {
-      if (nearestSeed[tru[2]] == seed[2]) nClosest++;
-    }
-    if (nClosest > 1) 
-    {
-      m_nMerge[conditions] += (nClosest - 1);
-      m_b_nMerge[m_iCondition] += (nClosest - 1);
-    }
-  }
-}
-
-void ImagingSeedTuningAlg::analyzeTracks(const std::vector<Trk::ITrackLink*>& trackVector,
-					 std::vector<const Trk::TrackParameters*>& perigeeList)
-{
-  for (auto seedtrkAtVtxIter = trackVector.begin();
-       seedtrkAtVtxIter != trackVector.end();
-       ++seedtrkAtVtxIter) 
-  {
-    perigeeList.push_back( (*seedtrkAtVtxIter)->parameters() );
-  }
-}
-
-void ImagingSeedTuningAlg::selectTracks(const xAOD::TrackParticleContainer* trackParticles, 
-					std::vector<Trk::ITrackLink*>& trackVector)
-{
-  bool selectionPassed{false};
-  const InDet::BeamSpotData* beamdata = nullptr;
-  if(m_useBeamConstraint){
-     SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey };
-     beamdata =  beamSpotHandle.retrieve();
-  }
-  for (auto itr  = trackParticles->begin(); itr != trackParticles->end(); ++itr) {
-    if (m_useBeamConstraint) {
-      xAOD::Vertex beamposition;
-      beamposition.makePrivateStore();
-      beamposition.setPosition(beamdata->beamVtx().position());
-      beamposition.setCovariancePosition(beamdata->beamVtx().covariancePosition());
-      selectionPassed=static_cast<bool> (m_trackFilter->accept(**itr,&beamposition));
-    }
-    else
-    {
-      xAOD::Vertex null;
-      null.makePrivateStore();
-      null.setPosition(Amg::Vector3D(0,0,0));
-      AmgSymMatrix(3) vertexError;
-      vertexError.setZero();
-      null.setCovariancePosition(vertexError);
-      selectionPassed=static_cast<bool>(m_trackFilter->accept(**itr,&null));
-    }
-    if (selectionPassed)
-    {
-      ElementLink<xAOD::TrackParticleContainer> link;
-      link.setElement(*itr);
-      Trk::LinkToXAODTrackParticle * linkTT = new Trk::LinkToXAODTrackParticle(link);
-      linkTT->setStorableObject(*trackParticles);
-      trackVector.push_back(linkTT);
-    }
-  }
-}
-
-/////////////////////////////////////////////////////////////////// 
-// Const methods: 
-///////////////////////////////////////////////////////////////////
-StatusCode ImagingSeedTuningAlg::findTruth(const std::vector<Trk::ITrackLink*>& trackVector, std::vector<Amg::Vector3D>& truth) const
-{
-    xAOD::TrackParticle::ConstAccessor<ElementLink<xAOD::TruthParticleContainer> > truthParticleAssoc("truthParticleLink");
-
-    SG::ReadHandle<xAOD::TruthEventContainer> signalEvents(m_truthEventsKey);
-
-    for (const xAOD::TruthEventBase* evt : *signalEvents)
-    {
-      const xAOD::TruthVertex* vLink = *(evt->truthVertexLink(0));
-      Amg::Vector3D vTruth(Amg::Vector3D(vLink->x(),vLink->y(),vLink->z()));
-      int nGoodTracks = 0;
-      for (auto trk : trackVector)
-      {
-	Trk::LinkToXAODTrackParticle* lxtp = dynamic_cast<Trk::LinkToXAODTrackParticle*>(trk);
-        if (lxtp)
-	{
-	  bool isAssoc = truthParticleAssoc(**(*lxtp)).isValid();
-	  if (isAssoc)
-	  {
-	    auto assocParticle = truthParticleAssoc(**(*lxtp));
-	    for (const auto& truthParticle : evt->truthParticleLinks())
-	    {
-	      if (assocParticle == truthParticle)
-	      {
-		double error;
-		double distance = distanceAndError(trk->parameters(), &vTruth, error);
-		if (distance < m_significanceTruthCut * error) nGoodTracks++;
-		break;
-	      }
-	    }
-	  }
-	}
-	if (nGoodTracks >= m_truthVertexTracks)
-	{
-	  truth.push_back(vTruth);
-	  break;
-	}
-      }
-    }
-    SG::ReadHandle<xAOD::TruthPileupEventContainer> pileupEvents(m_pileupEventsKey);
-
-    for (const xAOD::TruthEventBase* evt : *pileupEvents)
-    {
-      const xAOD::TruthVertex* vLink = *(evt->truthVertexLink(0));
-      Amg::Vector3D vTruth(Amg::Vector3D(vLink->x(),vLink->y(),vLink->z()));
-      int nGoodTracks = 0;
-      for (auto trk : trackVector)
-      {
-	Trk::LinkToXAODTrackParticle* lxtp = dynamic_cast<Trk::LinkToXAODTrackParticle*>(trk);
-	bool isAssoc = truthParticleAssoc(**(*lxtp)).isValid();
-	if (isAssoc)
-	{
-	  auto assocParticle = truthParticleAssoc(**(*lxtp));
-	  for (const auto& truthParticle : evt->truthParticleLinks())
-	  {
-	    if (assocParticle == truthParticle)
-	    {
-	      double error;
-	      double distance = distanceAndError(trk->parameters(), &vTruth, error);
-	      if (distance < m_significanceTruthCut * error) nGoodTracks++;
-	      break;
-	    }
-	  }
-	}
-	if (nGoodTracks >= m_truthVertexTracks)
-	{
-	  truth.push_back(vTruth);
-	  break;
-	}
-      }
-    }
-    return StatusCode::SUCCESS;
-}
-
-double ImagingSeedTuningAlg::distanceAndError(const Trk::TrackParameters* params, const Amg::Vector3D * vertex, double & error) const
-{
-    //find distance safely
-    double distance=0.;
-    try {
-      std::unique_ptr<Trk::PlaneSurface> mySurface=m_impactPoint3dEstimator->Estimate3dIP(params,vertex,distance);
-    }
-    catch (error::ImpactPoint3dEstimatorProblem err) {
-      msg(MSG::WARNING) << " ImpactPoin3dEstimator failed to find minimum distance between track and vertex seed: " << 
-        err.p << endmsg;
-    }
-    if (distance<0) {
-      msg(MSG::WARNING) << " Distance between track and seed vtx is negative: " << distance << endmsg;
-    }
-    //very approximate error
-    error= 0.;
-  
-    if(params) {
-      error = std::sqrt( (*params->covariance())(Trk::d0,Trk::d0) + (*params->covariance())(Trk::z0,Trk::z0) );
-    }
-      
-    if (error==0.) {
-      msg(MSG::ERROR) << " Error is zero! " << distance << endmsg;
-      error=1.;
-    }
-    msg(MSG::VERBOSE) << " Distance between track and seed vtx: " << distance << " d/s(d) = " << 
-      distance/error << " err " << error << endmsg;
-
-    return distance;
-}
-
-
-} // namespace
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/ImagingSeedTuningAlg.h b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/ImagingSeedTuningAlg.h
deleted file mode 100644
index c812dd8b933ef97215b277a7345446d3e67b2c08..0000000000000000000000000000000000000000
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/ImagingSeedTuningAlg.h
+++ /dev/null
@@ -1,202 +0,0 @@
-///////////////////////// -*- C++ -*- /////////////////////////////
-
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// ImagingSeedTuningAlg.h 
-// Header file for class ImagingSeedTuningAlg
-// Author: D.Casper<dcasper@uci.edu>
-/////////////////////////////////////////////////////////////////// 
-#ifndef TRKVERTEXSEEDFINDERUTILS_IMAGINGSEEDTUNINGALG_H
-#define TRKVERTEXSEEDFINDERUTILS_IMAGINGSEEDTUNINGALG_H 1
-
-// STL includes
-#include <string>
-#include <vector>
-#include <map>
-
-// FrameWork includes
-#include "AthenaBaseComps/AthAlgorithm.h"
-#include "GaudiKernel/ToolHandle.h"
-#include "GaudiKernel/ServiceHandle.h"
-#include "GaudiKernel/ITHistSvc.h"
-
-#include "TrkParticleBase/TrackParticleBaseCollection.h"
-#include "TrkParameters/TrackParameters.h"
-
-#include "xAODTracking/TrackParticleContainer.h"
-#include "xAODTracking/VertexContainer.h"
-#include "xAODTruth/TruthEventContainer.h"
-#include "xAODTruth/TruthPileupEventContainer.h"
-
-//Amg
-#include "GeoPrimitives/GeoPrimitives.h"
-
-#include "TH1F.h"
-#include "TTree.h"
-
-#include "BeamSpotConditionsData/BeamSpotData.h"
-
-namespace InDet
-{
-  class IInDetTrackSelectionTool;
-}
-
-namespace Trk
-{
-  class Track;
-  class ITrackLink;
-  class IVertexSeedFinder;
-  class IImpactPoint3dEstimator;
-
-class ImagingSeedTuningAlg
-  : public ::AthAlgorithm
-{ 
-
-  /////////////////////////////////////////////////////////////////// 
-  // Public methods: 
-  /////////////////////////////////////////////////////////////////// 
- public: 
-
-  // Copy constructor: 
-
-  /// Constructor with parameters: 
-  ImagingSeedTuningAlg( const std::string& name, ISvcLocator* pSvcLocator );
-
-  /// Destructor: 
-  virtual ~ImagingSeedTuningAlg(); 
-
-  // Assignment operator: 
-  //ImagingSeedTuningAlg &operator=(const ImagingSeedTuningAlg &alg); 
-
-  // Athena algorithm's Hooks
-  virtual StatusCode  initialize();
-  virtual StatusCode  execute();
-  virtual StatusCode  finalize();
-
- private:
-  /////////////////////////////////////////////////////////////////// 
-  // Const methods: 
-  ///////////////////////////////////////////////////////////////////
-  // compute track distance of approach to vertex
-  double distanceAndError(const Trk::TrackParameters* params, const Amg::Vector3D * vertex, double & err) const;
-
-  // routine to identify visible truth vertices
-  StatusCode findTruth(const std::vector<Trk::ITrackLink*> & trackVector, std::vector<Amg::Vector3D>& truth) const;
-
-  /////////////////////////////////////////////////////////////////// 
-  // Non-const methods: 
-  /////////////////////////////////////////////////////////////////// 
-  void selectTracks(const xAOD::TrackParticleContainer* trackParticles, std::vector<Trk::ITrackLink*> & trackVector);
-
-  void analyzeTracks(const std::vector<Trk::ITrackLink*> & trackVector, std::vector<const Trk::TrackParameters*>& perigeeList);
-
-  void analyzeSeeds(const std::string& conditions, const std::vector<Amg::Vector3D>& seeds, const std::vector<Amg::Vector3D>& truth);
-
-  StatusCode initializeConditions(std::string& conditions);
-
-  StatusCode iterateConditions(std::string& conditions, bool& done);
-
-  StatusCode setupConditions(std::string& conditions);
-  /////////////////////////////////////////////////////////////////// 
-  // Private data: 
-  /////////////////////////////////////////////////////////////////// 
- private: 
-  // Properties
-  // Reco track must pass within this many sigma of interaction vertex to be "good"
-  double m_significanceTruthCut;
-
-  // This many good reco tracks required for truth vertex to be "good"
-  int m_truthVertexTracks;
-
-  // Window around truth vertex for a seed to be "good"
-  double m_truthWindow;
-
-  // Use beam spot?
-  bool m_useBeamConstraint;
-
-  // Input parameter ranges
-  std::vector<float> m_angularCutoffParameterValues;
-  std::vector<float> m_clusterWindowXYValues;
-  std::vector<float> m_mergeParameterValues;
-  std::vector<float> m_weightThresholdValues;
-  std::vector<bool>  m_refineZValues;
-  std::vector<bool>  m_gaussianWindowValues;
-
-  // Tools
-  ToolHandle< InDet::IInDetTrackSelectionTool > m_trackFilter;
-  ToolHandle< Trk::IVertexSeedFinder > m_seedFinder;
-  ToolHandle< Trk::IImpactPoint3dEstimator > m_impactPoint3dEstimator;
-
-  // Non-property private data
-  
-  // Results
-  std::map<std::string, int> m_allSeeds;
-  std::map<std::string, int> m_allTruth;
-  std::map<std::string, int> m_goodSeeds;
-  std::map<std::string, int> m_goodTruth;
-  std::map<std::string, int> m_nFake;
-  std::map<std::string, int> m_nLost;
-  std::map<std::string, int> m_nSplit;
-  std::map<std::string, int> m_nMerge;
-  // IProperty handles
-  SmartIF<IProperty> m_imageMakerProperty;
-  SmartIF<IProperty> m_clusterFinderProperty;
-
-  SG::ReadCondHandleKey<InDet::BeamSpotData> m_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" };
-  ServiceHandle< ITHistSvc > m_iTHistSvc;
-
-  std::vector<float>::const_iterator m_i_angularCutoffParameter;
-  std::vector<float>::const_iterator m_i_clusterWindowXY;
-  std::vector<float>::const_iterator m_i_mergeParameter;
-  std::vector<float>::const_iterator m_i_weightThreshold;
-  std::vector<bool>::const_iterator  m_i_refineZ;
-  std::vector<bool>::const_iterator  m_i_gaussianWindow;
-
-  /// Default constructor: 
-  ImagingSeedTuningAlg();
-
-  /// Data handle keys
-  SG::ReadHandleKey<xAOD::TrackParticleContainer> m_trackParticlesKey  { this, "TrackParticles", "InDetTrackParticles", 
-                                                                         "Input track particle collection" };
-  SG::ReadHandleKey<xAOD::TruthEventContainer> m_truthEventsKey        { this, "TruthEvents", "TruthEvents", 
-                                                                         "TruthEvent collection" };
-  SG::ReadHandleKey<xAOD::TruthPileupEventContainer> m_pileupEventsKey { this, "TruthPileupEvents", "TruthPileupEvents", 
-                                                                         "TruthPileupEvent collection" };
-
-  /// Histograms and trees
-
-  TH1* m_h_nTruthVertices;
-  TH1* m_h_zTruthVertices;
-
-  TTree* m_t_seeds;
-  int m_b_nTruth;
-  int m_b_nConditions;
-  int m_b_nSeeds[5000];
-  int m_b_nGoodSeeds[5000];
-  int m_b_nGoodTruth[5000];
-  int m_b_nFake[5000];
-  int m_b_nLost[5000];
-  int m_b_nMerge[5000];
-  int m_b_nSplit[5000];
-  float m_b_angularCutoffParameter[5000];
-  float m_b_weightThreshold[5000];
-  float m_b_mergeParameter[5000];
-  float m_b_clusterWindowXY[5000];
-  int m_b_refineZ[5000];
-  int m_b_gaussianWindow[5000];
-
-  int m_iCondition;
-
-}; // class
-}  // namespace
-// I/O operators
-//////////////////////
-
-/////////////////////////////////////////////////////////////////// 
-// Inline methods: 
-/////////////////////////////////////////////////////////////////// 
-
-
-#endif //> !TRKVERTEXSEEDFINDERUTILS_IMAGINGSEEDTUNINGALG_H
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/LocalMax1DClusterFinder.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/LocalMax1DClusterFinder.cxx
deleted file mode 100644
index a3410a6006aa5790b842763a962d0bb8839506f3..0000000000000000000000000000000000000000
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/LocalMax1DClusterFinder.cxx
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-/*********************************************************************
-          LocalMax1DClusterFinder.cxx - Description in header file
-*********************************************************************/
-#include "TrkVertexSeedFinderUtils/LocalMax1DClusterFinder.h"
-#include "TrkVertexSeedFinderUtils/VertexImage.h"
-#include <algorithm>
-
-namespace Trk
-{
-  
-  namespace {
-#if 0
-    bool compareMaxZ( LocalMax1DClusterFinder::Projection m1,  LocalMax1DClusterFinder::Projection m2 ) {
-      return (m1.first < m2.first);
-    }
-#endif
-  }
-
-  LocalMax1DClusterFinder::LocalMax1DClusterFinder(const std::string& t, const std::string& n, const IInterface*  p) : 
-    base_class(t,n,p),
-    m_weightThreshold( 1500.0 ) ,
-    m_mergeParam( 0.95 ),
-    m_clusterWindowXY( 0.34 ),
-    m_refineZ( true ),
-    m_gaussianWindow( true )
-  {   
-    //threshold to consider a local max for seeding
-    declareProperty("weightThreshold", m_weightThreshold );
-    //merging parameter for nearby local maxima
-    declareProperty("mergeParameter",m_mergeParam);
-    //window in xy bin space within which clusters are formed
-    declareProperty("clusterWindowXY", m_clusterWindowXY );
-    //do quadratic refinement of peak positions
-    declareProperty("refineZ", m_refineZ);
-    //use gaussian window for z projection
-    declareProperty("gaussianWindow", m_gaussianWindow);
-  }
-  
-  
-  // --------------------------------------------------------------------------------
-  // Find vertex clusters of input image
-  std::vector<Amg::Vector3D> LocalMax1DClusterFinder::findVertexClusters( const VertexImage & image ) const
-  {
-
-    std::vector<float> zproj;
-
-    if (m_gaussianWindow) {
-      zproj = image.projectGaussianOnZ( m_clusterWindowXY );
-    } else {
-      zproj = image.projectRectangleOnZ( m_clusterWindowXY, m_clusterWindowXY);
-    }
-
-    //for (size_t i = 0; i < zproj.size(); i++) ATH_MSG_ALWAYS(i << " : " << image.getRelPosZ(i)<< " : " << zproj[i]);
-
-    // vector to store local maxima
-    std::vector<Projection> vmax;  
-  
-    for( size_t i=1; i< zproj.size()-1; ++i) {
-
-      // Check if bin is a local max
-      if( zproj[i] > m_weightThreshold && zproj[i] > zproj[i-1] && zproj[i] > zproj[i+1] ) {
-        //bin i is a local max
-        vmax.emplace_back(i,zproj[i]);
-      }
-    }
-
-
-    //consider closest z neighbours pair wise for merging
-    if( vmax.size() > 1 ) {
-      for(std::vector<Projection>::iterator it=vmax.begin(); it!=vmax.end(); ) {
-        //get the next iterator
-        std::vector<Projection>::iterator next = it+1;
-        //break out if we are on the last one        
-        if(next==vmax.end())
-          break;
-
-        //get lowest weight between these two max, stepping between them
-        float minw = it->second;
-
-        //must be at least 1 bin between them since they are both local maxima
-        for(int i=it->first+1; i<next->first; ++i) {
-          if(zproj[i] < minw)
-            minw = zproj[i];
-        }
-
-        //Calculate merging parameter
-        float mergeParam = minw / std::min( it->second, next->second );
-        if( mergeParam > m_mergeParam ) { //merge these together
-          if( it->second > next->second ) { //we should keep it and delete next
-            it = vmax.erase( next ); //it now points at the element after next in the original vector
-            it--; //step back so that "it" is pointing at the *same thing* it started on
-            //then we can go to the next part of the loop and compare the same local max to the next one in the list
-          } else { //keep next and delete it
-            it = vmax.erase( it );  //it now points at the element next used to point at
-            //don't need to move it, can go to next part of loop and compare to the one after that
-          }
-        } else { //do not merge
-          //go on to the next one directly
-          it++;
-        }
-        
-      } //loop over maxima
-    } //if we had at least 2 maxima to consider for merging
-
-    // Fill return vector
-    std::vector<Amg::Vector3D> vertices;    
-
-
-    //Set them to relative center of histogram in x,y
-    float x = image.getRelPosX( ((float) image.getNBinsX())/2. );
-    float y = image.getRelPosY( ((float) image.getNBinsY())/2. );
-    for(auto & m : vmax) {
-      if (!m_refineZ || zproj[m.first] <= 0) {
-          vertices.emplace_back( x, y, image.getRelPosZ(m.first) );
-      } else {
-	  float z;
-	  float z2 = image.getRelPosZ(m.first);
-	  // handle edge cases (max at first or last z bin)
-	  if (m.first == 0) {
-	    float z3 = image.getRelPosZ(m.first+1);
-	    if (zproj[m.first+1] > 0 && zproj[m.first + 2] > zproj[m.first+1]) {
-	      float w3 = zproj[m.first+1]*(zproj[m.first]/(zproj[m.first]+zproj[m.first+2]));
-    	      z = (z2*zproj[m.first] + z3*w3)/(zproj[m.first]+w3);
-	    } else if (zproj[m.first+1] > 0) {
-	      z = (z2*zproj[m.first] + z3*zproj[m.first+1])/(zproj[m.first] + zproj[m.first+1]);
-	    } else {
-	      z = image.getRelPosZ(m.first);
-	    }
-	  } else if (m.first == image.getNBinsZ() - 1) {
-	    float z1 = image.getRelPosZ(m.first-1);
-	    if (zproj[m.first-1] > 0 && zproj[m.first-2] > zproj[m.first-1]) {
-	      float w1 = zproj[m.first-1]*(zproj[m.first]/(zproj[m.first]+zproj[m.first-2]));
-	      z = (z1*w1 + z2*zproj[m.first])/(w1 + zproj[m.first]);
-	    } else if (zproj[m.first-1] > 0) {
-	      z = (z1*zproj[m.first-1] + z2*zproj[m.first])/(zproj[m.first-1] + zproj[m.first]);
-	    } else {
-	      z = image.getRelPosZ(m.first);
-	    }
-	  // not at an edge, do quadratic refinement
-	  } else {  
-	    if (zproj[m.first-1] > 0 && zproj[m.first] > 0 && zproj[m.first+1] > 0 ) {
-	      float z1 = image.getRelPosZ(m.first-1);
-	      float w2 = zproj[m.first];
-	      float w1;
-	      float w3;
-	      if (m.first > 1 && zproj[m.first-2] > zproj[m.first-1]) {
-		w1 = zproj[m.first-1] * w2/(w2 + zproj[m.first-2]);
-	      } else {
-		w1 = zproj[m.first-1];
-	      }
-	      if (m.first < image.getNBinsZ() - 2 && zproj[m.first+2] > zproj[m.first+1]) {
-		w3 = zproj[m.first+1] * w2/(w2 + zproj[m.first+2]);
-	      } else {
-		w3 = zproj[m.first+1];
-	      }
-	      if ( 4 * (w2 - w1) + 2 * (w1 - w3) > 0 ) {
-		z = z2 + (z2 - z1) * (w3 - w1)/(4 * (w2 - w1) + 2 * (w1 - w3));
-	      } else {  // degenerate (linear) or concave up cases should never happen since z2 is a local maximum
-		ATH_MSG_WARNING( "unexpected histogram shape ("<<w1<<","<<w2<<","<<w3<<")"  );
-		z = image.getRelPosZ(m.first);
-	      }
-	    } else {
-	      z = image.getRelPosZ(m.first);
-	    }
-	  }
-	  vertices.emplace_back( x, y, z );
-      }
-    }
-
-    ATH_MSG_DEBUG( "returning " << vertices.size() << " clusters"  );
-    return vertices;
-
-  } //End findLocalMax1DClusterFinder
-
-
- 
-} //End Trk namespace
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/SimpleVertexClusterFinder.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/SimpleVertexClusterFinder.cxx
deleted file mode 100644
index fe61f32a4667b07282989a938927dd101db5e3e3..0000000000000000000000000000000000000000
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/SimpleVertexClusterFinder.cxx
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-/*********************************************************************
-          SimpleVertexClusterFinder.cxx - Description in header file
-*********************************************************************/
-#include "TrkVertexSeedFinderUtils/SimpleVertexClusterFinder.h"
-
-namespace Trk
-{
-  
-  SimpleVertexClusterFinder::SimpleVertexClusterFinder(const std::string& t, const std::string& n, const IInterface*  p) : 
-    base_class(t,n,p),
-    m_weightThreshold( 0.0015        ) ,
-    m_seedCutScale(    1.2           ) 
-  {   
-    //threshold to consider a bin for clusterization
-    declareProperty("weightThreshold", m_weightThreshold );
-    //cut on max bin in a cluster as a multiple of the threshold above
-    declareProperty("seedCutScale"   , m_seedCutScale    );
-  }
-  
-  
-  // --------------------------------------------------------------------------------
-  // Find vertex clusters of input histogram. Note that this is the public function that
-  // Is called from the ImagingSeedFinder tool. Also, if the m_xbins, m_ybins, m_zbins,
-  // is not exactly what they were in ImagingSeedFinder (length of hist_rs is not binstot), 
-  // the code WILL and should fail. 
-  std::vector<Amg::Vector3D> SimpleVertexClusterFinder::findVertexClusters( const VertexImage & image ) const
-  {
-    int binstot = image.getNBins();
-
-    std::vector<Amg::Vector3D> vertices;    
-
-    std::map<int,float> binsRemaining;
-
-    for( int binnum = 0; binnum<image.getArraySize(); ++binnum ){ //Loop over all histogram bins
-
-      float test_val= image.getHist()[binnum] / binstot; //divide by binstot because of scaling after fourier transforms
-      if( test_val > m_weightThreshold) { //Tested value greater that thresshold
-	binsRemaining[binnum] = test_val;
-      }
-    }
-
-    std::vector<std::unique_ptr<Cluster> > clusts;
-    while (!binsRemaining.empty()) {
-      //get a new cluster, but check that it is filled.  Break if not.  in this case not all the bins above threshold are used because of the seed quality cut
-      std::unique_ptr<Cluster> tmpClust = highestCluster( image, binsRemaining );
-      if(!tmpClust->empty())
-	clusts.push_back( std::move (tmpClust) );
-      else {
-	break;
-      }
-    }
-    
-    //all clusters found passed the check on seed cut in highestCluster method, so can safely add them all and delete them.  The vertices are returned with relative position (in distance space) to center of histogram
-    for (std::unique_ptr<Cluster>& cl : clusts) {
-      float xbin,ybin,zbin;
-      getCenter(image, *cl, xbin,ybin,zbin);
-      vertices.emplace_back( image.getRelPosX(xbin),
-                                         image.getRelPosY(ybin),
-                                         image.getRelPosZ(zbin) );
-    }
-
-    ATH_MSG_DEBUG( "returning " << vertices.size() << " clusters"  );
-    return vertices;
-
-  } //End findSimpleVertexClusterFinders
-
-  // --------------------------------------------------------------------------------
-  // Private functions below
-  // --------------------------------------------------------------------------------
-
-  // --------------------------------------------------------------------------------
-  // Get highest cluster in binsremaining map
-  std::unique_ptr<SimpleVertexClusterFinder::Cluster>
-  SimpleVertexClusterFinder::highestCluster( const VertexImage& image,
-                                             std::map<int, float>& binsRemaining ) const
-  {
-    auto clust = std::make_unique<Cluster>();
-    
-    //find highest bin left above the seed cut scale.  for simple finding that doesnt need merging no point starting a cluster only to delete it later
-    float maxWeight = m_weightThreshold*m_seedCutScale;
-    std::map<int,float>::iterator maxIdx= binsRemaining.end();
-    for(std::map<int,float>::iterator bit = binsRemaining.begin(); bit!= binsRemaining.end(); bit++) {
-      if(bit->second > maxWeight) {
-	maxIdx=bit;
-	maxWeight= bit->second;
-      }
-    }
-    
-    if( maxIdx==binsRemaining.end() ) { //nothing above threshold
-      return clust;
-    } //start the cluster with the highest bin, removing it from future consideration
-      clust->push_back(binContent( maxIdx->first, maxIdx->second ));
-      binsRemaining.erase(maxIdx);
-    
-    
-    //find more bins to add
-    addBinsToCluster( image, *clust, 0, binsRemaining );
-    
-    return clust;
-    
-  } // End GethighestCluster
-  
-
-  // --------------------------------------------------------------------------------
-  // Add bins to cluster
-  void SimpleVertexClusterFinder::addBinsToCluster( const VertexImage& image,
-                                                    Cluster& clust,
-                                                    Cluster::size_type oldEdge,
-                                                    std::map<int, float>& binsRemaining ) const
-  {
-    //plan:
-    //loop over all "edge bins" = last set added by this method
-    //get all their adjacent bins (that are in the binsRemaining?)
-    //any adjacent bin gets put in a list
-    //...bin could be picked by 2 bins or more from the edfe
-    //...so run a duplicate removal
-    //add all new bins to the cluster and update edgeStart
-    //if we added any bins then run this method again
-    
-    int numadded = 0;
-    Cluster::size_type newEdge = clust.size();
-    //loop over all edges first
-    Cluster::const_iterator currEnd = clust.end();
-    for( Cluster::const_iterator bit= clust.begin()+oldEdge; bit!=currEnd; bit++) {
-      
-      //find adjacents, check if they are less and add them to the list
-      std::vector<int> adjIdx = image.getAdjacentBins( bit->first );
-      for(unsigned int i=0; i< adjIdx.size(); i++) {
-
-        //try to find it in bins remaining
-	std::map<int,float>::iterator mit= binsRemaining.find( adjIdx[i] );
-	if( mit!= binsRemaining.end()) {
-	  clust.push_back(binContent(adjIdx[i], mit->second)  );
-
-	  if(numadded==0) {
-            //keep track of the first bin added to the cluster on this call to method
-	    newEdge = clust.size()-1;
-	  }
-
-	  numadded++;
-
-	  binsRemaining.erase( mit );  // delete from remaining bins now
-	  
-	} 
-      }
-    }
-    
-    //if we added anything need to continue looking for more
-    if(numadded > 0) {
-      addBinsToCluster( image, clust, newEdge, binsRemaining);
-    }
-    
-    
-  } //End Add bins to cluster
-
-  
-  // --------------------------------------------------------------------------------
-  // get center
-  void SimpleVertexClusterFinder::getCenter( const VertexImage& image,
-                                             const Cluster& cl,
-                                             float & xpos,
-                                             float & ypos,
-                                             float & zpos) const
-  {
-    xpos=0;
-    ypos=0;
-    zpos=0;
-    
-    float totw=0;
-    
-    for (const binContent& bin : cl) {
-      const double w = bin.second;
-      totw += w;
-      
-      int x,y,z;
-      image.getInvRMBin( bin.first, x, y, z);
-      
-      xpos+= ((float) x)*w;
-      ypos+= ((float) y)*w;
-      zpos+= ((float) z)*w;
-      
-    }
-    
-    //in bin space
-    xpos= xpos/totw;
-    ypos= ypos/totw;
-    zpos= zpos/totw;
-    
-    //
-  } //end get center
-  
-
-} //End Trk namespace
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/VertexImage.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/VertexImage.cxx
deleted file mode 100644
index ff9e647a3db3958f104341afa2a4d113c74f7c86..0000000000000000000000000000000000000000
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/VertexImage.cxx
+++ /dev/null
@@ -1,346 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "TrkVertexSeedFinderUtils/VertexImage.h"
-#include "EventPrimitives/EventPrimitives.h"
-#include "fftw3.h"
-#include <cmath>
-#include <iostream>
-
-namespace Trk {
-
-  VertexImage::VertexImage( float* array,
-                            arrayDeleter* deleter,
-                            int nx, int ny, int nz, 
-                            float xrange, float yrange, float zrange) :
-    m_hist_3d(array),
-    m_deleter(deleter),
-    m_nbinsx(nx),
-    m_nbinsy(ny),
-    m_nbinsz(nz),
-    m_xrange(xrange),
-    m_yrange(yrange),
-    m_zrange(zrange)
-  {
-    //Calculate size of histogram and storage array
-    m_binstot = m_nbinsx*m_nbinsy*m_nbinsz;
-    m_arraytot = m_nbinsx*m_nbinsy*(m_nbinsz+2);
-
-    //Calculate binwidths
-    m_wx = 2*m_xrange/((float) m_nbinsx);
-    m_wy = 2*m_yrange/((float) m_nbinsy);
-    m_wz = 2*m_zrange/((float) m_nbinsz);
-  }
-
-
-  // Given indices (x,y,z), return overall array index of that bin
-  int VertexImage::getRMBin(const int & x, const int & y, const int & z) const {
-    int ret = z + (m_nbinsz+2)*y + (m_nbinsz+2)*m_nbinsy*x;
-    return ret;
-  }
-
-  // Given overall array index i of a bin, return indices (x,y,z) by reference
-  void VertexImage::getInvRMBin( const int & i, int & x, int & y, int &z ) const {
-    z = i % (m_nbinsz+2);
-    y = ( (i-z)/(m_nbinsz+2) ) % m_nbinsy;
-    x = ( i - z - y*(m_nbinsz+2) )/( (m_nbinsz+2)*m_nbinsy );
-  }
-
-  // Find array indices of all bins adjacent to index
-  std::vector<int> VertexImage::getAdjacentBins( int index ) const {
-    
-    int x,y,z;
-    
-    getInvRMBin( index, x,y,z );
-   
-    std::vector<int> v;
-    
-    if(x!=0) v.push_back(getRMBin( x-1, y, z));
-    if(y!=0) v.push_back(getRMBin( x, y-1, z));
-    if(z!=0) v.push_back(getRMBin( x, y, z-1));
-    
-    if(x<m_nbinsx-1) v.push_back(getRMBin( x+1, y, z));
-    if(y<m_nbinsy-1) v.push_back(getRMBin( x, y+1, z));
-    if(z<m_nbinsz-1) v.push_back(getRMBin( x, y, z+1));
-    
-    return v;
-
-  }
-
-  //Project to a 1D distribution in z using full xy range
-  std::vector<float> VertexImage::projectRectangleOnZ() const {
-    return projectRectangleOnZ( 0, m_nbinsx, 0, m_nbinsy);
-  }
-
-  // Given a rectangle in xy, project down to a 1D distribution in z
-  // min is inclusive, and max is exclusive (so full range is 0 to m_nbins)
-  std::vector<float> VertexImage::projectRectangleOnZ( int xmin, int xmax, int ymin, int ymax ) const {
-
-    //create return structure
-    std::vector<float> vret(m_nbinsz);
-
-    // Loop over z
-    for( int z=0; z<m_nbinsz; ++z ) {
-
-      //Do the projection
-      for(int x=xmin; x < xmax; ++x) {
-        for(int y=ymin; y < ymax; ++y) {
-          int idx = getRMBin(x,y,z);
-          vret[z] += m_hist_3d[idx];
-        }
-      }
- 
-    }
-
-    return vret;
-  }
-
-  // Project bins within nsigma standard deviations of the mean of the image
-  std::vector<float> VertexImage::projectRectangleOnZ( float nsigmax, float nsigmay) const {
-
-    //Calculate the mean and standard deviation in x and y
-    double meanx=0;
-    double mx2=0;
-    double meany=0;
-    double my2=0;
-    double tot=0;
-
-    //----------------------------------------
-    //One pass variant -- having precision issues when including negative weights, so cut them
-    // Loop through all actual bins in the histogram
-    for(int x=0; x < m_nbinsx; ++x) {
-      for(int y=0; y < m_nbinsy; ++y) {
-
-        double w=0;
-        //Add up whole z range to help with computational problems with negative weights
-        for( int z=0; z<m_nbinsz; ++z ) {
-          int i = getRMBin(x,y,z);
-          w+= m_hist_3d[i];
-        }
-
-        if(w < 0)
-          continue;
-
-        tot += w;
-
-        // for tot to be 0 w has to be also (so shouldn't update the values
-        if(tot==0)
-          continue;
-
-        //diff to last x mean
-        double diffx = ((double) x+0.5) - meanx;
-        //update mean x
-        meanx += w*diffx/tot;
-        //update squared difference 
-        mx2 += w * diffx * (((double) x+0.5 ) - meanx);
-        
-        //diff to last y mean
-        double diffy = ((double) y+0.5) - meany;
-        //update mean y
-        meany += w*diffy/tot;
-        //update squared difference 
-        my2 += w * diffy * (((double) y +0.5) - meany);
-        
-      }
-    }
-    
-    //If for some reason the total weight is 0 (empty histogram?), just project everything
-    if( tot == 0 ) {
-      return projectRectangleOnZ();
-    }
-
-    // Finalize standard deviation
-    float sigmax = sqrt( mx2/tot );
-    float sigmay = sqrt( my2/tot );
-
-    //----------------------------------------
-    //End 1 pass variant
-  
-    // Project using any bin touched by n standard deviations:
-    // Cast bounds to int, add 1 to the max 
-    
-    int xmin = meanx - sigmax*nsigmax;
-    int xmax = meanx + sigmax*nsigmax + 1.;
-
-    int ymin = meany - sigmay*nsigmay;
-    int ymax = meany + sigmay*nsigmay + 1.;
-
-    // Ensure no boundary issues (could result from large std. dev.)
-    if(xmin < 0)
-      xmin = 0;
-    if(xmax > m_nbinsx)
-      xmax = m_nbinsx;
-    if(ymin < 0)
-      ymin = 0;
-    if(ymax > m_nbinsy)
-      ymax = m_nbinsy;
-
-    return projectRectangleOnZ( xmin, xmax, ymin, ymax );
-
-  }
-
-  // Project on Z around fitted centroid using Gaussian weighting
-  std::vector<float> VertexImage::projectGaussianOnZ(float scale) const {
-    float x = 0.0;
-    float y = 0.0;
-    float sigmax = 0.0;
-    float sigmay = 0.0;
-    fitCentroid(x, y, sigmax, sigmay);
-    return projectGaussianOnZ(x, y, scale * sigmax, scale * sigmay);
-  }
-
-  // Fit the centroid by projecting on x,y
-  void VertexImage::fitCentroid(float& x, float& y, float& sigmax, float& sigmay) const {
-    // defaults in case something goes wrong
-    x = m_nbinsx/2;
-    y = m_nbinsy/2;
-    sigmax = m_nbinsx/2;
-    sigmay = m_nbinsy/2;
-    
-    float* hxy = new float[m_nbinsx*m_nbinsy];
-    float sumPos = 0.0;
-    int nPos = 0;
-    float sumx = 0;
-    float sumy = 0;
-    float sumx2 = 0;
-    float sumy2 = 0;
-    for (int ix = 0; ix < m_nbinsx; ix++) {
-      for (int iy = 0; iy < m_nbinsy; iy++) {
-	int ibin = ix + iy * m_nbinsx;
-	hxy[ibin] = 0.0;
-	for (int iz = 0; iz < m_nbinsz; iz++) {
-	  int idx = getRMBin(ix, iy, iz);
-	  hxy[ibin] += m_hist_3d[idx];
-	}
-	if (hxy[ibin] > 0) {
-	  sumPos += hxy[ibin];
-	  nPos++;
-	  sumx += (ix * hxy[ibin]);
-	  sumy += (iy * hxy[ibin]);
-	  sumx2+= (ix * ix * hxy[ibin]);
-	  sumy2+= (iy * iy * hxy[ibin]);
-	}
-      }
-    }
-    // compute average position and width of positive weights
-    if (nPos <= 0) {
-      //msg(MSG::WARNING) << "XY projection of image has no positive weights" << endmsg;
-      if (hxy) delete[] hxy;
-      return;
-    }
-    // update fallback quantities to something better
-    x = sumx/sumPos;
-    y = sumy/sumPos;
-    sigmax = sqrt(sumx2/sumPos - x*x);
-    sigmay = sqrt(sumy2/sumPos - y*y);
-    //std::cout << "VertexImage: fallback values " << x << ", " << y << " : " << sigmax << ", " << sigmay << std::endl;
-
-    // we will fit the centroid using only bins which are higher than the average of positive bins
-    // this avoids numerical problems with negative bins
-
-    // if we don't have at least 5 qualifying bins, we can't fit the five unknowns
-    if (nPos < 5) {
-      std::cout << "VertexImage: less than five bins available for fitting centroid" << std::endl;
-      if (hxy) delete[] hxy;
-      return;
-    }
-
-    float avePos = sumPos/nPos;
-    double s_x4 = 0;
-    double s_y4 = 0;
-    double s_x2y2 = 0;
-    double s_x3 = 0;
-    double s_y3 = 0;
-    double s_x2y = 0;
-    double s_xy2 = 0;
-    double s_x2 = 0;
-    double s_y2 = 0;
-    double s_xy = 0;
-    double s_x = 0;
-    double s_y = 0;
-    double s_x2q = 0;
-    double s_y2q = 0;
-    double s_xq = 0;
-    double s_yq = 0;
-    double s_q = 0;
-    int s_n = 0;
-    for (int ix = 0; ix < m_nbinsx; ix++) {
-      for (int iy = 0; iy < m_nbinsy; iy++) {
-	int ibin = ix + iy * m_nbinsx;
-	if (hxy[ibin] < avePos) continue;
-	float q = log(hxy[ibin]);
-	s_q += q;
-	s_x += (double) ix;
-	s_y += (double) iy;
-	s_xq += (double) ix * q;
-	s_yq += (double) iy * q;
-	s_x2 += (double) ix*ix;
-	s_xy += (double) ix*iy;
-	s_y2 += (double) iy*iy;
-	s_x2q += (double) ix*ix*q;
-	s_y2q += (double) iy*iy*q;
-	s_x3 += (double) ix*ix*ix;
-	s_y3 += (double) iy*iy*iy;
-	s_x2y += (double) ix*ix*iy;
-	s_xy2 += (double) ix*iy*iy;
-	s_x4 += (double) ix*ix*ix*ix;
-	s_y4 += (double) iy*iy*iy*iy;
-	s_x2y2 += (double) ix*ix*iy*iy;
-	s_n++;
-      }
-    }
-    if (hxy) delete[] hxy;
-    //AmgMatrix(5,5) m;
-    Eigen::Matrix<double,5,5> m;
-    m << s_x4, s_x2y2, s_x3, s_x2y, s_x2,
-      s_x3, s_xy2, s_x2, s_xy, s_x,
-      s_x2y2, s_y4, s_xy2, s_y3, s_y2,
-      s_x2y, s_y3, s_xy, s_y2, s_y,
-      s_x2, s_y2, s_x, s_y, s_n;
-    Eigen::Matrix<double, 5, 1> v;
-    v << s_x2q, s_xq, s_y2q, s_yq, s_q;
-    Eigen::Matrix<double, 5, 1> sol = m.colPivHouseholderQr().solve(v);
-
-    // transform the solution variables back to the ones we want
-    double sigmax2 = -1/(2*sol[0]);
-    double sigmay2 = -1/(2*sol[1]);
-    double mux = sol[2] * sigmax2;
-    double muy = sol[3] * sigmay2;
-    
-    if (sigmax2 > 0 && sigmay2 > 0) {
-      sigmax = (float) sqrt(sigmax2);
-      sigmay = (float) sqrt(sigmay2);
-      x = (float) mux;
-      y = (float) muy;
-      //std::cout << "VertexImage: Successful gaussian fit: " << x << ", " << y << " : " << sigmax << ", " << sigmay << std::endl;
-    } else {
-      std::cout << "Bad result from gaussian fit" << std::endl;
-      std::cout << "VertexImage : " << sol << std::endl;
-    }
-  }
-
-  // Project on z using Gaussian weighting in x,y
-  std::vector<float> VertexImage::projectGaussianOnZ(float centx, float centy, float sigmax, float sigmay) const {
-    //create return structure
-    std::vector<float> vret(m_nbinsz);
-
-    // Loop over z
-    for( int z=0; z<m_nbinsz; ++z ) {
-      float totalWeight = 0.0;
-      //Do the projection
-      for(int x=0; x < m_nbinsx; ++x) {
-        for(int y=0; y < m_nbinsy; ++y) {
-          int idx = getRMBin(x,y,z);
-	  float gauss = exp(-(x-centx)*(x-centx)/(2*sigmax*sigmax))*exp(-(y-centy)*(y-centy)/(2*sigmay*sigmay));
-          vret[z] += gauss*m_hist_3d[idx];
-	  totalWeight += gauss;
-        }
-      }
-      vret[z] /= totalWeight; 
-    }
-
-    return vret;
-  }
-
-}
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/VertexImageMaker.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/VertexImageMaker.cxx
deleted file mode 100644
index 7b844102fd3de6035c550d6bbf1e956476f877e6..0000000000000000000000000000000000000000
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/VertexImageMaker.cxx
+++ /dev/null
@@ -1,379 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "TrkVertexSeedFinderUtils/VertexImageMaker.h"
-#include "GaudiKernel/PhysicalConstants.h"
-
-
-namespace Trk
-{
-
-  VertexImageMaker::VertexImageMaker(const std::string& t, const std::string& n, const IInterface*  p) :
-    base_class(t,n,p),
-    m_xbins(                   32         ) , 
-    m_ybins(                   32         ) ,
-    m_zbins(                 2048         ) ,   
-    m_xrange(                   2.0       ) ,
-    m_yrange(                   2.0       ) , 
-    m_zrange(                 200.0       ) ,
-    m_a0Window(                 0.35875   ) ,
-    m_a1Window(                 0.48829   ) ,
-    m_a2Window(                 0.14128   ) ,
-    m_a3Window(                 0.01168   ) ,
-    m_cutoffFreqDenominator_xy( 2         ) ,
-    m_cutoffFreqDenominator_z(  1         ) ,
-    m_angularCutoffParameter(   0.75      ) ,
-    m_wx(0.0f), m_wy(0.0f), m_wz(0.0f), m_filttot(0), 
-    m_plan_r2c(nullptr), m_plan_c2r(nullptr)	          {
-
-    declareProperty("xbins"                   , m_xbins                    );
-    declareProperty("ybins"                   , m_ybins                    );
-    declareProperty("zbins"                   , m_zbins                    );
-    declareProperty("xrange"                  , m_xrange                   );
-    declareProperty("yrange"                  , m_yrange                   );
-    declareProperty("zrange"                  , m_zrange                   );
-    declareProperty("a0Window"                , m_a0Window                 );
-    declareProperty("a1Window"                , m_a1Window                 );
-    declareProperty("a2Window"                , m_a2Window                 );
-    declareProperty("a3Window"                , m_a3Window                 );
-    declareProperty("cutoffFreqDenominator_xy", m_cutoffFreqDenominator_xy );
-    declareProperty("cutoffFreqDenominator_z" , m_cutoffFreqDenominator_z  );
-    declareProperty("angularCutoffParameter"  , m_angularCutoffParameter   );
-    declareInterface<IVertexImageMaker>(this);
-  } //End constructor
-
-
-  StatusCode VertexImageMaker::initialize() {
-    
-    //Calculate binwidths
-    m_wx = 2*m_xrange/((float) m_xbins);
-    m_wy = 2*m_yrange/((float) m_ybins);
-    m_wz = 2*m_zrange/((float) m_zbins);
-
-    //calculate total number of bins needed for filter
-    m_filttot = m_xbins * m_ybins * ( m_zbins/2 + 1);
-
-    ATH_MSG_INFO( "Initializing frequency space filter"  );
-    initFSFilter();
-
-    //Allocate memory to histogram (used for both real and freq space)
-    ATH_MSG_INFO( "Allocating memory to fftw - Histogram size : " << m_xbins << " , " << m_ybins << " , " << m_zbins  );
-    float* histRS = (float*)fftwf_malloc( sizeof(float) * m_filttot * 2 );
-    //Get a complex casted version for easier access to the freq space using same bin numbering
-    fftwf_complex* histFS = (fftwf_complex*) histRS;
-
-    ATH_MSG_INFO( "Setting up FFTW plans"  );
-    m_plan_r2c = fftwf_plan_dft_r2c_3d(m_xbins, m_ybins, m_zbins, histRS, histFS, FFTW_MEASURE);
-    m_plan_c2r = fftwf_plan_dft_c2r_3d(m_xbins, m_ybins, m_zbins, histFS, histRS, FFTW_MEASURE);
-
-    fftwf_free( histRS );
-
-
-    return StatusCode::SUCCESS;
-
-  }// End initialize
-
-
-  StatusCode VertexImageMaker::finalize() 
-  {
-
-    fftwf_destroy_plan(m_plan_r2c);
-    fftwf_destroy_plan(m_plan_c2r);
-    fftwf_cleanup();
-
-    ATH_MSG_INFO( "Finalize ImageingSeedFinder successful"  );
-
-    return StatusCode::SUCCESS;
-  }// End ImagingSeedFinder finalize
-
-
-  std::unique_ptr<VertexImage>
-  VertexImageMaker::makeVertexImage( const std::vector<const Trk::TrackParameters*>& parametersList,
-                                     const xAOD::Vertex * constraint ) const
-  {
-    float* histRS = (float*)fftwf_malloc( sizeof(float) * m_filttot * 2 );
-    fftwf_complex* histFS = (fftwf_complex*) histRS;
-
-    auto image = std::make_unique<VertexImage> (histRS, fftwf_free,
-                                                m_xbins, m_ybins, m_zbins,
-                                                m_xrange, m_yrange, m_zrange);
-
-   //Fill the histogram
-    ATH_MSG_DEBUG("Filling Histogram ..."  );
-    fillHist( *image, parametersList, constraint );
-
-    //Forward transform
-    ATH_MSG_DEBUG("R2C Fourier ..."  );
-    fftwf_execute_dft_r2c ( m_plan_r2c, histRS, histFS );
-
-    ATH_MSG_DEBUG("Filtering ..."  );
-    filterFSHist (*image);
-
-    //back transform
-    ATH_MSG_DEBUG("C2R Fourier"  );
-    fftwf_execute_dft_c2r ( m_plan_c2r, histFS, histRS );
-
-    return image;
-  }
-
-  // --------------------------------------------------------------------------------
-  // VertexImageMaker Fill histogram
-  void VertexImageMaker::fillHist(VertexImage& image,
-                                  const std::vector<const Trk::TrackParameters*>& parametersList,
-                                  const xAOD::Vertex * constraint) const
-  {
-    //Method for backprojecting all the tracks through the bin space
-    //Method based on paper "A Fast Voxel Traversal Algorithm for Ray Tracing" by John Amanatides and Andrew Woo
-    // from Proceedings of EUROGRAPHICS Vol 87, 1987
-
-    //Histogram ranges
-    float x_min = - m_xrange;
-    float x_max =   m_xrange;
-    float y_min = - m_yrange;
-    float y_max =   m_yrange;
-    float z_min = - m_zrange;
-    float z_max =   m_zrange;
-
-
-    //Calculate ranges
-    if( constraint ) {
-      x_min += constraint->position().x();
-      x_max += constraint->position().x();
-      y_min += constraint->position().y();
-      y_max += constraint->position().y();
-      z_min += constraint->position().z();
-      z_max += constraint->position().z();
-    }
-
-    float* histRS = image.getHist();
-    
-    //Resetting histogram
-    for ( int iBin=0; iBin<m_filttot*2/*m_binstot*/; iBin++){
-	histRS[iBin] = 0.0;
-    }
-
-    //loop over track params
-    for (const Trk::TrackParameters* par : parametersList) {
-      //get parametric linearization of track first with t=0 at point given by track parameters (doesn't really matter where it is)
-
-      //position
-      float x = par->position()[Trk::x]; 
-      float y = par->position()[Trk::y];
-      float z = par->position()[Trk::z]; 
-
-      //3d slope of track is 
-      // | sinTheta*cosPhi |
-      // | sinTheta*sinPhi |
-      // |     cosTheta    |
-
-      // vec{pos} = vec{x}_{pca} + t*vec{slope}
-
-      float px = par->momentum()[Trk::px];
-      float py = par->momentum()[Trk::py];
-      float pz = par->momentum()[Trk::pz];
-      float p = sqrt( px*px + py*py + pz*pz );
-
-      float stcp = px / p;
-      float stsp = py / p;
-      float ct = pz / p;
-      float st = sqrt(stcp*stcp + stsp*stsp);  //always positive, as intended
-      float angularCutoffFactor = pow(st, m_angularCutoffParameter);
-
-      //which direction we are headed in bin space
-      //controls direction the bin counter moves
-      int stepX = ( stcp > 0 ) ? 1 : -1;
-      int stepY = ( stsp > 0 ) ? 1 : -1;
-      int stepZ = ( ct > 0 ) ? 1 : -1;
-
-      //how far in t we move to cross bin width in each direction with protection against no slope in that direction
-      float tDeltaX = (stcp != 0) ? fabs(m_wx/stcp) : FLT_MAX;
-      float tDeltaY = (stsp != 0) ? fabs(m_wy/stsp) : FLT_MAX;
-      float tDeltaZ = (ct != 0)   ? fabs(m_wz/ct)   : FLT_MAX;
-
-      //keep track of the next value of t that crosses a boundary during the traversal
-      float tMaxX = 0.0;
-      float tMaxY = 0.0;
-      float tMaxZ = 0.0;
-      
-      //keep track of current value of t -- used to calculate path length in a bin
-      float tcurr = 0.0;
-
-      //bin counters
-      int xbin, ybin, zbin;
-
-      //first solve for the parametric sol'ns for the intersections with the 6 planes of the box
-      float t[6] = {
-        ( x_min - x )/(stcp),
-        ( x_max - x )/(stcp),
-        
-        ( y_min - y )/(stsp),
-        ( y_max - y )/(stsp),
-        
-        ( z_min - z )/(ct),
-        ( z_max - z )/(ct)
-      };
-
-      //need to find the smallest value of t that is inside the box for all variables
-      //start by sorting
-      std::sort( t, t+6);
-      bool fail = true;
-      for(int i=0; i<6; ++i) {
-        
-        float xcurr = x + t[i]*stcp;
-        float ycurr = y + t[i]*stsp;
-        float zcurr = z + t[i]*ct;
-
-        if( xcurr >= x_min && xcurr <= x_max &&
-            ycurr >= y_min && ycurr <= y_max &&
-            zcurr >= z_min && zcurr <= z_max ) {
-
-          //this value of t hits the box, so don't want to skip projecting it
-          fail = false;
-
-          //set starting bin values and current value of t
-          xbin = int ( ((float) m_xbins)*(xcurr-x_min)/(x_max-x_min) );
-          ybin = int ( ((float) m_ybins)*(ycurr-y_min)/(y_max-y_min) );
-          zbin = int ( ((float) m_zbins)*(zcurr-z_min)/(z_max-z_min) );
-          tcurr = t[i];
-
-          //in case curr == max, need to adjust the bin number
-          if(xbin ==  m_xbins)
-            xbin--;
-          if(ybin ==  m_ybins)
-            ybin--;
-          if(zbin ==  m_zbins)
-            zbin--;
-
-          //next value of t to cross a bin boundary in x,y, or z -- only hard to calculate for this first step where we start at unknown point relative to the grid
-          //if one is set to FLT_MAX bc it has no slope in that direction, should always fail the < comparisons in the traversal
-          if(stcp==0)
-            tMaxX = FLT_MAX;
-          else
-            tMaxX = (stepX > 0) ? (x_min + ((float)xbin+1)*m_wx - xcurr)/(stcp) + tcurr : (x_min +((float)(xbin))*m_wx - xcurr)/(stcp) + tcurr;
-          if(stsp==0)
-            tMaxY = FLT_MAX;
-          else
-            tMaxY = (stepY > 0) ? (y_min + ((float)ybin+1)*m_wy - ycurr)/(stsp) + tcurr : (y_min +((float)(ybin))*m_wy - ycurr)/(stsp) + tcurr;
-          if(ct==0)
-            tMaxZ = FLT_MAX;
-          else
-            tMaxZ = (stepZ > 0) ? (z_min + ((float)zbin+1)*m_wz - zcurr)/(ct) + tcurr : (z_min +((float)(zbin))*m_wz - zcurr)/(ct) + tcurr;
-
-          break; //don't keep going or will find instead the exit from the box
-        }
-      }
-      if(fail) //miss box entirely so don't use this track
-        continue;
-      
-      //loop bins until we leave the box
-      while( xbin>=0 && xbin< m_xbins &&
-	     ybin>=0 && ybin< m_ybins &&
-	     zbin>=0 && zbin< m_zbins ) {
-
-        //if two tMax are equal, one will process before the other, but in the "middle" bin of those two steps, tMax - tcurr will be 0
-        //so that bin doesn't get any weight, and the result is the same as if both stepped at same time
-        if( tMaxX < tMaxY ) {
-          if(tMaxX < tMaxZ) { //leave x bin first
-            histRS[image.getRMBin( xbin, ybin, zbin )] += (tMaxX - tcurr)*angularCutoffFactor; //add the path length to the bin we are about to leave
-            tcurr = tMaxX; //set a new current value of t
-            tMaxX += tDeltaX; //set the max in x to the next time the path hits a boundary in x
-            xbin += stepX; //increment the bin
-          } else { //leave z bin first
-            histRS[image.getRMBin( xbin, ybin, zbin )] += (tMaxZ - tcurr)*angularCutoffFactor;
-            tcurr = tMaxZ;
-            tMaxZ += tDeltaZ;
-            zbin+=stepZ;
-          }
-        } else {
-          if(tMaxY < tMaxZ) { //leave y bin first
-            histRS[image.getRMBin( xbin, ybin, zbin )] += (tMaxY - tcurr)*angularCutoffFactor;
-            tcurr = tMaxY;
-            tMaxY += tDeltaY;
-            ybin+=stepY;
-          } else { //leave z bin first
-            histRS[image.getRMBin( xbin, ybin, zbin )] += (tMaxZ - tcurr)*angularCutoffFactor;
-            tcurr = tMaxZ;
-            tMaxZ += tDeltaZ;
-            zbin+=stepZ;
-          }
-        }
-
-      }
-
-    }//loop tracks
-  }//end backproj
-
-  // --------------------------------------------------------------------------------
-  // Initialize vector containing filter values for FS histogram bins
-  void VertexImageMaker::initFSFilter() {
-
-    m_histFSFilter.reserve( m_filttot );
-    m_histFSFilter.resize( m_filttot ); //Allocate to total size of filter
-
-    const int cutx = (m_xbins/2)/m_cutoffFreqDenominator_xy;
-    const int cuty = (m_ybins/2)/m_cutoffFreqDenominator_xy;
-    const int cutz = (m_zbins/2)/m_cutoffFreqDenominator_z; 
-
-    for(int ifilt=0; ifilt<m_filttot; ifilt++) {
-
-      float filtVal = 0.0;
-
-      int ztmp = (m_zbins/2+1);
-      int z = ifilt % ztmp;
-      int y = ( (ifilt-z) / ztmp ) % m_ybins;
-      int x = ( ifilt - z - y * ztmp )/( m_ybins * ztmp );
-
-      //convert to negative frequencies for magnitudes...
-      if( x > m_xbins/2) x = x - m_xbins;
-      if( y > m_ybins/2) y = y - m_ybins;
-      if( z > m_zbins/2) z = z - m_zbins;
-
-      float u1 = (1/m_wx)*((float) x)/((float) m_xbins);
-      float u2 = (1/m_wy)*((float) y)/((float) m_ybins);
-      float u3 = (1/m_wz)*((float) z)/((float) m_zbins);
-
-      //limited acceptance filter
-      
-      float magu = sqrt(u1*u1 + u2*u2 + u3*u3);
-      //either choice for magu=0 gives the same filter
-      float cosPsi = (magu>0) ? fabs(u3/magu)            : 1;
-      if(cosPsi>= 0.16307 ) {// angles corresponding to detector opening angle for tracking
-	filtVal = magu/(Gaudi::Units::twopi);
-      } else {
-        float sinPsi = (magu>0) ? sqrt(u1*u1 + u2*u2)/magu : 0;
-	filtVal = magu/(4*asin(0.98661/sinPsi));
-      }
-
-      //window function...
-      float denx = ((float) m_xbins)/m_cutoffFreqDenominator_xy;
-      float deny = ((float) m_ybins)/m_cutoffFreqDenominator_xy;
-      float denz = ((float) m_zbins)/m_cutoffFreqDenominator_z;
-      
-      float rx =  ((float) x)/(denx);
-      float ry =  ((float) y)/(deny);
-      float rz =  ((float) z)/(denz);
-
-      float winx = (abs(x)<=cutx) ? m_a0Window - m_a1Window*cos(2*Gaudi::Units::pi*(rx-0.5)) + m_a2Window*cos(4*Gaudi::Units::pi*(rx-0.5)) - m_a3Window*cos(6*Gaudi::Units::pi*(rx-0.5)) : 0;
-      float winy = (abs(y)<=cuty) ? m_a0Window - m_a1Window*cos(2*Gaudi::Units::pi*(ry-0.5)) + m_a2Window*cos(4*Gaudi::Units::pi*(ry-0.5)) - m_a3Window*cos(6*Gaudi::Units::pi*(ry-0.5)) : 0;
-      float winz = (abs(z)<=cutz) ? m_a0Window - m_a1Window*cos(2*Gaudi::Units::pi*(rz-0.5)) + m_a2Window*cos(4*Gaudi::Units::pi*(rz-0.5)) - m_a3Window*cos(6*Gaudi::Units::pi*(rz-0.5)) : 0;
-
-      m_histFSFilter[ifilt] = filtVal*winx*winy*winz;
-
-    }
-  } //End FS filter initialization
-
-  // --------------------------------------------------------------------------------
-  // Filter frequency space histogram
-  void VertexImageMaker::filterFSHist (VertexImage& image) const
-  {
-    fftwf_complex* histFS = (fftwf_complex*) image.getHist();
-    
-    for(int ifilt=0; ifilt<m_filttot; ifilt++) {
-      histFS[ifilt][0] *= m_histFSFilter[ifilt];
-      histFS[ifilt][1] *= m_histFSFilter[ifilt];
-    }
-
-  }//End filterFSHist
-
-} //End Trk namespace
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/components/TrkVertexSeedFinderUtils_entries.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/components/TrkVertexSeedFinderUtils_entries.cxx
index 42c6fae7ff14a6f8e61f1f17ee8105f6595a447b..8fc57da6d776affb966e3e0288a1f0a9ee504de1 100644
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/components/TrkVertexSeedFinderUtils_entries.cxx
+++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/components/TrkVertexSeedFinderUtils_entries.cxx
@@ -1,16 +1,12 @@
-#include "TrkVertexSeedFinderUtils/Trk2dDistanceSeeder.h"
-#include "TrkVertexSeedFinderUtils/NewtonTrkDistanceFinder.h"
+#include "../GaussianDensityTestAlg.h"
 #include "TrkVertexSeedFinderUtils/FsmwMode1dFinder.h"
+#include "TrkVertexSeedFinderUtils/GaussianTrackDensity.h"
+#include "TrkVertexSeedFinderUtils/Mode3dFromFsmw1dFinder.h"
 #include "TrkVertexSeedFinderUtils/Mode3dTo1dFinder.h"
+#include "TrkVertexSeedFinderUtils/NewtonTrkDistanceFinder.h"
 #include "TrkVertexSeedFinderUtils/SeedNewtonTrkDistanceFinder.h"
 #include "TrkVertexSeedFinderUtils/Trk2DDistanceFinder.h"
-#include "TrkVertexSeedFinderUtils/SimpleVertexClusterFinder.h"
-#include "TrkVertexSeedFinderUtils/LocalMax1DClusterFinder.h"
-#include "TrkVertexSeedFinderUtils/VertexImageMaker.h"
-#include "TrkVertexSeedFinderUtils/Mode3dFromFsmw1dFinder.h"
-#include "../ImagingSeedTuningAlg.h"
-#include "TrkVertexSeedFinderUtils/GaussianTrackDensity.h"
-#include "../GaussianDensityTestAlg.h"
+#include "TrkVertexSeedFinderUtils/Trk2dDistanceSeeder.h"
 
 using namespace Trk ;
 
@@ -20,10 +16,6 @@ DECLARE_COMPONENT( Mode3dTo1dFinder )
 DECLARE_COMPONENT( SeedNewtonTrkDistanceFinder )
 DECLARE_COMPONENT( FsmwMode1dFinder )
 DECLARE_COMPONENT( Trk2DDistanceFinder )
-DECLARE_COMPONENT( SimpleVertexClusterFinder )
-DECLARE_COMPONENT( LocalMax1DClusterFinder )
-DECLARE_COMPONENT( VertexImageMaker )
 DECLARE_COMPONENT( Mode3dFromFsmw1dFinder )
-DECLARE_COMPONENT( ImagingSeedTuningAlg )
 DECLARE_COMPONENT( GaussianTrackDensity )
 DECLARE_COMPONENT( GaussianDensityTestAlg )
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/GaussianTrackDensity_test.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/GaussianTrackDensity_test.cxx
index 906dac6f629d8c726d571e5b233970de6476893b..d828ee8c42347a8388963003468a11f1e0028a3c 100644
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/GaussianTrackDensity_test.cxx
+++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/GaussianTrackDensity_test.cxx
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration.
+ * Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration.
  */
 /**
  * @file TrkVertexSeedFinderUtils/test/GaussianTrackDensity_test.cxx
@@ -10,23 +10,20 @@
 
 
 #undef NDEBUG
-#include "TrkVertexSeedFinderUtils/GaussianTrackDensity.h"
-#include "TestTools/initGaudi.h"
-#include "TestTools/FLOATassert.h"
-#include "TestTools/expect_exception.h"
-#include "TestTools/random.h"
-#include "GaudiKernel/SystemOfUnits.h"
 #include "CxxUtils/ubsan_suppress.h"
+#include "GaudiKernel/SystemOfUnits.h"
 #include "GaudiKernel/ToolHandle.h"
 #include "TInterpreter.h"
-#include <iostream>
+#include "TestTools/FLOATassert.h"
+#include "TestTools/expect_exception.h"
+#include "TestTools/initGaudi.h"
+#include "TestTools/random.h"
+#include "TrkVertexSeedFinderUtils/GaussianTrackDensity.h"
 #include <cassert>
 #include <cmath>
+#include <iostream>
 
 
-// Can't link against these --- they're in a component library.
-#include "../src/GaussianTrackDensity.cxx"
-
 
 using Gaudi::Units::mm;
 using Gaudi::Units::MeV;
@@ -104,7 +101,7 @@ void test2 (Trk::GaussianTrackDensity& tool)
     else {
       z = z1dist(rng);
     }
-      
+
     Amg::Vector3D pos { x, y, z };
     double pt = ptdist(rng);
     double phi = phidist(rng);
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/Mode3dFromFsmw1dFinder_test.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/Mode3dFromFsmw1dFinder_test.cxx
index 34021067c68e2125e1dcd01c097a1724f9561542..1721ef156888a91adcb6bace928d4e30d8ef163c 100644
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/Mode3dFromFsmw1dFinder_test.cxx
+++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/Mode3dFromFsmw1dFinder_test.cxx
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration.
+ * Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration.
  */
 /**
  * @file TrkVertexSeedFinderUtils/test/Mode3dFromFsmw1dFinder_test.cxx
@@ -10,22 +10,18 @@
 
 
 #undef NDEBUG
-#include "TrkVertexSeedFinderUtils/Mode3dFromFsmw1dFinder.h"
-#include "TestTools/initGaudi.h"
-#include "TestTools/FLOATassert.h"
-#include "TestTools/expect_exception.h"
-#include "TestTools/random.h"
-#include "GaudiKernel/SystemOfUnits.h"
 #include "CxxUtils/ubsan_suppress.h"
+#include "GaudiKernel/SystemOfUnits.h"
 #include "GaudiKernel/ToolHandle.h"
 #include "TInterpreter.h"
-#include <iostream>
+#include "TestTools/FLOATassert.h"
+#include "TestTools/expect_exception.h"
+#include "TestTools/initGaudi.h"
+#include "TestTools/random.h"
+#include "TrkVertexSeedFinderUtils/Mode3dFromFsmw1dFinder.h"
 #include <cassert>
 #include <cmath>
-
-
-// Can't link against these --- they're in a component library.
-#include "../src/Mode3dFromFsmw1dFinder.cxx"
+#include <iostream>
 
 
 using Gaudi::Units::mm;
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/Mode3dTo1dFinder_test.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/Mode3dTo1dFinder_test.cxx
index 2ef92b6893986758f424a98c448d57e2104ed862..70eee1c833c06d9b842aab71d2f86e6dcad83e5a 100644
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/Mode3dTo1dFinder_test.cxx
+++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/Mode3dTo1dFinder_test.cxx
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration.
+ * Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration.
  */
 /**
  * @file TrkVertexSeedFinderUtils/test/Mode3dTo1dFinder_test.cxx
@@ -10,24 +10,18 @@
 
 
 #undef NDEBUG
-#include "TrkVertexSeedFinderUtils/Mode3dTo1dFinder.h"
-#include "TestTools/initGaudi.h"
-#include "TestTools/FLOATassert.h"
-#include "TestTools/expect_exception.h"
-#include "TestTools/random.h"
-#include "GaudiKernel/SystemOfUnits.h"
 #include "CxxUtils/ubsan_suppress.h"
+#include "GaudiKernel/SystemOfUnits.h"
 #include "GaudiKernel/ToolHandle.h"
 #include "TInterpreter.h"
-#include <iostream>
+#include "TestTools/FLOATassert.h"
+#include "TestTools/expect_exception.h"
+#include "TestTools/initGaudi.h"
+#include "TestTools/random.h"
+#include "TrkVertexSeedFinderUtils/Mode3dTo1dFinder.h"
 #include <cassert>
 #include <cmath>
 
-
-// Can't link against these --- they're in a component library.
-#include "../src/Mode3dTo1dFinder.cxx"
-
-
 using Gaudi::Units::mm;
 using Gaudi::Units::MeV;
 using Gaudi::Units::GeV;
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/NewtonTrkDistanceFinder_test.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/NewtonTrkDistanceFinder_test.cxx
index be7fb26d3caf07f678c6b387d01d086fa3a7bca9..d0d11bb3c94bd333235974e2f5bf66942088a6d7 100644
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/NewtonTrkDistanceFinder_test.cxx
+++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/NewtonTrkDistanceFinder_test.cxx
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration.
+ * Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration.
  */
 /**
  * @file TrkVertexSeedFinderUtils/test/NewtonTrkDistanceFinder_test.cxx
@@ -10,18 +10,18 @@
 
 
 #undef NDEBUG
-#include "TrkVertexSeedFinderUtils/NewtonTrkDistanceFinder.h"
-#include "MagFieldConditions/AtlasFieldCacheCondObj.h"
-#include "TestTools/initGaudi.h"
-#include "TestTools/FLOATassert.h"
-#include "TestTools/expect_exception.h"
 #include "CxxUtils/ubsan_suppress.h"
-#include "GaudiKernel/ToolHandle.h"
 #include "GaudiKernel/EventContext.h"
+#include "GaudiKernel/ToolHandle.h"
+#include "MagFieldConditions/AtlasFieldCacheCondObj.h"
 #include "TInterpreter.h"
-#include <iostream>
+#include "TestTools/FLOATassert.h"
+#include "TestTools/expect_exception.h"
+#include "TestTools/initGaudi.h"
+#include "TrkVertexSeedFinderUtils/NewtonTrkDistanceFinder.h"
 #include <cassert>
 #include <cmath>
+#include <iostream>
 
 // for the field map
 #include "PathResolver/PathResolver.h"
@@ -30,17 +30,13 @@
 
 // for populating conditions store
 #include "SGTools/TestStore.h"
-#include "StoreGate/WriteCondHandleKey.h"
 #include "StoreGate/WriteCondHandle.h"
+#include "StoreGate/WriteCondHandleKey.h"
 
 // for the conditions data
 #include "MagFieldConditions/AtlasFieldCacheCondObj.h"
 #include "MagFieldElements/AtlasFieldCache.h"
 
-// Can't link against these --- they're in a component library.
-#include "../src/NewtonTrkDistanceFinder.cxx"
-#include "../src/PointOnTrack.cxx"
-
 
 void assertVec3D (const Amg::Vector3D& a, const Amg::Vector3D& b)
 {
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/SeedNewtonTrkDistanceFinder_test.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/SeedNewtonTrkDistanceFinder_test.cxx
index ad910f01235d38ca3006623af0cccdff7fb8467e..fd098be5914a9549407f30eda91384b475d39960 100644
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/SeedNewtonTrkDistanceFinder_test.cxx
+++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/SeedNewtonTrkDistanceFinder_test.cxx
@@ -10,18 +10,18 @@
 
 
 #undef NDEBUG
-#include "TrkVertexSeedFinderUtils/ITrkDistanceFinder.h"
-#include "MagFieldConditions/AtlasFieldCacheCondObj.h"
-#include "TestTools/initGaudi.h"
-#include "TestTools/FLOATassert.h"
-#include "TestTools/expect_exception.h"
 #include "CxxUtils/ubsan_suppress.h"
-#include "GaudiKernel/ToolHandle.h"
 #include "GaudiKernel/EventContext.h"
+#include "GaudiKernel/ToolHandle.h"
+#include "MagFieldConditions/AtlasFieldCacheCondObj.h"
 #include "TInterpreter.h"
-#include <iostream>
+#include "TestTools/FLOATassert.h"
+#include "TestTools/expect_exception.h"
+#include "TestTools/initGaudi.h"
+#include "TrkVertexSeedFinderUtils/ITrkDistanceFinder.h"
 #include <cassert>
 #include <cmath>
+#include <iostream>
 
 // for the field map
 #include "PathResolver/PathResolver.h"
@@ -30,8 +30,8 @@
 
 // for populating conditions store
 #include "SGTools/TestStore.h"
-#include "StoreGate/WriteCondHandleKey.h"
 #include "StoreGate/WriteCondHandle.h"
+#include "StoreGate/WriteCondHandleKey.h"
 
 // for the conditions data
 #include "MagFieldConditions/AtlasFieldCacheCondObj.h"
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/SimpleVertexClusterFinder_test.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/SimpleVertexClusterFinder_test.cxx
deleted file mode 100644
index c8a99749a08f027b89f8910a726b5409543aa7ad..0000000000000000000000000000000000000000
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/SimpleVertexClusterFinder_test.cxx
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration.
- */
-/**
- * @file TrkVertexSeedFinderUtils/test/SimpleVertexClusterFinder_test.cxx
- * @author scott snyder <snyder@bnl.gov>
- * @date Jun, 2019
- * @brief Simple unit test for SimpleVertexClusterFinder.
- */
-
-
-#undef NDEBUG
-#include "TrkVertexSeedFinderUtils/SimpleVertexClusterFinder.h"
-#include "TrkVertexSeedFinderUtils/VertexImageMaker.h"
-#include "TestTools/initGaudi.h"
-#include "TestTools/FLOATassert.h"
-#include "TestTools/expect_exception.h"
-#include "TestTools/random.h"
-#include "GaudiKernel/SystemOfUnits.h"
-#include "CxxUtils/ubsan_suppress.h"
-#include "GaudiKernel/ToolHandle.h"
-#include "TInterpreter.h"
-#include <iostream>
-#include <cassert>
-#include <cmath>
-
-
-// Can't link against these --- they're in a component library.
-#include "../src/SimpleVertexClusterFinder.cxx"
-#include "../src/VertexImageMaker.cxx"
-#include "../src/VertexImage.cxx"
-
-
-using Gaudi::Units::mm;
-using Gaudi::Units::MeV;
-using Gaudi::Units::GeV;
-
-
-std::unique_ptr<AmgSymMatrix(5)> cov5()
-{
-  auto m = std::make_unique<AmgSymMatrix(5)>();
-  m->setIdentity();
-  return m;
-}
-
-
-void initVertex (xAOD::Vertex& v)
-{
-  v.makePrivateStore();
-  v.setX (1.7);
-  v.setY (1.3);
-  v.setZ (-6);
-
-  AmgSymMatrix(3) cov;
-  cov.setIdentity();
-  v.setCovariancePosition (cov);
-}
-
-
-void assertVec3D (const Amg::Vector3D& a, const Amg::Vector3D& b)
-{
-  assert( Athena_test::isEqual (a.x(), b.x(), 1e-5) );
-  assert( Athena_test::isEqual (a.y(), b.y(), 1e-5) );
-  assert( Athena_test::isEqual (a.z(), b.z(), 1e-5) );
-}
-
-
-#if 0
-std::ostream& printVec3D (const Amg::Vector3D& a)
-{
-  std::cout << a.x() << " " << a.y() << " " << a.z();
-  return std::cout;
-}
-#endif
-void test1 (Trk::VertexImageMaker& tool1, Trk::SimpleVertexClusterFinder& tool2)
-{
-  std::cout << "test1\n";
-
-  Amg::Vector3D pos0 { 0, 0, 0 };
-
-  std::vector<std::unique_ptr<Trk::Perigee> > perigees;
-  std::vector<const Trk::TrackParameters*> pvec;
-  Athena_test::normal_distribution<double> xdist (1*mm, 0.1*mm);
-  Athena_test::normal_distribution<double> ydist (-0.7*mm, 0.1*mm);
-  Athena_test::normal_distribution<double> z1dist (12*mm, 1*mm);
-  Athena_test::normal_distribution<double> z2dist (-3*mm, 0.5*mm);
-  Athena_test::uniform_real_distribution<double> ptdist (0.1*GeV, 100*GeV);
-  Athena_test::uniform_real_distribution<double> phidist (-M_PI, M_PI);
-  Athena_test::uniform_real_distribution<double> etadist (-4, 4);
-  Athena_test::URNG rng;
-  for (unsigned int i=0; i < 200; i++) {
-    double x = xdist(rng);
-    double y = ydist(rng);
-    double z;
-    if ((i%3) == 0) {
-      z = z2dist(rng);
-    }
-    else {
-      z = z1dist(rng);
-    }
-      
-    Amg::Vector3D pos { x, y, z };
-    double pt = ptdist(rng);
-    double phi = phidist(rng);
-    double eta = etadist(rng);
-    Amg::Vector3D mom { pt*cos(phi), pt*sin(phi), pt*sinh(eta) };
-    double charge = etadist(rng) > 0 ? 1 : -1;
-    perigees.emplace_back (std::make_unique<Trk::Perigee> (pos, mom, charge, pos0,
-                                                           cov5().release()));
-    pvec.push_back (perigees.back().get());
-  }
-
-  xAOD::Vertex vert1;
-  initVertex (vert1);
-
-  std::unique_ptr<Trk::VertexImage> image = tool1.makeVertexImage(pvec, &vert1);
-  std::vector<Amg::Vector3D> verts = tool2.findVertexClusters (*image);
-  assert (verts.size() == 4);
-  assertVec3D (verts[0], { -0.778228, -1.80779, 17.8691  });
-  assertVec3D (verts[1], { -0.721533, -1.79632,  2.88162 });
-  assertVec3D (verts[2], { -0.756713,  1.85018, 17.9267  });
-  assertVec3D (verts[3], { -0.788483,  1.85138,  2.82426 });
-#if 0
-  for (const auto& vv : verts) {
-    printVec3D (vv) << "\n";
-  }
-#endif
-}
-
-
-int main()
-{
-  std::cout << "TrkVertexSeedFinderUtils/SimpleVertexClusterFinder_test\n";
-  CxxUtils::ubsan_suppress ([]() { TInterpreter::Instance(); });
-  ISvcLocator* svcloc = nullptr;
-  Athena_test::initGaudi ("TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils_tests.txt", svcloc);
-
-  ToolHandle<Trk::VertexImageMaker> tool1 ("Trk::VertexImageMaker");
-  assert( tool1.retrieve().isSuccess() );
-  ToolHandle<Trk::SimpleVertexClusterFinder> tool2 ("Trk::SimpleVertexClusterFinder");
-  assert( tool2.retrieve().isSuccess() );
-
-  test1 (*tool1, *tool2);
-
-  return 0;
-}
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/Trk2DDistanceFinder_test.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/Trk2DDistanceFinder_test.cxx
index 8b63ea0e03bc7f5f43ab39aaf7700e171004e894..259bcb470b5834b879c52da7fe1548919c00a1a0 100644
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/Trk2DDistanceFinder_test.cxx
+++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/Trk2DDistanceFinder_test.cxx
@@ -10,18 +10,18 @@
 
 
 #undef NDEBUG
-#include "TrkVertexSeedFinderUtils/ITrkDistanceFinder.h"
-#include "MagFieldConditions/AtlasFieldCacheCondObj.h"
-#include "TestTools/initGaudi.h"
-#include "TestTools/FLOATassert.h"
-#include "TestTools/expect_exception.h"
 #include "CxxUtils/ubsan_suppress.h"
-#include "GaudiKernel/ToolHandle.h"
 #include "GaudiKernel/EventContext.h"
+#include "GaudiKernel/ToolHandle.h"
+#include "MagFieldConditions/AtlasFieldCacheCondObj.h"
 #include "TInterpreter.h"
-#include <iostream>
+#include "TestTools/FLOATassert.h"
+#include "TestTools/expect_exception.h"
+#include "TestTools/initGaudi.h"
+#include "TrkVertexSeedFinderUtils/ITrkDistanceFinder.h"
 #include <cassert>
 #include <cmath>
+#include <iostream>
 
 // for the field map
 #include "PathResolver/PathResolver.h"
@@ -30,8 +30,8 @@
 
 // for populating conditions store
 #include "SGTools/TestStore.h"
-#include "StoreGate/WriteCondHandleKey.h"
 #include "StoreGate/WriteCondHandle.h"
+#include "StoreGate/WriteCondHandleKey.h"
 
 // for the conditions data
 #include "MagFieldConditions/AtlasFieldCacheCondObj.h"
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/Trk2dDistanceSeeder_test.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/Trk2dDistanceSeeder_test.cxx
index c44be7730464425084b14289083330a3d6146e4b..44b54dfec97e30656dc99c4604dfb7ac7598d0e0 100644
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/Trk2dDistanceSeeder_test.cxx
+++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/Trk2dDistanceSeeder_test.cxx
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration.
+ * Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration.
  */
 /**
  * @file TrkVertexSeedFinderUtils/test/Trk2dDistanceSeeder_test.cxx
@@ -10,24 +10,18 @@
 
 
 #undef NDEBUG
-#include "TrkVertexSeedFinderUtils/Trk2dDistanceSeeder.h"
-#include "MagFieldConditions/AtlasFieldCacheCondObj.h"
-#include "TestTools/initGaudi.h"
-#include "TestTools/FLOATassert.h"
-#include "TestTools/expect_exception.h"
 #include "CxxUtils/ubsan_suppress.h"
-#include "GaudiKernel/ToolHandle.h"
 #include "GaudiKernel/EventContext.h"
+#include "GaudiKernel/ToolHandle.h"
+#include "MagFieldConditions/AtlasFieldCacheCondObj.h"
 #include "TInterpreter.h"
-#include <iostream>
+#include "TestTools/FLOATassert.h"
+#include "TestTools/expect_exception.h"
+#include "TestTools/initGaudi.h"
+#include "TrkVertexSeedFinderUtils/Trk2dDistanceSeeder.h"
 #include <cassert>
 #include <cmath>
 
-// Can't link against these --- they're in a component library.
-#include "../src/Trk2dDistanceSeeder.cxx"
-#include "../src/PointOnTrack.cxx"
-#include "../src/TwoTracks.cxx"
-
 // for the field map
 #include "PathResolver/PathResolver.h"
 #include "TFile.h"
@@ -35,8 +29,8 @@
 
 // for populating conditions store
 #include "SGTools/TestStore.h"
-#include "StoreGate/WriteCondHandleKey.h"
 #include "StoreGate/WriteCondHandle.h"
+#include "StoreGate/WriteCondHandleKey.h"
 
 // for the conditions data
 #include "MagFieldConditions/AtlasFieldCacheCondObj.h"
diff --git a/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/PufitMultiGrid.h b/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/PufitMultiGrid.h
index e3579c36d9078a808954cc8a87250638cbc6c67d..d64e82b01a9f3a8f9748b9613322d2d878265c2d 100644
--- a/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/PufitMultiGrid.h
+++ b/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/PufitMultiGrid.h
@@ -90,6 +90,8 @@ namespace HLT
          */
         Tower(PufitMultiGrid *parent, std::size_t index);
 
+        Tower(const Tower&) = default;
+
         /**
          * @brief Copy assignment operator
          *
diff --git a/Trigger/TrigAlgorithms/TrigMuSuperEF/src/TrigMuSuperEF.cxx b/Trigger/TrigAlgorithms/TrigMuSuperEF/src/TrigMuSuperEF.cxx
index 0476c11ae892138103452f2d7c11182833430ec1..5aaf35b9b998eba0a519fc273cdac16878a1a8ab 100644
--- a/Trigger/TrigAlgorithms/TrigMuSuperEF/src/TrigMuSuperEF.cxx
+++ b/Trigger/TrigAlgorithms/TrigMuSuperEF/src/TrigMuSuperEF.cxx
@@ -1664,7 +1664,7 @@ const IRoiDescriptor* TrigMuSuperEF::getRoiDescriptor(const HLT::TriggerElement*
       }
       
       if (trigRoI) {
-	newTrigRoI = createSingleTrigRoiDescriptor( trigRoI->eta(), trigRoI->phi(), m_dEtaRoI, m_dPhiRoI, trigRoI->roiId() );
+	newTrigRoI = new TrigRoiDescriptor(unsigned(0), unsigned(trigRoI->roiId()), trigRoI->eta(), trigRoI->etaMinus(), trigRoI->etaPlus(), trigRoI->phi(), trigRoI->phiMinus(), trigRoI->phiPlus());
 	m_Roi_StillToBeAttached = newTrigRoI;
 	m_roi = newTrigRoI;
       } // if trigRoI
diff --git a/Trigger/TrigAlgorithms/TrigT2CaloCommon/python/CaloDef.py b/Trigger/TrigAlgorithms/TrigT2CaloCommon/python/CaloDef.py
index 16bd617e6908858840ac38f31ba3978dd7480b89..6093811ed349e5ea95b4ed5cc83fbdbec0888d46 100644
--- a/Trigger/TrigAlgorithms/TrigT2CaloCommon/python/CaloDef.py
+++ b/Trigger/TrigAlgorithms/TrigT2CaloCommon/python/CaloDef.py
@@ -142,8 +142,7 @@ def HLTRoITopoRecoSequence(RoIs):
     import AthenaCommon.CfgMgr as CfgMgr
     HLTRoITopoRecoSequenceVDV = CfgMgr.AthViews__ViewDataVerifier("HLTRoITopoRecoSequenceVDV")
     HLTRoITopoRecoSequenceVDV.DataObjects = [( 'TrigRoiDescriptorCollection' , 'StoreGateSvc+PrecisionCaloRoIs' ),
-                                             ( 'CaloBCIDAverage' , 'StoreGateSvc+CaloBCIDAverage' ),
-                                             ( 'ILArHVScaleCorr' , 'ConditionStore+LArHVScaleCorrRecomputed' )]
+                                             ( 'CaloBCIDAverage' , 'StoreGateSvc+CaloBCIDAverage' )]
 
     cellMaker = HLTCellMaker(RoIs, algSuffix="RoI")
     topoClusterMaker = _algoHLTTopoCluster(inputEDM = cellMaker.CellsName, algSuffix="RoI")
diff --git a/Trigger/TrigAlgorithms/TrigT2CaloCommon/python/TrigCaloDataAccessConfig.py b/Trigger/TrigAlgorithms/TrigT2CaloCommon/python/TrigCaloDataAccessConfig.py
index 814312213c790cae9fa4b85d3f79a81da9f979e7..d0adaf914a41f03ea473ad2f5be75c6a3087aeb2 100644
--- a/Trigger/TrigAlgorithms/TrigT2CaloCommon/python/TrigCaloDataAccessConfig.py
+++ b/Trigger/TrigAlgorithms/TrigT2CaloCommon/python/TrigCaloDataAccessConfig.py
@@ -49,9 +49,9 @@ def trigCaloDataAccessSvcCfg( flags ):
     acc.merge( createLArRoI_Map( flags ) )
 
     # Needed by bad channel maskers, refrerenced from LArCellCont.
-    from IOVDbSvc.IOVDbSvcConfig import addFolders
-    acc.merge(addFolders(flags, ['/LAR/BadChannels/BadChannels'], 'LAR'))
-    acc.merge(addFolders(flags, ['/LAR/BadChannels/MissingFEBs'], 'LAR'))
+    from LArBadChannelTool.LArBadChannelConfig import LArBadChannelCfg, LArBadFebCfg
+    acc.merge(LArBadChannelCfg(flags))
+    acc.merge(LArBadFebCfg(flags))
 
     from TileConditions.TileEMScaleConfig import TileEMScaleCondAlgCfg
     acc.merge( TileEMScaleCondAlgCfg(flags) )
diff --git a/Trigger/TrigAlgorithms/TrigT2CaloCommon/src/TrigDataAccess.h b/Trigger/TrigAlgorithms/TrigT2CaloCommon/src/TrigDataAccess.h
index 977044386c914f63304f5834a58a149b1751ae62..350f5fa30e27db1b0aafc9e8d65cd8c773071fc8 100755
--- a/Trigger/TrigAlgorithms/TrigT2CaloCommon/src/TrigDataAccess.h
+++ b/Trigger/TrigAlgorithms/TrigT2CaloCommon/src/TrigDataAccess.h
@@ -297,7 +297,7 @@ protected:
     ServiceHandle<IROBDataProviderSvc>         m_robDataProvider;
 
   /** iterators to LArCells type depending on
-      access wa§y (IDC or Cont) */
+      access way (IDC or Cont) */
   LArTT_Selector<LArCellCont>* m_sel;
   LArTT_Selector<LArCellCont>* m_sellarfull;
   LArTT_Selector<LArCellCont>* m_selem;
diff --git a/Trigger/TrigAlgorithms/TrigTauRec/python/TrigTauAlgorithmsHolder.py b/Trigger/TrigAlgorithms/TrigTauRec/python/TrigTauAlgorithmsHolder.py
index 0131a57dfe65978b8075a734c9dba4cb69ccb7ac..322a14c5c333671cbbbdafd80668ddd9babb9e44 100644
--- a/Trigger/TrigAlgorithms/TrigTauRec/python/TrigTauAlgorithmsHolder.py
+++ b/Trigger/TrigAlgorithms/TrigTauRec/python/TrigTauAlgorithmsHolder.py
@@ -52,6 +52,30 @@ def getAtlasExtrapolator():
     return theAtlasExtrapolator
 
 ########################################################################
+def getTauVertexCorrection():
+    from tauRec.tauRecFlags import tauFlags
+    from tauRecTools.tauRecToolsConf import TauVertexCorrection
+
+    _name = sPrefix + 'TauVertexCorrection'
+    
+    if _name in cached_instances:
+        return cached_instances[_name]
+  
+    # FIXME:doJetVertexCorrection need to be False even though origin correction
+    # is turned on in jet reconstruction. 
+    # If the seed jet is PFlow jets, then the tau axis will be corrected to point 
+    # at PV0, but the clusters will not be corrected.
+
+    doJetVertexCorrection = False
+
+    myTauVertexCorrection = TauVertexCorrection(name = _name,
+                                                SeedJet = tauFlags.tauRecSeedJetCollection(), 
+                                                VertexCorrection = doVertexCorrection,
+                                                JetVertexCorrection = doJetVertexCorrection)
+    
+    cached_instances[_name] = myTauVertexCorrection
+    return myTauVertexCorrection
+
 # JetSeedBuilder
 def getJetSeedBuilder():
     _name = sPrefix + 'JetSeedBuilder'
@@ -76,7 +100,8 @@ def getTauAxis():
     from tauRecTools.tauRecToolsConf import TauAxisSetter
     TauAxisSetter = TauAxisSetter(  name = _name, 
                                     ClusterCone = 0.2,
-                                    VertexCorrection = doVertexCorrection
+                                    VertexCorrection = doVertexCorrection,
+                                    TauVertexCorrection = getTauVertexCorrection()
                                   )
     # No Axis correction at trigger level
                                     
@@ -123,7 +148,8 @@ def getMvaTESVariableDecorator():
 
     from AthenaCommon.AppMgr import ToolSvc
     from tauRecTools.tauRecToolsConf import MvaTESVariableDecorator
-    MvaTESVariableDecorator = MvaTESVariableDecorator(name = _name)
+    MvaTESVariableDecorator = MvaTESVariableDecorator(name = _name,
+                                                      TauVertexCorrection = getTauVertexCorrection())
 
     MvaTESVariableDecorator.Key_vertexInputContainer = ""
 
@@ -357,7 +383,7 @@ def getTauSubstructure():
     
     from tauRecTools.tauRecToolsConf import TauSubstructureVariables
     TauSubstructureVariables = TauSubstructureVariables(  name = _name,
-                                                          VertexCorrection = doVertexCorrection
+                                                          TauVertexCorrection = getTauVertexCorrection()
                                                         )
     
     cached_instances[_name] = TauSubstructureVariables
@@ -745,7 +771,8 @@ def getTauIDVarCalculator():
     
     from AthenaCommon.AppMgr import ToolSvc
     from tauRecTools.tauRecToolsConf import TauIDVarCalculator            
-    TauIDVarCalculator = TauIDVarCalculator(name=_name)
+    TauIDVarCalculator = TauIDVarCalculator(name=_name,
+                                            TauVertexCorrection=getTauVertexCorrection())
     
     ToolSvc += TauIDVarCalculator                                 
     cached_instances[_name] = TauIDVarCalculator
@@ -797,7 +824,8 @@ def getTauJetRNNEvaluator(NetworkFile0P="", NetworkFile1P="", NetworkFile3P="",
                                       InputLayerTracks=InputLayerTracks,
                                       InputLayerClusters=InputLayerClusters,
                                       OutputLayer=OutputLayer,
-                                      OutputNode=OutputNode)
+                                      OutputNode=OutputNode,
+                                      TauVertexCorrection=getTauVertexCorrection())
 
     ToolSvc += TauJetRNNEvaluator
     cached_instances[_name] = TauJetRNNEvaluator
diff --git a/Trigger/TrigAlgorithms/TrigTauRec/src/TrigTauRecMergedMT.cxx b/Trigger/TrigAlgorithms/TrigTauRec/src/TrigTauRecMergedMT.cxx
index 8837948894cb10e24df0b95fef7e6e4c32b126e0..e160628d31864c0a176b1d339d678733e0f6f983 100644
--- a/Trigger/TrigAlgorithms/TrigTauRec/src/TrigTauRecMergedMT.cxx
+++ b/Trigger/TrigAlgorithms/TrigTauRec/src/TrigTauRecMergedMT.cxx
@@ -1,6 +1,5 @@
-
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "GaudiKernel/SystemOfUnits.h"
@@ -193,29 +192,40 @@ StatusCode TrigTauRecMergedMT::execute(const EventContext& ctx) const
     ATH_MSG_DEBUG("Tau Track Container Size " << pTauTrackContainer->size());
   }
 
-
   // Make new container which is deep copy of that
-  xAOD::TauJetContainer*    pContainer    = nullptr;
-  xAOD::TauJetAuxContainer* pAuxContainer = nullptr;
+  std::unique_ptr<xAOD::TauJetContainer>    pContainer    = std::make_unique<xAOD::TauJetContainer>();
+  std::unique_ptr<xAOD::TauJetAuxContainer> pAuxContainer = std::make_unique<xAOD::TauJetAuxContainer>();
+  pContainer->setStore(pAuxContainer.get());
+
+  // Write final taujets container
+  SG::WriteHandle<xAOD::TauJetContainer> outputTauHandle(m_trigtauRecOutKey, ctx);
+  ATH_CHECK(outputTauHandle.record(std::move(pContainer),std::move(pAuxContainer)));
+
   xAOD::TauJet* tau(0);
   xAOD::TauJet* p_tau(0);
 
-  xAOD::TauTrackContainer*    pTrackContainer    = nullptr;
-  xAOD::TauTrackAuxContainer* pTrackAuxContainer = nullptr;
-  xAOD::TauTrack* tautrack(0);
+  ATH_CHECK(deepCopy(outputTauHandle, tau, pTauContainer));
+  if(outputTauHandle->size()>0) p_tau = outputTauHandle->back();
 
-  ATH_CHECK(deepCopy(pContainer, pAuxContainer, tau, pTauContainer));
-  if(pContainer->size()>0) p_tau = pContainer->back();
+  std::unique_ptr<xAOD::TauTrackContainer>    pTrackContainer    = std::make_unique<xAOD::TauTrackContainer>();
+  std::unique_ptr<xAOD::TauTrackAuxContainer> pTrackAuxContainer = std::make_unique<xAOD::TauTrackAuxContainer>();
+  pTrackContainer->setStore(pTrackAuxContainer.get());
 
-  ATH_CHECK(deepCopy(pTrackContainer, pTrackAuxContainer, tautrack, pTauTrackContainer));
+  SG::WriteHandle<xAOD::TauTrackContainer> tauTrackHandle(m_trigtauTrkOutKey, ctx);
+  ATH_MSG_DEBUG("  write: " << tauTrackHandle.key() << " = " << "..." );
+  ATH_CHECK(tauTrackHandle.record(std::move(pTrackContainer), std::move(pTrackAuxContainer)));
+
+  xAOD::TauTrack* tautrack(0);
+
+  ATH_CHECK(deepCopy(tauTrackHandle, tautrack, pTauTrackContainer));
 
   if(!m_trigTauTrackInKey.key().empty() && m_clustersKey.key().empty()){
     p_tau->clearTauTrackLinks();
-    if(pTrackContainer != nullptr){
-      ATH_MSG_DEBUG("TauTrackContainer size: " << pTrackContainer->size());
-      for( xAOD::TauTrack* track : *pTrackContainer){
+    if(tauTrackHandle.isValid() && tauTrackHandle->size()>0){
+      ATH_MSG_DEBUG("TauTrackContainer size: " << tauTrackHandle->size());
+      for( xAOD::TauTrack* track : *tauTrackHandle){
         ElementLink<xAOD::TauTrackContainer> linkToTauTrack;
-        linkToTauTrack.toContainedElement(*pTrackContainer, track);
+        linkToTauTrack.toContainedElement(*tauTrackHandle, track);
         p_tau->addTauTrackLink(linkToTauTrack);
       }
     }
@@ -241,7 +251,7 @@ StatusCode TrigTauRecMergedMT::execute(const EventContext& ctx) const
 
     if(p_tau==nullptr){
       p_tau = new xAOD::TauJet();
-      pContainer->push_back(p_tau);
+      outputTauHandle->push_back(p_tau);
       p_tau->setROIWord(roiDescriptor->roiWord());
     }
 
@@ -363,7 +373,7 @@ StatusCode TrigTauRecMergedMT::execute(const EventContext& ctx) const
       processStatus = tool->executeVertexFinder(*p_tau);
     }
     else if (tool->type() == "TauTrackFinder") {
-      processStatus = tool->executeTrackFinder(*p_tau, *pTrackContainer);
+      processStatus = tool->executeTrackFinder(*p_tau, *tauTrackHandle);
     }
     else if (tool->type() == "TauVertexVariables" ) {
       processStatus = tool->executeVertexVariables(*p_tau, dummyVxCont);
@@ -384,15 +394,17 @@ StatusCode TrigTauRecMergedMT::execute(const EventContext& ctx) const
     }
   }
 
+  ATH_MSG_DEBUG("This tau has " << p_tau->allTracks() << " tracks linked");
+
   //check status
   if ( !processStatus.isSuccess() )  {   // some problem
     ATH_MSG_DEBUG("The tau object has NOT been registered in the tau container");
 
-    xAOD::TauJet* bad_tau = pContainer->back();
+    xAOD::TauJet* bad_tau = outputTauHandle->back();
     ATH_MSG_DEBUG("Deleting " << bad_tau->nAllTracks() << " tracks associated with tau");
-    pTrackContainer->erase(pTrackContainer->end()-bad_tau->nAllTracks(), pTrackContainer->end());
+    tauTrackHandle->erase(tauTrackHandle->end()-bad_tau->nAllTracks(), tauTrackHandle->end());
 
-    pContainer->pop_back();
+    outputTauHandle->pop_back();
 
     ATH_MSG_DEBUG("Clean up done after jet seed");
   }
@@ -479,22 +491,12 @@ StatusCode TrigTauRecMergedMT::execute(const EventContext& ctx) const
   // all done, register the tau Container in TDS.
   //-------------------------------------------------------------------------
   
-  ATH_MSG_DEBUG("Output TauJetContainer size:"<< pContainer->size());
-  ATH_MSG_DEBUG("Output TauTrackJetContainer size:"<< pTrackContainer->size());
+  ATH_MSG_DEBUG("Output TauJetContainer size:"<< outputTauHandle->size());
+  ATH_MSG_DEBUG("Output TauJetTrackContainer size:"<< tauTrackHandle->size());
   
   
   ATH_MSG_DEBUG("Recorded a tau container: HLT_TrigTauRecMergedMT");
   ATH_MSG_DEBUG("the tau object has been registered in the tau container");
-
-  SG::WriteHandle<xAOD::TauTrackContainer> tauTrackHandle(m_trigtauTrkOutKey, ctx);
-  ATH_MSG_DEBUG("  write: " << tauTrackHandle.key() << " = " << "..." );
-  ATH_CHECK(tauTrackHandle.record(std::unique_ptr<xAOD::TauTrackContainer>(pTrackContainer), 
-                       std::unique_ptr<xAOD::TauTrackAuxContainer>(pTrackAuxContainer)));
-
-  // Write final taujets container
-  SG::WriteHandle<xAOD::TauJetContainer> outputTauHandle(m_trigtauRecOutKey, ctx);
-  ATH_CHECK(outputTauHandle.record(std::unique_ptr<xAOD::TauJetContainer>(pContainer),
-                       std::unique_ptr<xAOD::TauJetAuxContainer>(pAuxContainer)));
   
   return StatusCode::SUCCESS;
 }
diff --git a/Trigger/TrigAlgorithms/TrigTauRec/src/TrigTauRecMergedMT.h b/Trigger/TrigAlgorithms/TrigTauRec/src/TrigTauRecMergedMT.h
index 305ca60b1da925bc67d041344b0179315eeb3c6d..f773ee659e8e3d304abc317ce91a3a663a64c827 100755
--- a/Trigger/TrigAlgorithms/TrigTauRec/src/TrigTauRecMergedMT.h
+++ b/Trigger/TrigAlgorithms/TrigTauRec/src/TrigTauRecMergedMT.h
@@ -39,8 +39,7 @@ class TrigTauRecMergedMT: public AthReentrantAlgorithm {
 
   template<class T, class U, class V> StatusCode deepCopy(T*& containerOut, U*& containerStoreOut, const V* dummyContainerType,
                                  const T*& oldContainer);
-  template<class T, class U, class V> StatusCode deepCopy(T*& containerOut,
-                                                          U*& containerStoreOut,
+  template<class W, class V, class T> StatusCode deepCopy(W& writeHandle,
                                                           const V* dummyContainerType,
                                                           const T*& oldContainer) const;
 
@@ -89,25 +88,19 @@ class TrigTauRecMergedMT: public AthReentrantAlgorithm {
 };
 
   // Function to perform deep copy on container
-  template<class T, class U, class V>
-  StatusCode TrigTauRecMergedMT::deepCopy(T*& container,
-                                          U*& containerStore,
-                                          const V* /*dummyContainerElementType*/,
+  template<class W, class V, class T>
+    StatusCode TrigTauRecMergedMT::deepCopy(W& writeHandle,
+                                          const V* ,
                                           const T*& oldContainer) const {
-   // The new container should be null, check here
-   if(container==0 && containerStore==0){
-     container = new T();
-     containerStore = new U();
-     container->setStore(containerStore);
-   }else{
-     ATH_MSG_FATAL("Proviced non-null containters, not initializing please provide null containers: ");
-     return StatusCode::FAILURE;
+   if(!writeHandle.isValid()){
+      ATH_MSG_FATAL("Provided with an invalid write handle ");
+      return StatusCode::FAILURE;
    }
    if(oldContainer != nullptr){
      for( const V* v : *oldContainer ){
        V* newV = new V();
        // Put objects into new container
-       container->push_back(newV);
+       writeHandle->push_back(newV);
        // Copy across aux store
        *newV = *v;
      }
diff --git a/Trigger/TrigAnalysis/TrigInDetTruthAlgs/src/TrigInDetTrackTruthMaker.cxx b/Trigger/TrigAnalysis/TrigInDetTruthAlgs/src/TrigInDetTrackTruthMaker.cxx
index d67356efa4df9b263f31e598e6d3330aaa1c2be6..4b18d66a9a608bd147109f02cbd4cd9138381cbe 100644
--- a/Trigger/TrigAnalysis/TrigInDetTruthAlgs/src/TrigInDetTrackTruthMaker.cxx
+++ b/Trigger/TrigAnalysis/TrigInDetTruthAlgs/src/TrigInDetTrackTruthMaker.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
 */
 
 /**************************************************************************
@@ -292,7 +292,7 @@ bool TrigInDetTrackTruthMaker::TrackTruth(const TrigInDetTrack* p_trk, TrigInDet
   std::map<HepMcParticleLink, unsigned int> true_hits_map_trt;
   
   // get TrigSiSpacePoints
-  std::vector <const TrigSiSpacePoint*>* p_sp_vec = p_trk->siSpacePoints();
+  const std::vector <const TrigSiSpacePoint*>* p_sp_vec = p_trk->siSpacePoints();
   
   // check TrigSiSpacePoints are there and if so carry on
   if (p_sp_vec) {
@@ -300,8 +300,8 @@ bool TrigInDetTrackTruthMaker::TrackTruth(const TrigInDetTrack* p_trk, TrigInDet
     if (msgLvl(MSG::VERBOSE)) msg() << MSG::VERBOSE << "TrackTruth() : TrigInDetTrack has " 
            << p_sp_vec->size() << " SiSpacePoints" << endmsg;
 
-    std::vector<const TrigSiSpacePoint*>::iterator spIter = p_sp_vec->begin();
-    std::vector<const TrigSiSpacePoint*>::iterator lastSP = p_sp_vec->end();
+    std::vector<const TrigSiSpacePoint*>::const_iterator spIter = p_sp_vec->begin();
+    std::vector<const TrigSiSpacePoint*>::const_iterator lastSP = p_sp_vec->end();
     
     // make local vector to contain GenParticles corresponding to space point
     std::vector<HepMcParticleLink>* p_gp_vec = new std::vector<HepMcParticleLink>;
@@ -354,15 +354,15 @@ bool TrigInDetTrackTruthMaker::TrackTruth(const TrigInDetTrack* p_trk, TrigInDet
   } // ! if (siSpacePoints exist)
 
   // get TRT_DriftCircles
-  std::vector<const InDet::TRT_DriftCircle*>* p_dc_vec = p_trk->trtDriftCircles();
+  const std::vector<const InDet::TRT_DriftCircle*>* p_dc_vec = p_trk->trtDriftCircles();
   
   // check TRT_DriftCircles are there and if so carry on
   if (p_dc_vec) {
     if (msgLvl(MSG::VERBOSE)) msg() << MSG::VERBOSE << "TrackTruth() : TrigInDetTrack has " 
            << p_dc_vec->size() << " TRT_DriftCircles" << endmsg;
     
-    std::vector<const InDet::TRT_DriftCircle*>::iterator dcIter = p_dc_vec->begin();
-    std::vector<const InDet::TRT_DriftCircle*>::iterator lastSP = p_dc_vec->end();
+    std::vector<const InDet::TRT_DriftCircle*>::const_iterator dcIter = p_dc_vec->begin();
+    std::vector<const InDet::TRT_DriftCircle*>::const_iterator lastSP = p_dc_vec->end();
     
     // make vector to contain GenParticles corresponding to drift circle
     std::vector<HepMcParticleLink>* p_gp_vec = new std::vector<HepMcParticleLink>;
diff --git a/Trigger/TrigAnalysis/TrigJiveXML/src/TrigInDetTrackRetriever.cxx b/Trigger/TrigAnalysis/TrigJiveXML/src/TrigInDetTrackRetriever.cxx
index 90227f4789df6c37e3116174965c039801cb485f..7816d2b8d3ee5f32c0c8fdc339803b23b91b90ae 100755
--- a/Trigger/TrigAnalysis/TrigJiveXML/src/TrigInDetTrackRetriever.cxx
+++ b/Trigger/TrigAnalysis/TrigJiveXML/src/TrigInDetTrackRetriever.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 "TrigJiveXML/TrigInDetTrackRetriever.h"
@@ -99,20 +99,18 @@ namespace JiveXML {
 	  //Get associated hits
 	  int numHits = 0;
 	  if ( (*itr)->siSpacePoints() ){
-	    std::vector<const TrigSiSpacePoint*>::iterator itus = (*itr)->siSpacePoints()->begin();
-	    for (; itus != (*itr)->siSpacePoints()->end() ; ++itus){
-	      hitsvec.push_back(DataType(((*itus)->clusters( ).first)->identify().get_compact()));
+            for (const TrigSiSpacePoint* sp : *(*itr)->siSpacePoints()) {
+	      hitsvec.push_back(DataType((sp->clusters( ).first)->identify().get_compact()));
 	      ++numHits;
-	      if((*itus)->clusters( ).second != 0){
-		hitsvec.push_back(DataType(((*itus)->clusters( ).second)->identify().get_compact()));
+	      if(sp->clusters( ).second != 0){
+		hitsvec.push_back(DataType((sp->clusters( ).second)->identify().get_compact()));
 		++numHits;
 	      }
 	    }
 	  }
 	  if ( (*itr)->trtDriftCircles() ) {
-	    std::vector<const InDet::TRT_DriftCircle*>::iterator itus = (*itr)->trtDriftCircles()->begin();
-	    for (; itus != (*itr)->trtDriftCircles()->end() ; ++itus){
-	      hitsvec.push_back(DataType(((*itus)->identify().get_compact())));
+            for (const InDet::TRT_DriftCircle* dc : *(*itr)->trtDriftCircles()) {
+	      hitsvec.push_back(DataType((dc->identify().get_compact())));
 	      ++numHits;
 	    }
 	  }
diff --git a/Trigger/TrigAnalysis/TrigJiveXML/src/TrigSiSpacePointRetriever.cxx b/Trigger/TrigAnalysis/TrigJiveXML/src/TrigSiSpacePointRetriever.cxx
index c42287556dbb754343892b217be39daccc0df46e..53d943cc5f083e8ea67166ef6256a94c48998820 100755
--- a/Trigger/TrigAnalysis/TrigJiveXML/src/TrigSiSpacePointRetriever.cxx
+++ b/Trigger/TrigAnalysis/TrigJiveXML/src/TrigSiSpacePointRetriever.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "TrigJiveXML/TrigSiSpacePointRetriever.h"
@@ -21,13 +21,13 @@ namespace JiveXML {
     AthAlgTool(type, name, parent),
     m_typeName("TrigS3D"),
     m_pixelHelper(nullptr),
-    m_sctHelper(nullptr)
+    m_sctHelper(nullptr),
+    m_pixelSpContainerName ("TrigPixelSpacePoints"),
+    m_SCT_SpContainerName  ("TrigSCT_SpacePoints")
   {
 
     declareInterface<IDataRetriever>(this);
 
-    m_pixelSpContainerName = "TrigPixelSpacePoints";
-    m_SCT_SpContainerName  = "TrigSCT_SpacePoints";
     declareProperty("PixelSpacePoints", m_pixelSpContainerName);
     declareProperty("SCTSpacePoints"  , m_SCT_SpContainerName);
   }
diff --git a/Trigger/TrigConfiguration/TrigConfData/TrigConfData/HLTPrescalesSet.h b/Trigger/TrigConfiguration/TrigConfData/TrigConfData/HLTPrescalesSet.h
index 544bf8f9e99ac9bc2d5dae2dbdcb554f7053b6d3..5845a78f5ec5b46a63ea1fe18cd91cfb45d9a2c4 100644
--- a/Trigger/TrigConfiguration/TrigConfData/TrigConfData/HLTPrescalesSet.h
+++ b/Trigger/TrigConfiguration/TrigConfData/TrigConfData/HLTPrescalesSet.h
@@ -60,7 +60,7 @@ namespace TrigConf {
    private:
 
       /** Update the internal prescale map after modification of the data object */
-      virtual void update();
+      virtual void update() override;
 
       /** the prescale key */
       unsigned int m_psk {0};
diff --git a/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1PrescalesSet.h b/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1PrescalesSet.h
index 041ec9e03419d321efa446bad76b967e6b9d6209..54af67b0f445a3ecdbeaab057e76c1b7380f0f81 100644
--- a/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1PrescalesSet.h
+++ b/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1PrescalesSet.h
@@ -57,7 +57,7 @@ namespace TrigConf {
    private:
 
       /** Update the internal prescale map after modification of the data object */
-      virtual void update();
+      virtual void update() override;
 
       /** the prescale key */
       unsigned int m_psk {0};
diff --git a/Trigger/TrigConfiguration/TrigConfIO/scripts/AtlTriggerDBCopy.py b/Trigger/TrigConfiguration/TrigConfIO/scripts/AtlTriggerDBCopy.py
new file mode 100755
index 0000000000000000000000000000000000000000..0e84acaddab78afd53cc72074782f4cd6c21df44
--- /dev/null
+++ b/Trigger/TrigConfiguration/TrigConfIO/scripts/AtlTriggerDBCopy.py
@@ -0,0 +1,289 @@
+#!/usr/bin/env python
+
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+
+# script to produce a one-to-one copy of the oracle Run 2 MC TriggerDB to sqlite
+
+from TrigConfIO.TriggerConfigAccessBase import ConfigDBLoader
+
+import sqlite3
+
+def parseCmdline():
+    import argparse
+    parser = argparse.ArgumentParser(prog = "AtlTriggerDBCopy.py")
+    parser.add_argument("-d", "--dbalias", dest="dbalias", help="TriggerDB connection alias for the source DB")
+    parser.add_argument("-c", "--create", dest="createfile", help="create sqlite db file")
+    parser.add_argument("-u", "--update", dest="updatefile", help="update sqlite db file")
+    parser.add_argument("-v", help="increase output verbosity", action="count", default=0)
+    args = parser.parse_args()
+    if not args.dbalias:
+        print("No source Trigger DB specified")
+        parser.print_help()
+        return None
+    if not args.createfile and not args.updatefile:
+        print("No sqlite target file specified (use create or update)")
+        parser.print_help()
+        return None
+    return args
+
+# class to handle the oracle db connection
+# it uses the CORAL authentication method implemented in the TrigConfIO.TriggerConfigAccessBase (ConfigDBLoader)
+class DBConnection:
+    def __init__(self, dbalias):
+        self.dbalias = dbalias
+        self.connection = None
+        self.schema = None
+
+    def __enter__(self):
+        credentials = ConfigDBLoader.getConnectionParameters(self.dbalias)
+        self.connection, self.schema = ConfigDBLoader.getConnection(credentials)
+        print(f"Opening connection to {self.dbalias}")
+        return self
+
+    def __exit__(self, type, value, traceback):
+        self.connection.close()
+        print(f"Closing connection to {self.dbalias}" )
+
+    def cursor(self):
+        return self.connection.cursor()
+
+    def schema(self):
+        return self.schema
+
+# class to handle the insertion of schema and data on the sqlite side
+class SQLiteInserter:
+
+    def __init__(self, filename = None):
+        self.filename = filename
+        self.connection = None
+        self.activeTransaction = False
+        self.insCountInTrans = 0
+        self.maxInsertsPerTransaction = 1000
+        if self.filename is None:
+            print("Not connected to an output file, will print the insert commands instead")
+        import os
+        if filename and os.path.exists(filename):
+            print(f"File or path {filename} exists already, will not overwrite it and only print the insert commands instead")
+            self.filename = None
+        if self.filename is not None:
+            self.connection = sqlite3.connect(self.filename)
+            self.cursor = self.connection.cursor()
+    def commit(self):
+        if self.activeTransaction:
+            self.cursor.execute('COMMIT')
+            self.activeTransaction = False
+            self.insCountInTrans = 0
+
+    def insert(self, statement, data):
+        if self.connection is None:
+            return            
+        if not self.activeTransaction:
+            self.cursor.execute('BEGIN TRANSACTION')
+            self.activeTransaction = True
+        self.cursor.execute(statement, data)
+        self.insCountInTrans += 1
+        if self.insCountInTrans==self.maxInsertsPerTransaction:
+            self.commit()
+
+    def insertBulk(self, statement, data):
+        if self.connection is None:
+            return
+        self.cursor.executemany(statement, iter(data))
+        self.connection.commit()
+
+    def createSchema(self, creationFileName):
+        if self.connection is None:
+            return
+        with open(creationFileName) as fh:
+            print("Creating sqlite db %s from %s" % (self.filename, creationFileName) )
+            self.cursor.executescript( fh.read() )
+
+
+# class to handle the extraction of schema and data on the oracle side
+class OracleExporter:
+
+    def __init__(self, connection):
+        self.connection = connection
+        self.primaryKeys = None
+        self.foreignKeys = None
+        self.tables = None
+        self.ignoreTablesR2 = [ 'TT_WRITELOCK', 'HLT_SMT_TO_HRE', 'HLT_PARAMETER', 'HLT_RELEASE', 'TRIGGER_LOG',
+                                'DBCOPY_SOURCE_DATABASE', 'HLT_RULE_SET', 'TEMP', 'HLT_RULE_PARAMETER', 'HLT_RULE_COMPONENT',
+                                'ACTIVE_MASTERS', 'HLT_SETUP', 'TT_USERS', 'HLT_RULE', "HLT_HRC_TO_HRP", "HLT_HRE_TO_HRS", 
+                                "HLT_HRS_TO_HRU", "HLT_HRU_TO_HRC", "HLT_PRESCALE_SET_ALIAS", "HLT_PRESCALE_SET_COLL",
+                                "PRESCALE_SET_ALIAS", "TRIGGER_ALIAS", "L1_PRESCALE_SET_ALIAS", "L1_PITS", "L1_CALO_SIN_COS",
+                                "L1_CI_TO_CSC", "L1_DEAD_TIME", "L1_JET_INPUT", "L1_MUON_THRESHOLD_SET", "HLT_TRIGGER_TYPE",
+                                "L1_CTP_FILES", "L1_CTP_SMX" ]
+
+    def getTables(self, isRun2MC = True):
+        if self.tables:
+            return self.tables
+        query_ListAllTables = "SELECT table_name FROM all_tables WHERE owner=:SCHEMA"
+        data = { "SCHEMA" : self.connection.schema }
+        result = self.executeQuery(query_ListAllTables, data)
+        self.tables = [x[0] for x in result]
+        if isRun2MC:
+            for x in self.ignoreTablesR2:
+                self.tables.remove(x)
+        return self.tables
+
+    def executeQuery(self, query, data = {}):
+        cursor = self.connection.cursor()
+        cursor.arraysize = 1000
+        cursor.execute( query, **data )
+        return cursor        
+
+    def tableSize(self,tableName):
+        query_TableSize = "SELECT COUNT(*) FROM {schema}.{tableName}"
+        qdict = { "schema" : self.connection.schema, "tableName" : tableName }
+        result = self.executeQuery( query_TableSize.format(**qdict) )
+        row = result.fetchone()
+        return row[0]
+
+    def columnNames(self,tableName):
+        query_ColumnNames = "SELECT column_name, data_type FROM sys.all_tab_columns WHERE owner = :SCHEMA AND table_name = :TABLE_NAME ORDER BY column_id"
+        data = { "SCHEMA" : self.connection.schema, "TABLE_NAME" : tableName }
+        result = self.executeQuery( query = query_ColumnNames, data = data )
+        colNames, colTypes = zip(*result)
+        return colNames, colTypes
+
+    def getPrimaryKeys(self):
+        if self.primaryKeys is not None:
+            return self.primaryKeys
+        print("retrieving primary key constraints from Oracle")
+        query_PrimaryKeys = """
+        SELECT table_name, column_name, position FROM sys.all_cons_columns WHERE owner = :SCHEMA AND constraint_name in 
+        (SELECT constraint_name FROM sys.all_constraints WHERE owner = :SCHEMA AND constraint_type='P') 
+        ORDER BY table_name, position
+        """
+        data = { "SCHEMA" : self.connection.schema }
+        pk = {}
+        result = self.executeQuery( query = query_PrimaryKeys, data = data )
+        for table_name, column_name, _ in result:
+            if table_name not in pk:
+                pk[table_name] = []
+            pk[table_name] += [ column_name ]
+        self.primaryKeys = pk
+        return self.primaryKeys
+
+    def getForeignKeys(self):
+        if self.foreignKeys is not None:
+            return self.foreignKeys
+        print("retrieving foreign key constraints from Oracle")
+        query_ForeignKeys = """
+        SELECT c.table_name, c.constraint_name, a.column_name, c.r_constraint_name, r.table_name, r.column_name 
+        FROM sys.all_constraints c
+        INNER JOIN
+        sys.all_cons_columns a
+        on (c.constraint_type='R' and c.constraint_name = a.constraint_name and c.owner = :SCHEMA and a.owner = :SCHEMA)
+        INNER JOIN
+        sys.all_cons_columns r
+        on (c.r_constraint_name = r.constraint_name and r.owner = :SCHEMA)
+        """        
+        data = { "SCHEMA" : self.connection.schema }
+        fk = {}
+        result = self.executeQuery( query = query_ForeignKeys, data = data )
+        for table, _, fkcol, _, rtable, rcol in result:
+            if table not in fk:
+                fk[table] = []
+            fk[table] += [ { "col" : fkcol, "rtab" : rtable, "rcol" : rcol } ]
+        self.foreignKeys = fk
+        return self.foreignKeys
+
+    def sqliteType(self, oraType):
+        if oraType.startswith("TIMESTAMP"):
+            return "TEXT"
+        d = { "VARCHAR2" : "TEXT",
+              "CHAR" : "TEXT",
+              "NUMBER" : "INTEGER",
+              "CLOB" : "TEXT"
+          }
+        return d[oraType]
+
+    def tableCreationCommand(self, tableName, primaryKeys, foreignKeys):
+        colNames, colTypes = self.columnNames(tableName)
+        lines = []
+        for colName, colType in zip(colNames,colTypes):
+            lines.append( "%s %s" % (colName, self.sqliteType(colType)) )
+        lines.append( "PRIMARY KEY (%s)" % ",".join(primaryKeys) )
+        for fk in foreignKeys:
+            lines.append( "FOREIGN KEY (%s) REFERENCES %s (%s)" % (fk["col"], fk["rtab"], fk["rcol"]) )
+        creationCommand = f"CREATE TABLE IF NOT EXISTS {tableName} (\n    "
+        creationCommand += ",\n    ".join(lines)
+        creationCommand += "\n);\n"
+        return creationCommand
+
+    def extractSchema(self, creationFileName, isRun2MC = True):
+        fk = self.getForeignKeys()
+        pk = self.getPrimaryKeys()
+        with open(creationFileName, "w") as fh:
+            print("Creating schema file for sqlite: %s" % creationFileName)
+            for tableName in self.getTables(isRun2MC):
+                print(self.tableCreationCommand(tableName, pk[tableName], fk[tableName] if tableName in fk else []), file = fh)
+
+    def copyTable(self, tableName, sqliteInserter, size):
+        # build insert statement
+        schema = self.connection.schema
+        colNames,_ = self.columnNames(tableName)
+        colNameList = ",".join(colNames)
+        bindVarList = ",".join(len(colNames)*["?"])
+        insertStatement = f"INSERT INTO {tableName} ({colNameList}) VALUES ({bindVarList})"
+        # select entries from oracle
+        selectQuery = f"SELECT {colNameList} FROM {schema}.{tableName}"
+        #print(selectQuery)
+        result = self.executeQuery( selectQuery )
+        useBulkInsert = True
+        if useBulkInsert:
+            sqliteInserter.insertBulk(insertStatement, result)
+        else:
+            c = 0
+            for data in result:
+                if c%10000==0:
+                    print("%i / %i" % (c, size))
+                c+=1
+                sqliteInserter.insert(insertStatement, data)
+                if c==size:
+                    break # just doing some timing measurements
+        sqliteInserter.commit()
+
+
+def main():
+    args = parseCmdline()
+    if args is None:
+        return 1
+
+    # instantiate the sqlite inserter with the sqlite db filename
+    sqliteInserter = SQLiteInserter(args.createfile)
+
+    # connect to oracle and do the work
+    with DBConnection(args.dbalias) as oraConn:
+        oraExp = OracleExporter(oraConn)
+
+        # extract the schema into a temporary file and create it on the sqlite side
+        tempTableCreationFileName = "tmpCreateTablesSQLite.sql"
+        oraExp.extractSchema(tempTableCreationFileName)
+        sqliteInserter.createSchema(tempTableCreationFileName)
+
+        # collect some info about the size, to not run completely blind
+        entries = {}
+        for tableName in oraExp.getTables():
+            entries[tableName] = oraExp.tableSize(tableName)
+            print("  table %s has %i entries" % (tableName, entries[tableName]) )
+        totalEntries = sum(entries.values())
+        print("\nTotal number of entries: %i" %totalEntries)
+
+        # copy the data one table at the time
+        print("Start copying data")
+        copiedEntries = 0
+        for tableName in oraExp.getTables():            
+            print("Copying table %s" % tableName, end = '', flush=True)
+            oraExp.copyTable(tableName, sqliteInserter, entries[tableName])
+            copiedEntries += entries[tableName]
+            print(" => done %i / %i (%f%%)" % (copiedEntries, totalEntries, 100 * copiedEntries/totalEntries))
+
+    sqliteInserter.connection.close()
+
+
+if __name__ == "__main__":
+    import sys
+    sys.exit(main())
diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/python/TrigConfigSvcConfig.py b/Trigger/TrigConfiguration/TrigConfigSvc/python/TrigConfigSvcConfig.py
index aa9e51a3481cb7d87dc6e387c9669d5721885f73..59b620da65188398096f77ff782781665c077125 100755
--- a/Trigger/TrigConfiguration/TrigConfigSvc/python/TrigConfigSvcConfig.py
+++ b/Trigger/TrigConfiguration/TrigConfigSvc/python/TrigConfigSvcConfig.py
@@ -82,7 +82,7 @@ class DefaultHLTConfigSvc( TrigConf__HLTConfigSvc ):
         else:
             mlog.info("Will load algos from xml")
             allalgs = []
-            doc = ET.parse(self.XMLMenuFile)
+            doc = ET.parse( findFileInXMLPATH(self.XMLMenuFile) )
             algs = self.getAllAlgorithms(doc)
             l2TEs, efTEs = self.getTEsByLevel(doc)
 
@@ -111,7 +111,7 @@ class DefaultHLTConfigSvc( TrigConf__HLTConfigSvc ):
             mlog.info("Will load algos from xml")
             l2algs = []
             efalgs = []
-            doc = ET.parse(self.XMLMenuFile)
+            doc = ET.parse( findFileInXMLPATH(self.XMLMenuFile) )
             algs = self.getAllAlgorithms(doc)
             l2TEs, efTEs = self.getTEsByLevel(doc)
 
@@ -130,7 +130,7 @@ class DefaultHLTConfigSvc( TrigConf__HLTConfigSvc ):
         l2TEs = []
         efTEs = []
         #print "INFO parsing: " + self.XMLMenuFile
-        if not doc: doc = ET.parse(self.XMLMenuFile)
+        if not doc: doc = ET.parse( findFileInXMLPATH(self.XMLMenuFile) )
 
         #print "INFO got chains " + str(chainlist)
         for ch in doc.getiterator("CHAIN"):
@@ -173,7 +173,7 @@ class DefaultHLTConfigSvc( TrigConf__HLTConfigSvc ):
 
     def getAllSequenceInputs (self, doc = None):
         """ Produce dictionaries where key is outout TE name and values are tuples of TEs """
-        if not doc: doc = ET.parse(self.XMLMenuFile)
+        if not doc: doc = ET.parse( findFileInXMLPATH(self.XMLMenuFile) )
         inp = {}
         for seq in doc.getiterator("SEQUENCE"):
             #print "INFO Discovered algorithms in the sequence: " + seq.getAttribute("algorithm")
@@ -183,7 +183,7 @@ class DefaultHLTConfigSvc( TrigConf__HLTConfigSvc ):
     def getAllAlgorithms(self, doc = None):
         """ Produce dictionary where key is output TE name of the sequence and value is a list of algos in sequence"""
         #print "INFO parsing: " + self.XMLMenuFile
-        if not doc: doc = ET.parse(self.XMLMenuFile)
+        if not doc: doc = ET.parse( findFileInXMLPATH(self.XMLMenuFile) )
         #print "INFO getting sequences "
         algos = {}
         for seq in doc.getiterator("SEQUENCE"):
diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/src/AlgToChainTool.cxx b/Trigger/TrigConfiguration/TrigConfigSvc/src/AlgToChainTool.cxx
deleted file mode 100644
index cb9c3b9eb2723572cdc6e3625c920a3c4f482290..0000000000000000000000000000000000000000
--- a/Trigger/TrigConfiguration/TrigConfigSvc/src/AlgToChainTool.cxx
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
-  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "AlgToChainTool.h"
-
-TrigConf::AlgToChainTool::AlgToChainTool(const std::string& type,
-                        const std::string& name,
-                        const IInterface* parent)
-    : AthAlgTool (type, name, parent) 
-    {}
-
-
-TrigConf::AlgToChainTool::~AlgToChainTool() {}
-
-
-StatusCode TrigConf::AlgToChainTool::initialize() {
-    ATH_CHECK( m_HLTMenuKey.initialize() );
-
-    return StatusCode::SUCCESS;
-}
-
-
-StatusCode TrigConf::AlgToChainTool::start() {
-    SG::ReadHandle<TrigConf::HLTMenu>  hltMenuHandle = SG::makeHandle( m_HLTMenuKey );
-    ATH_CHECK( hltMenuHandle.isValid() );
-
-    // fill the maps
-    for ( const TrigConf::Chain& chain : *hltMenuHandle ) {
-        for ( const std::string& sequencer : chain.sequencers() ) {
-            m_sequencerToChainMap[sequencer].push_back(chain.name());
-        }
-    }
-
-    for ( const auto& sequencer : hltMenuHandle->sequencers() ) {
-        for ( const std::string& algorithm : sequencer.second ) {
-            // save just second part of algorithm ex. RoRSeqFilter/FFastCaloElectron -> FFastCaloElectron
-            m_algToSequencersMap[algorithm.substr(algorithm.find('/') + 1)]
-                .push_back(sequencer.first);
-        }
-    }
-
-    return StatusCode::SUCCESS;
-}
-
-
-std::set<std::string> TrigConf::AlgToChainTool::getChainsForAlg(const std::string& algorithmName) const {
-    std::set<std::string> result;
-
-    try {
-        for ( const std::string& sequencer : m_algToSequencersMap.at(algorithmName) ) {
-            result.insert(m_sequencerToChainMap.at(sequencer).begin(), m_sequencerToChainMap.at(sequencer).end());
-        }
-    } catch ( const std::out_of_range & ex ) {
-        ATH_MSG_ERROR ( algorithmName << " is not part of the menu!" );
-    }
-
-    return result;
-}
\ No newline at end of file
diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/src/HLTConfigSvc.cxx b/Trigger/TrigConfiguration/TrigConfigSvc/src/HLTConfigSvc.cxx
index 1f0fadd7393b7829978cdbe044654c6c007f24c2..3536edb0cae818e70d3313d5d8b0ed5df5572e3e 100644
--- a/Trigger/TrigConfiguration/TrigConfigSvc/src/HLTConfigSvc.cxx
+++ b/Trigger/TrigConfiguration/TrigConfigSvc/src/HLTConfigSvc.cxx
@@ -56,16 +56,13 @@ using namespace TrigConf;
 
 HLTConfigSvc::HLTConfigSvc( const string& name, ISvcLocator* pSvcLocator ) :
    base_class(name, pSvcLocator),
-   m_eventStore( "StoreGateSvc/StoreGateSvc",  name ),
-   m_histProp_timePrescaleUpdate(Gaudi::Histo1DDef("Time for prescale update",0,200,100))
+   m_eventStore( "StoreGateSvc/StoreGateSvc",  name )
 {
    base_class::declareCommonProperties();
 
    declareProperty( "DBHLTPSKey",       m_dbHLTPSKey );
    declareProperty( "DBHLTPSKeySet",    m_dbHLTPSKeySet,
                     "List of HLT Prescale keys associated with start Lumiblocks LB1uPSK1cLB2uPSK2" );
-   declareProperty( "HistTimePrescaleUpdate", m_histProp_timePrescaleUpdate,
-                    "Histogram of time for prescale update");
    declareProperty( "doMergedHLT",      m_setMergedHLT,
                     "Set true to run the merged HLT processing");
    declareProperty( "doMonitoring",     m_doMon,
@@ -286,8 +283,6 @@ TrigConf::HLTConfigSvc::start() {
 
    ATH_MSG_INFO("HLTConfigSvc::start");
 
-   // Book histograms
-   if (m_doMon) bookHistograms().ignore();
    m_currentLumiblock = 0;
 
    if( ! fromDB() ) // xml config
@@ -339,39 +334,6 @@ TrigConf::HLTConfigSvc::applyPrescaleSet(const TrigConf::HLTPrescaleSet& pss) {
 }
 
 
-StatusCode
-TrigConf::HLTConfigSvc::bookHistograms() {
-
-   ServiceHandle<ITHistSvc> histSvc("THistSvc", name());
-
-   CHECK(histSvc.retrieve());
-
-   const std::string histPath = "/EXPERT/" + name() + "/";
-
-   m_hist_timePrescaleUpdate = new TH1F("TimePrescaleUpdate",
-                                        (m_histProp_timePrescaleUpdate.value().title() + ";time [ms]").c_str(),
-                                        m_histProp_timePrescaleUpdate.value().bins(),
-                                        m_histProp_timePrescaleUpdate.value().lowEdge(),
-                                        m_histProp_timePrescaleUpdate.value().highEdge());
-   const int nLB(1), nKey(1);
-   m_hist_prescaleLB = new TH2I("PrescaleKey_LB","Prescale key used in LB;Lumiblock;Prescale key",
-                                nLB, 0, nLB, nKey, 0, nKey);
-
-   // try to register, delete if failure
-   TH1** hists[] = { (TH1**)&m_hist_timePrescaleUpdate,
-                     (TH1**)&m_hist_prescaleLB };
-   for ( TH1** h: hists ) {
-      if ( *h && histSvc->regHist(histPath + (*h)->GetName(), *h).isFailure() ) {
-         ATH_MSG_WARNING("Cannot register histogram " << (*h)->GetName());
-         delete *h;
-         *h = 0;
-      }
-   }
-
-   return StatusCode::SUCCESS;
-}
-
-
 StatusCode
 TrigConf::HLTConfigSvc::finalize() {
    ATH_MSG_DEBUG("Finalizing");
@@ -428,26 +390,60 @@ TrigConf::HLTConfigSvc::setL2LowerChainCounter(const CTPConfig* ctpcfg) {
 // query the TriggerDB for the list of lumiblocks and corresponding prescalekeys
 // will then load the and prescaleSets that have not yet been loaded
 StatusCode
-TrigConf::HLTConfigSvc::updatePrescaleSets(uint /*requestcount*/) {
+TrigConf::HLTConfigSvc::updatePrescaleSets(uint requestcount) {
 
    if( ! fromDB() ) { // xml 
       ATH_MSG_WARNING("Configured to not run from the database!");
       return StatusCode::SUCCESS;
    }
 
-   ATH_MSG_ERROR("Running from DB is no longer supported in legacy trigger");
-   return StatusCode::FAILURE;
+   if( !m_dbconfig->m_hltkeys.empty() ) {
+      ATH_MSG_WARNING("Has list of [(lb1,psk1), (lb2,psk2),...] defined!");
+      return StatusCode::SUCCESS;
+   }
+
+   // Load prescale set
+   CHECK(initStorageMgr());
+
+   bool loadSuccess = dynamic_cast<TrigConf::StorageMgr*>
+     (m_storageMgr)->hltPrescaleSetCollectionLoader().load( m_HLTFrame.thePrescaleSetCollection(), requestcount, "" );
+
+   CHECK(freeStorageMgr());
+
+   if(!loadSuccess) {
+      ATH_MSG_WARNING("HLTConfigSvc::updatePrescaleSets(): loading failed");
+      return StatusCode::FAILURE;
+   } else {
+      ATH_MSG_INFO ( m_HLTFrame.thePrescaleSetCollection() );
+   }
+   return StatusCode::SUCCESS;
 }
 
 
 // Assigns the prescales that are valid for a given lumiblock to the chains
 // This method is called by TrigSteer on *every* event (keep it fast)
 StatusCode
-TrigConf::HLTConfigSvc::assignPrescalesToChains(uint /*lumiblock*/) {
+TrigConf::HLTConfigSvc::assignPrescalesToChains(uint lumiblock) {
 
    if(! fromDB() ) // xml
       return StatusCode::SUCCESS;
 
-   ATH_MSG_ERROR("Running from DB is no longer supported in legacy trigger");
+   // get the HLTPrescaleSet
+   const HLTPrescaleSet* pss = m_HLTFrame.getPrescaleSetCollection().prescaleSet(lumiblock);
+   if (pss == 0) {
+      ATH_MSG_ERROR("Could not retrieve HLT prescale set for lumiblock = " << lumiblock);
+      return StatusCode::FAILURE;
+   }
+
+   // still the same HLTPSS -> nothing to do
+   if(pss->id() ==  m_currentPSS) {
+      return StatusCode::SUCCESS;
+   }
+
+   ATH_MSG_INFO("Changing PSK from " << m_currentPSS << " to " << pss->id()
+                << " for lumiblock " << lumiblock);
+
+   applyPrescaleSet(*pss);
+
    return StatusCode::FAILURE;
 }
diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/src/HLTConfigSvc.h b/Trigger/TrigConfiguration/TrigConfigSvc/src/HLTConfigSvc.h
index 1f1ad5d266d97fb2e12089dcdca1ec158813be35..6b993fa48ca18022766213691cfa69277f4edd30 100644
--- a/Trigger/TrigConfiguration/TrigConfigSvc/src/HLTConfigSvc.h
+++ b/Trigger/TrigConfiguration/TrigConfigSvc/src/HLTConfigSvc.h
@@ -92,11 +92,6 @@ namespace TrigConf {
       // Properties:
       bool            m_setMergedHLT { true }; 
       bool            m_doMon { false };
-      Histo1DProperty m_histProp_timePrescaleUpdate;
-
-      // Histograms:
-      TH1F* m_hist_timePrescaleUpdate { nullptr };
-      TH2I* m_hist_prescaleLB { nullptr };
    };
 }
 
diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/src/components/TrigConfigSvc_entries.cxx b/Trigger/TrigConfiguration/TrigConfigSvc/src/components/TrigConfigSvc_entries.cxx
index bdf1972f66a52c55f1ea0e25d937e53e19b66022..2e708b1b4c4225edb87373258a6e10f5f4fe6653 100644
--- a/Trigger/TrigConfiguration/TrigConfigSvc/src/components/TrigConfigSvc_entries.cxx
+++ b/Trigger/TrigConfiguration/TrigConfigSvc/src/components/TrigConfigSvc_entries.cxx
@@ -8,7 +8,6 @@
 #include "../L1PrescaleCondAlg.h"
 #include "../HLTPrescaleCondAlg.h"
 
-#include "../AlgToChainTool.h"
 
 DECLARE_COMPONENT( TrigConf::L1TopoConfigSvc )
 DECLARE_COMPONENT( TrigConf::LVL1ConfigSvc )
@@ -18,6 +17,4 @@ DECLARE_COMPONENT( TrigConf::DSConfigSvc )
 DECLARE_COMPONENT( TrigConf::TrigConfigSvc )
 
 DECLARE_COMPONENT( TrigConf::L1PrescaleCondAlg )
-DECLARE_COMPONENT( TrigConf::HLTPrescaleCondAlg )
-
-DECLARE_COMPONENT( TrigConf::AlgToChainTool )
\ No newline at end of file
+DECLARE_COMPONENT( TrigConf::HLTPrescaleCondAlg )
\ No newline at end of file
diff --git a/Trigger/TrigCost/TrigCostD3PD/CMakeLists.txt b/Trigger/TrigCost/TrigCostD3PD/CMakeLists.txt
deleted file mode 100644
index e31dc074cb246ada51748311bca97d8af4d4cf5a..0000000000000000000000000000000000000000
--- a/Trigger/TrigCost/TrigCostD3PD/CMakeLists.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-################################################################################
-# Package: TrigCostD3PD
-################################################################################
-
-# Declare the package name:
-atlas_subdir( TrigCostD3PD )
-
-# External dependencies:
-find_package( ROOT COMPONENTS Cint Core Tree MathCore Hist RIO pthread )
-
-# Component(s) in the package:
-atlas_add_root_dictionary( TrigCostD3PD
-                           TrigCostD3PDDictSource
-                           ROOT_HEADERS TrigCostD3PD/*.h Root/LinkDef.h
-                           EXTERNAL_PACKAGES ROOT )
-
-atlas_add_library( TrigCostD3PD
-                   Root/*.cxx
-                   ${TrigCostD3PDDictSource}
-                   PUBLIC_HEADERS TrigCostD3PD
-                   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                   LINK_LIBRARIES ${ROOT_LIBRARIES} )
-
diff --git a/Trigger/TrigCost/TrigCostD3PD/Root/LinkDef.h b/Trigger/TrigCost/TrigCostD3PD/Root/LinkDef.h
deleted file mode 100644
index d2295f82fbfc2296dd5a0d4212688e161e2ee1bb..0000000000000000000000000000000000000000
--- a/Trigger/TrigCost/TrigCostD3PD/Root/LinkDef.h
+++ /dev/null
@@ -1,86 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: Helpers.py 530000 2012-12-11 15:45:53Z krasznaa $
-#ifdef __CINT__
-
-#include "../TrigCostD3PD/D3PDObjectBase.h"
-//#include "../TrigCostD3PD/D3PDPerfStats.h"
-//#include "../TrigCostD3PD/D3PDReadStats.h"
-#include "../TrigCostD3PD/NTUP_TRIGCOST.h"
-#include "../TrigCostD3PD/TrigCostD3PDObject.h"
-#include "../TrigCostD3PD/TrigDBKeysD3PDObject.h"
-#include "../TrigCostD3PD/UserD3PDObject.h"
-#include "../TrigCostD3PD/Utils.h"
-
-#pragma link off all globals;
-#pragma link off all classes;
-#pragma link off all functions;
-
-#pragma link C++ nestedclass;
-
-#pragma link C++ class std::map<std::string,int>+;
-#pragma link C++ class std::map<std::string,float>+;
-
-#pragma link C++ class D3PDReader::VarHandleBase+;
-#pragma link C++ class D3PDReader::VarProxyBase+;
-//#pragma link C++ class D3PDReader::VariableStats+;
-//#pragma link C++ class D3PDReader::D3PDReadStats+;
-//#pragma link C++ class map<TString,D3PDReader::VariableStats>+;
-//#pragma link C++ class pair<TString,D3PDReader::VariableStats>+;
-#pragma link C++ class map<TString,D3PDReader::VarHandleBase*>+;
-#pragma link C++ class pair<TString,D3PDReader::VarHandleBase*>+;
-#pragma link C++ class D3PDReader::UserD3PDObjectElement+;
-#pragma link C++ class D3PDReader::UserD3PDObject+;
-#pragma link C++ class D3PDReader::VarHandle<unsigned int>+;
-#pragma link C++ class D3PDReader::D3PDObjectBase+;
-//#pragma link C++ class D3PDReader::D3PDPerfStats+;
-#pragma link C++ class D3PDReader::VarHandle<float>+;
-#pragma link C++ class D3PDReader::NTUP_TRIGCOST+;
-#pragma link C++ class D3PDReader::VarHandle<vector<unsigned short>*>+;
-#pragma link C++ class D3PDReader::VarHandle<vector<unsigned char>*>+;
-#pragma link C++ class D3PDReader::VarHandle<unsigned short>+;
-#pragma link C++ class D3PDReader::VarHandle<vector<float>*>+;
-#pragma link C++ class D3PDReader::VarHandle<vector<vector<unsigned int> >*>+;
-#pragma link C++ class D3PDReader::VarHandle<vector<vector<unsigned char> >*>+;
-#pragma link C++ class D3PDReader::VarHandle<vector<unsigned int>*>+;
-#pragma link C++ class D3PDReader::VarHandle<vector<double>*>+;
-#pragma link C++ class D3PDReader::VarHandle<vector<vector<double> >*>+;
-#pragma link C++ class D3PDReader::VarHandle<vector<vector<unsigned short> >*>+;
-#pragma link C++ class D3PDReader::TrigCostD3PDObject+;
-#pragma link C++ class D3PDReader::TrigDBKeysD3PDObject+;
-#pragma link C++ class D3PDReader::VarHandle<vector<short>*>+;
-#pragma link C++ class D3PDReader::VarHandle<bool>+;
-// You can disable the remaining lines if you don't
-// plan to use the library in CINT or PyROOT.
-#pragma link C++ function D3PDReader::UserD3PDObject::DeclareVariable<bool>;
-#pragma link C++ function D3PDReader::UserD3PDObject::DeclareVariable<short>;
-#pragma link C++ function D3PDReader::UserD3PDObject::DeclareVariable<unsigned short>;
-#pragma link C++ function D3PDReader::UserD3PDObject::DeclareVariable<int>;
-#pragma link C++ function D3PDReader::UserD3PDObject::DeclareVariable<unsigned int>;
-#pragma link C++ function D3PDReader::UserD3PDObject::DeclareVariable<long long>;
-#pragma link C++ function D3PDReader::UserD3PDObject::DeclareVariable<unsigned long long>;
-#pragma link C++ function D3PDReader::UserD3PDObject::DeclareVariable<float>;
-#pragma link C++ function D3PDReader::UserD3PDObject::DeclareVariable<double>;
-#pragma link C++ function D3PDReader::UserD3PDObject::Variable<bool>;
-#pragma link C++ function D3PDReader::UserD3PDObject::Variable<short>;
-#pragma link C++ function D3PDReader::UserD3PDObject::Variable<unsigned short>;
-#pragma link C++ function D3PDReader::UserD3PDObject::Variable<int>;
-#pragma link C++ function D3PDReader::UserD3PDObject::Variable<unsigned int>;
-#pragma link C++ function D3PDReader::UserD3PDObject::Variable<long long>;
-#pragma link C++ function D3PDReader::UserD3PDObject::Variable<unsigned long long>;
-#pragma link C++ function D3PDReader::UserD3PDObject::Variable<float>;
-#pragma link C++ function D3PDReader::UserD3PDObject::Variable<double>;
-#pragma link C++ function D3PDReader::UserD3PDObjectElement::Variable<short>;
-#pragma link C++ function D3PDReader::UserD3PDObjectElement::Variable<unsigned short>;
-#pragma link C++ function D3PDReader::UserD3PDObjectElement::Variable<int>;
-#pragma link C++ function D3PDReader::UserD3PDObjectElement::Variable<unsigned int>;
-#pragma link C++ function D3PDReader::UserD3PDObjectElement::Variable<long long>;
-#pragma link C++ function D3PDReader::UserD3PDObjectElement::Variable<unsigned long long>;
-#pragma link C++ function D3PDReader::UserD3PDObjectElement::Variable<float>;
-#pragma link C++ function D3PDReader::UserD3PDObjectElement::Variable<double>;
-
-#endif // __CINT__
diff --git a/Trigger/TrigCost/TrigCostD3PD/Root/NTUP_TRIGCOST.cxx b/Trigger/TrigCost/TrigCostD3PD/Root/NTUP_TRIGCOST.cxx
deleted file mode 100644
index 01315336d4095273a4eb4b3a23463d4cfac9c082..0000000000000000000000000000000000000000
--- a/Trigger/TrigCost/TrigCostD3PD/Root/NTUP_TRIGCOST.cxx
+++ /dev/null
@@ -1,105 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// -------------------------------------------------------------
-//             Code produced by D3PDMakerReader
-//
-//  author: Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
-// -------------------------------------------------------------
-
-#include "../TrigCostD3PD/NTUP_TRIGCOST.h"
-//#include "../TrigCostD3PD/D3PDPerfStats.h"
-
-ClassImp( D3PDReader::NTUP_TRIGCOST )
-
-namespace D3PDReader {
-
-   NTUP_TRIGCOST::NTUP_TRIGCOST()
-      : D3PDObjectBase(),
-        TrigCostHLT( m_entry, "TrigCostHLT_" ),
-        trig_DB( m_entry, "trig_DB_" ),
-        m_entry( 0 ),
-        m_fromInput( kTRUE ) {
-
-   }
-
-   NTUP_TRIGCOST::NTUP_TRIGCOST( Bool_t )
-      : D3PDObjectBase(),
-        TrigCostHLT( "TrigCostHLT_" ),
-        trig_DB( "trig_DB_" ),
-        m_entry( 0 ),
-        m_fromInput( kFALSE ) {
-
-   }
-
-   const char* NTUP_TRIGCOST::GetPrefix() const {
-
-      Warning( "GetPrefix", "A prefix is not defined for this object" );
-      return "";
-   }
-
-   void NTUP_TRIGCOST::SetPrefix( const char* ) {
-
-      Warning( "SetPrefix", "A prefix is not defined for this object" );
-      return;
-   }
-
-   void NTUP_TRIGCOST::ReadFrom( ::TTree* tree ) {
-
-      if( ! m_fromInput ) {
-         Error( "ReadFrom", "Object can't read a D3PD. Use a different constructor!" );
-         return;
-      }
-
-      TrigCostHLT.ReadFrom( tree );
-      trig_DB.ReadFrom( tree );
-
-      return;
-   }
-
-   void NTUP_TRIGCOST::WriteTo( ::TTree* tree ) {
-
-      TrigCostHLT.WriteTo( tree );
-      trig_DB.WriteTo( tree );
-
-      return;
-   }
-
-   void NTUP_TRIGCOST::SetActive( ::Bool_t active, const ::TString& pattern ) {
-
-      TrigCostHLT.SetActive( active, pattern );
-      trig_DB.SetActive( active, pattern );
-
-      return;
-   }
-
-   void NTUP_TRIGCOST::ReadAllActive() {
-
-      TrigCostHLT.ReadAllActive();
-      trig_DB.ReadAllActive();
-
-      return;
-   }
-
-   // D3PDReadStats NTUP_TRIGCOST::GetStatistics() const {
-
-   //    // The result object:
-   //    D3PDReadStats result( D3PDPerfStats::Instance()->GetStats() );
-
-   //    // Collect the statistics from all constituents:
-   //    result += TrigCostHLT.GetStatistics();
-   //    result += trig_DB.GetStatistics();
-
-   //    return result;
-   // }
-
-   void NTUP_TRIGCOST::GetEntry( ::Long64_t entry ) {
-
-      m_entry = entry;
-      return;
-   }
-
-} // namespace D3PDReader
diff --git a/Trigger/TrigCost/TrigCostD3PD/Root/TrigCostD3PDObject.cxx b/Trigger/TrigCost/TrigCostD3PD/Root/TrigCostD3PDObject.cxx
deleted file mode 100644
index 70c5b52afb5565a78492ac87d186c338f07b4315..0000000000000000000000000000000000000000
--- a/Trigger/TrigCost/TrigCostD3PD/Root/TrigCostD3PDObject.cxx
+++ /dev/null
@@ -1,1450 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// -------------------------------------------------------------
-//             Code produced by D3PDMakerReader
-//
-//  author: Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
-// -------------------------------------------------------------
-
-#include <TPRegexp.h>
-#include <TList.h>
-#include <TDataMember.h>
-
-#include "../TrigCostD3PD/TrigCostD3PDObject.h"
-
-ClassImp( D3PDReader::TrigCostD3PDObject )
-
-namespace D3PDReader {
-
-   /**
-    * This constructor should be used when the object will be used to read
-    * variables from an existing ntuple. The object will also be able to
-    * output variables, but it will also need to read them from somewhere.
-    *
-    * @param master Reference to the variable holding the current event number
-    * @param prefix Prefix of the variables in the D3PD
-    */
-   TrigCostD3PDObject::TrigCostD3PDObject( const ::Long64_t& master, const char* prefix )
-      : UserD3PDObject( master, prefix ),
-        m_handles(),
-        m_fromInput( kTRUE ),
-        m_prefix( prefix ) {
-
-      SetVarHandles( &master );
-   }
-
-   /**
-    * This constructor can be used when the object will only have to output
-    * (and temporarily store) new information into an output ntuple. For
-    * instance when one wants to create a selected/modified list of information.
-    *
-    * @param prefix Prefix of the variables in the D3PD
-    */
-   TrigCostD3PDObject::TrigCostD3PDObject( const char* prefix )
-      : UserD3PDObject( prefix ),
-        m_handles(),
-        m_fromInput( kFALSE ),
-        m_prefix( prefix ) {
-
-      SetVarHandles( 0 );
-   }
-
-   /**
-    * @returns The branch name prefix used by the object
-    */
-   const char* TrigCostD3PDObject::GetPrefix() const {
-
-      return m_prefix;
-   }
-
-   /**
-    * @param prefix The prefix that should be used for the variables
-    */
-   void TrigCostD3PDObject::SetPrefix( const char* prefix ) {
-
-      // Call the base class's function:
-      UserD3PDObject::SetPrefix( prefix );
-
-      // Remember the prefix:
-      m_prefix = prefix;
-
-      // Set all the variable names:
-      std::map< TString, VarHandleBase* >::const_iterator itr = m_handles.begin();
-      std::map< TString, VarHandleBase* >::const_iterator end = m_handles.end();
-      for( ; itr != end; ++itr ) {
-         itr->second->SetName( ::TString( prefix ) + itr->first );
-      }
-
-      return;
-   }
-
-   /**
-    * This function should be called every time a new TFile is opened
-    * by your analysis code.
-    *
-    * @param tree Pointer to the TTree with the variables
-    */
-   void TrigCostD3PDObject::ReadFrom( TTree* tree ) {
-
-      // Check if the object will be able to read from the TTree:
-      if( ! m_fromInput ) {
-         Error( "ReadFrom", "The object was not created with the correct" );
-         Error( "ReadFrom", "constructor to read data from a D3PD!" );
-         return;
-      }
-
-      // Call the base class's function:
-      UserD3PDObject::ReadFrom( tree );
-
-      // Call ReadFrom(...) on all the variables:
-      std::map< TString, VarHandleBase* >::const_iterator itr = m_handles.begin();
-      std::map< TString, VarHandleBase* >::const_iterator end = m_handles.end();
-      for( ; itr != end; ++itr ) {
-         itr->second->ReadFrom( tree );
-      }
-
-      return;
-   }
-
-   /**
-    * This function can be called to connect the active variables of the object
-    * to an output TTree. It can be called multiple times, then the variables
-    * will be written to multiple TTrees.
-    *
-    * @param tree Pointer to the TTree where the variables should be written
-    */
-   void TrigCostD3PDObject::WriteTo( TTree* tree ) {
-
-      // Call the base class's function:
-      UserD3PDObject::WriteTo( tree );
-
-      // Call WriteTo(...) on all the variables:
-      std::map< TString, VarHandleBase* >::const_iterator itr = m_handles.begin();
-      std::map< TString, VarHandleBase* >::const_iterator end = m_handles.end();
-      for( ; itr != end; ++itr ) {
-         itr->second->WriteTo( tree );
-      }
-
-      return;
-   }
-
-   /**
-    * This is a convenience function for turning the branches active or
-    * inactive conveniently. If the parameter is set to <code>kTRUE</code>
-    * then the branches available from the input which match the given
-    * pattern are turned active.
-    * When it's set to <code>kFALSE</code> then all the variables matching
-    * the pattern are turned inactive.
-    *
-    * @param active Flag behaving as explained above
-    * @param pattern Regular expression specifying which branches to modify
-    */
-   void TrigCostD3PDObject::SetActive( ::Bool_t active, const ::TString& pattern ) {
-
-      // Call the base class's function:
-      UserD3PDObject::SetActive( active, pattern );
-
-      ::TPRegexp re( pattern );
-
-      std::map< TString, VarHandleBase* >::const_iterator itr = m_handles.begin();
-      std::map< TString, VarHandleBase* >::const_iterator end = m_handles.end();
-      for( ; itr != end; ++itr ) {
-         if( ! re.Match( m_prefix + itr->first ) ) continue;
-         if( active ) {
-            if( itr->second->IsAvailable() ) itr->second->SetActive( active );
-         } else {
-            itr->second->SetActive( active );
-         }
-      }
-
-      return;
-   }
-
-   /**
-    * This function can be used to read in all the branches from the input
-    * TTree which are set active for writing out. This can simplify writing
-    * event selector codes immensely. Remember to set the desired variable
-    * active before calling this function.
-    */
-   void TrigCostD3PDObject::ReadAllActive() {
-
-      // Check if it makes sense to call this function:
-      if( ! m_fromInput ) {
-         static ::Bool_t wPrinted = kFALSE;
-         if( ! wPrinted ) {
-            Warning( "ReadAllActive", "Function only meaningful when used on objects" );
-            Warning( "ReadAllActive", "which are used to read information from a D3PD" );
-            wPrinted = kTRUE;
-         }
-      }
-
-      // Call the base class's function:
-      UserD3PDObject::ReadAllActive();
-
-      // Read in the current entry for each active variable:
-      std::map< TString, VarHandleBase* >::const_iterator itr = m_handles.begin();
-      std::map< TString, VarHandleBase* >::const_iterator end = m_handles.end();
-      for( ; itr != end; ++itr ) {
-         if( ! itr->second->IsActive() ) continue;
-         itr->second->ReadCurrentEntry();
-      }
-
-      return;
-   }
-
-   /**
-    * This function can be used to get information about the access
-    * pattern/statistics of the job. It should be called at the end of
-    * an analysis job to get the information about the performance of the
-    * analysis.
-    *
-    * @returns An object describing the D3PD access statistics
-    */
-   // D3PDReadStats TrigCostD3PDObject::GetStatistics() const {
-
-   //    // The result object:
-   //    D3PDReadStats result = UserD3PDObject::GetStatistics();
-
-   //    // Add the statistics from each variable to the result:
-   //    std::map< ::TString, VarHandleBase* >::const_iterator itr = m_handles.begin();
-   //    std::map< ::TString, VarHandleBase* >::const_iterator end = m_handles.end();
-   //    for( ; itr != end; ++itr ) {
-   //       result.AddVariable( itr->second->GetStatistics() );
-   //    }
-
-   //    return result;
-   // }
-
-   /**
-    * This function can be used to copy the contents of the entire object
-    * for a given event. This can be useful for instance when the user
-    * wants to copy all information to an output file, and modify it a bit,
-    * and only then write it out.
-    *
-    * @param parent The object to copy the information from
-    * @returns This same object, for convenience reasons
-    */
-   TrigCostD3PDObject& TrigCostD3PDObject::Set( const TrigCostD3PDObject& parent ) {
-
-      // Check if this function can be used on the object:
-      if( m_fromInput ) {
-         Error( "Set", "Objects used for reading a D3PD can't be modified!" );
-         return *this;
-      }
-
-      // Call the base class's function:
-      UserD3PDObject::Set( parent );
-
-      if( parent.appId.IsAvailable() && appId.IsActive() ) {
-         appId() = parent.appId();
-      } else {
-         appId() = 0;
-      }
-      if( parent.ebWeight.IsAvailable() && ebWeight.IsActive() ) {
-         ebWeight() = parent.ebWeight();
-      } else {
-         ebWeight() = 0;
-      }
-      if( parent.ebWeightBG.IsAvailable() && ebWeightBG.IsActive() ) {
-         ebWeightBG() = parent.ebWeightBG();
-      } else {
-         ebWeightBG() = 0;
-      }
-      if( parent.ebUnbiased.IsAvailable() && ebUnbiased.IsActive() ) {
-         ebUnbiased() = parent.ebUnbiased();
-      } else {
-         ebUnbiased() = 0;
-      }
-      if( parent.ranScaleTools.IsAvailable() && ranScaleTools.IsActive() ) {
-         ranScaleTools() = parent.ranScaleTools();
-      } else {
-         ranScaleTools() = 0;
-      }
-      if( parent.bunchCrossingId.IsAvailable() && bunchCrossingId.IsActive() ) {
-         bunchCrossingId() = parent.bunchCrossingId();
-      } else {
-         bunchCrossingId() = 0;
-      }
-      if( parent.chain_counter.IsAvailable() && chain_counter.IsActive() ) {
-         *( chain_counter() ) = *( parent.chain_counter() );
-      } else {
-         chain_counter()->clear();
-      }
-      if( parent.chain_isExpressStream.IsAvailable() && chain_isExpressStream.IsActive() ) {
-         *( chain_isExpressStream() ) = *( parent.chain_isExpressStream() );
-      } else {
-         chain_isExpressStream()->clear();
-      }
-      if( parent.chain_isPassed.IsAvailable() && chain_isPassed.IsActive() ) {
-         *( chain_isPassed() ) = *( parent.chain_isPassed() );
-      } else {
-         chain_isPassed()->clear();
-      }
-      if( parent.chain_isPassedRaw.IsAvailable() && chain_isPassedRaw.IsActive() ) {
-         *( chain_isPassedRaw() ) = *( parent.chain_isPassedRaw() );
-      } else {
-         chain_isPassedRaw()->clear();
-      }
-      if( parent.chain_isPassthrough.IsAvailable() && chain_isPassthrough.IsActive() ) {
-         *( chain_isPassthrough() ) = *( parent.chain_isPassthrough() );
-      } else {
-         chain_isPassthrough()->clear();
-      }
-      if( parent.chain_isPrescaled.IsAvailable() && chain_isPrescaled.IsActive() ) {
-         *( chain_isPrescaled() ) = *( parent.chain_isPrescaled() );
-      } else {
-         chain_isPrescaled()->clear();
-      }
-      if( parent.chain_isResurrected.IsAvailable() && chain_isResurrected.IsActive() ) {
-         *( chain_isResurrected() ) = *( parent.chain_isResurrected() );
-      } else {
-         chain_isResurrected()->clear();
-      }
-      if( parent.chain_level.IsAvailable() && chain_level.IsActive() ) {
-         *( chain_level() ) = *( parent.chain_level() );
-      } else {
-         chain_level()->clear();
-      }
-      if( parent.chain_n.IsAvailable() && chain_n.IsActive() ) {
-         chain_n() = parent.chain_n();
-      } else {
-         chain_n() = 0;
-      }
-      if( parent.chain_timer.IsAvailable() && chain_timer.IsActive() ) {
-         *( chain_timer() ) = *( parent.chain_timer() );
-      } else {
-         chain_timer()->clear();
-      }
-      if( parent.chain_wasL1AfterPrescale.IsAvailable() && chain_wasL1AfterPrescale.IsActive() ) {
-         *( chain_wasL1AfterPrescale() ) = *( parent.chain_wasL1AfterPrescale() );
-      } else {
-         chain_wasL1AfterPrescale()->clear();
-      }
-      if( parent.chain_wasL1AfterVeto.IsAvailable() && chain_wasL1AfterVeto.IsActive() ) {
-         *( chain_wasL1AfterVeto() ) = *( parent.chain_wasL1AfterVeto() );
-      } else {
-         chain_wasL1AfterVeto()->clear();
-      }
-      if( parent.chain_wasL1BeforePrescale.IsAvailable() && chain_wasL1BeforePrescale.IsActive() ) {
-         *( chain_wasL1BeforePrescale() ) = *( parent.chain_wasL1BeforePrescale() );
-      } else {
-         chain_wasL1BeforePrescale()->clear();
-      }
-      if( parent.costEvent.IsAvailable() && costEvent.IsActive() ) {
-         costEvent() = parent.costEvent();
-      } else {
-         costEvent() = 0;
-      }
-      if( parent.costRunNsec.IsAvailable() && costRunNsec.IsActive() ) {
-         costRunNsec() = parent.costRunNsec();
-      } else {
-         costRunNsec() = 0;
-      }
-      if( parent.costRunSec.IsAvailable() && costRunSec.IsActive() ) {
-         costRunSec() = parent.costRunSec();
-      } else {
-         costRunSec() = 0;
-      }
-      if( parent.eventNumber.IsAvailable() && eventNumber.IsActive() ) {
-         eventNumber() = parent.eventNumber();
-      } else {
-         eventNumber() = 0;
-      }
-      if( parent.l1_ctpId.IsAvailable() && l1_ctpId.IsActive() ) {
-         *( l1_ctpId() ) = *( parent.l1_ctpId() );
-      } else {
-         l1_ctpId()->clear();
-      }
-      if( parent.l1_isPrescaled.IsAvailable() && l1_isPrescaled.IsActive() ) {
-         *( l1_isPrescaled() ) = *( parent.l1_isPrescaled() );
-      } else {
-         l1_isPrescaled()->clear();
-      }
-      if( parent.l1_isVetoed.IsAvailable() && l1_isVetoed.IsActive() ) {
-         *( l1_isVetoed() ) = *( parent.l1_isVetoed() );
-      } else {
-         l1_isVetoed()->clear();
-      }
-      if( parent.l1_n.IsAvailable() && l1_n.IsActive() ) {
-         l1_n() = parent.l1_n();
-      } else {
-         l1_n() = 0;
-      }
-      if( parent.l1_passed.IsAvailable() && l1_passed.IsActive() ) {
-         *( l1_passed() ) = *( parent.l1_passed() );
-      } else {
-         l1_passed()->clear();
-      }
-      if( parent.l1_passedAfterPrescale.IsAvailable() && l1_passedAfterPrescale.IsActive() ) {
-         *( l1_passedAfterPrescale() ) = *( parent.l1_passedAfterPrescale() );
-      } else {
-         l1_passedAfterPrescale()->clear();
-      }
-      if( parent.l1_passedAfterVeto.IsAvailable() && l1_passedAfterVeto.IsActive() ) {
-         *( l1_passedAfterVeto() ) = *( parent.l1_passedAfterVeto() );
-      } else {
-         l1_passedAfterVeto()->clear();
-      }
-      if( parent.l1_passedBeforePrescale.IsAvailable() && l1_passedBeforePrescale.IsActive() ) {
-         *( l1_passedBeforePrescale() ) = *( parent.l1_passedBeforePrescale() );
-      } else {
-         l1_passedBeforePrescale()->clear();
-      }
-      if( parent.lumi.IsAvailable() && lumi.IsActive() ) {
-         lumi() = parent.lumi();
-      } else {
-         lumi() = 0;
-      }
-      if( parent.lumiLength.IsAvailable() && lumiLength.IsActive() ) {
-         lumiLength() = parent.lumiLength();
-      } else {
-         lumiLength() = 0;
-      }
-      if( parent.nanoSeconds.IsAvailable() && nanoSeconds.IsActive() ) {
-         nanoSeconds() = parent.nanoSeconds();
-      } else {
-         nanoSeconds() = 0;
-      }
-      if( parent.rob_data_id.IsAvailable() && rob_data_id.IsActive() ) {
-         *( rob_data_id() ) = *( parent.rob_data_id() );
-      } else {
-         rob_data_id()->clear();
-      }
-      if( parent.rob_data_isCached.IsAvailable() && rob_data_isCached.IsActive() ) {
-         *( rob_data_isCached() ) = *( parent.rob_data_isCached() );
-      } else {
-         rob_data_isCached()->clear();
-      }
-      if( parent.rob_data_isDisabled.IsAvailable() && rob_data_isDisabled.IsActive() ) {
-         *( rob_data_isDisabled() ) = *( parent.rob_data_isDisabled() );
-      } else {
-         rob_data_isDisabled()->clear();
-      }
-      if( parent.rob_data_isIgnored.IsAvailable() && rob_data_isIgnored.IsActive() ) {
-         *( rob_data_isIgnored() ) = *( parent.rob_data_isIgnored() );
-      } else {
-         rob_data_isIgnored()->clear();
-      }
-      if( parent.rob_data_isRetrieved.IsAvailable() && rob_data_isRetrieved.IsActive() ) {
-         *( rob_data_isRetrieved() ) = *( parent.rob_data_isRetrieved() );
-      } else {
-         rob_data_isRetrieved()->clear();
-      }
-      if( parent.rob_data_isStatusOk.IsAvailable() && rob_data_isStatusOk.IsActive() ) {
-         *( rob_data_isStatusOk() ) = *( parent.rob_data_isStatusOk() );
-      } else {
-         rob_data_isStatusOk()->clear();
-      }
-      if( parent.rob_data_isStatusPrefetched.IsAvailable() && rob_data_isStatusPrefetched.IsActive() ) {
-         *( rob_data_isStatusPrefetched() ) = *( parent.rob_data_isStatusPrefetched() );
-      } else {
-         rob_data_isStatusPrefetched()->clear();
-      }
-      if( parent.rob_data_isUnclassified.IsAvailable() && rob_data_isUnclassified.IsActive() ) {
-         *( rob_data_isUnclassified() ) = *( parent.rob_data_isUnclassified() );
-      } else {
-         rob_data_isUnclassified()->clear();
-      }
-      if( parent.rob_data_n.IsAvailable() && rob_data_n.IsActive() ) {
-         *( rob_data_n() ) = *( parent.rob_data_n() );
-      } else {
-         rob_data_n()->clear();
-      }
-      if( parent.rob_data_size.IsAvailable() && rob_data_size.IsActive() ) {
-         *( rob_data_size() ) = *( parent.rob_data_size() );
-      } else {
-         rob_data_size()->clear();
-      }
-      if( parent.rob_n.IsAvailable() && rob_n.IsActive() ) {
-         rob_n() = parent.rob_n();
-      } else {
-         rob_n() = 0;
-      }
-      if( parent.rob_requestorId.IsAvailable() && rob_requestorId.IsActive() ) {
-         *( rob_requestorId() ) = *( parent.rob_requestorId() );
-      } else {
-         rob_requestorId()->clear();
-      }
-      if( parent.rob_sum_isCached.IsAvailable() && rob_sum_isCached.IsActive() ) {
-         *( rob_sum_isCached() ) = *( parent.rob_sum_isCached() );
-      } else {
-         rob_sum_isCached()->clear();
-      }
-      if( parent.rob_sum_isDisabled.IsAvailable() && rob_sum_isDisabled.IsActive() ) {
-         *( rob_sum_isDisabled() ) = *( parent.rob_sum_isDisabled() );
-      } else {
-         rob_sum_isDisabled()->clear();
-      }
-      if( parent.rob_sum_isIgnored.IsAvailable() && rob_sum_isIgnored.IsActive() ) {
-         *( rob_sum_isIgnored() ) = *( parent.rob_sum_isIgnored() );
-      } else {
-         rob_sum_isIgnored()->clear();
-      }
-      if( parent.rob_sum_isRetrieved.IsAvailable() && rob_sum_isRetrieved.IsActive() ) {
-         *( rob_sum_isRetrieved() ) = *( parent.rob_sum_isRetrieved() );
-      } else {
-         rob_sum_isRetrieved()->clear();
-      }
-      if( parent.rob_sum_isUnclassified.IsAvailable() && rob_sum_isUnclassified.IsActive() ) {
-         *( rob_sum_isUnclassified() ) = *( parent.rob_sum_isUnclassified() );
-      } else {
-         rob_sum_isUnclassified()->clear();
-      }
-      if( parent.rob_sum_n.IsAvailable() && rob_sum_n.IsActive() ) {
-         *( rob_sum_n() ) = *( parent.rob_sum_n() );
-      } else {
-         rob_sum_n()->clear();
-      }
-      if( parent.rob_sum_nRob.IsAvailable() && rob_sum_nRob.IsActive() ) {
-         *( rob_sum_nRob() ) = *( parent.rob_sum_nRob() );
-      } else {
-         rob_sum_nRob()->clear();
-      }
-      if( parent.rob_sum_size.IsAvailable() && rob_sum_size.IsActive() ) {
-         *( rob_sum_size() ) = *( parent.rob_sum_size() );
-      } else {
-         rob_sum_size()->clear();
-      }
-      if( parent.rob_sum_subDet.IsAvailable() && rob_sum_subDet.IsActive() ) {
-         *( rob_sum_subDet() ) = *( parent.rob_sum_subDet() );
-      } else {
-         rob_sum_subDet()->clear();
-      }
-      if( parent.rob_timeStartMicroSec.IsAvailable() && rob_timeStartMicroSec.IsActive() ) {
-         *( rob_timeStartMicroSec() ) = *( parent.rob_timeStartMicroSec() );
-      } else {
-         rob_timeStartMicroSec()->clear();
-      }
-      if( parent.rob_timeStartSec.IsAvailable() && rob_timeStartSec.IsActive() ) {
-         *( rob_timeStartSec() ) = *( parent.rob_timeStartSec() );
-      } else {
-         rob_timeStartSec()->clear();
-      }
-      if( parent.rob_timeStopMicroSec.IsAvailable() && rob_timeStopMicroSec.IsActive() ) {
-         *( rob_timeStopMicroSec() ) = *( parent.rob_timeStopMicroSec() );
-      } else {
-         rob_timeStopMicroSec()->clear();
-      }
-      if( parent.rob_timeStopSec.IsAvailable() && rob_timeStopSec.IsActive() ) {
-         *( rob_timeStopSec() ) = *( parent.rob_timeStopSec() );
-      } else {
-         rob_timeStopSec()->clear();
-      }
-      if( parent.rob_timer.IsAvailable() && rob_timer.IsActive() ) {
-         *( rob_timer() ) = *( parent.rob_timer() );
-      } else {
-         rob_timer()->clear();
-      }
-      if( parent.roi_area.IsAvailable() && roi_area.IsActive() ) {
-         *( roi_area() ) = *( parent.roi_area() );
-      } else {
-         roi_area()->clear();
-      }
-      if( parent.roi_eta.IsAvailable() && roi_eta.IsActive() ) {
-         *( roi_eta() ) = *( parent.roi_eta() );
-      } else {
-         roi_eta()->clear();
-      }
-      if( parent.roi_id.IsAvailable() && roi_id.IsActive() ) {
-         *( roi_id() ) = *( parent.roi_id() );
-      } else {
-         roi_id()->clear();
-      }
-      if( parent.roi_isTypeEmTau.IsAvailable() && roi_isTypeEmTau.IsActive() ) {
-         *( roi_isTypeEmTau() ) = *( parent.roi_isTypeEmTau() );
-      } else {
-         roi_isTypeEmTau()->clear();
-      }
-      if( parent.roi_isTypeEnergy.IsAvailable() && roi_isTypeEnergy.IsActive() ) {
-         *( roi_isTypeEnergy() ) = *( parent.roi_isTypeEnergy() );
-      } else {
-         roi_isTypeEnergy()->clear();
-      }
-      if( parent.roi_isTypeJet.IsAvailable() && roi_isTypeJet.IsActive() ) {
-         *( roi_isTypeJet() ) = *( parent.roi_isTypeJet() );
-      } else {
-         roi_isTypeJet()->clear();
-      }
-      if( parent.roi_isTypeJetEt.IsAvailable() && roi_isTypeJetEt.IsActive() ) {
-         *( roi_isTypeJetEt() ) = *( parent.roi_isTypeJetEt() );
-      } else {
-         roi_isTypeJetEt()->clear();
-      }
-      if( parent.roi_isTau.IsAvailable() && roi_isTau.IsActive() ) {
-         *( roi_isTau() ) = *( parent.roi_isTau() );
-      } else {
-         roi_isTau()->clear();
-      }
-      if( parent.roi_isTypeMuon.IsAvailable() && roi_isTypeMuon.IsActive() ) {
-         *( roi_isTypeMuon() ) = *( parent.roi_isTypeMuon() );
-      }
-       else {
-         roi_isTypeMuon()->clear();
-      }
-      if( parent.roi_isTypeNone.IsAvailable() && roi_isTypeNone.IsActive() ) {
-         *( roi_isTypeNone() ) = *( parent.roi_isTypeNone() );
-      } else {
-         roi_isTypeNone()->clear();
-      }
-      if( parent.roi_n.IsAvailable() && roi_n.IsActive() ) {
-         roi_n() = parent.roi_n();
-      } else {
-         roi_n() = 0;
-      }
-      if( parent.roi_nL1Thresholds.IsAvailable() && roi_nL1Thresholds.IsActive() ) {
-         *( roi_nL1Thresholds() ) = *( parent.roi_nL1Thresholds() );
-      } else {
-         roi_nL1Thresholds()->clear();
-      }
-      if( parent.roi_phi.IsAvailable() && roi_phi.IsActive() ) {
-         *( roi_phi() ) = *( parent.roi_phi() );
-      } else {
-         roi_phi()->clear();
-      }
-      if( parent.roi_et.IsAvailable() && roi_et.IsActive() ) {
-         *( roi_et() ) = *( parent.roi_et() );
-      } else {
-         roi_et()->clear();
-      }       
-      if( parent.roi_etLarge.IsAvailable() && roi_etLarge.IsActive() ) {
-         *( roi_etLarge() ) = *( parent.roi_etLarge() );
-      } else {
-         roi_etLarge()->clear();
-      }       
-      if( parent.roi_muCharge.IsAvailable() && roi_muCharge.IsActive() ) {
-         *( roi_muCharge() ) = *( parent.roi_muCharge() );
-      } else {
-         roi_muCharge()->clear();
-      }       
-      if( parent.roi_isoBits.IsAvailable() && roi_isoBits.IsActive() ) {
-         *( roi_isoBits() ) = *( parent.roi_isoBits() );
-      } else {
-         roi_isoBits()->clear();
-      }       
-      if( parent.roi_vectorEX.IsAvailable() && roi_vectorEX.IsActive() ) {
-         *( roi_vectorEX() ) = *( parent.roi_vectorEX() );
-      } else {
-         roi_vectorEX()->clear();
-      }       
-      if( parent.roi_vectorEY.IsAvailable() && roi_vectorEY.IsActive() ) {
-         *( roi_vectorEY() ) = *( parent.roi_vectorEY() );
-      } else {
-         roi_vectorEY()->clear();
-      }       
-      if( parent.roi_overflowEX.IsAvailable() && roi_overflowEX.IsActive() ) {
-         *( roi_overflowEX() ) = *( parent.roi_overflowEX() );
-      } else {
-         roi_overflowEX()->clear();
-      }       
-      if( parent.roi_overflowEY.IsAvailable() && roi_overflowEY.IsActive() ) {
-         *( roi_overflowEY() ) = *( parent.roi_overflowEY() );
-      } else {
-         roi_overflowEY()->clear();
-      }       
-      if( parent.roi_overflowET.IsAvailable() && roi_overflowET.IsActive() ) {
-         *( roi_overflowET() ) = *( parent.roi_overflowET() );
-      } else {
-         roi_overflowET()->clear();
-      }
-      if( parent.runNumber.IsAvailable() && runNumber.IsActive() ) {
-         runNumber() = parent.runNumber();
-      } else {
-         runNumber() = 0;
-      }
-      if( parent.seconds.IsAvailable() && seconds.IsActive() ) {
-         seconds() = parent.seconds();
-      } else {
-         seconds() = 0;
-      }
-      if( parent.seq_algTotalTime.IsAvailable() && seq_algTotalTime.IsActive() ) {
-         *( seq_algTotalTime() ) = *( parent.seq_algTotalTime() );
-      } else {
-         seq_algTotalTime()->clear();
-      }
-      if( parent.seq_alg_isCached.IsAvailable() && seq_alg_isCached.IsActive() ) {
-         *( seq_alg_isCached() ) = *( parent.seq_alg_isCached() );
-      } else {
-         seq_alg_isCached()->clear();
-      }
-      if( parent.seq_alg_isCalled.IsAvailable() && seq_alg_isCalled.IsActive() ) {
-         *( seq_alg_isCalled() ) = *( parent.seq_alg_isCalled() );
-      } else {
-         seq_alg_isCalled()->clear();
-      }
-      if( parent.seq_alg_n.IsAvailable() && seq_alg_n.IsActive() ) {
-         *( seq_alg_n() ) = *( parent.seq_alg_n() );
-      } else {
-         seq_alg_n()->clear();
-      }
-      if( parent.seq_alg_position.IsAvailable() && seq_alg_position.IsActive() ) {
-         *( seq_alg_position() ) = *( parent.seq_alg_position() );
-      } else {
-         seq_alg_position()->clear();
-      }
-      if( parent.seq_alg_roi_index.IsAvailable() && seq_alg_roi_index.IsActive() ) {
-         *( seq_alg_roi_index() ) = *( parent.seq_alg_roi_index() );
-      } else {
-         seq_alg_roi_index()->clear();
-      }
-      if( parent.seq_alg_roi_n.IsAvailable() && seq_alg_roi_n.IsActive() ) {
-         *( seq_alg_roi_n() ) = *( parent.seq_alg_roi_n() );
-      } else {
-         seq_alg_roi_n()->clear();
-      }
-      if( parent.seq_alg_timeStartMicroSec.IsAvailable() && seq_alg_timeStartMicroSec.IsActive() ) {
-         *( seq_alg_timeStartMicroSec() ) = *( parent.seq_alg_timeStartMicroSec() );
-      } else {
-         seq_alg_timeStartMicroSec()->clear();
-      }
-      if( parent.seq_alg_timeStartSec.IsAvailable() && seq_alg_timeStartSec.IsActive() ) {
-         *( seq_alg_timeStartSec() ) = *( parent.seq_alg_timeStartSec() );
-      } else {
-         seq_alg_timeStartSec()->clear();
-      }
-      if( parent.seq_alg_timeStopMicroSec.IsAvailable() && seq_alg_timeStopMicroSec.IsActive() ) {
-         *( seq_alg_timeStopMicroSec() ) = *( parent.seq_alg_timeStopMicroSec() );
-      } else {
-         seq_alg_timeStopMicroSec()->clear();
-      }
-      if( parent.seq_alg_timeStopSec.IsAvailable() && seq_alg_timeStopSec.IsActive() ) {
-         *( seq_alg_timeStopSec() ) = *( parent.seq_alg_timeStopSec() );
-      } else {
-         seq_alg_timeStopSec()->clear();
-      }
-      if( parent.seq_alg_timer.IsAvailable() && seq_alg_timer.IsActive() ) {
-         *( seq_alg_timer() ) = *( parent.seq_alg_timer() );
-      } else {
-         seq_alg_timer()->clear();
-      }
-      if( parent.seq_channelCounter.IsAvailable() && seq_channelCounter.IsActive() ) {
-         *( seq_channelCounter() ) = *( parent.seq_channelCounter() );
-      } else {
-         seq_channelCounter()->clear();
-      }
-      if( parent.seq_index.IsAvailable() && seq_index.IsActive() ) {
-         *( seq_index() ) = *( parent.seq_index() );
-      } else {
-         seq_index()->clear();
-      }
-      if( parent.seq_isAlreadyExecuted.IsAvailable() && seq_isAlreadyExecuted.IsActive() ) {
-         *( seq_isAlreadyExecuted() ) = *( parent.seq_isAlreadyExecuted() );
-      } else {
-         seq_isAlreadyExecuted()->clear();
-      }
-      if( parent.seq_isExecuted.IsAvailable() && seq_isExecuted.IsActive() ) {
-         *( seq_isExecuted() ) = *( parent.seq_isExecuted() );
-      } else {
-         seq_isExecuted()->clear();
-      }
-      if( parent.seq_isInitial.IsAvailable() && seq_isInitial.IsActive() ) {
-         *( seq_isInitial() ) = *( parent.seq_isInitial() );
-      } else {
-         seq_isInitial()->clear();
-      }
-      if( parent.seq_isPrevious.IsAvailable() && seq_isPrevious.IsActive() ) {
-         *( seq_isPrevious() ) = *( parent.seq_isPrevious() );
-      } else {
-         seq_isPrevious()->clear();
-      }
-      if( parent.seq_level.IsAvailable() && seq_level.IsActive() ) {
-         *( seq_level() ) = *( parent.seq_level() );
-      } else {
-         seq_level()->clear();
-      }
-      if( parent.seq_n.IsAvailable() && seq_n.IsActive() ) {
-         seq_n() = parent.seq_n();
-      } else {
-         seq_n() = 0;
-      }
-      if( parent.seq_roi.IsAvailable() && seq_roi.IsActive() ) {
-         *( seq_roi() ) = *( parent.seq_roi() );
-      } else {
-         seq_roi()->clear();
-      }
-      if( parent.seq_timer.IsAvailable() && seq_timer.IsActive() ) {
-         *( seq_timer() ) = *( parent.seq_timer() );
-      } else {
-         seq_timer()->clear();
-      }
-      if( parent.te_childIndex.IsAvailable() && te_childIndex.IsActive() ) {
-         *( te_childIndex() ) = *( parent.te_childIndex() );
-      } else {
-         te_childIndex()->clear();
-      }
-      if( parent.te_clid.IsAvailable() && te_clid.IsActive() ) {
-         *( te_clid() ) = *( parent.te_clid() );
-      } else {
-         te_clid()->clear();
-      }
-      if( parent.te_id.IsAvailable() && te_id.IsActive() ) {
-         *( te_id() ) = *( parent.te_id() );
-      } else {
-         te_id()->clear();
-      }
-      if( parent.te_index.IsAvailable() && te_index.IsActive() ) {
-         *( te_index() ) = *( parent.te_index() );
-      } else {
-         te_index()->clear();
-      }
-      if( parent.te_isActiveState.IsAvailable() && te_isActiveState.IsActive() ) {
-         *( te_isActiveState() ) = *( parent.te_isActiveState() );
-      } else {
-         te_isActiveState()->clear();
-      }
-      if( parent.te_isErrorState.IsAvailable() && te_isErrorState.IsActive() ) {
-         *( te_isErrorState() ) = *( parent.te_isErrorState() );
-      } else {
-         te_isErrorState()->clear();
-      }
-      if( parent.te_isInitialTe.IsAvailable() && te_isInitialTe.IsActive() ) {
-         *( te_isInitialTe() ) = *( parent.te_isInitialTe() );
-      } else {
-         te_isInitialTe()->clear();
-      }
-      if( parent.te_isL1ThresholdTe.IsAvailable() && te_isL1ThresholdTe.IsActive() ) {
-         *( te_isL1ThresholdTe() ) = *( parent.te_isL1ThresholdTe() );
-      } else {
-         te_isL1ThresholdTe()->clear();
-      }
-      if( parent.te_isOutputEFNode.IsAvailable() && te_isOutputEFNode.IsActive() ) {
-         *( te_isOutputEFNode() ) = *( parent.te_isOutputEFNode() );
-      } else {
-         te_isOutputEFNode()->clear();
-      }
-      if( parent.te_isOutputL2Node.IsAvailable() && te_isOutputL2Node.IsActive() ) {
-         *( te_isOutputL2Node() ) = *( parent.te_isOutputL2Node() );
-      } else {
-         te_isOutputL2Node()->clear();
-      }
-      if( parent.te_isRegularTe.IsAvailable() && te_isRegularTe.IsActive() ) {
-         *( te_isRegularTe() ) = *( parent.te_isRegularTe() );
-      } else {
-         te_isRegularTe()->clear();
-      }
-      if( parent.te_isRoITe.IsAvailable() && te_isRoITe.IsActive() ) {
-         *( te_isRoITe() ) = *( parent.te_isRoITe() );
-      } else {
-         te_isRoITe()->clear();
-      }
-      if( parent.te_isTerminalNode.IsAvailable() && te_isTerminalNode.IsActive() ) {
-         *( te_isTerminalNode() ) = *( parent.te_isTerminalNode() );
-      } else {
-         te_isTerminalNode()->clear();
-      }
-      if( parent.te_isTopologicalTe.IsAvailable() && te_isTopologicalTe.IsActive() ) {
-         *( te_isTopologicalTe() ) = *( parent.te_isTopologicalTe() );
-      } else {
-         te_isTopologicalTe()->clear();
-      }
-      if( parent.te_n.IsAvailable() && te_n.IsActive() ) {
-         te_n() = parent.te_n();
-      } else {
-         te_n() = 0;
-      }
-      if( parent.te_parentIndex.IsAvailable() && te_parentIndex.IsActive() ) {
-         *( te_parentIndex() ) = *( parent.te_parentIndex() );
-      } else {
-         te_parentIndex()->clear();
-      }
-      if( parent.te_roiId.IsAvailable() && te_roiId.IsActive() ) {
-         *( te_roiId() ) = *( parent.te_roiId() );
-      } else {
-         te_roiId()->clear();
-      }
-      if( parent.timer.IsAvailable() && timer.IsActive() ) {
-         timer() = parent.timer();
-      } else {
-         timer() = 0;
-      }
-      if( parent.timerChainProcess.IsAvailable() && timerChainProcess.IsActive() ) {
-         timerChainProcess() = parent.timerChainProcess();
-      } else {
-         timerChainProcess() = 0;
-      }
-      if( parent.timerEndSteer.IsAvailable() && timerEndSteer.IsActive() ) {
-         timerEndSteer() = parent.timerEndSteer();
-      } else {
-         timerEndSteer() = 0;
-      }
-      if( parent.timerMon.IsAvailable() && timerMon.IsActive() ) {
-         timerMon() = parent.timerMon();
-      } else {
-         timerMon() = 0;
-      }
-      if( parent.timerResultBuilder.IsAvailable() && timerResultBuilder.IsActive() ) {
-         timerResultBuilder() = parent.timerResultBuilder();
-      } else {
-         timerResultBuilder() = 0;
-      }
-      if( parent.timerTrigCost.IsAvailable() && timerTrigCost.IsActive() ) {
-         timerTrigCost() = parent.timerTrigCost();
-      } else {
-         timerTrigCost() = 0;
-      }
-
-      return *this;
-   }
-
-   /**
-    * This function is used internally to access VarHandle members
-    * by name. This is necessary to push some setup from compile time
-    * to run time. It may sound weird, but it makes a lot of sense for large
-    * classes.
-    *
-    * @param name The name of the C++ variable (not of the branch)
-    * @returns A pointer to the VarHandle object
-    */
-   VarHandleBase* TrigCostD3PDObject::GetVarHandle( const char* name ) {
-
-      if( ! ::strcmp( name, "appId" ) ) {
-         return &appId;
-      }
-      else if( ! ::strcmp( name, "ebWeight" ) ) {
-         return &ebWeight;
-      }
-      else if( ! ::strcmp( name, "ebWeightBG" ) ) {
-         return &ebWeightBG;
-      }
-      else if( ! ::strcmp( name, "ebUnbiased" ) ) {
-         return &ebUnbiased;
-      }
-      else if( ! ::strcmp( name, "ranScaleTools" ) ) {
-         return &ranScaleTools;
-      }
-      else if( ! ::strcmp( name, "bunchCrossingId" ) ) {
-         return &bunchCrossingId;
-      }
-      else if( ! ::strcmp( name, "chain_counter" ) ) {
-         return &chain_counter;
-      }
-      else if( ! ::strcmp( name, "chain_isExpressStream" ) ) {
-         return &chain_isExpressStream;
-      }
-      else if( ! ::strcmp( name, "chain_isPassed" ) ) {
-         return &chain_isPassed;
-      }
-      else if( ! ::strcmp( name, "chain_isPassedRaw" ) ) {
-         return &chain_isPassedRaw;
-      }
-      else if( ! ::strcmp( name, "chain_isPassthrough" ) ) {
-         return &chain_isPassthrough;
-      }
-      else if( ! ::strcmp( name, "chain_isPrescaled" ) ) {
-         return &chain_isPrescaled;
-      }
-      else if( ! ::strcmp( name, "chain_isResurrected" ) ) {
-         return &chain_isResurrected;
-      }
-      else if( ! ::strcmp( name, "chain_level" ) ) {
-         return &chain_level;
-      }
-      else if( ! ::strcmp( name, "chain_n" ) ) {
-         return &chain_n;
-      }
-      else if( ! ::strcmp( name, "chain_timer" ) ) {
-         return &chain_timer;
-      }
-      else if( ! ::strcmp( name, "chain_wasL1AfterPrescale" ) ) {
-         return &chain_wasL1AfterPrescale;
-      }
-      else if( ! ::strcmp( name, "chain_wasL1AfterVeto" ) ) {
-         return &chain_wasL1AfterVeto;
-      }
-      else if( ! ::strcmp( name, "chain_wasL1BeforePrescale" ) ) {
-         return &chain_wasL1BeforePrescale;
-      }
-      else if( ! ::strcmp( name, "costEvent" ) ) {
-         return &costEvent;
-      }
-      else if( ! ::strcmp( name, "costRunNsec" ) ) {
-         return &costRunNsec;
-      }
-      else if( ! ::strcmp( name, "costRunSec" ) ) {
-         return &costRunSec;
-      }
-      else if( ! ::strcmp( name, "eventNumber" ) ) {
-         return &eventNumber;
-      }
-      else if( ! ::strcmp( name, "l1_ctpId" ) ) {
-         return &l1_ctpId;
-      }
-      else if( ! ::strcmp( name, "l1_isPrescaled" ) ) {
-         return &l1_isPrescaled;
-      }
-      else if( ! ::strcmp( name, "l1_isVetoed" ) ) {
-         return &l1_isVetoed;
-      }
-      else if( ! ::strcmp( name, "l1_n" ) ) {
-         return &l1_n;
-      }
-      else if( ! ::strcmp( name, "l1_passed" ) ) {
-         return &l1_passed;
-      }
-      else if( ! ::strcmp( name, "l1_passedAfterPrescale" ) ) {
-         return &l1_passedAfterPrescale;
-      }
-      else if( ! ::strcmp( name, "l1_passedAfterVeto" ) ) {
-         return &l1_passedAfterVeto;
-      }
-      else if( ! ::strcmp( name, "l1_passedBeforePrescale" ) ) {
-         return &l1_passedBeforePrescale;
-      }
-      else if( ! ::strcmp( name, "lumi" ) ) {
-         return &lumi;
-      }
-      else if( ! ::strcmp( name, "lumiLength" ) ) {
-         return &lumiLength;
-      }
-      else if( ! ::strcmp( name, "nanoSeconds" ) ) {
-         return &nanoSeconds;
-      }
-      else if( ! ::strcmp( name, "rob_data_id" ) ) {
-         return &rob_data_id;
-      }
-      else if( ! ::strcmp( name, "rob_data_isCached" ) ) {
-         return &rob_data_isCached;
-      }
-      else if( ! ::strcmp( name, "rob_data_isDisabled" ) ) {
-         return &rob_data_isDisabled;
-      }
-      else if( ! ::strcmp( name, "rob_data_isIgnored" ) ) {
-         return &rob_data_isIgnored;
-      }
-      else if( ! ::strcmp( name, "rob_data_isRetrieved" ) ) {
-         return &rob_data_isRetrieved;
-      }
-      else if( ! ::strcmp( name, "rob_data_isStatusOk" ) ) {
-         return &rob_data_isStatusOk;
-      }
-      else if( ! ::strcmp( name, "rob_data_isStatusPrefetched" ) ) {
-         return &rob_data_isStatusPrefetched;
-      }
-      else if( ! ::strcmp( name, "rob_data_isUnclassified" ) ) {
-         return &rob_data_isUnclassified;
-      }
-      else if( ! ::strcmp( name, "rob_data_n" ) ) {
-         return &rob_data_n;
-      }
-      else if( ! ::strcmp( name, "rob_data_size" ) ) {
-         return &rob_data_size;
-      }
-      else if( ! ::strcmp( name, "rob_n" ) ) {
-         return &rob_n;
-      }
-      else if( ! ::strcmp( name, "rob_requestorId" ) ) {
-         return &rob_requestorId;
-      }
-      else if( ! ::strcmp( name, "rob_sum_isCached" ) ) {
-         return &rob_sum_isCached;
-      }
-      else if( ! ::strcmp( name, "rob_sum_isDisabled" ) ) {
-         return &rob_sum_isDisabled;
-      }
-      else if( ! ::strcmp( name, "rob_sum_isIgnored" ) ) {
-         return &rob_sum_isIgnored;
-      }
-      else if( ! ::strcmp( name, "rob_sum_isRetrieved" ) ) {
-         return &rob_sum_isRetrieved;
-      }
-      else if( ! ::strcmp( name, "rob_sum_isUnclassified" ) ) {
-         return &rob_sum_isUnclassified;
-      }
-      else if( ! ::strcmp( name, "rob_sum_n" ) ) {
-         return &rob_sum_n;
-      }
-      else if( ! ::strcmp( name, "rob_sum_nRob" ) ) {
-         return &rob_sum_nRob;
-      }
-      else if( ! ::strcmp( name, "rob_sum_size" ) ) {
-         return &rob_sum_size;
-      }
-      else if( ! ::strcmp( name, "rob_sum_subDet" ) ) {
-         return &rob_sum_subDet;
-      }
-      else if( ! ::strcmp( name, "rob_timeStartMicroSec" ) ) {
-         return &rob_timeStartMicroSec;
-      }
-      else if( ! ::strcmp( name, "rob_timeStartSec" ) ) {
-         return &rob_timeStartSec;
-      }
-      else if( ! ::strcmp( name, "rob_timeStopMicroSec" ) ) {
-         return &rob_timeStopMicroSec;
-      }
-      else if( ! ::strcmp( name, "rob_timeStopSec" ) ) {
-         return &rob_timeStopSec;
-      }
-      else if( ! ::strcmp( name, "rob_timer" ) ) {
-         return &rob_timer;
-      }
-      else if( ! ::strcmp( name, "roi_area" ) ) {
-         return &roi_area;
-      }
-      else if( ! ::strcmp( name, "roi_eta" ) ) {
-         return &roi_eta;
-      }
-      else if( ! ::strcmp( name, "roi_id" ) ) {
-         return &roi_id;
-      }
-      else if( ! ::strcmp( name, "roi_isTypeEmTau" ) ) {
-         return &roi_isTypeEmTau;
-      }
-      else if( ! ::strcmp( name, "roi_isTau" ) ) {
-         return &roi_isTau;
-      }
-      else if( ! ::strcmp( name, "roi_isTypeEnergy" ) ) {
-         return &roi_isTypeEnergy;
-      }
-      else if( ! ::strcmp( name, "roi_isTypeJet" ) ) {
-         return &roi_isTypeJet;
-      }
-      else if( ! ::strcmp( name, "roi_isTypeJetEt" ) ) {
-         return &roi_isTypeJetEt;
-      }
-      else if( ! ::strcmp( name, "roi_isTypeMuon" ) ) {
-         return &roi_isTypeMuon;
-      }
-      else if( ! ::strcmp( name, "roi_isTypeNone" ) ) {
-         return &roi_isTypeNone;
-      }
-      else if( ! ::strcmp( name, "roi_n" ) ) {
-         return &roi_n;
-      }
-      else if( ! ::strcmp( name, "roi_nL1Thresholds" ) ) {
-         return &roi_nL1Thresholds;
-      }
-       else if( ! ::strcmp( name, "roi_phi" ) ) {
-         return &roi_phi;
-      }
-      else if( ! ::strcmp( name, "roi_et" ) ) {
-         return &roi_et;
-      }
-      else if( ! ::strcmp( name, "roi_etLarge" ) ) {
-         return &roi_etLarge;
-      }
-      else if( ! ::strcmp( name, "roi_muCharge" ) ) {
-         return &roi_muCharge;
-      }
-      else if( ! ::strcmp( name, "roi_isoBits" ) ) {
-         return &roi_isoBits;
-      }
-      else if( ! ::strcmp( name, "roi_vectorEX" ) ) {
-         return &roi_vectorEX;
-      }
-      else if( ! ::strcmp( name, "roi_vectorEY" ) ) {
-         return &roi_vectorEY;
-      }
-      else if( ! ::strcmp( name, "roi_overflowEX" ) ) {
-         return &roi_overflowEX;
-      }
-      else if( ! ::strcmp( name, "roi_overflowEY" ) ) {
-         return &roi_overflowEY;
-      }
-      else if( ! ::strcmp( name, "roi_overflowET" ) ) {
-         return &roi_overflowET;
-      }
-      else if( ! ::strcmp( name, "runNumber" ) ) {
-         return &runNumber;
-      }
-      else if( ! ::strcmp( name, "seconds" ) ) {
-         return &seconds;
-      }
-      else if( ! ::strcmp( name, "seq_algTotalTime" ) ) {
-         return &seq_algTotalTime;
-      }
-      else if( ! ::strcmp( name, "seq_alg_isCached" ) ) {
-         return &seq_alg_isCached;
-      }
-      else if( ! ::strcmp( name, "seq_alg_isCalled" ) ) {
-         return &seq_alg_isCalled;
-      }
-      else if( ! ::strcmp( name, "seq_alg_n" ) ) {
-         return &seq_alg_n;
-      }
-      else if( ! ::strcmp( name, "seq_alg_position" ) ) {
-         return &seq_alg_position;
-      }
-      else if( ! ::strcmp( name, "seq_alg_roi_index" ) ) {
-         return &seq_alg_roi_index;
-      }
-      else if( ! ::strcmp( name, "seq_alg_roi_n" ) ) {
-         return &seq_alg_roi_n;
-      }
-      else if( ! ::strcmp( name, "seq_alg_timeStartMicroSec" ) ) {
-         return &seq_alg_timeStartMicroSec;
-      }
-      else if( ! ::strcmp( name, "seq_alg_timeStartSec" ) ) {
-         return &seq_alg_timeStartSec;
-      }
-      else if( ! ::strcmp( name, "seq_alg_timeStopMicroSec" ) ) {
-         return &seq_alg_timeStopMicroSec;
-      }
-      else if( ! ::strcmp( name, "seq_alg_timeStopSec" ) ) {
-         return &seq_alg_timeStopSec;
-      }
-      else if( ! ::strcmp( name, "seq_alg_timer" ) ) {
-         return &seq_alg_timer;
-      }
-      else if( ! ::strcmp( name, "seq_channelCounter" ) ) {
-         return &seq_channelCounter;
-      }
-      else if( ! ::strcmp( name, "seq_index" ) ) {
-         return &seq_index;
-      }
-      else if( ! ::strcmp( name, "seq_isAlreadyExecuted" ) ) {
-         return &seq_isAlreadyExecuted;
-      }
-      else if( ! ::strcmp( name, "seq_isExecuted" ) ) {
-         return &seq_isExecuted;
-      }
-      else if( ! ::strcmp( name, "seq_isInitial" ) ) {
-         return &seq_isInitial;
-      }
-      else if( ! ::strcmp( name, "seq_isPrevious" ) ) {
-         return &seq_isPrevious;
-      }
-      else if( ! ::strcmp( name, "seq_level" ) ) {
-         return &seq_level;
-      }
-      else if( ! ::strcmp( name, "seq_n" ) ) {
-         return &seq_n;
-      }
-      else if( ! ::strcmp( name, "seq_roi" ) ) {
-         return &seq_roi;
-      }
-      else if( ! ::strcmp( name, "seq_timer" ) ) {
-         return &seq_timer;
-      }
-      else if( ! ::strcmp( name, "te_childIndex" ) ) {
-         return &te_childIndex;
-      }
-      else if( ! ::strcmp( name, "te_clid" ) ) {
-         return &te_clid;
-      }
-      else if( ! ::strcmp( name, "te_id" ) ) {
-         return &te_id;
-      }
-      else if( ! ::strcmp( name, "te_index" ) ) {
-         return &te_index;
-      }
-      else if( ! ::strcmp( name, "te_isActiveState" ) ) {
-         return &te_isActiveState;
-      }
-      else if( ! ::strcmp( name, "te_isErrorState" ) ) {
-         return &te_isErrorState;
-      }
-      else if( ! ::strcmp( name, "te_isInitialTe" ) ) {
-         return &te_isInitialTe;
-      }
-      else if( ! ::strcmp( name, "te_isL1ThresholdTe" ) ) {
-         return &te_isL1ThresholdTe;
-      }
-      else if( ! ::strcmp( name, "te_isOutputEFNode" ) ) {
-         return &te_isOutputEFNode;
-      }
-      else if( ! ::strcmp( name, "te_isOutputL2Node" ) ) {
-         return &te_isOutputL2Node;
-      }
-      else if( ! ::strcmp( name, "te_isRegularTe" ) ) {
-         return &te_isRegularTe;
-      }
-      else if( ! ::strcmp( name, "te_isRoITe" ) ) {
-         return &te_isRoITe;
-      }
-      else if( ! ::strcmp( name, "te_isTerminalNode" ) ) {
-         return &te_isTerminalNode;
-      }
-      else if( ! ::strcmp( name, "te_isTopologicalTe" ) ) {
-         return &te_isTopologicalTe;
-      }
-      else if( ! ::strcmp( name, "te_n" ) ) {
-         return &te_n;
-      }
-      else if( ! ::strcmp( name, "te_parentIndex" ) ) {
-         return &te_parentIndex;
-      }
-      else if( ! ::strcmp( name, "te_roiId" ) ) {
-         return &te_roiId;
-      }
-      else if( ! ::strcmp( name, "timer" ) ) {
-         return &timer;
-      }
-      else if( ! ::strcmp( name, "timerChainProcess" ) ) {
-         return &timerChainProcess;
-      }
-      else if( ! ::strcmp( name, "timerEndSteer" ) ) {
-         return &timerEndSteer;
-      }
-      else if( ! ::strcmp( name, "timerMon" ) ) {
-         return &timerMon;
-      }
-      else if( ! ::strcmp( name, "timerResultBuilder" ) ) {
-         return &timerResultBuilder;
-      }
-      else if( ! ::strcmp( name, "timerTrigCost" ) ) {
-         return &timerTrigCost;
-      }
-
-      Error( "GetVarHandle", "Variable \"%s\" unknown", name );
-      return 0;
-   }
-
-   /**
-    * This function is used internally to set up all the VarHandle members
-    * of the class. It speeds up compilation *a lot* to do this at run-time
-    * like this, instead of putting a lot of lines of code operating on
-    * the std::map member.
-    *
-    * @param master Pointer to the master index, or a null pointer
-    */
-   void TrigCostD3PDObject::SetVarHandles( const ::Long64_t* master ) {
-
-      // Create a list of variable-branch name pairs:
-      static const Int_t NVARNAMES = 129;
-      static const char* VARNAMES[ NVARNAMES ][ 2 ] = {
-         { "appId", "appId" },
-         { "ebWeight", "ebWeight" },
-         { "ebWeightBG", "ebWeightBG" },
-         { "ebUnbiased", "ebUnbiased" },         
-         { "ranScaleTools", "ranScaleTools" },         
-         { "bunchCrossingId", "bunchCrossingId" },
-         { "chain_counter", "chain_counter" },
-         { "chain_isExpressStream", "chain_isExpressStream" },
-         { "chain_isPassed", "chain_isPassed" },
-         { "chain_isPassedRaw", "chain_isPassedRaw" },
-         { "chain_isPassthrough", "chain_isPassthrough" },
-         { "chain_isPrescaled", "chain_isPrescaled" },
-         { "chain_isResurrected", "chain_isResurrected" },
-         { "chain_level", "chain_level" },
-         { "chain_n", "chain_n" },
-         { "chain_timer", "chain_timer" },
-         { "chain_wasL1AfterPrescale", "chain_wasL1AfterPrescale" },
-         { "chain_wasL1AfterVeto", "chain_wasL1AfterVeto" },
-         { "chain_wasL1BeforePrescale", "chain_wasL1BeforePrescale" },
-         { "costEvent", "costEvent" },
-         { "costRunNsec", "costRunNsec" },
-         { "costRunSec", "costRunSec" },
-         { "eventNumber", "eventNumber" },
-         { "l1_ctpId", "l1_ctpId" },
-         { "l1_isPrescaled", "l1_isPrescaled" },
-         { "l1_isVetoed", "l1_isVetoed" },
-         { "l1_n", "l1_n" },
-         { "l1_passed", "l1_passed" },
-         { "l1_passedAfterPrescale", "l1_passedAfterPrescale" },
-         { "l1_passedAfterVeto", "l1_passedAfterVeto" },
-         { "l1_passedBeforePrescale", "l1_passedBeforePrescale" },
-         { "lumi", "lumi" },
-         { "lumiLength", "lumiLength" },
-         { "nanoSeconds", "nanoSeconds" },
-         { "rob_data_id", "rob_data_id" },
-         { "rob_data_isCached", "rob_data_isCached" },
-         { "rob_data_isDisabled", "rob_data_isDisabled" },
-         { "rob_data_isIgnored", "rob_data_isIgnored" },
-         { "rob_data_isRetrieved", "rob_data_isRetrieved" },
-         { "rob_data_isStatusOk", "rob_data_isStatusOk" },
-         { "rob_data_isStatusPrefetched", "rob_data_isStatusPrefetched" },
-         { "rob_data_isUnclassified", "rob_data_isUnclassified" },
-         { "rob_data_n", "rob_data_n" },
-         { "rob_data_size", "rob_data_size" },
-         { "rob_n", "rob_n" },
-         { "rob_requestorId", "rob_requestorId" },
-         { "rob_sum_isCached", "rob_sum_isCached" },
-         { "rob_sum_isDisabled", "rob_sum_isDisabled" },
-         { "rob_sum_isIgnored", "rob_sum_isIgnored" },
-         { "rob_sum_isRetrieved", "rob_sum_isRetrieved" },
-         { "rob_sum_isUnclassified", "rob_sum_isUnclassified" },
-         { "rob_sum_n", "rob_sum_n" },
-         { "rob_sum_nRob", "rob_sum_nRob" },
-         { "rob_sum_size", "rob_sum_size" },
-         { "rob_sum_subDet", "rob_sum_subDet" },
-         { "rob_timeStartMicroSec", "rob_timeStartMicroSec" },
-         { "rob_timeStartSec", "rob_timeStartSec" },
-         { "rob_timeStopMicroSec", "rob_timeStopMicroSec" },
-         { "rob_timeStopSec", "rob_timeStopSec" },
-         { "rob_timer", "rob_timer" },
-         { "roi_area", "roi_area" },
-         { "roi_eta", "roi_eta" },
-         { "roi_id", "roi_id" },
-         { "roi_isTypeEmTau", "roi_isTypeEmTau" },
-         { "roi_isTau", "roi_isTau" },         
-         { "roi_isTypeEnergy", "roi_isTypeEnergy" },
-         { "roi_isTypeJet", "roi_isTypeJet" },
-         { "roi_isTypeJetEt", "roi_isTypeJetEt" },
-         { "roi_isTypeMuon", "roi_isTypeMuon" },
-         { "roi_isTypeNone", "roi_isTypeNone" },
-         { "roi_n", "roi_n" },
-         { "roi_nL1Thresholds", "roi_nL1Thresholds" },
-         { "roi_phi", "roi_phi" },
-         { "roi_et", "roi_et" },
-         { "roi_etLarge", "roi_etLarge" },
-         { "roi_muCharge", "roi_muCharge" },
-         { "roi_isoBits", "roi_isoBits" },
-         { "roi_vectorEX", "roi_vectorEX" },
-         { "roi_vectorEY", "roi_vectorEY" },
-         { "roi_overflowEX", "roi_overflowEX" },
-         { "roi_overflowEY", "roi_overflowEY" },
-         { "roi_overflowET", "roi_overflowET" },
-         { "runNumber", "runNumber" },
-         { "seconds", "seconds" },
-         { "seq_algTotalTime", "seq_algTotalTime" },
-         { "seq_alg_isCached", "seq_alg_isCached" },
-         { "seq_alg_isCalled", "seq_alg_isCalled" },
-         { "seq_alg_n", "seq_alg_n" },
-         { "seq_alg_position", "seq_alg_position" },
-         { "seq_alg_roi_index", "seq_alg_roi_index" },
-         { "seq_alg_roi_n", "seq_alg_roi_n" },
-         { "seq_alg_timeStartMicroSec", "seq_alg_timeStartMicroSec" },
-         { "seq_alg_timeStartSec", "seq_alg_timeStartSec" },
-         { "seq_alg_timeStopMicroSec", "seq_alg_timeStopMicroSec" },
-         { "seq_alg_timeStopSec", "seq_alg_timeStopSec" },
-         { "seq_alg_timer", "seq_alg_timer" },
-         { "seq_channelCounter", "seq_channelCounter" },
-         { "seq_index", "seq_index" },
-         { "seq_isAlreadyExecuted", "seq_isAlreadyExecuted" },
-         { "seq_isExecuted", "seq_isExecuted" },
-         { "seq_isInitial", "seq_isInitial" },
-         { "seq_isPrevious", "seq_isPrevious" },
-         { "seq_level", "seq_level" },
-         { "seq_n", "seq_n" },
-         { "seq_roi", "seq_roi" },
-         { "seq_timer", "seq_timer" },
-         { "te_childIndex", "te_childIndex" },
-         { "te_clid", "te_clid" },
-         { "te_id", "te_id" },
-         { "te_index", "te_index" },
-         { "te_isActiveState", "te_isActiveState" },
-         { "te_isErrorState", "te_isErrorState" },
-         { "te_isInitialTe", "te_isInitialTe" },
-         { "te_isL1ThresholdTe", "te_isL1ThresholdTe" },
-         { "te_isOutputEFNode", "te_isOutputEFNode" },
-         { "te_isOutputL2Node", "te_isOutputL2Node" },
-         { "te_isRegularTe", "te_isRegularTe" },
-         { "te_isRoITe", "te_isRoITe" },
-         { "te_isTerminalNode", "te_isTerminalNode" },
-         { "te_isTopologicalTe", "te_isTopologicalTe" },
-         { "te_n", "te_n" },
-         { "te_parentIndex", "te_parentIndex" },
-         { "te_roiId", "te_roiId" },
-         { "timer", "timer" },
-         { "timerChainProcess", "timerChainProcess" },
-         { "timerEndSteer", "timerEndSteer" },
-         { "timerMon", "timerMon" },
-         { "timerResultBuilder", "timerResultBuilder" },
-         { "timerTrigCost", "timerTrigCost" }
-      };
-
-      // Set up the m_handles map using this list:
-      for( Int_t i = 0; i < NVARNAMES; ++i ) {
-         VarHandleBase* vh = GetVarHandle( VARNAMES[ i ][ 0 ] );
-         vh->SetName( m_prefix + VARNAMES[ i ][ 1 ] );
-         vh->SetMaster( master );
-         m_handles[ VARNAMES[ i ][ 0 ] ] = vh;
-      }
-
-      return;
-   }
-
-} // namespace D3PDReader
diff --git a/Trigger/TrigCost/TrigCostD3PD/Root/TrigDBKeysD3PDObject.cxx b/Trigger/TrigCost/TrigCostD3PD/Root/TrigDBKeysD3PDObject.cxx
deleted file mode 100644
index ca0d18230b9acf4e40d683b8cdd7ac06869bf518..0000000000000000000000000000000000000000
--- a/Trigger/TrigCost/TrigCostD3PD/Root/TrigDBKeysD3PDObject.cxx
+++ /dev/null
@@ -1,315 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// -------------------------------------------------------------
-//             Code produced by D3PDMakerReader
-//
-//  author: Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
-// -------------------------------------------------------------
-
-#include <TPRegexp.h>
-#include <TList.h>
-#include <TDataMember.h>
-
-#include "../TrigCostD3PD/TrigDBKeysD3PDObject.h"
-
-ClassImp( D3PDReader::TrigDBKeysD3PDObject )
-
-namespace D3PDReader {
-
-   /**
-    * This constructor should be used when the object will be used to read
-    * variables from an existing ntuple. The object will also be able to
-    * output variables, but it will also need to read them from somewhere.
-    *
-    * @param master Reference to the variable holding the current event number
-    * @param prefix Prefix of the variables in the D3PD
-    */
-   TrigDBKeysD3PDObject::TrigDBKeysD3PDObject( const ::Long64_t& master, const char* prefix )
-      : UserD3PDObject( master, prefix ),
-        m_handles(),
-        m_fromInput( kTRUE ),
-        m_prefix( prefix ) {
-
-      SetVarHandles( &master );
-   }
-
-   /**
-    * This constructor can be used when the object will only have to output
-    * (and temporarily store) new information into an output ntuple. For
-    * instance when one wants to create a selected/modified list of information.
-    *
-    * @param prefix Prefix of the variables in the D3PD
-    */
-   TrigDBKeysD3PDObject::TrigDBKeysD3PDObject( const char* prefix )
-      : UserD3PDObject( prefix ),
-        m_handles(),
-        m_fromInput( kFALSE ),
-        m_prefix( prefix ) {
-
-      SetVarHandles( 0 );
-   }
-
-   /**
-    * @returns The branch name prefix used by the object
-    */
-   const char* TrigDBKeysD3PDObject::GetPrefix() const {
-
-      return m_prefix;
-   }
-
-   /**
-    * @param prefix The prefix that should be used for the variables
-    */
-   void TrigDBKeysD3PDObject::SetPrefix( const char* prefix ) {
-
-      // Call the base class's function:
-      UserD3PDObject::SetPrefix( prefix );
-
-      // Remember the prefix:
-      m_prefix = prefix;
-
-      // Set all the variable names:
-      std::map< TString, VarHandleBase* >::const_iterator itr = m_handles.begin();
-      std::map< TString, VarHandleBase* >::const_iterator end = m_handles.end();
-      for( ; itr != end; ++itr ) {
-         itr->second->SetName( ::TString( prefix ) + itr->first );
-      }
-
-      return;
-   }
-
-   /**
-    * This function should be called every time a new TFile is opened
-    * by your analysis code.
-    *
-    * @param tree Pointer to the TTree with the variables
-    */
-   void TrigDBKeysD3PDObject::ReadFrom( TTree* tree ) {
-
-      // Check if the object will be able to read from the TTree:
-      if( ! m_fromInput ) {
-         Error( "ReadFrom", "The object was not created with the correct" );
-         Error( "ReadFrom", "constructor to read data from a D3PD!" );
-         return;
-      }
-
-      // Call the base class's function:
-      UserD3PDObject::ReadFrom( tree );
-
-      // Call ReadFrom(...) on all the variables:
-      std::map< TString, VarHandleBase* >::const_iterator itr = m_handles.begin();
-      std::map< TString, VarHandleBase* >::const_iterator end = m_handles.end();
-      for( ; itr != end; ++itr ) {
-         itr->second->ReadFrom( tree );
-      }
-
-      return;
-   }
-
-   /**
-    * This function can be called to connect the active variables of the object
-    * to an output TTree. It can be called multiple times, then the variables
-    * will be written to multiple TTrees.
-    *
-    * @param tree Pointer to the TTree where the variables should be written
-    */
-   void TrigDBKeysD3PDObject::WriteTo( TTree* tree ) {
-
-      // Call the base class's function:
-      UserD3PDObject::WriteTo( tree );
-
-      // Call WriteTo(...) on all the variables:
-      std::map< TString, VarHandleBase* >::const_iterator itr = m_handles.begin();
-      std::map< TString, VarHandleBase* >::const_iterator end = m_handles.end();
-      for( ; itr != end; ++itr ) {
-         itr->second->WriteTo( tree );
-      }
-
-      return;
-   }
-
-   /**
-    * This is a convenience function for turning the branches active or
-    * inactive conveniently. If the parameter is set to <code>kTRUE</code>
-    * then the branches available from the input which match the given
-    * pattern are turned active.
-    * When it's set to <code>kFALSE</code> then all the variables matching
-    * the pattern are turned inactive.
-    *
-    * @param active Flag behaving as explained above
-    * @param pattern Regular expression specifying which branches to modify
-    */
-   void TrigDBKeysD3PDObject::SetActive( ::Bool_t active, const ::TString& pattern ) {
-
-      // Call the base class's function:
-      UserD3PDObject::SetActive( active, pattern );
-
-      ::TPRegexp re( pattern );
-
-      std::map< TString, VarHandleBase* >::const_iterator itr = m_handles.begin();
-      std::map< TString, VarHandleBase* >::const_iterator end = m_handles.end();
-      for( ; itr != end; ++itr ) {
-         if( ! re.Match( m_prefix + itr->first ) ) continue;
-         if( active ) {
-            if( itr->second->IsAvailable() ) itr->second->SetActive( active );
-         } else {
-            itr->second->SetActive( active );
-         }
-      }
-
-      return;
-   }
-
-   /**
-    * This function can be used to read in all the branches from the input
-    * TTree which are set active for writing out. This can simplify writing
-    * event selector codes immensely. Remember to set the desired variable
-    * active before calling this function.
-    */
-   void TrigDBKeysD3PDObject::ReadAllActive() {
-
-      // Check if it makes sense to call this function:
-      if( ! m_fromInput ) {
-         static ::Bool_t wPrinted = kFALSE;
-         if( ! wPrinted ) {
-            Warning( "ReadAllActive", "Function only meaningful when used on objects" );
-            Warning( "ReadAllActive", "which are used to read information from a D3PD" );
-            wPrinted = kTRUE;
-         }
-      }
-
-      // Call the base class's function:
-      UserD3PDObject::ReadAllActive();
-
-      // Read in the current entry for each active variable:
-      std::map< TString, VarHandleBase* >::const_iterator itr = m_handles.begin();
-      std::map< TString, VarHandleBase* >::const_iterator end = m_handles.end();
-      for( ; itr != end; ++itr ) {
-         if( ! itr->second->IsActive() ) continue;
-         itr->second->ReadCurrentEntry();
-      }
-
-      return;
-   }
-
-   /**
-    * This function can be used to get information about the access
-    * pattern/statistics of the job. It should be called at the end of
-    * an analysis job to get the information about the performance of the
-    * analysis.
-    *
-    * @returns An object describing the D3PD access statistics
-    */
-   // D3PDReadStats TrigDBKeysD3PDObject::GetStatistics() const {
-
-   //    // The result object:
-   //    D3PDReadStats result = UserD3PDObject::GetStatistics();
-
-   //    // Add the statistics from each variable to the result:
-   //    std::map< ::TString, VarHandleBase* >::const_iterator itr = m_handles.begin();
-   //    std::map< ::TString, VarHandleBase* >::const_iterator end = m_handles.end();
-   //    for( ; itr != end; ++itr ) {
-   //       result.AddVariable( itr->second->GetStatistics() );
-   //    }
-
-   //    return result;
-   // }
-
-   /**
-    * This function can be used to copy the contents of the entire object
-    * for a given event. This can be useful for instance when the user
-    * wants to copy all information to an output file, and modify it a bit,
-    * and only then write it out.
-    *
-    * @param parent The object to copy the information from
-    * @returns This same object, for convenience reasons
-    */
-   TrigDBKeysD3PDObject& TrigDBKeysD3PDObject::Set( const TrigDBKeysD3PDObject& parent ) {
-
-      // Check if this function can be used on the object:
-      if( m_fromInput ) {
-         Error( "Set", "Objects used for reading a D3PD can't be modified!" );
-         return *this;
-      }
-
-      // Call the base class's function:
-      UserD3PDObject::Set( parent );
-
-      if( parent.HLTPSK.IsAvailable() && HLTPSK.IsActive() ) {
-         HLTPSK() = parent.HLTPSK();
-      } else {
-         HLTPSK() = 0;
-      }
-      if( parent.L1PSK.IsAvailable() && L1PSK.IsActive() ) {
-         L1PSK() = parent.L1PSK();
-      } else {
-         L1PSK() = 0;
-      }
-      if( parent.SMK.IsAvailable() && SMK.IsActive() ) {
-         SMK() = parent.SMK();
-      } else {
-         SMK() = 0;
-      }
-
-      return *this;
-   }
-
-   /**
-    * This function is used internally to access VarHandle members
-    * by name. This is necessary to push some setup from compile time
-    * to run time. It may sound weird, but it makes a lot of sense for large
-    * classes.
-    *
-    * @param name The name of the C++ variable (not of the branch)
-    * @returns A pointer to the VarHandle object
-    */
-   VarHandleBase* TrigDBKeysD3PDObject::GetVarHandle( const char* name ) {
-
-      if( ! ::strcmp( name, "HLTPSK" ) ) {
-         return &HLTPSK;
-      }
-      else if( ! ::strcmp( name, "L1PSK" ) ) {
-         return &L1PSK;
-      }
-      else if( ! ::strcmp( name, "SMK" ) ) {
-         return &SMK;
-      }
-
-      Error( "GetVarHandle", "Variable \"%s\" unknown", name );
-      return 0;
-   }
-
-   /**
-    * This function is used internally to set up all the VarHandle members
-    * of the class. It speeds up compilation *a lot* to do this at run-time
-    * like this, instead of putting a lot of lines of code operating on
-    * the std::map member.
-    *
-    * @param master Pointer to the master index, or a null pointer
-    */
-   void TrigDBKeysD3PDObject::SetVarHandles( const ::Long64_t* master ) {
-
-      // Create a list of variable-branch name pairs:
-      static const Int_t NVARNAMES = 3;
-      static const char* VARNAMES[ NVARNAMES ][ 2 ] = {
-         { "HLTPSK", "HLTPSK" },
-         { "L1PSK", "L1PSK" },
-         { "SMK", "SMK" }
-      };
-
-      // Set up the m_handles map using this list:
-      for( Int_t i = 0; i < NVARNAMES; ++i ) {
-         VarHandleBase* vh = GetVarHandle( VARNAMES[ i ][ 0 ] );
-         vh->SetName( m_prefix + VARNAMES[ i ][ 1 ] );
-         vh->SetMaster( master );
-         m_handles[ VARNAMES[ i ][ 0 ] ] = vh;
-      }
-
-      return;
-   }
-
-} // namespace D3PDReader
diff --git a/Trigger/TrigCost/TrigCostD3PD/Root/UserD3PDObject.cxx b/Trigger/TrigCost/TrigCostD3PD/Root/UserD3PDObject.cxx
deleted file mode 100644
index 287a328621fad8e618bfdc3cf41d7760d5250b98..0000000000000000000000000000000000000000
--- a/Trigger/TrigCost/TrigCostD3PD/Root/UserD3PDObject.cxx
+++ /dev/null
@@ -1,326 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: CodeGenerator_v2_constants.h 539451 2013-03-01 08:33:45Z krasznaa $
-
-// ROOT include(s):
-#include <TPRegexp.h>
-
-// Local include(s):
-#include "../TrigCostD3PD/UserD3PDObject.h"
-
-namespace D3PDReader {
-
-   UserD3PDObjectElement::UserD3PDObjectElement( size_t index,
-                                                 const UserD3PDObject& parent )
-      : ::TNamed(), m_parent( &parent ), m_index( index ), m_proxies() {
-
-   }
-
-   UserD3PDObjectElement::
-   UserD3PDObjectElement( const UserD3PDObjectElement& parent )
-      : TNamed( parent ), m_parent( parent.m_parent ), m_index( parent.m_index ),
-        m_proxies() {
-
-   }
-
-   UserD3PDObjectElement::~UserD3PDObjectElement() {
-
-      // Delete the allocated objects:
-      std::map< ::TString, VarProxyBase* >::iterator itr = m_proxies.begin();
-      std::map< ::TString, VarProxyBase* >::iterator end = m_proxies.end();
-      for( ; itr != end; ++itr ) {
-         delete itr->second;
-      }
-   }
-
-   size_t UserD3PDObjectElement::GetIndex() const {
-
-      return m_index;
-   }
-
-   UserD3PDObject::UserD3PDObject( const ::Long64_t& master,
-                                   const char* prefix )
-      : D3PDObjectBase(), m_master( &master ), m_prefix( prefix ), m_proxies(),
-        m_handles(), m_extraHandles(), m_fromInput( kTRUE ),
-        m_inTree( 0 ) {
-
-   }
-
-   UserD3PDObject::UserD3PDObject( const char* prefix )
-      : D3PDObjectBase(), m_master( 0 ), m_prefix( prefix ), m_proxies(),
-        m_handles(), m_extraHandles(), m_fromInput( kFALSE ),
-        m_inTree( 0 ) {
-
-   }
-
-   UserD3PDObject::~UserD3PDObject() {
-
-      // Delete the allocated objects:
-      std::map< ::TString, VarHandleBase* >::iterator itr = m_handles.begin();
-      std::map< ::TString, VarHandleBase* >::iterator end = m_handles.end();
-      for( ; itr != end; ++itr ) {
-         delete itr->second;
-      }
-      // Although the code almost certainly crashes when such dummy objects
-      // are created, there's still some chance that they need to be cleaned:
-      std::vector< VarHandleBase* >::iterator eitr = m_extraHandles.begin();
-      std::vector< VarHandleBase* >::iterator eend = m_extraHandles.end();
-      for( ; eitr != eend; ++eitr ) {
-         delete *eitr;
-      }
-   }
-
-   /**
-    * @returns The branch name prefix used by the object
-    */
-   const char* UserD3PDObject::GetPrefix() const {
-
-      return m_prefix;
-   }
-
-   /**
-    * @param prefix The prefix that should be used for the variables
-    */
-   void UserD3PDObject::SetPrefix( const char* prefix ) {
-
-      m_prefix = prefix;
-
-      // Set all the variable names:
-      std::map< TString, VarHandleBase* >::const_iterator itr = m_handles.begin();
-      std::map< TString, VarHandleBase* >::const_iterator end = m_handles.end();
-      for( ; itr != end; ++itr ) {
-         itr->second->SetName( ::TString( prefix ) + itr->first );
-      }
-
-      return;
-   }
-
-   /**
-    * This function should be called every time a new TFile is opened
-    * by your analysis code.
-    *
-    * @param tree Pointer to the TTree with the variables
-    */
-   void UserD3PDObject::ReadFrom( TTree* tree ) {
-
-      // Check if the object will be able to read from the TTree:
-      if( ! m_fromInput ) {
-         Error( "ReadFrom",
-                "The object was not created with the correct" );
-         Error( "ReadFrom",
-                "constructor to read data from a D3PD!" );
-         return;
-      }
-
-      // Call ReadFrom(...) on all the variables:
-      std::map< TString, VarHandleBase* >::const_iterator itr = m_handles.begin();
-      std::map< TString, VarHandleBase* >::const_iterator end = m_handles.end();
-      for( ; itr != end; ++itr ) {
-         // Ignore the variables that are created only now:
-         if( ! itr->second->GetMaster() ) continue;
-         itr->second->ReadFrom( tree );
-      }
-
-      // Remember the pointer:
-      m_inTree = tree;
-
-      return;
-   }
-
-   /**
-    * This function can be called to connect the active variables of the object
-    * to an output TTree. It can be called multiple times, then the variables
-    * will be written to multiple TTrees.
-    *
-    * @param tree Pointer to the TTree where the variables should be written
-    */
-   void UserD3PDObject::WriteTo( TTree* tree ) {
-
-      // Call WriteTo(...) on all the variables:
-      std::map< TString, VarHandleBase* >::const_iterator itr = m_handles.begin();
-      std::map< TString, VarHandleBase* >::const_iterator end = m_handles.end();
-      for( ; itr != end; ++itr ) {
-         itr->second->WriteTo( tree );
-      }
-
-      return;
-   }
-
-   /**
-    * This is a convenience function for turning the branches active or
-    * inactive conveniently. If the parameter is set to <code>kTRUE</code>
-    * then the branches available from the input which match the given
-    * pattern are turned active.
-    * When it's set to <code>kFALSE</code> then all the variables matching
-    * the pattern are turned inactive.
-    *
-    * @param active Flag behaving as explained above
-    * @param pattern Regular expression specifying which branches to modify
-    */
-   void UserD3PDObject::SetActive( ::Bool_t active, const ::TString& pattern ) {
-
-      ::TPRegexp re( pattern );
-
-      std::map< TString, VarHandleBase* >::const_iterator itr = m_handles.begin();
-      std::map< TString, VarHandleBase* >::const_iterator end = m_handles.end();
-      for( ; itr != end; ++itr ) {
-         if( ! re.Match( m_prefix + itr->first ) ) continue;
-         if( active ) {
-            if( itr->second->IsAvailable() ) itr->second->SetActive( active );
-         } else {
-            itr->second->SetActive( active );
-         }
-      }
-
-      return;
-   }
-
-   /**
-    * This function can be used to read in all the branches from the input
-    * TTree which are set active for writing out. This can simplify writing
-    * event selector codes immensely. Remember to set the desired variable
-    * active before calling this function.
-    */
-   void UserD3PDObject::ReadAllActive() {
-
-      // Check if it makes sense to call this function:
-      if( ! m_fromInput ) {
-         static ::Bool_t wPrinted = kFALSE;
-         if( ! wPrinted ) {
-            Warning( "ReadAllActive",
-                     "Function only meaningful when used on objects" );
-            Warning( "ReadAllActive",
-                     "which are used to read information from a D3PD" );
-            wPrinted = kTRUE;
-         }
-      }
-
-      // Read in the current entry for each active variable:
-      std::map< TString, VarHandleBase* >::const_iterator itr = m_handles.begin();
-      std::map< TString, VarHandleBase* >::const_iterator end = m_handles.end();
-      for( ; itr != end; ++itr ) {
-         if( ! itr->second->IsActive() ) continue;
-         itr->second->ReadCurrentEntry();
-      }
-
-      return;
-   }
-
-   /**
-    * This function can be used to get information about the access
-    * pattern/statistics of the job. It should be called at the end of
-    * an analysis job to get the information about the performance of the
-    * analysis.
-    *
-    * @returns An object describing the D3PD access statistics
-    */
-   // D3PDReadStats UserD3PDObject::GetStatistics() const {
-
-   //    // The result object:
-   //    D3PDReadStats result;
-
-   //    // Add the statistics from each variable to the result:
-   //    std::map< ::TString, VarHandleBase* >::const_iterator itr = m_handles.begin();
-   //    std::map< ::TString, VarHandleBase* >::const_iterator end = m_handles.end();
-   //    for( ; itr != end; ++itr ) {
-   //       result.AddVariable( itr->second->GetStatistics() );
-   //    }
-
-   //    return result;
-   // }
-
-   /**
-    * User variables can't be copied like this at the moment.
-    */
-   UserD3PDObject& UserD3PDObject::Set( const UserD3PDObject& parent ) {
-
-      if( parent.m_handles.size() ) {
-         Error( "Set",
-                "User variables can not be copied usig this function!" );
-      }
-      return *this;
-   }
-
-   /**
-    * This function makes it easier to clear out the object completely.
-    * It cleares all the vector variables, and sets the element number
-    * variable to 0. Very useful when performing object selection.
-    * The option argument is not used at the moment for anything.
-    * It's only there because the <code>Clear</code> function defined in
-    * TObject has this parameter as well.
-    *
-    * @param option Ignored at the moment
-    */
-   void UserD3PDObject::Clear( Option_t* ) {
-
-      // Clear each variable:
-      std::map< ::TString, VarHandleBase* >::const_iterator itr = m_handles.begin();
-      std::map< ::TString, VarHandleBase* >::const_iterator end = m_handles.end();
-      for( ; itr != end; ++itr ) {
-         itr->second->Clear();
-      }
-
-      return;
-   }
-
-   /**
-    * User variables can't be copied like this at the moment.
-    */
-   UserD3PDObject& UserD3PDObject::Add( const UserD3PDObjectElement& el ) {
-
-      if( el.m_proxies.size() ) {
-         Error( "Add",
-                "User variables can not be copied usig this function!" );
-      }
-      return *this;
-   }
-
-   /**
-    * This operator can be used to get access to one element in the
-    * collection. This element can then be passed around between parts
-    * of the analysis code easily.
-    *
-    * This version is useful when modifying the variable contents through
-    * the proxy objects.
-    *
-    * @param index Index of the element inside the collection
-    */
-   UserD3PDObjectElement& UserD3PDObject::operator[]( size_t index ) {
-
-      while( m_proxies.size() <= index ) {
-         m_proxies.push_back( new UserD3PDObjectElement( m_proxies.size(), *this ) );
-      }
-      return *m_proxies[ index ];
-   }
-
-   /**
-    * This operator can be used to get access to one element in the
-    * collection. This element can then be passed around between parts
-    * of the analysis code easily.
-    *
-    * This version is useful when only reading the variables.
-    *
-    * @param index Index of the element inside the collection
-    */
-   const UserD3PDObjectElement& UserD3PDObject::operator[]( size_t index ) const {
-
-      while( m_proxies.size() <= index ) {
-         m_proxies.push_back( new UserD3PDObjectElement( m_proxies.size(), *this ) );
-      }
-      return *m_proxies[ index ];
-   }
-
-   /**
-    * A convenience operator for adding an 'element' to this collection.
-    *
-    * @see Add
-    * @param el The 'element' that should be added to the collection
-    */
-   UserD3PDObject& UserD3PDObject::operator+=( const UserD3PDObjectElement& el ) {
-
-      return this->Add( el );
-   }
-
-} // namespace D3PDReader
diff --git a/Trigger/TrigCost/TrigCostD3PD/Root/Utils.cxx b/Trigger/TrigCost/TrigCostD3PD/Root/Utils.cxx
deleted file mode 100644
index 96cbdc13748155c195fd84b16089e9d2916b52b7..0000000000000000000000000000000000000000
--- a/Trigger/TrigCost/TrigCostD3PD/Root/Utils.cxx
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: CodeGenerator_v2_constants.h 539451 2013-03-01 08:33:45Z krasznaa $
-
-// STL include(s):
-#include <cmath>
-
-// Local include(s):
-#include "../TrigCostD3PD/Utils.h"
-
-namespace {
-
-   /**
-    *  @short Simple structure describing an elapsed amount of time
-    *
-    *         In order to print some elapsed times in a nice way, the
-    *         private functions of this source file use this structure.
-    *
-    *         The amount of times measured by the code should be
-    *         representable by this structure. (We shouldn't care about
-    *         sub-milisecond times, or longer running periods than a
-    *         few days...)
-    *
-    * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
-    *
-    * $Revision: 539451 $
-    * $Date: 2013-03-01 09:33:45 +0100 (Fri, 01 Mar 2013) $
-    */
-   struct TimeStruct {
-      ::Int_t miliseconds; ///< Elapsed milisecods
-      ::Int_t seconds; ///< Elapsed seconds
-      ::Int_t minutes; ///< Elapsed minutes
-      ::Int_t hours; ///< Elapsed hours
-      ::Int_t days; ///< Elapsed days
-   }; // struct TimeStruct
-
-   /// Function creating a time structure
-   /**
-    * This function is used to break down a simple elapsed time expressed in
-    * seconds into an easy-to-print structure. Shame that I couldn't find something
-    * in standard C/C++ to do it...
-    *
-    * @param secs The elapsed time expressed in seconds
-    * @returns A structure describing the elapsed time
-    */
-   TimeStruct TimeToStruct( ::Double_t secs ) {
-
-      // Create the structure, fill its miliseconds variable,
-      // and reset all the rest:
-      TimeStruct result;
-      result.miliseconds =
-         static_cast< ::Int_t >( std::fmod( secs, 1.0 ) * 1000.0 );
-      result.seconds = 0; result.minutes = 0; result.hours = 0;
-      result.days = 0;
-
-      // If the elapsed time was less than a second, finish here:
-      secs -= ( result.miliseconds / 1000.0 );
-      if( std::abs( secs ) < 0.5 ) return result;
-
-      // Calculate the number of seconds passed, and finish if the
-      // amount of time passed was less than a minute:
-      result.seconds =
-         static_cast< ::Int_t >( std::fmod( secs, 60.0 ) );
-      secs -= result.seconds;
-      if( std::abs( secs ) < 0.5 ) return result;
-
-      // Calculate the number of minutes passed, and finish if the
-      // amount of time passed was less than an hour:
-      result.minutes =
-         static_cast< ::Int_t >( std::fmod( secs, 3600.0 ) / 60.0 );
-      secs -= result.minutes * 60.0;
-      if( std::abs( secs ) < 0.5 ) return result;
-
-      // Calculate the number of hours passed, and finish if the
-      // amount of time passed was less than a day:
-      result.hours =
-         static_cast< ::Int_t >( std::fmod( secs, 86400.0 ) / 3600.0 );
-      secs -= result.hours * 3600.0;
-      if( std::abs( secs ) < 0.5 ) return result;
-
-      // Calculate the number of days passed. The function should
-      // not expect to have to express a larger order of magnitude...
-      result.days = static_cast< ::Int_t >( secs / 86400.0 );
-
-      return result;
-   }
-
-} // private namespace
-
-namespace D3PDReader {
-
-   /**
-    * Since I wasn't able to find a nice function printing elapsed times
-    * in a human-readable format, I ended up writing one. This function
-    * is used in printing the statistics about an analysis.
-    *
-    * @param secs An amount of time passed, expressed in seconds
-    * @returns A formatted, human-readable version of the amount of time passed
-    */
-   ::TString TimeToString( ::Double_t secs ) {
-
-      const TimeStruct ts = TimeToStruct( secs );
-      ::TString result;
-      if( ts.days ) {
-         result += ::TString::Format( "%id ", ts.days );
-      }
-      if( ts.hours ) {
-         result += ::TString::Format( "%ih ", ts.hours );
-      }
-      if( ts.minutes ) {
-         result += ::TString::Format( "%im ", ts.minutes );
-      }
-      if( ts.seconds ) {
-         result += ::TString::Format( "%is ", ts.seconds );
-      }
-      result += ::TString::Format( "%ims", ts.miliseconds );
-
-      return result;
-   }
-
-   /**
-    * This function is used to produce nicely readable printouts for
-    * amounts of data.
-    *
-    * @param bytes The amount of data expressed in bytes
-    * @returns A human-readable printout of the data size
-    */
-   ::TString SizeToString( ::Long64_t bytes ) {
-
-      if( std::abs( bytes ) > 1e12 ) {
-         return ::TString::Format( "%g TB", bytes * 1e-12 );
-      } else if( std::abs( bytes ) > 1e9 ) {
-         return ::TString::Format( "%g GB", bytes * 1e-9 );
-      } else if( std::abs( bytes ) > 1e6 ) {
-         return ::TString::Format( "%g MB", bytes * 1e-6 );
-      } else if( std::abs( bytes ) > 1e3 ) {
-         return ::TString::Format( "%g kB", bytes * 1e-3 );
-      } else {
-         return ::TString::Format( "%lli bytes", bytes );
-      }
-   }
-
-   /**
-    * @param bytespersec The speed expressed in bytes / seconds
-    * @returns A human-readable printout of the data processing speed
-    */
-   ::TString SpeedToString( ::Double_t bytespersec ) {
-
-      if( ::fabs( bytespersec ) > 1e12 ) {
-         return ::TString::Format( "%g TB/s", bytespersec * 1e-12 );
-      } else if( ::fabs( bytespersec ) > 1e9 ) {
-         return ::TString::Format( "%g GB/s", bytespersec * 1e-9 );
-      } else if( ::fabs( bytespersec ) > 1e6 ) {
-         return ::TString::Format( "%g MB/s", bytespersec * 1e-6 );
-      } else if( ::fabs( bytespersec ) > 1e3 ) {
-         return ::TString::Format( "%g kB/s", bytespersec * 1e-3 );
-      } else {
-         return ::TString::Format( "%g B/s", bytespersec );
-      }
-   }
-
-} // namespace D3PDReader
diff --git a/Trigger/TrigCost/TrigCostD3PD/Root/VarHandle.cxx b/Trigger/TrigCost/TrigCostD3PD/Root/VarHandle.cxx
deleted file mode 100644
index 0173a2460b7f875d64dc1dfcbfc830af45fe57e6..0000000000000000000000000000000000000000
--- a/Trigger/TrigCost/TrigCostD3PD/Root/VarHandle.cxx
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: CodeGenerator_v2_constants.h 539451 2013-03-01 08:33:45Z krasznaa $
-
-// ROOT include(s):
-#include <TError.h>
-
-// Local include(s):
-#include "../TrigCostD3PD/VarHandle.h"
-//#include "../TrigCostD3PD/D3PDPerfStats.h"
-
-namespace D3PDReader {
-
-   VarHandleBase::VarHandleBase( const char* name,
-                                 const ::Long64_t* master )
-      : m_master( master ), m_fromInput( kFALSE ),
-        m_inTree( 0 ), m_inBranch( 0 ), m_available( UNKNOWN ), m_name( name ),
-        m_active( kFALSE ), m_type( "" ),
-        m_entriesRead(), m_branchSize(), m_zippedSize() {
-
-#ifdef COLLECT_D3PD_READING_STATISTICS
-      //D3PDPerfStats::Instance();
-#endif // COLLECT_D3PD_READING_STATISTICS
-   }
-
-   const char* VarHandleBase::GetName() const {
-
-      return m_name;
-   }
-
-   void VarHandleBase::SetName( const char* name ) {
-
-      m_name = name;
-      return;
-   }
-
-   const char* VarHandleBase::GetType() const {
-
-      return m_type;
-   }
-
-   void VarHandleBase::SetType( const char* type ) {
-
-      m_type = type;
-      return;
-   }
-
-   const ::Long64_t* VarHandleBase::GetMaster() const {
-
-      return m_master;
-   }
-
-   void VarHandleBase::SetMaster( const ::Long64_t* master ) {
-
-      m_master = master;
-      return;
-   }
-
-   ::Bool_t VarHandleBase::IsActive() const {
-
-      return m_active;
-   }
-
-   void VarHandleBase::SetActive( ::Bool_t active ) {
-
-      m_active = active;
-      return;
-   }
-
-   ::Bool_t VarHandleBase::IsAvailable() const {
-
-      if( ! m_fromInput ) return kTRUE;
-      switch( m_available ) {
-
-      case AVAILABLE:
-         return kTRUE;
-         break;
-      case UNAVAILABLE:
-         return kFALSE;
-         break;
-      case UNKNOWN:
-         {
-            if( ! m_inTree ) return kTRUE;
-            ::Bool_t temp = kFALSE;
-            m_available = ( temp = m_inTree->GetBranch( GetName() ) ) ? AVAILABLE :
-                         UNAVAILABLE;
-            return temp;
-         }
-         break;
-      default:
-         // This should really never be reached...
-         break;
-      }
-
-      // It's just here to make the compiler happy:
-      return kFALSE;
-   }
-
-   // VariableStats VarHandleBase::GetStatistics() const {
-
-   //    // Calculate the statistics:
-   //    ::Long64_t readEntries = 0;
-   //    ::Long64_t unzippedBytes = 0;
-   //    ::Long64_t zippedBytes = 0;
-   //    for( size_t i = 0; i < m_entriesRead.size(); ++i ) { 
-   //       readEntries += m_entriesRead[ i ];
-   //       unzippedBytes += static_cast< ::Long64_t >( m_branchSize[ i ] *
-   //                                                   m_entriesRead[ i ] );
-   //       zippedBytes += static_cast< ::Long64_t >( m_zippedSize[ i ] *
-   //                                                 m_entriesRead[ i ] );
-   //    }
-
-   //    // Now return the "smart" object:
-   //    return VariableStats( GetName(), GetType(),
-   //                          m_entriesRead.size(), readEntries,
-   //                          unzippedBytes, zippedBytes );
-   // }
-
-   ::Bool_t VarHandleBase::ConnectVariable( void* var, ::TClass* realClass,
-                                            EDataType dtype, Bool_t isptr ) const {
-
-      if( ! m_inTree ) {
-         ::Error( "D3PDReader::VarHandleBase::ConnectVariable",
-                  "Object not connected yet!" );
-         return kFALSE;
-      }
-      if( ! m_inTree->GetBranch( GetName() ) ) {
-         ::Error( "D3PDReader::VarHandleBase::ConnectVariable",
-                  "The following variable doesn't exist: %s",
-                  GetName() );
-         return kFALSE;
-      }
-#ifdef ACTIVATE_BRANCHES
-      // Only call this function when the user asks for it. It's quite expensive...
-      m_inTree->SetBranchStatus( ::TString( GetName() ) + "*", 1 );
-#endif // ACTIVATE_BRANCHES
-      if( m_inTree->SetBranchAddress( GetName(), var, &m_inBranch,
-                                     realClass, dtype, isptr ) ) {
-         ::Error( "D3PDReader::VarHandleBase::ConnectVariable",
-                  "Couldn't connect variable to branch: %s", GetName() );
-         return kFALSE;
-      }
-
-#ifdef COLLECT_D3PD_READING_STATISTICS
-      //UpdateStat( m_inBranch );
-#endif // COLLECT_D3PD_READING_STATISTICS
-
-      return kTRUE;
-   }
-
-   void VarHandleBase::UpdateBranch() const {
-      //Cov warning
-      if (!m_inBranch) return;
-
-      if( *m_master != m_inBranch->GetReadEntry() ) {
-         m_inBranch->GetEntry( *m_master );
-#ifdef COLLECT_D3PD_READING_STATISTICS
-        // ++( m_entriesRead.back() );
-#endif // COLLECT_D3PD_READING_STATISTICS
-      }
-
-      return;
-   }
-
-   // void VarHandleBase::UpdateStat( ::TBranch* br ) const {
-
-   //    m_entriesRead.push_back( 0 );
-   //    m_branchSize.push_back( ( ::Float_t ) br->GetTotalSize( "*" ) /
-   //                           ( ::Float_t ) br->GetEntries() );
-   //    m_zippedSize.push_back( ( ::Float_t ) br->GetZipBytes( "*" ) /
-   //                           ( ::Float_t ) br->GetEntries() );
-
-   //    D3PDPerfStats::Instance()->NewTreeAccessed( m_inTree );
-
-   //    return;
-   // }
-
-   const char* VarHandleBase::RootType( const char* typeid_type ) const {
-
-      if( strlen( typeid_type ) != 1 ) {
-         ::Error( "D3PDReader::VarHandleBase::RootType",
-                  "Received complex object description" );
-         return "";
-      }
-
-      switch( typeid_type[ 0 ] ) {
-
-      case 'c':
-         return "B";
-         break;
-      case 'h':
-         return "b";
-         break;
-      case 's':
-         return "S";
-         break;
-      case 't':
-         return "s";
-         break;
-      case 'i':
-         return "I";
-         break;
-      case 'j':
-         return "i";
-         break;
-      case 'f':
-         return "F";
-         break;
-      case 'd':
-         return "D";
-         break;
-      case 'x':
-         return "L";
-         break;
-      case 'y':
-         return "l";
-         break;
-      case 'b':
-         return "O";
-         break;
-
-      }
-
-      ::Error( "D3PDReader::VarHandleBase::RootType",
-               "Unknown primitive type encountered: %s",
-               typeid_type );
-      return "";
-   }
-
-   const char* VarHandleBase::RootCppType( const char* typeid_type ) const {
-
-      if( strlen( typeid_type ) != 1 ) {
-         ::Error( "D3PDReader::VarHandleBase::RootCppType",
-                  "Received complex object description" );
-         return "";
-      }
-
-      switch( typeid_type[ 0 ] ) {
-
-      case 'c':
-         return "Char_t";
-         break;
-      case 'h':
-         return "UChar_t";
-         break;
-      case 's':
-         return "Short_t";
-         break;
-      case 't':
-         return "UShort_t";
-         break;
-      case 'i':
-         return "Int_t";
-         break;
-      case 'j':
-         return "UInt_t";
-         break;
-      case 'f':
-         return "Float_t";
-         break;
-      case 'd':
-         return "Double_t";
-         break;
-      case 'x':
-         return "Long64_t";
-         break;
-      case 'y':
-         return "ULong64_t";
-         break;
-      case 'b':
-         return "Bool_t";
-         break;
-
-      }
-
-      ::Error( "D3PDReader::VarHandleBase::RootCppType",
-               "Unknown primitive type encountered: %s",
-               typeid_type );
-      return "";
-   }
-
-} // namespace D3PDReader
diff --git a/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/D3PDObjectBase.h b/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/D3PDObjectBase.h
deleted file mode 100644
index 21d81c091b2321dc64dfe1a0a565ed53a3dca441..0000000000000000000000000000000000000000
--- a/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/D3PDObjectBase.h
+++ /dev/null
@@ -1,67 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: CodeGenerator_v2_constants.h 539451 2013-03-01 08:33:45Z krasznaa $
-#ifndef D3PDREADER_D3PDOBJECTBASE_H
-#define D3PDREADER_D3PDOBJECTBASE_H
-
-// ROOT include(s):
-#include <TNamed.h>
-#include <TString.h>
-
-// Local include(s):
-//#include "D3PDReadStats.h"
-
-// Forward declaration(s):
-class TTree;
-
-namespace D3PDReader {
-
-   /**
-    *  @short Common base class for all main D3PDReader classes
-    *
-    *         To make the classes a bit easier to handle in "smart" code
-    *         they inherit from a common base that defines all of their
-    *         common features.
-    *
-    * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
-    *
-    * $Revision: 539451 $
-    * $Date: 2013-03-01 09:33:45 +0100 (Fri, 01 Mar 2013) $
-    */
-   class D3PDObjectBase : public ::TNamed {
-
-   public:
-      /// Default constructor
-      D3PDObjectBase() : ::TNamed() {}
-
-      /// Get the currently configured prefix value
-      virtual const char* GetPrefix() const = 0;
-      /// Set the prefix for the variables
-      virtual void SetPrefix( const char* prefix ) = 0;
-
-      /// Connect the object to an input TTree
-      virtual void ReadFrom( ::TTree* tree ) = 0;
-      /// Connect the object to an output TTree
-      virtual void WriteTo( ::TTree* tree ) = 0;
-
-      /// Turn (selected) branches either on or off
-      virtual void SetActive( ::Bool_t active = kTRUE,
-                              const ::TString& pattern = ".*" ) = 0;
-
-      /// Read in all the variables that we need to write out as well
-      virtual void ReadAllActive() = 0;
-
-      /// Get the D3PD reading statistics
-      //virtual D3PDReadStats GetStatistics() const = 0;
-
-      ClassDef( D3PDObjectBase, 0 )
-
-   }; // class D3PDObjectBase
-
-} // namespace D3PDReader
-
-#endif // D3PDREADER_D3PDOBJECTBASE_H
diff --git a/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/NTUP_TRIGCOST.h b/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/NTUP_TRIGCOST.h
deleted file mode 100644
index a759ee9a5caa762fd91baa1b12aa3fb50238a6e3..0000000000000000000000000000000000000000
--- a/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/NTUP_TRIGCOST.h
+++ /dev/null
@@ -1,75 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// -------------------------------------------------------------
-//             Code produced by D3PDMakerReader
-//
-//  author: Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
-// -------------------------------------------------------------
-#ifndef D3PDREADER_NTUP_TRIGCOST_H
-#define D3PDREADER_NTUP_TRIGCOST_H
-
-// Local include(s):
-#include "D3PDObjectBase.h"
-#include "TrigCostD3PDObject.h"
-#include "TrigDBKeysD3PDObject.h"
-
-namespace D3PDReader {
-
-   /**
-    * Code generated by CodeGenerator_v2 on:
-    *  host = lxplus0164.cern.ch
-    *  OS   = Linux / 2.6.32-431.11.2.el6.x86_64
-    *  user = tamartin
-    *  time = Fri Jun 27 16:52:19 2014
-    */
-   class NTUP_TRIGCOST : public D3PDObjectBase {
-
-   public:
-      /// Default constructor, to be used when reading a D3PD
-      NTUP_TRIGCOST();
-      /// Constructor for only writing data
-      NTUP_TRIGCOST( Bool_t onlyForWriting );
-
-      /// Get the currently configured prefix value
-      virtual const char* GetPrefix() const;
-      /// Set the prefix for the variables
-      virtual void SetPrefix( const char* prefix );
-
-      /// Connect the object to an input TTree
-      virtual void ReadFrom( ::TTree* tree );
-      /// Connect the object to an output TTree
-      virtual void WriteTo( ::TTree* tree );
-
-      /// Turn (selected) branches either on or off
-      virtual void SetActive( ::Bool_t active = kTRUE,
-                              const ::TString& pattern = ".*" );
-      /// Read in all the variables that we need to write out as well
-      virtual void ReadAllActive();
-
-      /// Get the D3PD reading statistics
-      //virtual D3PDReadStats GetStatistics() const;
-
-      /// Switch the reader object to a new event
-      void GetEntry( ::Long64_t entry );
-
-      //
-      // All the components of the D3PD:
-      //
-      TrigCostD3PDObject TrigCostHLT;
-      TrigDBKeysD3PDObject trig_DB;
-
-   private:
-      Long64_t m_entry; ///< Variable storing the current entry number
-      Bool_t m_fromInput; ///< Flag specifying if object is used for D3PD reading
-
-      ClassDef( NTUP_TRIGCOST, 0 )
-
-   }; // class NTUP_TRIGCOST
-
-} // namespace D3PDReader
-
-#endif // D3PDREADER_NTUP_TRIGCOST_H
diff --git a/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/TrigCostD3PDObject.h b/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/TrigCostD3PDObject.h
deleted file mode 100644
index e4ce74f86c6d81e6031e6e07cb58801bb422a2ea..0000000000000000000000000000000000000000
--- a/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/TrigCostD3PDObject.h
+++ /dev/null
@@ -1,234 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// -------------------------------------------------------------
-//             Code produced by D3PDMakerReader
-//
-//  author: Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
-// -------------------------------------------------------------
-#ifndef D3PDREADER_TrigCostD3PDObject_H
-#define D3PDREADER_TrigCostD3PDObject_H
-
-// STL include(s):
-#include <map>
-#include <vector>
-
-// ROOT include(s):
-#include <TObject.h>
-#include <TString.h>
-
-#include "D3PDObjectBase.h"
-//#include "D3PDReadStats.h"
-#include "VarHandle.h"
-#include "UserD3PDObject.h"
-
-class TTree;
-
-namespace D3PDReader {
-
-   /**
-    * Code generated by CodeGenerator_v2 on:
-    *  host = lxplus0164.cern.ch
-    *  OS   = Linux / 2.6.32-431.11.2.el6.x86_64
-    *  user = tamartin
-    *  time = Fri Jun 27 16:52:19 2014
-    */
-   class TrigCostD3PDObject : public UserD3PDObject {
-
-   public:
-      /// Constructor used when reading from a TTree
-      TrigCostD3PDObject( const ::Long64_t& master, const char* prefix = "TrigCostHLT_" );
-      /// Constructor when the object is only used for writing data out
-      TrigCostD3PDObject( const char* prefix = "TrigCostHLT_" );
-
-      /// Get the currently configured prefix value
-      virtual const char* GetPrefix() const;
-      /// Set the prefix for the variables
-      virtual void SetPrefix( const char* prefix );
-
-      /// Connect the object to an input TTree
-      virtual void ReadFrom( ::TTree* tree );
-      /// Connect the object to an output TTree
-      virtual void WriteTo( ::TTree* tree );
-
-      /// Turn (selected) branches either on or off
-      virtual void SetActive( ::Bool_t active = kTRUE,
-                              const ::TString& pattern = ".*" );
-      /// Read in all the variables that we need to write out as well
-      virtual void ReadAllActive();
-
-      /// Get the D3PD reading statistics
-      //virtual D3PDReadStats GetStatistics() const;
-
-      /// Set the contents of the object according to another object
-      TrigCostD3PDObject& Set( const TrigCostD3PDObject& parent );
-
-      /// Hash of AppId of the XPU node processing this event.
-      VarHandle< unsigned int > appId;
-      /// Enhanced bias weight of the event (only if specificaly calculated)
-      VarHandle< float > ebWeight;
-      VarHandle< unsigned int > ebWeightBG;
-      VarHandle< unsigned char > ebUnbiased;
-      /// If the event was a monitoring event
-      VarHandle< unsigned char > ranScaleTools;
-      /// BCID for this event
-      VarHandle< unsigned int > bunchCrossingId;
-      VarHandle< std::vector<unsigned short,std::allocator<unsigned short> >* > chain_counter;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > chain_isExpressStream;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > chain_isPassed;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > chain_isPassedRaw;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > chain_isPassthrough;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > chain_isPrescaled;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > chain_isResurrected;
-      VarHandle< std::vector<unsigned short,std::allocator<unsigned short> >* > chain_level;
-      VarHandle< unsigned short > chain_n;
-      VarHandle< std::vector<float,std::allocator<float> >* > chain_timer;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > chain_wasL1AfterPrescale;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > chain_wasL1AfterVeto;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > chain_wasL1BeforePrescale;
-      /// Sequential number of cost events processed
-      VarHandle< float > costEvent;
-      /// Nanosecond the data were saved by CostMon
-      VarHandle< unsigned int > costRunNsec;
-      /// Second the data were saved by CostMon
-      VarHandle< unsigned int > costRunSec;
-      /// Event number
-      VarHandle< unsigned int > eventNumber;
-      VarHandle< std::vector<unsigned short,std::allocator<unsigned short> >* > l1_ctpId;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > l1_isPrescaled;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > l1_isVetoed;
-      VarHandle< unsigned short > l1_n;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > l1_passed;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > l1_passedAfterPrescale;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > l1_passedAfterVeto;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > l1_passedBeforePrescale;
-      /// Lumi block number for this event
-      VarHandle< unsigned int > lumi;
-      VarHandle< float > lumiLength;
-      /// Start of the event nanoseconds
-      VarHandle< unsigned int > nanoSeconds;
-      VarHandle< std::vector<std::vector<unsigned int,std::allocator<unsigned int> >,std::allocator<std::vector<unsigned int,std::allocator<unsigned int> > > >* > rob_data_id;
-      VarHandle< std::vector<std::vector<unsigned char,std::allocator<unsigned char> >,std::allocator<std::vector<unsigned char,std::allocator<unsigned char> > > >* > rob_data_isCached;
-      VarHandle< std::vector<std::vector<unsigned char,std::allocator<unsigned char> >,std::allocator<std::vector<unsigned char,std::allocator<unsigned char> > > >* > rob_data_isDisabled;
-      VarHandle< std::vector<std::vector<unsigned char,std::allocator<unsigned char> >,std::allocator<std::vector<unsigned char,std::allocator<unsigned char> > > >* > rob_data_isIgnored;
-      VarHandle< std::vector<std::vector<unsigned char,std::allocator<unsigned char> >,std::allocator<std::vector<unsigned char,std::allocator<unsigned char> > > >* > rob_data_isRetrieved;
-      VarHandle< std::vector<std::vector<unsigned char,std::allocator<unsigned char> >,std::allocator<std::vector<unsigned char,std::allocator<unsigned char> > > >* > rob_data_isStatusOk;
-      VarHandle< std::vector<std::vector<unsigned char,std::allocator<unsigned char> >,std::allocator<std::vector<unsigned char,std::allocator<unsigned char> > > >* > rob_data_isStatusPrefetched;
-      VarHandle< std::vector<std::vector<unsigned char,std::allocator<unsigned char> >,std::allocator<std::vector<unsigned char,std::allocator<unsigned char> > > >* > rob_data_isUnclassified;
-      VarHandle< std::vector<unsigned short,std::allocator<unsigned short> >* > rob_data_n;
-      VarHandle< std::vector<std::vector<unsigned int,std::allocator<unsigned int> >,std::allocator<std::vector<unsigned int,std::allocator<unsigned int> > > >* > rob_data_size;
-      VarHandle< unsigned short > rob_n;
-      VarHandle< std::vector<unsigned int,std::allocator<unsigned int> >* > rob_requestorId;
-      VarHandle< std::vector<std::vector<unsigned char,std::allocator<unsigned char> >,std::allocator<std::vector<unsigned char,std::allocator<unsigned char> > > >* > rob_sum_isCached;
-      VarHandle< std::vector<std::vector<unsigned char,std::allocator<unsigned char> >,std::allocator<std::vector<unsigned char,std::allocator<unsigned char> > > >* > rob_sum_isDisabled;
-      VarHandle< std::vector<std::vector<unsigned char,std::allocator<unsigned char> >,std::allocator<std::vector<unsigned char,std::allocator<unsigned char> > > >* > rob_sum_isIgnored;
-      VarHandle< std::vector<std::vector<unsigned char,std::allocator<unsigned char> >,std::allocator<std::vector<unsigned char,std::allocator<unsigned char> > > >* > rob_sum_isRetrieved;
-      VarHandle< std::vector<std::vector<unsigned char,std::allocator<unsigned char> >,std::allocator<std::vector<unsigned char,std::allocator<unsigned char> > > >* > rob_sum_isUnclassified;
-      VarHandle< std::vector<unsigned short,std::allocator<unsigned short> >* > rob_sum_n;
-      VarHandle< std::vector<std::vector<unsigned int,std::allocator<unsigned int> >,std::allocator<std::vector<unsigned int,std::allocator<unsigned int> > > >* > rob_sum_nRob;
-      VarHandle< std::vector<std::vector<unsigned int,std::allocator<unsigned int> >,std::allocator<std::vector<unsigned int,std::allocator<unsigned int> > > >* > rob_sum_size;
-      VarHandle< std::vector<std::vector<unsigned int,std::allocator<unsigned int> >,std::allocator<std::vector<unsigned int,std::allocator<unsigned int> > > >* > rob_sum_subDet;
-      VarHandle< std::vector<unsigned int,std::allocator<unsigned int> >* > rob_timeStartMicroSec;
-      VarHandle< std::vector<unsigned int,std::allocator<unsigned int> >* > rob_timeStartSec;
-      VarHandle< std::vector<unsigned int,std::allocator<unsigned int> >* > rob_timeStopMicroSec;
-      VarHandle< std::vector<unsigned int,std::allocator<unsigned int> >* > rob_timeStopSec;
-      VarHandle< std::vector<double,std::allocator<double> >* > rob_timer;
-      VarHandle< std::vector<float,std::allocator<float> >* > roi_area;
-      VarHandle< std::vector<float,std::allocator<float> >* > roi_eta;
-      VarHandle< std::vector<unsigned int,std::allocator<unsigned int> >* > roi_id;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > roi_isTypeEmTau;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > roi_isTau; // new
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > roi_isTypeEnergy;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > roi_isTypeJet;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > roi_isTypeJetEt;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > roi_isTypeMuon;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > roi_isTypeNone;
-      VarHandle< unsigned short > roi_n;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > roi_nL1Thresholds;
-      VarHandle< std::vector<float,std::allocator<float> >* > roi_phi;
-      // New
-      VarHandle< std::vector<float,std::allocator<float> >* > roi_et;
-      VarHandle< std::vector<float,std::allocator<float> >* > roi_etLarge;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > roi_muCharge;
-      VarHandle< std::vector<unsigned int,std::allocator<unsigned int> >* > roi_isoBits;
-      VarHandle< std::vector<float,std::allocator<float> >* >  roi_vectorEX;
-      VarHandle< std::vector<float,std::allocator<float> >* > roi_vectorEY;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > roi_overflowEX;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > roi_overflowEY;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > roi_overflowET;
-      /// Run number for this event
-      VarHandle< unsigned int > runNumber;
-      /// Start of the event in seconds
-      VarHandle< unsigned int > seconds;
-      VarHandle< std::vector<double,std::allocator<double> >* > seq_algTotalTime;
-      VarHandle< std::vector<std::vector<unsigned char,std::allocator<unsigned char> >,std::allocator<std::vector<unsigned char,std::allocator<unsigned char> > > >* > seq_alg_isCached;
-      VarHandle< std::vector<std::vector<unsigned char,std::allocator<unsigned char> >,std::allocator<std::vector<unsigned char,std::allocator<unsigned char> > > >* > seq_alg_isCalled;
-      VarHandle< std::vector<unsigned short,std::allocator<unsigned short> >* > seq_alg_n;
-      VarHandle< std::vector<std::vector<unsigned char,std::allocator<unsigned char> >,std::allocator<std::vector<unsigned char,std::allocator<unsigned char> > > >* > seq_alg_position;
-      VarHandle< std::vector<std::vector<unsigned int,std::allocator<unsigned int> >,std::allocator<std::vector<unsigned int,std::allocator<unsigned int> > > >* > seq_alg_roi_index;
-      VarHandle< std::vector<std::vector<unsigned char,std::allocator<unsigned char> >,std::allocator<std::vector<unsigned char,std::allocator<unsigned char> > > >* > seq_alg_roi_n;
-      VarHandle< std::vector<std::vector<unsigned int,std::allocator<unsigned int> >,std::allocator<std::vector<unsigned int,std::allocator<unsigned int> > > >* > seq_alg_timeStartMicroSec;
-      VarHandle< std::vector<std::vector<unsigned int,std::allocator<unsigned int> >,std::allocator<std::vector<unsigned int,std::allocator<unsigned int> > > >* > seq_alg_timeStartSec;
-      VarHandle< std::vector<std::vector<unsigned int,std::allocator<unsigned int> >,std::allocator<std::vector<unsigned int,std::allocator<unsigned int> > > >* > seq_alg_timeStopMicroSec;
-      VarHandle< std::vector<std::vector<unsigned int,std::allocator<unsigned int> >,std::allocator<std::vector<unsigned int,std::allocator<unsigned int> > > >* > seq_alg_timeStopSec;
-      VarHandle< std::vector<std::vector<double,std::allocator<double> >,std::allocator<std::vector<double,std::allocator<double> > > >* > seq_alg_timer;
-      VarHandle< std::vector<unsigned short,std::allocator<unsigned short> >* > seq_channelCounter;
-      VarHandle< std::vector<unsigned short,std::allocator<unsigned short> >* > seq_index;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > seq_isAlreadyExecuted;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > seq_isExecuted;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > seq_isInitial;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > seq_isPrevious;
-      VarHandle< std::vector<unsigned short,std::allocator<unsigned short> >* > seq_level;
-      VarHandle< unsigned short > seq_n;
-      VarHandle< std::vector<std::vector<unsigned char,std::allocator<unsigned char> >,std::allocator<std::vector<unsigned char,std::allocator<unsigned char> > > >* > seq_roi;
-      VarHandle< std::vector<float,std::allocator<float> >* > seq_timer;
-      VarHandle< std::vector<std::vector<unsigned short,std::allocator<unsigned short> >,std::allocator<std::vector<unsigned short,std::allocator<unsigned short> > > >* > te_childIndex;
-      VarHandle< std::vector<std::vector<unsigned int,std::allocator<unsigned int> >,std::allocator<std::vector<unsigned int,std::allocator<unsigned int> > > >* > te_clid;
-      VarHandle< std::vector<unsigned short,std::allocator<unsigned short> >* > te_id;
-      VarHandle< std::vector<unsigned short,std::allocator<unsigned short> >* > te_index;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > te_isActiveState;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > te_isErrorState;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > te_isInitialTe;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > te_isL1ThresholdTe;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > te_isOutputEFNode;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > te_isOutputL2Node;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > te_isRegularTe;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > te_isRoITe;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > te_isTerminalNode;
-      VarHandle< std::vector<unsigned char,std::allocator<unsigned char> >* > te_isTopologicalTe;
-      VarHandle< unsigned short > te_n;
-      VarHandle< std::vector<std::vector<unsigned short,std::allocator<unsigned short> >,std::allocator<std::vector<unsigned short,std::allocator<unsigned short> > > >* > te_parentIndex;
-      VarHandle< std::vector<std::vector<unsigned char,std::allocator<unsigned char> >,std::allocator<std::vector<unsigned char,std::allocator<unsigned char> > > >* > te_roiId;
-      /// Nominal time for this event
-      VarHandle< float > timer;
-      /// Detailed: Time of chain execution
-      VarHandle< float > timerChainProcess;
-      /// Detailed: Time to end of steering
-      VarHandle< float > timerEndSteer;
-      /// Detailed: Total time of monitoring tool(s) execution
-      VarHandle< float > timerMon;
-      /// Detailed: Time of ResultBuilder tool execution
-      VarHandle< float > timerResultBuilder;
-      /// Detailed: Time to run the OPI trig cost tools
-      VarHandle< float > timerTrigCost;
-
-   private:
-      /// Function used internally to access the variables
-      VarHandleBase* GetVarHandle( const char* name );
-      /// Function setting up all the VarHandle members
-      void SetVarHandles( const ::Long64_t* master );
-
-      std::map< ::TString, VarHandleBase* > m_handles; ///< Book-keeper of the VarHandle members
-      const ::Bool_t m_fromInput; ///< Flag specifying if object is used for D3PD reading
-      ::TString m_prefix; ///< Prefix to the branch names
-
-      ClassDef( TrigCostD3PDObject, 0 )
-
-   }; // class TrigCostD3PDObject
-
-} // namespace D3PDReader
-
-#endif // D3PDREADER_TrigCostD3PDObject_H
diff --git a/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/TrigDBKeysD3PDObject.h b/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/TrigDBKeysD3PDObject.h
deleted file mode 100644
index 59cba60fbf7c9872fd6d8d4c5c1b374ebdb38d03..0000000000000000000000000000000000000000
--- a/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/TrigDBKeysD3PDObject.h
+++ /dev/null
@@ -1,91 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// -------------------------------------------------------------
-//             Code produced by D3PDMakerReader
-//
-//  author: Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
-// -------------------------------------------------------------
-#ifndef D3PDREADER_TrigDBKeysD3PDObject_H
-#define D3PDREADER_TrigDBKeysD3PDObject_H
-
-// STL include(s):
-#include <map>
-
-// ROOT include(s):
-#include <TObject.h>
-#include <TString.h>
-
-#include "D3PDObjectBase.h"
-//#include "D3PDReadStats.h"
-#include "VarHandle.h"
-#include "UserD3PDObject.h"
-
-class TTree;
-
-namespace D3PDReader {
-
-   /**
-    * Code generated by CodeGenerator_v2 on:
-    *  host = epp-ui01
-    *  OS   = Linux / 2.6.18-348.3.1.el5
-    *  user = phsmai
-    *  time = Tue Apr 16 11:36:42 2013
-    */
-   class TrigDBKeysD3PDObject : public UserD3PDObject {
-
-   public:
-      /// Constructor used when reading from a TTree
-      TrigDBKeysD3PDObject( const ::Long64_t& master, const char* prefix = "trig_DB_" );
-      /// Constructor when the object is only used for writing data out
-      TrigDBKeysD3PDObject( const char* prefix = "trig_DB_" );
-
-      /// Get the currently configured prefix value
-      virtual const char* GetPrefix() const;
-      /// Set the prefix for the variables
-      virtual void SetPrefix( const char* prefix );
-
-      /// Connect the object to an input TTree
-      virtual void ReadFrom( ::TTree* tree );
-      /// Connect the object to an output TTree
-      virtual void WriteTo( ::TTree* tree );
-
-      /// Turn (selected) branches either on or off
-      virtual void SetActive( ::Bool_t active = kTRUE,
-                              const ::TString& pattern = ".*" );
-      /// Read in all the variables that we need to write out as well
-      virtual void ReadAllActive();
-
-      /// Get the D3PD reading statistics
-      //virtual D3PDReadStats GetStatistics() const;
-
-      /// Set the contents of the object according to another object
-      TrigDBKeysD3PDObject& Set( const TrigDBKeysD3PDObject& parent );
-
-      /// HLT PreScale Key
-      VarHandle< unsigned int > HLTPSK;
-      /// LVL1 PreScale Key
-      VarHandle< unsigned int > L1PSK;
-      /// Super Master Key
-      VarHandle< unsigned int > SMK;
-
-   private:
-      /// Function used internally to access the variables
-      VarHandleBase* GetVarHandle( const char* name );
-      /// Function setting up all the VarHandle members
-      void SetVarHandles( const ::Long64_t* master );
-
-      std::map< ::TString, VarHandleBase* > m_handles; ///< Book-keeper of the VarHandle members
-      const ::Bool_t m_fromInput; ///< Flag specifying if object is used for D3PD reading
-      ::TString m_prefix; ///< Prefix to the branch names
-
-      ClassDef( TrigDBKeysD3PDObject, 0 )
-
-   }; // class TrigDBKeysD3PDObject
-
-} // namespace D3PDReader
-
-#endif // D3PDREADER_TrigDBKeysD3PDObject_H
diff --git a/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/UserD3PDObject.h b/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/UserD3PDObject.h
deleted file mode 100644
index 8fbf2bbced91a0fe751ead60a2b632632048f2c7..0000000000000000000000000000000000000000
--- a/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/UserD3PDObject.h
+++ /dev/null
@@ -1,186 +0,0 @@
-// Dear emacs, this is -*- c++ -*--
-
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: CodeGenerator_v2_constants.h 539451 2013-03-01 08:33:45Z krasznaa $
-#ifndef D3PDREADER_UserD3PDObject_H
-#define D3PDREADER_UserD3PDObject_H
-
-// STL include(s):
-#include <map>
-#include <vector>
-
-// ROOT include(s):
-#include <TNamed.h>
-#include <TString.h>
-
-// Local include(s):
-#include "D3PDObjectBase.h"
-//#include "D3PDReadStats.h"
-#include "VarHandle.h"
-#include "VarProxy.h"
-
-// Forward declaration(s):
-class TTree;
-
-namespace D3PDReader {
-
-   // Forward declaration(s):
-   class UserD3PDObject;
-
-   /**
-    *  @short Special class for handling user variables
-    *
-    *         This proxy class can be used to handle user-defined vector
-    *         variables in a fancy way. It is also used by all of the regular
-    *         proxy classes as base class, so they could handle user defined
-    *         variables as well. (For instance for adding a new property to
-    *         electrons in the analysis.)
-    *
-    *         The class doesn't inherit from TObject on purpose, in order to
-    *         avoid ending up with a diamond in the inheritance structure.
-    *         (Python *really* doesn't like that...)
-    *
-    * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
-    *
-    * $Revision: 539451 $
-    * $Date: 2013-03-01 09:33:45 +0100 (Fri, 01 Mar 2013) $
-    */
-   class UserD3PDObjectElement : public ::TNamed {
-
-      friend class UserD3PDObject;
-
-   protected:
-      /// Constructor only visible to children and UserD3PDObject
-      UserD3PDObjectElement( size_t index, const UserD3PDObject& parent );
-
-   public:
-      /// Copy constructor
-      UserD3PDObjectElement( const UserD3PDObjectElement& parent );
-      /// Destructor, cleaning up the created objects
-      virtual ~UserD3PDObjectElement();
-
-      /// Index of the object inside its container
-      virtual size_t GetIndex() const;
-
-      /// Access a variable
-      template< typename T >
-      VarProxy< T >& Variable( const TString& name );
-      /// Access a variable (constant version)
-      template< typename T >
-      const VarProxy< T >& Variable( const TString& name ) const;
-
-   private:
-      /// Reference to the parent of this object
-      const UserD3PDObject* m_parent;
-      /// The index of this object inside the parent container
-      size_t m_index;
-      /// Book-keeper of the VarProxy members
-      mutable std::map< ::TString, VarProxyBase* > m_proxies;
-
-      UserD3PDObjectElement& operator=( const UserD3PDObjectElement& parent );
-
-      ClassDef( UserD3PDObjectElement, 0 )
-
-   }; // class UserD3PDObjectElement
-
-   /**
-    *  @short Special class for handling user variables
-    *
-    *         This class is used to handle user defined variables. It can be
-    *         used on its own to read/write any sort of variable, but it also
-    *         acts as a base class for all the other D3PDObject classes, to
-    *         make it possible to decorate the information stored by them.
-    *
-    *         While the class fully implements the D3PDObjectBase interface,
-    *         it doesn't inherit from it, in order to avoid creating a diamond
-    *         in the inheritance structure. Python is not able to handle such
-    *         an inheritance structure correctly.
-    *
-    * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
-    *
-    * $Revision: 539451 $
-    * $Date: 2013-03-01 09:33:45 +0100 (Fri, 01 Mar 2013) $
-    */
-   class UserD3PDObject : public D3PDObjectBase {
-
-   public:
-      /// Constructor used when reading from a TTree
-      UserD3PDObject( const ::Long64_t& master, const char* prefix = "" );
-      /// Constructor when the object is only used for writing data out
-      UserD3PDObject( const char* prefix = "" );
-      /// Destructor, cleaning up the created objects
-      virtual ~UserD3PDObject();
-
-      /// Get the currently configured prefix value
-      virtual const char* GetPrefix() const;
-      /// Set the prefix for the variables
-      virtual void SetPrefix( const char* prefix );
-
-      /// Connect the object to an input TTree
-      virtual void ReadFrom( ::TTree* tree );
-      /// Connect the object to an output TTree
-      virtual void WriteTo( ::TTree* tree );
-
-      /// Turn (selected) branches either on or off
-      virtual void SetActive( ::Bool_t active = kTRUE,
-                              const ::TString& pattern = ".*" );
-      /// Read in all the variables that we need to write out as well
-      virtual void ReadAllActive();
-
-      /// Get the D3PD reading statistics
-      //virtual D3PDReadStats GetStatistics() const;
-
-      /// Set the contents of the object according to another object
-      UserD3PDObject& Set( const UserD3PDObject& parent );
-
-      /// Clear the container. Useful when writing new branches.
-      void Clear( Option_t* option = "" );
-      /// Add one element to an output collection
-      UserD3PDObject& Add( const UserD3PDObjectElement& el );
-
-      /// Access a proxy class describing one element of the container
-      UserD3PDObjectElement& operator[]( size_t index );
-      /// Access a proxy class describing one element of the container (constant version)
-      const UserD3PDObjectElement& operator[]( size_t index ) const;
-      /// Add one element to an output collection
-      UserD3PDObject& operator+=( const UserD3PDObjectElement& el );
-
-      /// Declare a new variable for writing
-      template< typename T >
-      void DeclareVariable( const TString& name );
-      /// Access a variable
-      template< typename T >
-      VarHandle< T >& Variable( const TString& name );
-      /// Access a variable (constant version)
-      template< typename T >
-      const VarHandle< T >& Variable( const TString& name ) const;
-
-   private:
-      const ::Long64_t* m_master; ///< Pointer to the master entry number
-      ::TString m_prefix; ///< Prefix to the branch names
-      ///< Internal list of proxy objects
-      mutable std::vector< UserD3PDObjectElement* > m_proxies;
-      /// Book-keeper of the VarHandle members
-      mutable std::map< ::TString, VarHandleBase* > m_handles;
-      /// Book-keeper of VarHandle objects needed for technical reasons
-      mutable std::vector< VarHandleBase* > m_extraHandles;
-      /// Flag specifying if object is used for D3PD reading
-      const ::Bool_t m_fromInput;
-      /// TTree that is being read currently
-      ::TTree* m_inTree;
-
-      ClassDef( UserD3PDObject, 0 )
-
-   }; // class UserD3PDObject
-
-} // namespace D3PDReader
-
-// Include the template implementation:
-#ifndef __CINT__
-#include "UserD3PDObject.icc"
-#endif // __CINT__
-
-#endif // D3PDREADER_UserD3PDObject_H
diff --git a/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/UserD3PDObject.icc b/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/UserD3PDObject.icc
deleted file mode 100644
index f034ce35b1f6eefcbd482a9409198c2510554cc1..0000000000000000000000000000000000000000
--- a/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/UserD3PDObject.icc
+++ /dev/null
@@ -1,249 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: CodeGenerator_v2_constants.h 539451 2013-03-01 08:33:45Z krasznaa $
-#ifndef D3PDREADER_UserD3PDObject_ICC
-#define D3PDREADER_UserD3PDObject_ICC
-
-namespace D3PDReader {
-
-   /**
-    * This function accesses a user-defined variable for modification.
-    * The template type needs to follow the type of the underlying
-    * TTree branch's type, without the outermost vector. So for instance
-    * to access a <code>std::vector<float></code> variable from here, you
-    * need to call the function with a <code>float</code> template argument.
-    *
-    * The function also takes care of extending the underlying vector variable
-    * to the needed size. This makes the decoration of existing objects in
-    * a container with new variables much easier.
-    *
-    * If you're decorating elements that you are reading from an input D3PD,
-    * you must have already called <code>DeclareVariable(...)</code> on the
-    * parent object before calling thig function.
-    *
-    * @param name The name of the user variable
-    * @returns The VarProxy object handling the requested variable
-    */
-   template< typename T >
-   VarProxy< T >& UserD3PDObjectElement::Variable( const TString& name ) {
-
-      // Try to find the variable:
-      std::map< ::TString, VarProxyBase* >::const_iterator itr =
-         m_proxies.find( name );
-      if( itr != m_proxies.end() ) {
-         // If it's already known, let's see if it's the right type:
-         VarProxy< T >* result =
-            dynamic_cast< VarProxy< T >* >( itr->second );
-         if( ! result ) {
-            // Create a dummy object. The code will crash soon
-            // anyway...
-            VarProxy< T >* dummy =
-               new VarProxy< T >( m_parent->Variable< std::vector< T >* >( name ),
-                                  m_index );
-            m_proxies[ name ] = dummy;
-            // Tell the user what happened:
-            Error( "Variable",
-                   "Variable with name '%s' requested with wrong type",
-                   name.Data() );
-            return *dummy;
-         }
-         // Check if the underlying vector is large enough:
-         const VarHandle< std::vector< T >* >& vh = 
-            m_parent->Variable< std::vector< T >* >( name );
-         if( vh.IsAvailable() && ( ! vh.GetMaster() ) &&
-             ( vh()->size() <= m_index ) ) {
-            UserD3PDObject* ncparent = const_cast< UserD3PDObject* >( m_parent );
-            ncparent->Variable< std::vector< T >* >( name )()->resize( m_index + 1 );
-         }
-         // Return the proxy:
-         return *result;
-      }
-
-      // Add the new proxy variable:
-      VarProxy< T >* result =
-         new VarProxy< T >( m_parent->Variable< std::vector< T >* >( name ),
-                            m_index );
-      m_proxies[ name ] = result;
-
-      // Check if the underlying vector is large enough:
-      const VarHandle< std::vector< T >* >& vh = 
-         m_parent->Variable< std::vector< T >* >( name );
-      if( vh.IsAvailable() && ( ! vh.GetMaster() ) &&
-          ( vh()->size() <= m_index ) ) {
-         UserD3PDObject* ncparent = const_cast< UserD3PDObject* >( m_parent );
-         ncparent->Variable< std::vector< T >* >( name )()->resize( m_index + 1 );
-      }
-
-      // Return the proxy:
-      return *result;
-   }
-
-   /**
-    * This function accesses a user-defined variable for reading.
-    * The template type needs to follow the type of the underlying
-    * TTree branch's type, without the outermost vector. So for instance
-    * to access a <code>std::vector<float></code> variable from here, you
-    * need to call the function with a <code>float</code> template argument.
-    *
-    * If you're decorating elements that you are reading from an input D3PD,
-    * you must have already called <code>DeclareVariable(...)</code> on the
-    * parent object before calling thig function.
-    *
-    * @param name The name of the user variable
-    * @returns The VarProxy object handling the requested variable
-    */
-   template< typename T >
-   const VarProxy< T >& UserD3PDObjectElement::Variable( const TString& name ) const {
-
-      // Try to find the variable:
-      std::map< ::TString, VarProxyBase* >::const_iterator itr =
-         m_proxies.find( name );
-      if( itr != m_proxies.end() ) {
-         // If it's already known, let's see if it's the right type:
-         VarProxy< T >* result =
-            dynamic_cast< VarProxy< T >* >( itr->second );
-         if( ! result ) {
-            // Create a dummy object. The code will crash soon
-            // anyway...
-            VarProxy< T >* dummy =
-               new VarProxy< T >( m_parent->Variable< std::vector< T >* >( name ),
-                                  m_index );
-            m_proxies[ name ] = dummy;
-            // Tell the user what happened:
-            Error( "Variable",
-                   "Variable with name '%s' requested with wrong type",
-                   name.Data() );
-            return *dummy;
-         }
-         // Return the proxy:
-         return *result;
-      }
-
-      // Add the new proxy variable:
-      VarProxy< T >* result =
-         new VarProxy< T >( m_parent->Variable< std::vector< T >* >( name ),
-                            m_index );
-      m_proxies[ name ] = result;
-
-      // Return the proxy:
-      return *result;
-   }
-
-   /**
-    * This function can be used to add a new variable to an output D3PD.
-    * When reading an input D3PD that the user wants to write out a part of,
-    * extended with some additional variables, this function should be used.
-    *
-    * @param name The name of the new variable to create
-    */
-   template< typename T >
-   void UserD3PDObject::DeclareVariable( const TString& name ) {
-
-      // Check if the variable with this name is already in place:
-      std::map< ::TString, VarHandleBase* >::const_iterator itr =
-         m_handles.find( name );
-      if( itr != m_handles.end() ) {
-         Warning( "DeclareVariable",
-                  "Variable with name '%s' already declared",
-                  ( m_prefix + name ).Data() );
-         return;
-      }
-
-      // Declare the new variable:
-      m_handles[ name ] = new VarHandle< T >( m_prefix + name, 0 );
-
-      return;
-   }
-
-   /**
-    * This function can be used to access a user-defined variable for
-    * modification. It should mostly be used when writing a D3PD with the
-    * additional user variable.
-    *
-    * @param name The name of the user-defined variable
-    * @returns The VarHandle object handling the user variable
-    */
-   template< typename T >
-   VarHandle< T >& UserD3PDObject::Variable( const TString& name ) {
-
-      // Try to find the variable:
-      std::map< ::TString, VarHandleBase* >::const_iterator itr =
-         m_handles.find( name );
-      if( itr != m_handles.end() ) {
-         // It's already known, so let's see if it's of the right type:
-         VarHandle< T >* result =
-            dynamic_cast< VarHandle< T >* >( itr->second );
-         if( ! result ) {
-            // Add a dummy object for technical reasons. The user code
-            // will anyway probably die after this.
-            VarHandle< T >* dummy = new VarHandle< T >();
-            m_extraHandles.push_back( dummy );
-            // Tell the user what happened:
-            Error( "Variable",
-                   "Variable with name '%s' is of type '%s', "
-                   "not of type '%s'",
-                   ( m_prefix + name ).Data(), itr->second->GetType(),
-                   dummy->GetType() );
-            // Return the dummy:
-            return *dummy;
-         }
-         // Return the object:
-         return *result;
-      }
-
-      // If it doesn't exist yet, let's add it:
-      VarHandle< T >* result = new VarHandle< T >( m_prefix + name, m_master );
-      if( m_inTree ) result->ReadFrom( m_inTree );
-      m_handles[ name ] = result;
-      return *result;
-   }
-
-   /**
-    * This function can be used to access a user-defined variable for
-    * reading. It can be used both when reading or writing a D3PD.
-    *
-    * @param name The name of the user-defined variable
-    * @returns The VarHandle object handling the user variable
-    */
-   template< typename T >
-   const VarHandle< T >& UserD3PDObject::Variable( const TString& name ) const {
-
-      // Try to find the variable:
-      std::map< ::TString, VarHandleBase* >::const_iterator itr =
-         m_handles.find( name );
-      if( itr != m_handles.end() ) {
-         // It's already known, so let's see if it's of the right type:
-         VarHandle< T >* result =
-            dynamic_cast< VarHandle< T >* >( itr->second );
-         if( ! result ) {
-            // Add a dummy object for technical reasons. The user code
-            // will anyway probably die after this.
-            VarHandle< T >* dummy = new VarHandle< T >();
-            m_extraHandles.push_back( dummy );
-            // Tell the user what happened:
-            Error( "Variable",
-                   "Variable with name '%s' is of type '%s', "
-                   "not of type '%s'",
-                   ( m_prefix + name ).Data(), itr->second->GetType(),
-                   dummy->GetType() );
-            // Return the dummy:
-            return *dummy;
-         }
-         // Return the object:
-         return *result;
-      }
-
-      // If it doesn't exist yet, let's add it:
-      VarHandle< T >* result = new VarHandle< T >( m_prefix + name, m_master );
-      if( m_inTree ) result->ReadFrom( m_inTree );
-      m_handles[ name ] = result;
-      return *result;
-   }
-
-} // namespace D3PDReader
-
-#endif // D3PDREADER_UserD3PDObject_ICC
diff --git a/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/Utils.h b/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/Utils.h
deleted file mode 100644
index a30e4f4bc4d04cbab93e7d921ef53064ad6bd927..0000000000000000000000000000000000000000
--- a/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/Utils.h
+++ /dev/null
@@ -1,27 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: CodeGenerator_v2_constants.h 539451 2013-03-01 08:33:45Z krasznaa $
-#ifndef D3PDREADER_UTILS_H
-#define D3PDREADER_UTILS_H
-
-// ROOT include(s):
-#include <TString.h>
-
-namespace D3PDReader {
-
-   /// Function creating a human-readable elapsed time printout
-   ::TString TimeToString( ::Double_t secs );
-
-   /// Function for printing data sizes in human-readable format
-   ::TString SizeToString( ::Long64_t bytes );
-
-   /// Function for printing data processing speeds in a human-readable format
-   ::TString SpeedToString( ::Double_t bytespersec );
-
-} // namespace D3PDReader
-
-#endif // D3PDREADER_UTILS_H
diff --git a/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/VarHandle.h b/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/VarHandle.h
deleted file mode 100644
index 243e09ce81e2297f7b38cd48dbab79ca9126a263..0000000000000000000000000000000000000000
--- a/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/VarHandle.h
+++ /dev/null
@@ -1,225 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: CodeGenerator_v2_constants.h 539451 2013-03-01 08:33:45Z krasznaa $
-#ifndef D3PDREADER_VARHANDLE_H
-#define D3PDREADER_VARHANDLE_H
-
-// ROOT include(s):
-#include <TString.h>
-#include <TDataType.h>
-
-// Local include(s):
-//#include "D3PDReadStats.h"
-
-// Forward declaration(s):
-class TTree;
-class TBranch;
-
-namespace D3PDReader {
-
-   /**
-    *  @short Base class for the different kind of VarHandle specializations
-    *
-    *         This class is used to keep a list of all the VarHandle members of
-    *         a D3PDObject class. It makes some operations much easier.
-    *
-    * $Revision: 539451 $
-    * $Date: 2013-03-01 09:33:45 +0100 (Fri, 01 Mar 2013) $
-    */
-   class VarHandleBase {
-
-   protected:
-      /// Custom enumeration describing the availability of the branch
-      enum BranchAvailability {
-         UNKNOWN = 0, ///< The input TTree has not yet been checked
-         AVAILABLE = 1, ///< The input branch is available
-         UNAVAILABLE = 2 ///< The input branch is not available
-      };
-
-   public:
-      /// Constructor specifying all the needed parameters
-      VarHandleBase( const char* name = "",
-                     const ::Long64_t* master = 0 );
-      /// The destructor is actually only useful in the specialized class...
-      virtual ~VarHandleBase() {}
-
-      /// Get the name of the branch handled by this class
-      const char* GetName() const;
-      /// Set the name of the branch handled by this class
-      void SetName( const char* name );
-
-      /// Get the type name of the branch handled by this object
-      const char* GetType() const;
-      /// Set the type name of the branch handled by this object
-      void SetType( const char* type );
-
-      /// Get a pointer to the master entry variable
-      const ::Long64_t* GetMaster() const;
-      /// Set the pointer to the master entry variable
-      void SetMaster( const ::Long64_t* master );
-
-      /// Connect the object to an input tree
-      virtual void ReadFrom( ::TTree* tree ) = 0;
-      /// Connect the object to an output tree
-      virtual ::TBranch* WriteTo( ::TTree* tree ) = 0;
-
-      /// Check if this variable is "active" at the moment
-      ::Bool_t IsActive() const;
-      /// Set the "activity level" of the variable
-      void SetActive( ::Bool_t active = kTRUE );
-
-      /// Check if the variable is available in the input
-      virtual ::Bool_t IsAvailable() const;
-
-      /// Read in the current entry from the branch
-      virtual void ReadCurrentEntry() const = 0;
-
-      /// "Clear" the variable of its contents
-      virtual void Clear() = 0;
-
-      /// Get information about the read statistics
-      //virtual VariableStats GetStatistics() const;
-
-   protected:
-      /// Connect the variable to the branch
-      ::Bool_t ConnectVariable( void* var, ::TClass* realClass,
-                                EDataType dtype, Bool_t isptr ) const;
-      /// Update the variable to the current entry in the D3PD
-      void UpdateBranch() const;
-      /// Switch to a new tree in the statistics gathering
-      // void UpdateStat( ::TBranch* br ) const;
-      /// Translate the typeid() type name to something ROOT understands
-      const char* RootType( const char* typeid_type ) const;
-      /// Translate the typeid() type name to a huma-readable ROOT type name
-      const char* RootCppType( const char* typeid_type ) const;
-
-      const ::Long64_t* m_master; ///< Pointer to the current entry number
-      ::Bool_t m_fromInput; ///< Flag showing if the variable is read from an input TTree
-      ::TTree* m_inTree; ///< The input TTree
-      mutable ::TBranch* m_inBranch; /// The input branch belonging to this variable
-      mutable BranchAvailability m_available; ///< Availability of the branch
-
-   private:
-      ::TString m_name; ///< Name of the branch to handle
-      ::Bool_t m_active; ///< Flag telling if the variable can be written to the output
-
-      ::TString m_type; ///< Variable type
-      mutable std::vector< ::Long64_t > m_entriesRead; ///< Number of read entries for each tree
-      mutable std::vector< ::Float_t > m_branchSize; ///< Unzipped entry size for each tree
-      mutable std::vector< ::Float_t > m_zippedSize; ///< Zipped entry size for each tree
-
-   }; // class VarHandleBase
-
-   /**
-    *  @short Class responsible for reading primitive types from the D3PD
-    *
-    *         This class is used by all the D3PDReader classes to physically
-    *         handle the branches of the input TTree.
-    *
-    * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
-    *
-    * $Revision: 539451 $
-    * $Date: 2013-03-01 09:33:45 +0100 (Fri, 01 Mar 2013) $
-    */
-   template< typename Type >
-   class VarHandle : public VarHandleBase {
-
-   public:
-      /// Convenience typedef of the used variable
-      typedef Type& result_type;
-      /// Convenience typedef of the used variable (const version)
-      typedef const Type& const_result_type;
-
-      /// Constructor specifying all the needed parameters
-      VarHandle( const char* name = "",
-                 const ::Long64_t* master = 0 );
-      /// The destructor is actually only useful in the specialized class...
-      ~VarHandle();
-
-      /// Connect the object to an input tree
-      virtual void ReadFrom( ::TTree* tree );
-      /// Connect the object to an output tree
-      virtual ::TBranch* WriteTo( ::TTree* tree );
-
-      /// Operator used to access the branch itself
-      result_type operator()();
-      /// Operator used to access the branch itself (constant version)
-      const_result_type operator()() const;
-
-      /// Read in the current entry from the branch
-      virtual void ReadCurrentEntry() const;
-
-      /// "Clear" the variable of its contents
-      virtual void Clear();
-
-      /// Set the value of the variable. Used primarily from Python.
-      void Set( Type value );
-
-   private:
-      mutable Type m_variable; ///< The variable in memory
-
-   }; // class VarHandle
-
-   /**
-    *  @short Class responsible for reading STL objects from the D3PD
-    *
-    *         This specialization of the template class makes it possible to
-    *         handle branches describing primitive types and branches describing
-    *         STL collections a little differently.
-    *
-    * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
-    *
-    * $Revision: 539451 $
-    * $Date: 2013-03-01 09:33:45 +0100 (Fri, 01 Mar 2013) $
-    */
-   template< typename Type >
-   class VarHandle< Type* > : public VarHandleBase {
-
-   public:
-      /// Convenience typedef of the used variable
-      typedef Type* result_type;
-      /// Convenience typedef of the used variable (const version)
-      typedef const Type* const_result_type;
-
-      /// Constructor specifying all the needed parameters
-      VarHandle( const char* name = "",
-                 const ::Long64_t* master = 0 );
-      /// This destructor actually does something...
-      ~VarHandle();
-
-      /// Connect the object to an input tree
-      virtual void ReadFrom( ::TTree* tree );
-      /// Connect the object to an output tree
-      virtual ::TBranch* WriteTo( ::TTree* tree );
-
-      /// Operator used to access the branch itself
-      result_type operator()();
-      /// Operator used to access the branch itself (constant version)
-      const_result_type operator()() const;
-
-      /// Read in the current entry from the branch
-      virtual void ReadCurrentEntry() const;
-
-      /// "Clear" the variable of its contents
-      virtual void Clear();
-
-      /// Set the value of the variable. Used primarily from Python.
-      void Set( const_result_type value );
-
-   private:
-      mutable Type* m_variable; ///< The variable in memory
-
-   }; // class VarHandle
-
-} // namespace D3PDReader
-
-// Include the implementation:
-#ifndef __CINT__
-#include "VarHandle.icc"
-#endif // __CINT__
-
-#endif // D3PDREADER_VARHANDLE_H
diff --git a/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/VarHandle.icc b/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/VarHandle.icc
deleted file mode 100644
index c5c45b58dde382f7d1f731f7ca2eda4cac3548cf..0000000000000000000000000000000000000000
--- a/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/VarHandle.icc
+++ /dev/null
@@ -1,277 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: CodeGenerator_v2_constants.h 539451 2013-03-01 08:33:45Z krasznaa $
-#ifndef D3PDREADER_VARHANDLE_ICC
-#define D3PDREADER_VARHANDLE_ICC
-
-// System include(s):
-#include <string.h>
-#include <cxxabi.h>
-#include <cstdlib>
-
-// ROOT include(s):
-#include <TObject.h>
-#include <TClass.h>
-#include <TTree.h>
-#include <TBranch.h>
-#include <TError.h>
-
-namespace D3PDReader {
-
-   template< typename Type >
-   // cppcheck-suppress uninitMemberVar
-   VarHandle< Type >::VarHandle( const char* name,
-                                 const ::Long64_t* master )
-      : VarHandleBase( name, master ),
-        m_variable() {
-
-      SetType( RootCppType( typeid( Type ).name() ) );
-   }
-
-   template< typename Type >
-   VarHandle< Type >::~VarHandle() {
-
-   }
-
-   template< typename Type >
-   void VarHandle< Type >::ReadFrom( ::TTree* tree ) {
-
-      m_inTree = tree;
-      m_fromInput = kTRUE;
-      m_variable = 0;
-      m_inBranch = 0;
-      m_available = UNKNOWN;
-
-      return;
-   }
-
-   template< typename Type >
-   ::TBranch* VarHandle< Type >::WriteTo( ::TTree* tree ) {
-
-      if( ! IsActive() ) return 0;
-
-      ::TBranch* branch = tree->GetBranch( GetName() );
-      if( branch ) return branch;
-
-      branch = tree->Branch( GetName(), &m_variable,
-                             ::TString::Format( "%s/%s", GetName(),
-                                                RootType( typeid( Type ).name() ) ) );
-      if( ! branch ) {
-         ::Error( "D3PDReader::VarHandle::WriteTo",
-                  "Couldn't add variable %s to tree %s",
-                  GetName(), tree->GetName() );
-      } else {
-         for( ::Long64_t i = 0; i < tree->GetEntries(); ++i ) {
-            branch->Fill();
-         }
-      }
-
-      return branch;
-   }
-
-   template< typename Type >
-   typename VarHandle< Type >::result_type VarHandle< Type >::operator()() {
-
-      if( ! m_fromInput ) return m_variable;
-
-      if( ! m_inBranch ) {
-         if( ! ConnectVariable( &m_variable, TClass::GetClass( typeid( Type ) ),
-                                TDataType::GetType( typeid( Type ) ), kFALSE ) ||
-             !m_inBranch )
-         {
-            ::Error( ::TString( "D3PDReader::VarHandle::" ) + GetName() + "()",
-                     "Failed connecting to D3PD" );
-            return m_variable;
-         }
-      }
-      UpdateBranch();
-
-      return m_variable;
-   }
-
-   template< typename Type >
-   typename VarHandle< Type >::const_result_type VarHandle< Type >::operator()() const {
-
-      if( ! m_fromInput ) return m_variable;
-
-      if( ! m_inBranch ) {
-         if( ! ConnectVariable( &m_variable, TClass::GetClass( typeid( Type ) ),
-                                TDataType::GetType( typeid( Type ) ), kFALSE ) ) {
-            ::Error( ::TString( "D3PDReader::VarHandle::" ) + GetName() + "()",
-                     "Failed connecting to D3PD" );
-            return m_variable;
-         }
-      }
-      UpdateBranch();
-
-      return m_variable;
-   }
-
-   template< typename Type >
-   void VarHandle< Type >::ReadCurrentEntry() const {
-
-      if( IsAvailable() ) {
-         this->operator()();
-      } else {
-         m_variable = 0;
-      }
-      return;
-   }
-
-   template< typename Type >
-   void VarHandle< Type >::Clear() {
-
-      this->operator()() = 0;
-      return;
-   }
-
-   template< typename Type >
-   void VarHandle< Type >::Set( Type value ) {
-
-      m_variable = value;
-      return;
-   }
-
-   template< typename Type >
-   // cppcheck-suppress uninitMemberVar
-   VarHandle< Type* >::VarHandle( const char* name,
-                                  const ::Long64_t* master )
-      : VarHandleBase( name, master ),
-        m_variable( 0 ) {
-
-      int status;
-      char* type_name = abi::__cxa_demangle( typeid( Type ).name(), 0, 0, &status );
-      if( ! status ) {
-         SetType( type_name );
-         ::free( type_name );
-      }
-   }
-
-   template< typename Type >
-   VarHandle< Type* >::~VarHandle() {
-
-      if( m_variable ) delete m_variable;
-   }
-
-   template< typename Type >
-   void VarHandle< Type* >::ReadFrom( ::TTree* tree ) {
-
-      m_inTree = tree;
-      m_fromInput = kTRUE;
-      if( m_variable ) m_variable->clear();
-      m_inBranch = 0;
-      m_available = UNKNOWN;
-
-      return;
-   }
-
-   template< typename Type >
-   ::TBranch* VarHandle< Type* >::WriteTo( ::TTree* tree ) {
-
-      if( ! IsActive() ) return 0;
-
-      ::TBranch* branch = tree->GetBranch( GetName() );
-      if( branch ) return branch;
-
-      if( ! ::strcmp( GetType(), "" ) ) {
-         ::Error( "D3PDReader::VarHandle::WriteTo",
-                  "Couldn't demangle type name: %s",
-                  typeid( Type ).name() );
-         return 0;
-      }
-      if( ! m_variable ) {
-         m_variable = new Type();
-      }
-      branch = tree->Bronch( GetName(), GetType(), &m_variable );
-      if( ! branch ) {
-         ::Error( "D3PDReader::VarHandle::WriteTo",
-                  "Couldn't add variable %s to tree %s",
-                  GetName(), tree->GetName() );
-      } else {
-         for( ::Long64_t i = 0; i < tree->GetEntries(); ++i ) {
-            branch->Fill();
-         }
-      }
-
-      return branch;
-   }
-
-   template< typename Type >
-   typename VarHandle< Type* >::result_type
-   VarHandle< Type* >::operator()() {
-
-      if( ! m_fromInput ) {
-         if( ! m_variable ) m_variable = new Type();
-         return m_variable;
-      }
-
-      if( ! m_inBranch ) {
-         if( ! ConnectVariable( &m_variable, TClass::GetClass( typeid( Type ) ),
-                                TDataType::GetType( typeid( Type ) ), kTRUE ) ) {
-            ::Error( ::TString( "D3PDReader::VarHandle::" ) + GetName() + "()",
-                     "Failed connecting to D3PD" );
-            return m_variable;
-         }
-      }
-      UpdateBranch();
-
-      return m_variable;
-   }
-
-   template< typename Type >
-   typename VarHandle< Type* >::const_result_type
-   VarHandle< Type* >::operator()() const {
-
-      if( ! m_fromInput ) {
-         if( ! m_variable ) m_variable = new Type();
-         return m_variable;
-      }
-
-      if( ! m_inBranch ) {
-         if( ! ConnectVariable( &m_variable, TClass::GetClass( typeid( Type ) ),
-                                TDataType::GetType( typeid( Type ) ), kTRUE ) ||
-             !m_inBranch)
-         {
-            ::Error( ::TString( "D3PDReader::VarHandle::" ) + GetName() + "()",
-                     "Failed connecting to D3PD" );
-            return m_variable;
-         }
-      }
-      UpdateBranch();
-
-      return m_variable;
-   }
-
-   template< typename Type >
-   void VarHandle< Type* >::ReadCurrentEntry() const {
-
-      if( IsAvailable() ) {
-         this->operator()();
-      } else {
-         if( ! m_variable ) m_variable = new Type();
-         m_variable->clear();
-      }
-      return;
-   }
-
-   template< typename Type >
-   void VarHandle< Type* >::Clear() {
-
-      this->operator()()->clear();
-      return;
-   }
-
-   template< typename Type >
-   void VarHandle< Type* >::Set( const_result_type value ) {
-
-      *m_variable = *value;
-      return;
-   }
-
-} // namespace D3PDReader
-
-#endif // D3PDREADER_VARHANDLE_ICC
diff --git a/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/VarProxy.h b/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/VarProxy.h
deleted file mode 100644
index bc6f71c51134a96063ddd0331df44e9c6f497d3e..0000000000000000000000000000000000000000
--- a/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/VarProxy.h
+++ /dev/null
@@ -1,90 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: CodeGenerator_v2_constants.h 539451 2013-03-01 08:33:45Z krasznaa $
-#ifndef D3PDREADER_VARPROXY_H
-#define D3PDREADER_VARPROXY_H
-
-// STL include(s):
-#include <vector>
-
-// Local include(s):
-#include "VarHandle.h"
-
-namespace D3PDReader {
-
-   /**
-    *  @short Base class for the VarProxy versions
-    *
-    *         This class is needed for technical reasons in order to handle
-    *         user defined variables in a nice way.
-    *
-    * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
-    *
-    * $Revision: 539451 $
-    * $Date: 2013-03-01 09:33:45 +0100 (Fri, 01 Mar 2013) $
-    */
-   class VarProxyBase {
-
-   public:
-      /// Destructor, to make vtable happy
-      virtual ~VarProxyBase() {}
-
-      /// Check if the variable is available in the input
-      virtual ::Bool_t IsAvailable() const = 0;
-
-   }; // class VarProxyBase
-
-   /**
-    *  @short Class acting as a proxy to one element of an std::vector
-    *
-    *         This class is used in the "Element" classes to represent one
-    *         object from a collection.
-    *
-    * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
-    *
-    * $Revision: 539451 $
-    * $Date: 2013-03-01 09:33:45 +0100 (Fri, 01 Mar 2013) $
-    */
-   template< typename Type >
-   class VarProxy : public VarProxyBase {
-
-   public:
-      /// Convenience typedef of the used variable
-      typedef Type& result_type;
-      /// Convenience typedef of the used variable (const version)
-      typedef const Type& const_result_type;
-
-      /// Constructor specifying the handle object this proxy uses
-      VarProxy( const VarHandle< std::vector< Type >* >& handle, size_t i );
-      /// Copy constructor
-      VarProxy( const VarProxy< Type >& parent );
-      /// Copy operator
-      VarProxy< Type >& operator=( const VarProxy< Type >& parent );
-
-      /// Check if the variable is available in the input
-      virtual ::Bool_t IsAvailable() const;
-
-      /// Operator returning the variable belonging to this object
-      result_type operator()();
-      /// Operator returning the variable belonging to this object (constant version)
-      const_result_type operator()() const;
-
-   private:
-      VarHandle< std::vector< Type >* >* m_handle; ///< Pointer to the handle object
-      size_t m_index; ///< Index inside the handle object's vector
-      Type m_dummy; ///< Object returned by default
-
-   }; // class VarProxy
-
-} // namespace D3PDReader
-
-// Include the implementation:
-#ifndef __CINT__
-#include "VarProxy.icc"
-#endif // __CINT__
-
-#endif // D3PDREADER_VARPROXY_H
diff --git a/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/VarProxy.icc b/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/VarProxy.icc
deleted file mode 100644
index 7ab1c65f9dfb22f5c5936b4c4f51de15a6a0aeeb..0000000000000000000000000000000000000000
--- a/Trigger/TrigCost/TrigCostD3PD/TrigCostD3PD/VarProxy.icc
+++ /dev/null
@@ -1,72 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: CodeGenerator_v2_constants.h 539451 2013-03-01 08:33:45Z krasznaa $
-#ifndef D3PDREADER_VARPROXY_ICC
-#define D3PDREADER_VARPROXY_ICC
-
-// ROOT include(s):
-#include <TError.h>
-
-namespace D3PDReader {
-
-   template< typename Type >
-   VarProxy< Type >::VarProxy( const VarHandle< std::vector< Type >* >& handle,
-                               size_t i )
-      : m_handle( const_cast< VarHandle< std::vector< Type >* >* >( &handle ) ),
-        m_index( i ), m_dummy() {
-
-   }
-
-   template< typename Type >
-   VarProxy< Type >::VarProxy( const VarProxy< Type >& parent )
-      : VarProxyBase(), m_handle( parent.m_handle ), m_index( parent.m_index ),
-        m_dummy() {
-
-   }
-
-   template< typename Type >
-   VarProxy< Type >& VarProxy< Type >::operator=( const VarProxy< Type >& parent ) {
-
-      m_handle = parent.m_handle;
-      m_index  = parent.m_index;
-
-      return *this;
-   }
-
-   template< typename Type >
-   ::Bool_t VarProxy< Type >::IsAvailable() const {
-
-      return m_handle->IsAvailable();
-   }
-
-   template< typename Type >
-   typename VarProxy< Type >::result_type VarProxy< Type >::operator()() {
-
-      if( m_handle->IsAvailable() ) {
-         return ( ( *( *m_handle )() ) )[ m_index ];
-      } else {
-         ::Warning( ::TString( "D3PDReader::VarProxy::" ) + m_handle->GetName() + "()",
-                    "Variable not available on input. Returning 0" );
-         return m_dummy;
-      }
-   }
-
-   template< typename Type >
-   typename VarProxy< Type >::const_result_type VarProxy< Type >::operator()() const {
-
-      if( m_handle->IsAvailable() ) {
-         return ( ( *( *m_handle )() ) )[ m_index ];
-      } else {
-         ::Warning( ::TString( "D3PDReader::VarProxy::" ) + m_handle->GetName() + "()",
-                    "Variable not available on input. Returning 0" );
-         return m_dummy;
-      }
-   }
-
-} // namespace D3PDReader
-
-#endif // D3PDREADER_VARPROXY_ICC
diff --git a/Trigger/TrigEvent/TrigInDetPattRecoEvent/TrigInDetPattRecoEvent/TrigInDetTriplet.h b/Trigger/TrigEvent/TrigInDetPattRecoEvent/TrigInDetPattRecoEvent/TrigInDetTriplet.h
index 8f04a760c9bbcfcd2c8e4e56d638897afb486967..d1dfe16b6761d4972b7f20c03d0e01999c502185 100644
--- a/Trigger/TrigEvent/TrigInDetPattRecoEvent/TrigInDetPattRecoEvent/TrigInDetTriplet.h
+++ b/Trigger/TrigEvent/TrigInDetPattRecoEvent/TrigInDetPattRecoEvent/TrigInDetTriplet.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 __TRIG_IN_DET_TRIPLET_H__
@@ -18,8 +18,7 @@ class TrigInDetTriplet {
  TrigInDetTriplet(const TrigSiSpacePointBase& s1, const TrigSiSpacePointBase& s2, const TrigSiSpacePointBase& s3, float Q) : 
     m_s1(s1), m_s2(s2), m_s3(s3), m_Q(Q) {};
 
- TrigInDetTriplet(const TrigInDetTriplet& t) :
-    m_s1(t.m_s1), m_s2(t.m_s2), m_s3(t.m_s3), m_Q(t.m_Q) {};
+ TrigInDetTriplet(const TrigInDetTriplet& t) = default;
  TrigInDetTriplet(TrigInDetTriplet* t) :
     m_s1(t->m_s1), m_s2(t->m_s2), m_s3(t->m_s3), m_Q(t->m_Q) {};
 
diff --git a/Trigger/TrigEvent/TrigNavStructure/TrigNavStructure/TrigHolderStructure.h b/Trigger/TrigEvent/TrigNavStructure/TrigNavStructure/TrigHolderStructure.h
index 66e02d07febb987f55c7e2990f14f5b9a734b99a..7ee305780887d3791d714dc807583b30996c6d32 100644
--- a/Trigger/TrigEvent/TrigNavStructure/TrigNavStructure/TrigHolderStructure.h
+++ b/Trigger/TrigEvent/TrigNavStructure/TrigNavStructure/TrigHolderStructure.h
@@ -1,12 +1,13 @@
 // Emacs -*- c++ -*-
 
 /*
-  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 TRIGNAVSTRUCTURE_TRIGHOLDERSTRUCTURE
 #define TRIGNAVSTRUCTURE_TRIGHOLDERSTRUCTURE
 #include <map>
+#include <memory>
 #include <string>
 
 #include <boost/variant.hpp>
@@ -20,23 +21,23 @@ namespace HLT{
   class TrigHolderStructure : public asg::AsgMessaging {
   public:
     TrigHolderStructure();
- 
+
     void reset();
-    
+
     bool registerHolder(const std::shared_ptr<BaseHolder>& holder);
-    
+
     template<typename HolderType = BaseHolder>
-    HolderType* getHolder(class_id_type clid, const boost::variant<sub_index_type,std::string>& stiOrLabel) const {    
+    HolderType* getHolder(class_id_type clid, const boost::variant<sub_index_type,std::string>& stiOrLabel) const {
       return getCastHolder<HolderType>(getBaseHolder(clid,getSubTypeIndex(clid,stiOrLabel)));
     }
 
     template<typename HolderType = BaseHolder>
-    HolderType* getHolderForFeature(const TriggerElement::FeatureAccessHelper& fea) const {    
+    HolderType* getHolderForFeature(const TriggerElement::FeatureAccessHelper& fea) const {
       return getCastHolder<HolderType>(getBaseHolder(fea.getCLID(),fea.getIndex().subTypeIndex()));
     }
-    
+
     template<typename HolderType = BaseHolder>
-    std::vector<HolderType*> getAllHolders() const {    
+    std::vector<HolderType*> getAllHolders() const {
       std::vector<HolderType*> result;
       for(auto& clid_indexmap : m_holderByClidAndIndex){
 	for(auto& index_holder : clid_indexmap.second){
@@ -53,7 +54,7 @@ namespace HLT{
       if(lookup_it == m_holderByClidAndIndex.end()) return result;
 
       for(auto& index_holder : lookup_it->second){
-	result.push_back(getCastHolder<HolderType>(index_holder.second.get()));	
+	result.push_back(getCastHolder<HolderType>(index_holder.second.get()));
       }
       return result;
     }
@@ -67,7 +68,7 @@ namespace HLT{
 
       auto lookup_it = m_lookupSubIndex.find(clid);
       if(lookup_it == m_lookupSubIndex.end()) return invalid_sub_index;
-      
+
       auto it = lookup_it->second.find(boost::get<std::string>(stiOrLabel));
       if(it==lookup_it->second.end()) return invalid_sub_index;
 
@@ -84,14 +85,14 @@ namespace HLT{
 
       auto lookup_it = m_lookupLabels.find(clid);
       if(lookup_it == m_lookupLabels.end()) return invalid_label;
-      
+
       auto it = lookup_it->second.find(boost::get<sub_index_type>(stiOrLabel));
       if(it==lookup_it->second.end()) return invalid_label;
 
       return  it->second;
     }
 
-    
+
   private:
 
     BaseHolder* getBaseHolder(class_id_type clid,sub_index_type sti) const;
diff --git a/Trigger/TrigFake/CMakeLists.txt b/Trigger/TrigFake/CMakeLists.txt
deleted file mode 100644
index 0d79ad93b1fe04e877470904572858272dfd8201..0000000000000000000000000000000000000000
--- a/Trigger/TrigFake/CMakeLists.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
-
-# Declare the package name:
-atlas_subdir( TrigFake )
-
-# External dependencies:
-find_package( CLHEP )
-
-# Component(s) in the package:
-atlas_add_component( TrigFake
-                     src/*.cxx src/components/*.cxx
-                     INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${CLHEP_LIBRARIES} AtlasHepMCLib GeneratorObjects TrigConfHLTData TrigInDetEvent TrigSteeringEvent TrigSteeringLib TrigT1Interfaces TrigT1Result )
diff --git a/Trigger/TrigFake/src/FakeLvl1MultipleRoIsatFixedEtaPhi.cxx b/Trigger/TrigFake/src/FakeLvl1MultipleRoIsatFixedEtaPhi.cxx
deleted file mode 100644
index bda6b320806c441d0c870d85c711ee0388e27d7d..0000000000000000000000000000000000000000
--- a/Trigger/TrigFake/src/FakeLvl1MultipleRoIsatFixedEtaPhi.cxx
+++ /dev/null
@@ -1,289 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-/********************************************************************
-
-
-NAME:     FakeLvl1MultipleRoIsatFixedEtaPhi.cxx
-PACKAGE:
-
-AUTHORS: J. Boyd (copied from and then adapted FakeLvl1RoIatFixedEtaPhi
-
-CREATED:  Apr, 2007
-
-PURPOSE:  Fake Lvl1 RoI for seeding Lvl2
-
-Modified :
-
-
-********************************************************************/
-
-#include <stdlib.h>
-#include <vector>
-#include <utility>
-// INCLUDE GAUDI HEADER FILES:
-#include "GaudiKernel/MsgStream.h"
-#include "Gaudi/Property.h"
-#include "GaudiKernel/ISvcLocator.h"
-
-
-# include "CLHEP/Units/SystemOfUnits.h"
-
-#include "TrigSteeringEvent/TrigRoiDescriptor.h"
-#include "FakeLvl1MultipleRoIsatFixedEtaPhi.h"
-#include "FakeRoI.h"
-#include "Trajectory.h"
-
-#include "TrigInterfaces/AlgoConfig.h"
-#include "TrigSteering/SteeringChain.h"
-#include "TrigNavigation/Navigation.h"
-#include "TrigNavigation/TriggerElement.h"
-#include "TrigConfHLTData/HLTTriggerElement.h"
-
-#include "CLHEP/Vector/ThreeVector.h"
-
-#include "TrigT1Result/EMTauRoI.h"
-#include "TrigT1Result/JetEnergyResult.h"
-
-#include "TrigT1Interfaces/TrigT1Interfaces_ClassDEF.h"
-#include "TrigT1Interfaces/RecMuonRoI.h"
-#include "TrigT1Interfaces/RecMuonRoiSvc.h"
-
-
-
-
-////////////////////////////////////////////////////////////////
-//  CONSTRUCTOR:
-
-FakeLvl1MultipleRoIsatFixedEtaPhi::FakeLvl1MultipleRoIsatFixedEtaPhi(const std::string& name, const std::string& type,
-						   const IInterface* parent)
-  : HLT::LvlConverter(name, type, parent), 
-    m_roiId(0),
-    m_lvl1ID(1)
-{
-  declareProperty( "FakeEmRoiPhi", m_emRoiPhi);
-  declareProperty( "FakeEmRoiEta", m_emRoiEta);
-
-  declareProperty( "FakeTauRoiPhi", m_tauRoiPhi);
-  declareProperty( "FakeTauRoiEta", m_tauRoiEta);
-
-  declareProperty( "FakeMuonRoiPhi", m_muonRoiPhi);
-  declareProperty( "FakeMuonRoiEta", m_muonRoiEta);
-
-  declareProperty( "FakeJetRoiPhi", m_jetRoiPhi);
-  declareProperty( "FakeJetRoiEta", m_jetRoiEta);
-
-  declareProperty( "FakeEmRoiLabel",   m_emRoiLabel  );
-  declareProperty( "FakeMuonRoiLabel", m_muonRoiLabel);
-  declareProperty( "FakeJetRoiLabel",  m_jetRoiLabel );
-  declareProperty( "FakeTauRoiLabel",  m_tauRoiLabel );
-
-}
-
-// DESTRUCTOR:
-
-FakeLvl1MultipleRoIsatFixedEtaPhi::~FakeLvl1MultipleRoIsatFixedEtaPhi()
-{ }
-
-
-
-/////////////////////////////////////////////////////////////////
-// INITIALIZE METHOD:
-
-HLT::ErrorCode FakeLvl1MultipleRoIsatFixedEtaPhi::hltInitialize()
-{
-  // check that the vectors for emRoi are the same length
-  if (m_emRoiPhi.size() != m_emRoiEta.size() || m_emRoiPhi.size() != m_emRoiLabel.size()) {    msg() << MSG::FATAL << " problem configuring EMROI sizes of Phi, Eta, Label vectors different, phi " << m_muonRoiPhi.size()  << "  eta " << m_emRoiEta.size()  << "  label "<<m_emRoiLabel.size()  <<endmsg;
-  return HLT::BAD_JOB_SETUP;
-  }
-  if (m_emRoiPhi.size() == 0) msg() << MSG::INFO << " Not forming any fake EMROIs" << endmsg;
-
-  for (size_t em=0;em<m_emRoiPhi.size();em++){
-    if ( m_emRoiPhi.at(em) <= M_PI && m_emRoiPhi.at(em) >= -M_PI ) {
-      msg() << MSG::INFO << " Forming fake EMROI with name " << m_emRoiLabel.at(em)  <<" at phi =  " <<
-        m_emRoiPhi.at(em) << " eta = "  << m_emRoiEta.at(em) << endmsg;
-    } else {
-      msg() << MSG::INFO << " Not forming fake EMROI " <<m_emRoiLabel.at(em)  << " phi out of range"<< endmsg;
-    }
-  }
-
-  // check that the vectors for tauRoi are the same length
-  if (m_tauRoiPhi.size() != m_tauRoiEta.size() || m_tauRoiPhi.size() != m_tauRoiLabel.size()) {
-    msg() << MSG::FATAL << " problem configuring TAUROI sizes of Phi, Eta, Label vectors different, phi " << m_muonRoiPhi.size()  << "  eta " << m_tauRoiEta.size()  << "  label "<< m_tauRoiLabel.size()  <<endmsg;
-    return HLT::BAD_JOB_SETUP;
-  }
-  if (m_tauRoiPhi.size() == 0) msg() << MSG::INFO << " Not forming any fake TAUROIs" <<
-endmsg;
-  for (size_t tau=0;tau<m_tauRoiPhi.size();tau++){
-    if ( m_tauRoiPhi.at(tau) <= M_PI && m_tauRoiPhi.at(tau) >= -M_PI ) {
-      msg() << MSG::INFO << " Forming fake TAUROI with name " << m_tauRoiLabel.at(tau)
-<< " at phi =  " <<
-        m_tauRoiPhi.at(tau) << " eta = "  << m_tauRoiEta.at(tau) << endmsg;
-    } else {
-      msg() << MSG::INFO << " Not forming fake TAUROI " <<m_tauRoiLabel.at(tau)  << " phi out of range"<< endmsg;
-    }
-  }
-  // check that the vectors for muonRoi are the same length
-  if (m_muonRoiPhi.size() != m_muonRoiEta.size() || m_muonRoiPhi.size() != m_muonRoiLabel.size()) {
-    msg() << MSG::FATAL << " problem configuring MUONROI sizes of Phi, Eta, Label vectors different, phi " << m_muonRoiPhi.size()  << "  eta " << m_muonRoiEta.size()  << "  label "<< m_muonRoiLabel.size()  <<endmsg;
-    return HLT::BAD_JOB_SETUP;
-  }
-  if (m_muonRoiPhi.size() == 0) msg() << MSG::INFO << " Not forming any fake MUONROIs" << endmsg;
-
-  // print out the MUONROIs that will be created...
-  for (size_t mu=0;mu<m_muonRoiPhi.size();mu++){
-    if ( m_muonRoiPhi.at(mu) <= M_PI && m_muonRoiPhi.at(mu) >= -M_PI ) {
-      msg() << MSG::INFO << " Forming fake MUONROI " <<mu<< " with name " << m_muonRoiLabel.at(mu)  << "  at phi =  " <<
-        m_muonRoiPhi.at(mu) << " eta = "   << m_muonRoiEta.at(mu) << endmsg;
-    } else {
-      msg() << MSG::INFO << " Not forming fake MUONROI " <<mu << "phi out of range " <<endmsg;
-    }
-  }
-
-
-  // check that the vectors for jetRoi are the same length
-  if (m_jetRoiPhi.size() != m_jetRoiEta.size() || m_jetRoiPhi.size() != m_jetRoiLabel.size()) {
-    msg() << MSG::FATAL << " problem configuring JETROI sizes of Phi, Eta, Label vectors different, phi " << m_muonRoiPhi.size()  << "  eta " << m_jetRoiEta.size()  << "  label "<< m_jetRoiLabel.size()  <<endmsg;
-    return HLT::BAD_JOB_SETUP;
-  }
-  if (m_jetRoiPhi.size() == 0) msg() << MSG::INFO << " Not forming any fake JETROIs" <<
-endmsg;
-  for (size_t j=0;j<m_jetRoiPhi.size();j++){
-    if ( m_jetRoiPhi.at(j) <= M_PI && m_jetRoiPhi.at(j) >= -M_PI ) {
-      msg() << MSG::INFO << " Forming fake JETROI with name " << m_jetRoiLabel.at(j)  << "  at phi =  " <<
-        m_jetRoiPhi.at(j) << " eta = "  <<  m_jetRoiEta.at(j) << endmsg;
-    } else {
-      msg() << MSG::INFO << " Not forming fake JETROI " <<m_jetRoiLabel.at(j)  << " phi out of range "<< endmsg;
-    }
-  }
-
-
-  msg() << MSG::INFO << name() << ": Initialization completed successfully" << endmsg;
-
-  return HLT::OK;
-}
-
-
-/////////////////////////////////////////////////////////////////
-// EXECUTE METHOD:
-
-HLT::ErrorCode FakeLvl1MultipleRoIsatFixedEtaPhi::hltExecute( std::vector<HLT::SteeringChain*>& activeSteeringChains ) {
-
-
-
-
-
-  msg() << MSG::DEBUG << "Executing FakeLvl1MultipleRoIsatFixedEtaPhi" << endmsg;
-
-  // activate all configured chains:
-  msg() << MSG::DEBUG << "activating all configured chains." << endmsg;
-
-  for (std::vector<HLT::SteeringChain*>::const_iterator it = m_configuredChains->begin();
-       it != m_configuredChains->end(); ++it) {
-    // set to active:
-    (*it)->setActive();
-    // set pass through state:
-    (*it)->setPassThroughState();
-    activeSteeringChains.push_back( (*it) );
-  }
-
-  HLT::TriggerElement* initialTE = m_config->getNavigation()->getInitialNode();
-  msg() << MSG::DEBUG << "initial Navigation node created." << endmsg;
-
-  // set Lvl1 ID in AlgoConfig:
-  m_config->setLvl1Id(m_lvl1ID);
-
-
-  m_roiId=0;
-  const float zspread = 168.;
-
-  for (size_t em=0; em<m_emRoiPhi.size();em++){
-    if ( m_emRoiPhi.at(em) <= M_PI && m_emRoiPhi.at(em) >= -M_PI ) {
-      HLT::TriggerElement* roiTE = m_config->getNavigation()->addRoINode( initialTE );
-      TrigRoiDescriptor* roiDescriptor = new TrigRoiDescriptor(0, m_lvl1ID, m_roiId++,
-							       m_emRoiEta.at(em), m_emRoiEta.at(em)-0.1,m_emRoiEta.at(em)+0.1,
-							       m_emRoiPhi.at(em), m_emRoiPhi.at(em)-0.1, m_emRoiPhi.at(em)+0.1,
-							       0.,-zspread,zspread);
-      
-      std::string key;
-      m_config->getNavigation()->attachFeature( roiTE, roiDescriptor, HLT::Navigation::ObjectCreatedByNew, key, "initialRoI" );
-      
-      // build threshold TE
-      unsigned int teId;
-      TrigConf::HLTTriggerElement::getId(m_emRoiLabel.at(em).c_str(), teId);
-      m_config->getNavigation()->addNode(roiTE, teId);
-      
-      msg() << MSG::DEBUG << "created "<< m_emRoiLabel.at(em) << endmsg;
-    }
-  }
-  
-  for (size_t t=0; t<m_tauRoiPhi.size();t++){
-    if ( m_tauRoiPhi.at(t) <= M_PI && m_tauRoiPhi.at(t) >= -M_PI ) {
-      HLT::TriggerElement* roiTE = m_config->getNavigation()->addRoINode( initialTE );
-      TrigRoiDescriptor* roiDescriptor = new TrigRoiDescriptor(0, m_lvl1ID, m_roiId++,
-							       m_tauRoiEta.at(t), m_tauRoiEta.at(t)-0.4, m_tauRoiEta.at(t)+0.4,
-							       m_tauRoiPhi.at(t), m_tauRoiPhi.at(t)-0.4, m_tauRoiPhi.at(t)+0.4,
-							       0.,-zspread,zspread);
-      
-      std::string key;
-      m_config->getNavigation()->attachFeature( roiTE, roiDescriptor, HLT::Navigation::ObjectCreatedByNew, key, "initialRoI" );
-
-      // build threshold TE
-      unsigned int teId;
-      TrigConf::HLTTriggerElement::getId(m_tauRoiLabel.at(t).c_str(), teId);
-      m_config->getNavigation()->addNode(roiTE, teId);
-      msg() << MSG::DEBUG << "created" << m_tauRoiLabel.at(t) << endmsg;
-    }
-  }
-
-  for (size_t m=0; m<m_muonRoiPhi.size();m++){
-    if ( m_muonRoiPhi.at(m) <= M_PI && m_muonRoiPhi.at(m) >= -M_PI ) {
-    HLT::TriggerElement* roiTE = m_config->getNavigation()->addRoINode( initialTE );
-    TrigRoiDescriptor* roiDescriptor = new TrigRoiDescriptor(0, m_lvl1ID, m_roiId++,
-							     m_muonRoiEta.at(m),m_muonRoiEta.at(m)-0.1,m_muonRoiEta.at(m)+0.1,
-							     m_muonRoiPhi.at(m),m_muonRoiPhi.at(m)-0.1,m_muonRoiPhi.at(m)+0.1,
-							       0.,-zspread,zspread);
-
-    std::string key;
-    m_config->getNavigation()->attachFeature( roiTE, roiDescriptor, HLT::Navigation::ObjectCreatedByNew, key, "initialRoI" );
-
-    // build threshold TE
-    unsigned int teId;
-    TrigConf::HLTTriggerElement::getId(m_muonRoiLabel.at(m).c_str(), teId);
-    m_config->getNavigation()->addNode(roiTE, teId);
-    msg() << MSG::DEBUG << "created"<< m_muonRoiLabel.at(m) << endmsg;
-    }
-  }
-
-  for (size_t j=0; j<m_jetRoiPhi.size();j++){
-    if ( m_jetRoiPhi.at(j) <= M_PI && m_jetRoiPhi.at(j) >= -M_PI ) {
-      HLT::TriggerElement* roiTE = m_config->getNavigation()->addRoINode( initialTE );
-      TrigRoiDescriptor* roiDescriptor = new TrigRoiDescriptor(0, m_lvl1ID, m_roiId++,
-							       m_jetRoiEta.at(j),m_jetRoiEta.at(j)-0.4,m_jetRoiEta.at(j)+0.4,
-							       m_jetRoiPhi.at(j),m_jetRoiPhi.at(j)-0.4,m_jetRoiPhi.at(j)+0.4,
-							       0.,-zspread,zspread);
-
-
-      std::string key;
-      m_config->getNavigation()->attachFeature( roiTE, roiDescriptor, HLT::Navigation::ObjectCreatedByNew, key, "initialRoI" );
-      
-      // build threshold TE
-      unsigned int teId;
-      TrigConf::HLTTriggerElement::getId(m_jetRoiLabel.at(j).c_str(), teId);
-      m_config->getNavigation()->addNode(roiTE, teId);
-    msg() << MSG::DEBUG << "created " << m_jetRoiLabel.at(j) << endmsg;
-    }
-  }
-
-  m_lvl1ID++;
-  return HLT::OK;
-}
-
-/////////////////////////////////////////////////////////////////
-// FINALIZE METHOD:
-
-HLT::ErrorCode FakeLvl1MultipleRoIsatFixedEtaPhi::hltFinalize() 
-{ 
-  return HLT::OK; 
-}
diff --git a/Trigger/TrigFake/src/FakeLvl1MultipleRoIsatFixedEtaPhi.h b/Trigger/TrigFake/src/FakeLvl1MultipleRoIsatFixedEtaPhi.h
deleted file mode 100755
index 42b797f6226c847c93dd969a3848d4b9463d708c..0000000000000000000000000000000000000000
--- a/Trigger/TrigFake/src/FakeLvl1MultipleRoIsatFixedEtaPhi.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef FAKELVL1MULTIPLEROISATFIXEDETAPHI_H
-#define FAKELVL1MULTIPLEROISATFIXEDETAPHI_H
-
-#include <string>
-#include <vector>
-#include "TrigSteering/LvlConverter.h"
-
-#define DEFAULT_RoIBRDOLocation "/RoIB/RoIBRDOLocation"
-#define DEFAULT_CaloConfigLocation "/Run/CaloTrigConfig"
-
-class StoreGateSvc;
-class FakeRoI;
-class HepLorentzVector;
-class Hep3Vector;
-
-
-class FakeLvl1MultipleRoIsatFixedEtaPhi : public HLT::LvlConverter
-{
- public:
-
-  FakeLvl1MultipleRoIsatFixedEtaPhi(const std::string& name, const std::string& type,
-			   const IInterface* parent); //!< constructor
-  ~FakeLvl1MultipleRoIsatFixedEtaPhi();
-
-  HLT::ErrorCode hltInitialize();
-  HLT::ErrorCode hltExecute(std::vector<HLT::SteeringChain*>& activeSteeringChains);
-  HLT::ErrorCode hltFinalize();
-
- private:
-
-  unsigned int m_roiId;
-  std::vector<double> m_muonRoiPhi;
-  std::vector<double> m_muonRoiEta;
-  std::vector<std::string> m_muonRoiLabel;
-
-  std::vector<double> m_tauRoiPhi;
-  std::vector<double> m_tauRoiEta;
-  std::vector<std::string> m_tauRoiLabel;
-
-  std::vector<double> m_emRoiPhi;
-  std::vector<double> m_emRoiEta;
-  std::vector<std::string> m_emRoiLabel;
-
-  std::vector<double> m_jetRoiPhi;
-  std::vector<double> m_jetRoiEta;
-  std::vector<std::string> m_jetRoiLabel;
-
-  unsigned int m_lvl1ID; //!< Level 1 ID, in case Level 1 result is read from file
-
-
-};
-
-
-#endif
diff --git a/Trigger/TrigFake/src/FakeLvl1RoIatFixedEtaPhi.cxx b/Trigger/TrigFake/src/FakeLvl1RoIatFixedEtaPhi.cxx
deleted file mode 100644
index 164b12a3ea103697391a9545fd59af04bdff1d02..0000000000000000000000000000000000000000
--- a/Trigger/TrigFake/src/FakeLvl1RoIatFixedEtaPhi.cxx
+++ /dev/null
@@ -1,268 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-/********************************************************************
-
-NAME:     FakeLvl1RoIatFixedEtaPhi.cxx
-PACKAGE:
-
-AUTHORS: J. Baines        john.baines@rl.ac.uk based on TrigSteer/Lvl1Converstion by
-         G. Comune        gianluca.comune@cern.ch (http://cern.ch/gcomune)
-
-CREATED:  Nov, 2002
-
-PURPOSE:  Fake Lvl1 RoI for seeding Lvl2
-
-Modified :
-
-
-********************************************************************/
-
-#include <stdlib.h>
-#include <vector>
-#include <utility>
-// INCLUDE GAUDI HEADER FILES:
-
-# include "CLHEP/Units/SystemOfUnits.h"
-
-#include "TrigSteeringEvent/TrigRoiDescriptor.h"
-#include "FakeLvl1RoIatFixedEtaPhi.h"
-#include "FakeRoI.h"
-#include "Trajectory.h"
-
-#include "TrigInterfaces/AlgoConfig.h"
-#include "TrigSteering/SteeringChain.h"
-#include "TrigNavigation/Navigation.h"
-#include "TrigNavigation/TriggerElement.h"
-#include "TrigConfHLTData/HLTTriggerElement.h"
-
-#include "CLHEP/Vector/ThreeVector.h"
-
-#include "TrigT1Result/EMTauRoI.h"
-#include "TrigT1Result/JetEnergyResult.h"
-
-#include "TrigT1Interfaces/TrigT1Interfaces_ClassDEF.h"
-#include "TrigT1Interfaces/RecMuonRoI.h"
-#include "TrigT1Interfaces/RecMuonRoiSvc.h"
-
-
-
-
-////////////////////////////////////////////////////////////////
-//  CONSTRUCTOR:
-
-FakeLvl1RoIatFixedEtaPhi::FakeLvl1RoIatFixedEtaPhi(const std::string& name, const std::string& type,
-						   const IInterface* parent)
-  : HLT::LvlConverter(name, type, parent), 
-    m_roiId(0),
-    m_tauRoiPhi(99.),
-    m_tauRoiEta(0.),
-    m_emRoiPhi(99.),
-    m_emRoiEta(0.),
-    m_muonRoiPhi(99.),
-    m_muonRoiEta(0.),
-    m_jetRoiPhi(99.),
-    m_jetRoiEta(0.),
-    m_lvl1ID(1)
-{
-  declareProperty( "FakeEmRoiPhi", m_emRoiPhi=99.);
-  declareProperty( "FakeEmRoiEta", m_emRoiEta);
-
-  declareProperty( "FakeTauRoiPhi", m_tauRoiPhi=99.);
-  declareProperty( "FakeTauRoiEta", m_tauRoiEta);
-
-  declareProperty( "FakeMuonRoiPhi", m_muonRoiPhi=99.);
-  declareProperty( "FakeMuonRoiEta", m_muonRoiEta);
-
-  declareProperty( "FakeJetRoiPhi", m_jetRoiPhi=99.);
-  declareProperty( "FakeJetRoiEta", m_jetRoiEta);
-
-  declareProperty( "FakeEmRoiLabel",   m_emRoiLabel  ="EM01");
-  declareProperty( "FakeMuonRoiLabel", m_muonRoiLabel="MU06");
-  declareProperty( "FakeJetRoiLabel",  m_jetRoiLabel ="JT00");
-  declareProperty( "FakeTauRoiLabel",  m_tauRoiLabel ="TAU01");
-
-}
-
-// DESTRUCTOR:
-
-FakeLvl1RoIatFixedEtaPhi::~FakeLvl1RoIatFixedEtaPhi()
-{ }
-
-
-
-/////////////////////////////////////////////////////////////////
-// INITIALIZE METHOD:
-
-HLT::ErrorCode FakeLvl1RoIatFixedEtaPhi::hltInitialize()
-{
-  msg() << MSG::INFO << " FakeLvl1RoIatFixedEtaPhi creating the following RoI:  " << endmsg;
-  if ( m_emRoiPhi <= M_PI && m_emRoiPhi >= -M_PI ) {
-    msg() << MSG::INFO << " Forming fake EMROI with name " << m_emRoiLabel  << " at phi =  " <<
-      m_emRoiPhi << " eta = "  << m_emRoiEta << endmsg;
-
-  } else {
-    msg() << MSG::INFO << " Not forming fake EMROI" << endmsg;
-  }
-
-  if ( m_tauRoiPhi <= M_PI && m_tauRoiPhi >= -M_PI ) {
-    msg() << MSG::INFO << " Forming fake TAUROI with name " << m_tauRoiLabel  << " at phi =  " <<
-      m_tauRoiPhi << " eta = "  << m_tauRoiEta << endmsg;
-
-  } else {
-    msg() << MSG::INFO << " Not forming fake TAUROI" << endmsg;
-  }
-
-
-
-  if ( m_muonRoiPhi <= M_PI && m_muonRoiPhi >= -M_PI ) {
-    msg() << MSG::INFO << " Forming fake MUONROI with name " << m_muonRoiLabel  << "  at phi =  " <<
-      m_muonRoiPhi << " eta = "   << m_muonRoiEta << endmsg;
-
-  } else {
-    msg() << MSG::INFO << " Not forming fake MUONROI" << endmsg;
-  }
-
-
-  if ( m_jetRoiPhi <= M_PI && m_jetRoiPhi >= -M_PI ) {
-    msg() << MSG::INFO << " Forming fake JETROI with name " << m_jetRoiLabel  << "  at phi =  " <<
-      m_jetRoiPhi << " eta = "  <<  m_jetRoiEta << endmsg;
-
-  } else {
-    msg() << MSG::INFO << " Not forming fake JETROI" << endmsg;
-  }
-
-  msg() << MSG::INFO << name() << ": Initialization completed successfully" << endmsg;
-
-  return HLT::OK;
-}
-
-
-/////////////////////////////////////////////////////////////////
-// EXECUTE METHOD:
-
-HLT::ErrorCode FakeLvl1RoIatFixedEtaPhi::hltExecute( std::vector<HLT::SteeringChain*>& activeSteeringChains ) {
-
-
-
-
-
-  msg() << MSG::DEBUG << "Executing FakeLvl1RoIatFixedEtaPhi" << endmsg;
-
-  // activate all configured chains:
-  msg() << MSG::DEBUG << "activating all configured chains." << endmsg;
-
-  for (std::vector<HLT::SteeringChain*>::const_iterator it = m_configuredChains->begin();
-       it != m_configuredChains->end(); ++it) {
-    // set to active:
-    (*it)->setActive();
-    // set pass through state:
-    (*it)->setPassThroughState();
-    activeSteeringChains.push_back( (*it) );
-  }
-
-  HLT::TriggerElement* initialTE = m_config->getNavigation()->getInitialNode();
-  msg() << MSG::DEBUG << "initial Navigation node created." << endmsg;
-
-  // set Lvl1 ID in AlgoConfig:
-  m_config->setLvl1Id(m_lvl1ID);
-
-
-  m_roiId=0;
-  const float zspread = 168.;
-  if ( m_emRoiPhi <= M_PI && m_emRoiPhi >= -M_PI ) {
-    //    getStepSequencerPointer()->addTE(createSeed((key2keyStore*)0x00000000,m_emRoiEta, m_emRoiPhi, Frame::instance()->getId2Str(m_emRoiLabel), m_roiId++));
-
-    HLT::TriggerElement* roiTE = m_config->getNavigation()->addRoINode( initialTE );
-    TrigRoiDescriptor* roiDescriptor = new TrigRoiDescriptor(0, m_lvl1ID, m_roiId,
-							     m_emRoiEta, m_emRoiEta-0.1,m_emRoiEta+0.1,
-							     m_emRoiPhi,m_emRoiPhi-0.1,m_emRoiPhi+0.1,
-							     0., -zspread, zspread);
-
-
-    std::string key;
-    m_config->getNavigation()->attachFeature( roiTE, roiDescriptor, HLT::Navigation::ObjectCreatedByNew, key, "initialRoI" );
-
-    // build threshold TE
-    unsigned int teId;
-    TrigConf::HLTTriggerElement::getId(m_emRoiLabel.c_str(), teId);
-    m_config->getNavigation()->addNode(roiTE, teId);
-
-    msg() << MSG::DEBUG << "created "<< m_emRoiLabel << endmsg;
-  }
-
-  if ( m_tauRoiPhi <= M_PI && m_tauRoiPhi >= -M_PI ) {
-    //    getStepSequencerPointer()->addTE(createSeed((key2keyStore*)0x00000000,m_tauRoiEta, m_tauRoiPhi, Frame::instance()->getId2Str(m_tauRoiLabel), m_roiId++));
-
-    HLT::TriggerElement* roiTE = m_config->getNavigation()->addRoINode( initialTE );
-    TrigRoiDescriptor* roiDescriptor = new TrigRoiDescriptor(0, m_lvl1ID, m_roiId,
-							     m_tauRoiEta,m_tauRoiEta-0.4,m_tauRoiEta+0.4,
-							     m_tauRoiPhi,m_tauRoiPhi-0.4,m_tauRoiPhi+0.4,
-							     0., -zspread, zspread);
-
-
-    std::string key;
-    m_config->getNavigation()->attachFeature( roiTE, roiDescriptor, HLT::Navigation::ObjectCreatedByNew, key, "initialRoI" );
-
-
-    // build threshold TE
-    unsigned int teId;
-    TrigConf::HLTTriggerElement::getId(m_tauRoiLabel.c_str(), teId);
-    m_config->getNavigation()->addNode(roiTE, teId);
-    msg() << MSG::DEBUG << "created" << m_tauRoiLabel << endmsg;
-  }
-
-  if ( m_muonRoiPhi <= M_PI && m_muonRoiPhi >= -M_PI ) {
-    //    getStepSequencerPointer()->addTE(createSeed((key2keyStore*)0x00000000, m_muonRoiEta, m_muonRoiPhi, Frame::instance()->getId2Str(m_muonRoiLabel) ,m_roiId++));
-    HLT::TriggerElement* roiTE = m_config->getNavigation()->addRoINode( initialTE );
-    TrigRoiDescriptor* roiDescriptor = new TrigRoiDescriptor(0, m_lvl1ID, m_roiId,
-							     m_muonRoiEta,m_muonRoiEta-0.1,m_muonRoiEta+0.1,
-							     m_muonRoiPhi,m_muonRoiPhi-0.1,m_muonRoiPhi+0.1,
-							     0., -zspread, zspread);
-
-
-
-
-    std::string key;
-    m_config->getNavigation()->attachFeature( roiTE, roiDescriptor, HLT::Navigation::ObjectCreatedByNew, key, "initialRoI" );
-
-
-    // build threshold TE
-    unsigned int teId;
-    TrigConf::HLTTriggerElement::getId(m_muonRoiLabel.c_str(), teId);
-    m_config->getNavigation()->addNode(roiTE, teId);
-    msg() << MSG::DEBUG << "created"<< m_muonRoiLabel << endmsg;
-
-  }
-
-  if ( m_jetRoiPhi <= M_PI && m_jetRoiPhi >= -M_PI ) {
-    //    getStepSequencerPointer()->addTE(createSeed((key2keyStore*)0x00000000,m_jetRoiEta, m_jetRoiPhi, Frame::instance()->getId2Str(m_jetRoiLabel) ,m_roiId++));
-    HLT::TriggerElement* roiTE = m_config->getNavigation()->addRoINode( initialTE );
-    TrigRoiDescriptor* roiDescriptor = new TrigRoiDescriptor(0, m_lvl1ID, m_roiId,
-							     m_jetRoiEta,m_jetRoiEta-0.4,m_jetRoiEta+0.4,
-							     m_jetRoiPhi,m_jetRoiPhi-0.4,m_jetRoiPhi+0.4,   
-							     0., -zspread, zspread);
-
-    std::string key;
-    m_config->getNavigation()->attachFeature( roiTE, roiDescriptor, HLT::Navigation::ObjectCreatedByNew, key, "initialRoI" );
-
-
-    // build threshold TE
-    unsigned int teId;
-    TrigConf::HLTTriggerElement::getId(m_jetRoiLabel.c_str(), teId);
-    m_config->getNavigation()->addNode(roiTE, teId);
-    msg() << MSG::DEBUG << "created " << m_jetRoiLabel << endmsg;
-  }
-
-  m_lvl1ID++;
-  return HLT::OK;
-}
-
-/////////////////////////////////////////////////////////////////
-// FINALIZE METHOD:
-
-HLT::ErrorCode FakeLvl1RoIatFixedEtaPhi::hltFinalize() 
-{ 
-  return HLT::OK; 
-}
diff --git a/Trigger/TrigFake/src/FakeLvl1RoIatFixedEtaPhi.h b/Trigger/TrigFake/src/FakeLvl1RoIatFixedEtaPhi.h
deleted file mode 100755
index 6aa57d8a836566b7c7ff05f9719ffdc9d466499b..0000000000000000000000000000000000000000
--- a/Trigger/TrigFake/src/FakeLvl1RoIatFixedEtaPhi.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef FAKELVL1ROIATFIXEDETAPHI_H
-#define FAKELVL1ROIATFIXEDETAPHI_H
-
-#include <string>
-#include <vector>
-#include "TrigSteering/LvlConverter.h"
-
-#define DEFAULT_RoIBRDOLocation "/RoIB/RoIBRDOLocation"
-#define DEFAULT_CaloConfigLocation "/Run/CaloTrigConfig"
-
-class StoreGateSvc;
-class FakeRoI;
-class HepLorentzVector;
-class Hep3Vector;
-
-
-class FakeLvl1RoIatFixedEtaPhi : public HLT::LvlConverter
-{
- public:
-
-  FakeLvl1RoIatFixedEtaPhi(const std::string& name, const std::string& type,
-			   const IInterface* parent); //!< constructor
-  ~FakeLvl1RoIatFixedEtaPhi();
-
-  HLT::ErrorCode hltInitialize();
-  HLT::ErrorCode hltExecute(std::vector<HLT::SteeringChain*>& activeSteeringChains);
-  HLT::ErrorCode hltFinalize();
-
- private:
-
-  unsigned int m_roiId;
-
-  double m_tauRoiPhi;
-  double m_tauRoiEta;
-  double m_emRoiPhi;
-  double m_emRoiEta;
-  double m_muonRoiPhi;
-  double m_muonRoiEta;
-  double m_jetRoiPhi;
-  double m_jetRoiEta;
-
-  std::string m_emRoiLabel;
-  std::string m_muonRoiLabel;
-  std::string m_jetRoiLabel;
-  std::string m_tauRoiLabel;
-
-  unsigned int m_lvl1ID; //!< Level 1 ID, in case Level 1 result is read from file
-
-
-};
-
-
-#endif
diff --git a/Trigger/TrigFake/src/FakeLvl1RoIfromKine.cxx b/Trigger/TrigFake/src/FakeLvl1RoIfromKine.cxx
deleted file mode 100644
index ec18ce9258780bb9d623fc479348d9641efd4d29..0000000000000000000000000000000000000000
--- a/Trigger/TrigFake/src/FakeLvl1RoIfromKine.cxx
+++ /dev/null
@@ -1,379 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-/*******************************************************************e
-
-NAME:     FakeLvl1RoIfromKine.cxx
-PACKAGE:
-
-AUTHORS: J. Baines        john.baines@rl.ac.uk based on TrigSteer/Lvl1Converstion by
-         G. Comune        gianluca.comune@cern.ch (http://cern.ch/gcomune)
-
-CREATED:  Nov, 2002
-
-PURPOSE:  Fake Lvl1 RoI for seeding Lvl2
-
-Modified :
-
-
-********************************************************************/
-
-#include <stdlib.h>
-#include <vector>
-#include <utility>
-// INCLUDE GAUDI HEADER FILES:
-#include "Gaudi/Property.h"
-#include "GaudiKernel/ISvcLocator.h"
-
-# include "CLHEP/Units/SystemOfUnits.h"
-
-#include "AtlasHepMC/GenEvent.h"
-#include "AtlasHepMC/GenParticle.h"
-#include "GeneratorObjects/McEventCollection.h"
-
-#include "TrigSteeringEvent/TrigRoiDescriptor.h"
-#include "FakeLvl1RoIfromKine.h"
-#include "FakeRoI.h"
-#include "Trajectory.h"
-
-
-#include "TrigInterfaces/AlgoConfig.h"
-#include "TrigSteering/SteeringChain.h"
-#include "TrigNavigation/Navigation.h"
-#include "TrigNavigation/TriggerElement.h"
-#include "TrigConfHLTData/HLTTriggerElement.h"
-
-#include "CLHEP/Vector/ThreeVector.h"
-
-#include "TrigT1Result/EMTauRoI.h"
-#include "TrigT1Result/JetEnergyResult.h"
-
-#include "TrigT1Interfaces/TrigT1Interfaces_ClassDEF.h"
-#include "TrigT1Interfaces/RecMuonRoI.h"
-#include "TrigT1Interfaces/RecMuonRoiSvc.h"
-
-
-
-using namespace TrigFake; // for Trajectory
-using namespace LVL1;
-
-
-////////////////////////////////////////////////////////////////
-//  CONSTRUCTOR:
-
-FakeLvl1RoIfromKine::FakeLvl1RoIfromKine(const std::string& name, const std::string& type,
-						   const IInterface* parent)
-  : HLT::LvlConverter(name, type, parent),
-    m_roiId(0),
-    m_mcEventCollectionName("")
-{
-
-  declareProperty("McEventCollectionName", m_mcEventCollectionName="GEN_EVENT");
-
-  declareProperty( "FakeEmTauRoiParticleIDs", m_emTauRoiParticles);
-  declareProperty( "FakeEmTauRoiPtMin", m_emTauRoiPtMin=20.*CLHEP::GeV);
-  declareProperty( "FakeEmTauRoiEtaMax", m_emTauRoiEtaMax=2.5);
-
-  declareProperty( "FakeMuonRoiParticleIDs",  m_muonRoiParticles);
-  declareProperty( "FakeMuonRoiPtMin",  m_muonRoiPtMin=20.*CLHEP::GeV);
-  declareProperty( "FakeMuonRoiEtaMax",  m_muonRoiEtaMax=2.5);
-
-  declareProperty( "FakeJetRoiParticleIDs",   m_jetRoiParticles);
-  declareProperty( "FakeJetRoiPtMin",   m_jetRoiPtMin=20.*CLHEP::GeV);
-  declareProperty( "FakeJetRoiEtaMax",   m_jetRoiEtaMax=2.5);
-
-  declareProperty( "FakeEmRoiLabel",   m_emRoiLabel  ="EM10");
-  declareProperty( "FakeMuonRoiLabel", m_muonRoiLabel="MU06");
-  declareProperty( "FakeJetRoiLabel",  m_jetRoiLabel ="JET20");
-  declareProperty( "FakeTauRoiLabel",  m_tauRoiLabel ="HA10");
-
-}
-
-// DESTRUCTOR:
-
-FakeLvl1RoIfromKine::~FakeLvl1RoIfromKine()
-{ }
-
-/////////////////////////////////////////////////////////////////
-// INITIALIZE METHOD:
-
-HLT::ErrorCode FakeLvl1RoIfromKine::hltInitialize()
-{
-  //  if ( m_particleDataTable.empty() ) {
-  //(*m_log) << MSG::WARNING << "FakeLvl1RoIfromKine failed to read particleDataTable" << endmsg;
-  //return StatusCode::FAILURE;
-  // }
-
-  if (! m_emTauRoiParticles.empty()) {
-    std::vector<int>::iterator emParticle=m_emTauRoiParticles.begin();
-    std::vector<int>::iterator lastEmParticle=m_emTauRoiParticles.end();
-    msg(MSG::INFO) << " Forming fake EMROI (" << m_emRoiLabel << ") from the following kine particle IDs : ";
-    for ( ; emParticle != lastEmParticle ; emParticle++ ) {
-      msg() << *emParticle << " " ;
-    }
-    msg() << endmsg;
-    ATH_MSG_INFO(" with ET > " << m_emTauRoiPtMin <<
-                 " and |eta| < " << m_emTauRoiEtaMax);
-  } else {
-    ATH_MSG_INFO(" Not forming fake EMROI (" << m_emRoiLabel << ")");
-  }
-
-  if ( ! m_muonRoiParticles.empty()) {
-    std::vector<int>::iterator muParticle=m_muonRoiParticles.begin();
-    std::vector<int>::iterator lastMuParticle=m_muonRoiParticles.end();
-    msg(MSG::INFO) << " Forming fake MUONROI (" << m_muonRoiLabel << ") from the following kine particle IDs : ";
-    for ( ; muParticle != lastMuParticle ; muParticle++ ) {
-      msg() << *muParticle << " " ;
-    }
-    msg() << endmsg;
-    ATH_MSG_INFO(" with pT > " << m_muonRoiPtMin <<
-                 " and |eta| < " << m_muonRoiEtaMax);
-  } else {
-    ATH_MSG_INFO(" Not forming fake MUONROI (" << m_muonRoiLabel << ")");
-  }
-
-
-  if ( ! m_jetRoiParticles.empty()) {
-    std::vector<int>::iterator muParticle=m_jetRoiParticles.begin();
-    std::vector<int>::iterator lastMuParticle=m_jetRoiParticles.end();
-    msg(MSG::INFO) << " Forming fake JETROI (" <<  m_jetRoiLabel << ") from the following kine particle IDs : ";
-    for ( ; muParticle != lastMuParticle ; muParticle++ ) {
-      msg() << *muParticle << " " ;
-    }
-    msg() << endmsg;
-    ATH_MSG_INFO(" with pT > " << m_jetRoiPtMin<<
-                 " and |eta| < " << m_jetRoiEtaMax);
-  } else {
-    ATH_MSG_INFO(" Not forming fake JETROI (" <<  m_jetRoiLabel << ")");
-  }
-
-  return HLT::OK;
-}
-
-/////////////////////////////////////////////////////////////////
-// FINALIZE METHOD:
-
-HLT::ErrorCode FakeLvl1RoIfromKine::hltFinalize()
-{
-  return HLT::OK;
-}
-
-/////////////////////////////////////////////////////////////////
-// EXECUTE METHOD:
-
-HLT::ErrorCode FakeLvl1RoIfromKine::hltExecute( std::vector<HLT::SteeringChain*>& activeSteeringChains )
-{
-  ATH_MSG_DEBUG("Executing FakeLvl1RoIfromKine");
-
-  // activate all configured chains:
-  ATH_MSG_DEBUG("activating all configured chains.");
-
-  for (std::vector<HLT::SteeringChain*>::const_iterator it = m_configuredChains->begin();
-       it != m_configuredChains->end(); ++it) {
-    // set to active:
-    (*it)->setActive();
-    // set pass through state:
-    (*it)->setPassThroughState();
-    activeSteeringChains.push_back( (*it) );
-  }
-
-
-  //  HLT::TriggerElement* initialTE = m_config->getNavigation()->getInitialNode();
-  //  (*m_log) << MSG::DEBUG << "initial Navigation node created." << endmsg;
-
-  m_roiId=0;
-  std::vector<FakeRoI> *roiList;
-  roiList = createRoIfromMC();
-
-
-  int nCreatedRoI=0;
-  std::vector< FakeRoI>::iterator firstroi =  roiList->begin();
-  std::vector< FakeRoI>::iterator lastRoi =   roiList->end();
-  for ( std::vector< FakeRoI>::iterator iroi = firstroi; iroi != lastRoi; iroi++) {
-
-    // skip duplicate roi
-    bool doneAlready = false;
-    std::vector< FakeRoI>::iterator jroi = firstroi;
-    for (; jroi != iroi; jroi++ ) {
-      if ( iroi->type() == jroi->type()){
-	double deta = fabs (jroi->eta() - iroi->eta());
-	double dphi = (jroi->phi() - iroi->phi());
-	double absdphi = fabs(dphi);
-	if (2.*M_PI-absdphi < absdphi) {
-	  if (dphi > 0) { dphi = dphi - 2.*M_PI;} else { dphi = 2*M_PI - absdphi;}
-	}
-        if ((fabs(deta) < 0.1) && (fabs (dphi) < 0.1)) doneAlready=true;
-      }
-    }
-    if (not doneAlready) {
-      if ( (this)->createRoI(*iroi).isSuccess()) nCreatedRoI++;
-    }
-  }
-
-  if ( nCreatedRoI == 0) {
-    ATH_MSG_DEBUG("FakeLvl1RoIfromKine did not create any RoI");
-} else {
-    ATH_MSG_DEBUG("FakeLvl1RoIfromKine created " << nCreatedRoI << " RoI");
-  }
-
-  delete roiList;
-
-  return HLT::OK;
-}
-
-StatusCode FakeLvl1RoIfromKine::createRoI(FakeRoI &fakeRoi) {
-
-
-
-  HLT::TriggerElement* roiTE = m_config->getNavigation()->addRoINode( m_config->getNavigation()->getInitialNode() );
-  const float zspread = 168.;
-  
-  TrigRoiDescriptor* roiDescriptor = new TrigRoiDescriptor(0, 0, m_roiId,
-							   fakeRoi.eta(),fakeRoi.eta()-0.1,fakeRoi.eta()+0.1,
-							   fakeRoi.phi(),fakeRoi.phi()-0.1,fakeRoi.phi()+0.1,
-							   0.-zspread, zspread);
-  std::string key;
-  m_config->getNavigation()->attachFeature( roiTE, roiDescriptor, HLT::Navigation::ObjectCreatedByNew, key, "initialRoI" );
-
-  // build threshold TE
-  unsigned int teId;
-  TrigConf::HLTTriggerElement::getId(fakeRoi.type().c_str(), teId);
-  m_config->getNavigation()->addNode(roiTE, teId);
-
-  m_roiId++;
-
-  /*
-    if(fakeRoi.type() == m_emRoiLabel) getStepSequencerPointer()->addTE(createSeed((key2keyStore*)0x00000000,fakeRoi.eta(), fakeRoi.phi(), Frame::instance()->getId2Str(m_emRoiLabel), m_roiId++));
-    if(fakeRoi.type() == m_muonRoiLabel) getStepSequencerPointer()->addTE(createSeed((key2keyStore*)0x00000000,fakeRoi.eta(), fakeRoi.phi(), Frame::instance()->getId2Str(m_muonRoiLabel) ,m_roiId++));
-    if(fakeRoi.type() == m_jetRoiLabel) getStepSequencerPointer()->addTE(createSeed((key2keyStore*)0x00000000,fakeRoi.eta(), fakeRoi.phi(), Frame::instance()->getId2Str(m_jetRoiLabel) ,m_roiId++));
-    if(fakeRoi.type() == m_tauRoiLabel) getStepSequencerPointer()->addTE(createSeed((key2keyStore*)0x00000000,fakeRoi.eta(), fakeRoi.phi(), Frame::instance()->getId2Str(m_tauRoiLabel) ,m_roiId++));
-  */
-
-
-  ATH_MSG_DEBUG(" REGTEST created an " <<  fakeRoi.type() << " RoI " << *roiDescriptor);
-
-
-  return StatusCode::SUCCESS;
-}
-
-std::vector<FakeRoI> * FakeLvl1RoIfromKine::createRoIfromMC() {
-
-  std::vector<FakeRoI> *fakeRoiList = new std::vector<FakeRoI>;
-
-  //  Get the collection generator events (physics and pile-up) making up this event
-
-  const McEventCollection* mcEvents;
-  StatusCode sc = evtStore()->retrieve( mcEvents, m_mcEventCollectionName );
-  if( sc.isFailure() ) {
-    ATH_MSG_INFO("Could not retrieve mcEventCollection with key " << m_mcEventCollectionName);
-    return fakeRoiList;
-  };
-
-  // Loop over the generator events
-  McEventCollection::const_iterator  evt = mcEvents->begin();
-  //McEventCollection::const_iterator  lastevt = mcEvents->end();
-
-  // for ( ; evt != lastevt; evt++) {
-  double qq = 0;
-
-  // loop over Particles in this generator event
-  for ( HepMC::GenEvent::particle_const_iterator p = (*evt)->particles_begin();
-	p != (*evt)->particles_end(); ++p ) {
-
-    int pdgid= (*p)->pdg_id();
-
-    std::vector<int>::iterator emParticle=m_emTauRoiParticles.begin();
-    std::vector<int>::iterator lastEmParticle=m_emTauRoiParticles.end();
-    bool formEmTauRoi=false;
-    for ( ; emParticle != lastEmParticle ; emParticle++ ) {
-      if (pdgid == *emParticle && (*p)->momentum().perp() > m_emTauRoiPtMin &&
-	 (*p)->momentum().pseudoRapidity() < m_emTauRoiEtaMax ) formEmTauRoi=true;
-    }
-    if ( formEmTauRoi ) {
-      // temp fix:
-      if (pdgid == 22) {
-	qq = 0.;
-      } else if (pdgid > 0) { qq = -1; } else { qq = 1; };
-      Trajectory track((*p)->momentum().px(), (*p)->momentum().py(), (*p)->momentum().pz(),
-		       (*p)->production_vertex()->position().x(),
-		       (*p)->production_vertex()->position().y(),
-		       (*p)->production_vertex()->position().z(), qq);
-
-      ATH_MSG_VERBOSE(" Forming EMROI (" << m_emRoiLabel << ") from kine ID " << pdgid << " charge " << qq);
-      ATH_MSG_VERBOSE(" Address " << std::hex << (*p) << std::dec);
-      ATH_MSG_VERBOSE(" px " << (*p)->momentum().px() <<
-                      " py " <<  (*p)->momentum().py() << " pz " << (*p)->momentum().pz());
-      ATH_MSG_VERBOSE(" vx " << (*p)->production_vertex()->position().x() <<
-                      " vy " <<  (*p)->production_vertex()->position().y() <<
-                      " vz " << (*p)->production_vertex()->position().z());
-      ATH_MSG_VERBOSE(" pt " << (*p)->momentum().perp() <<
-                      " phi " << (*p)->momentum().phi() << " eta " << track.eta());
-      ATH_MSG_VERBOSE(" Closest approach to origin : d0 " << track.d0() <<
-                      " phi0 " << track.phi0() << " z0 " << track.z0());
-#define RCAL 147.
-#define ZCAL 380.
-      std::pair<double, double> etaPhi = track.etaPhiAtCylinder(RCAL, ZCAL);
-
-      ATH_MSG_VERBOSE(" At calorimeter : phi " << etaPhi.second <<
-	" eta " << etaPhi.first);
-      FakeRoI fakeRoi(m_emRoiLabel, etaPhi.second, etaPhi.first);
-      fakeRoiList->push_back(fakeRoi);
-    }
-
-    // MUONROI
-
-    std::vector<int>::iterator muParticle=m_muonRoiParticles.begin();
-    std::vector<int>::iterator lastMuParticle=m_muonRoiParticles.end();
-    bool formMuonRoi=false;
-    for ( ; muParticle != lastMuParticle ; muParticle++ ) {
-      if (pdgid == *muParticle && (*p)->momentum().perp() > m_muonRoiPtMin &&
-	 (*p)->momentum().pseudoRapidity() < m_muonRoiEtaMax) formMuonRoi=true;
-    }
-    if ( formMuonRoi ) {
-
-      ATH_MSG_VERBOSE(" Forming MUONROI (" << m_muonRoiLabel << ") from kine ID " << pdgid <<
-                      " pt " << (*p)->momentum().perp() <<
-                      " phi " << (*p)->momentum().phi() <<
-                      " eta " << (*p)->momentum().pseudoRapidity());
-
-
-      Trajectory track((*p)->momentum().px(), (*p)->momentum().py(), (*p)->momentum().pz(),
-		       (*p)->production_vertex()->position().x(),
-		       (*p)->production_vertex()->position().y(),
-		       (*p)->production_vertex()->position().z(), qq);
-
-#define RCAL 147.
-#define ZCAL 380.
-      std::pair<double, double> etaPhi = track.etaPhiAtCylinder(RCAL, ZCAL);
-
-      ATH_MSG_VERBOSE(" At ID outer radius : phi " << etaPhi.second <<
-                      " eta " << etaPhi.first);
-      FakeRoI fakeRoi(m_muonRoiLabel, etaPhi.second, etaPhi.first);
-      fakeRoiList->push_back(fakeRoi);
-
-    }
-
-    // JETROI
-
-    std::vector<int>::iterator jetParticle=m_jetRoiParticles.begin();
-    std::vector<int>::iterator lastJetParticle=m_jetRoiParticles.end();
-    bool formJetRoi=false;
-    for ( ; jetParticle != lastJetParticle ; jetParticle++ ) {
-      if (pdgid == *jetParticle && (*p)->momentum().perp() > m_jetRoiPtMin &&
-	 (*p)->momentum().pseudoRapidity() < m_jetRoiEtaMax) formJetRoi=true;
-    }
-    if ( formJetRoi ) {
-
-      ATH_MSG_VERBOSE(" Forming JETROI (" <<  m_jetRoiLabel << ") from kine ID " << pdgid <<
-                      " pt " << (*p)->momentum().perp() <<
-                      " phi " << (*p)->momentum().phi() <<
-                      " eta " << (*p)->momentum().pseudoRapidity());
-      FakeRoI fakeRoi(m_jetRoiLabel,(*p)->momentum().phi() ,(*p)->momentum().pseudoRapidity());
-      fakeRoiList->push_back(fakeRoi);
-    }
-
-  }
-  //}
-  return fakeRoiList;
-}
diff --git a/Trigger/TrigFake/src/FakeLvl1RoIfromKine.h b/Trigger/TrigFake/src/FakeLvl1RoIfromKine.h
deleted file mode 100755
index 230eee2a38e9fb862543c3d5d20ac2b12aa5533e..0000000000000000000000000000000000000000
--- a/Trigger/TrigFake/src/FakeLvl1RoIfromKine.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef FAKELVL1ROIFROMKINE_H
-#define FAKELVL1ROIFROMKINE_H
-
-#include <string>
-#include <vector>
-#include "TrigSteering/LvlConverter.h"
-
-#define DEFAULT_RoIBRDOLocation "/RoIB/RoIBRDOLocation"
-#define DEFAULT_CaloConfigLocation "/Run/CaloTrigConfig"
-
-class StoreGateSvc;
-class FakeRoI;
-class HepLorentzVector;
-class Hep3Vector;
-
-class FakeLvl1RoIfromKine : public HLT::LvlConverter {
- public:
-  FakeLvl1RoIfromKine(const std::string& name, const std::string& type,
-		      const IInterface* parent); //!< constructor
-  ~FakeLvl1RoIfromKine();
-
-  HLT::ErrorCode hltInitialize();
-  HLT::ErrorCode hltExecute(std::vector<HLT::SteeringChain*>& activeSteeringChains);
-  HLT::ErrorCode hltFinalize();
-
- private:
-
-  std::vector<FakeRoI> * createRoIfromMC();
-  StatusCode createRoI(FakeRoI &roi);
-
- private:
-
-  unsigned int m_roiId;
-
-  std::string m_mcEventCollectionName;
-  double m_emTauRoiPtMin;
-  double m_emTauRoiEtaMax;
-  double m_muonRoiPtMin;
-  double m_muonRoiEtaMax;
-  double m_jetRoiPtMin;
-  double m_jetRoiEtaMax;
-  std::vector<int> m_emTauRoiParticles;
-  std::vector<int> m_muonRoiParticles;
-  std::vector<int> m_jetRoiParticles;
-
-  std::string m_emRoiLabel;
-  std::string m_muonRoiLabel;
-  std::string m_jetRoiLabel;
-  std::string m_tauRoiLabel;
-
-};
-
-#endif
diff --git a/Trigger/TrigFake/src/FakeRoI.h b/Trigger/TrigFake/src/FakeRoI.h
deleted file mode 100755
index 22345cd2c6fb8bf2a37082f57aea4bb18857aaef..0000000000000000000000000000000000000000
--- a/Trigger/TrigFake/src/FakeRoI.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef FAKEROI_H
-#define FAKEROI_H
-#include <string> 
-
-class FakeRoI {
- public:
-
-  FakeRoI(std::string type, double phi, double eta) : 
-    m_type(type), m_phi(phi), m_eta(eta) {};
-
-  ~FakeRoI() {};
-  
- public:
-  std::string type () const { return m_type; } ;
-  double phi () const { return m_phi ; } ;
-  double eta () const { return m_eta ; } ;
-  
- private:
-  std::string m_type;
-  double m_phi;
-  double m_eta;
-};
-#endif
diff --git a/Trigger/TrigFake/src/Trajectory.cxx b/Trigger/TrigFake/src/Trajectory.cxx
deleted file mode 100644
index 44113db61aec510ae4655f14dd25034b8ae86b2c..0000000000000000000000000000000000000000
--- a/Trigger/TrigFake/src/Trajectory.cxx
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include<cmath>
-#include "Trajectory.h"
-
-namespace TrigFake{
-Trajectory::Trajectory(double px_MeV, double py_MeV, double pz_MeV, 
-		       double vx_mm, double vy_mm, double vz_mm, double q) {
-
-  double px = px_MeV/1000; // GeV
-  double py = py_MeV/1000; // GeV
-  double pz = pz_MeV/1000; // GeV
-		       
-  double vx = vx_mm/10; // cm
-  double vy = vy_mm/10; // cm
-  double vz = vz_mm/10; // cm
-
-  m_q = q;
-  m_pz = pz; 
-
-  m_pT = sqrt( px*px + py*py ); 
-  m_theta = atan2(m_pT,m_pz);
-  
-  double pzpt=m_pz/m_pT;
-
-  m_eta=log(pzpt+sqrt(1.0+pzpt*pzpt));
-
-  double Rv  = sqrt( vx*vx + vy*vy ); 
-
-  // calculate parameters at closest approach to origin
-  
-#define Bfield 2.
-  m_Rcurv = 100. * m_pT/(0.3*Bfield);  // cm; 
-  
-  if (m_q != 0) {
-    double phiR = atan2(py,px) - m_q*M_PI_2;
-    double Ox = vx + m_Rcurv * cos(phiR);
-    double Oy = vy + m_Rcurv * sin(phiR);
-    double Ro = sqrt(Ox*Ox + Oy*Oy);
-    double d01 = Ro + m_Rcurv;
-    double d02 = Ro - m_Rcurv;
-    if (d01*d02 > 0) {
-      m_d0 = std::min(fabs(d01), fabs(d02));
-    } else {
-      m_d0 = -std::min(fabs(d01), fabs(d02));
-    }
-    m_phi0 = atan2(Oy,Ox) + m_q*M_PI_2;
-    m_z0 = vz - m_pz * (Rv - fabs(m_d0)) / m_pT;
-  } else {
-    m_phi0 = atan2(py,px);
-    m_d0 = fabs(vx * sin(m_phi0) - vy * cos(m_phi0));
-    m_z0 = vz - m_pz * (Rv - m_d0) / m_pT;
-  }
-
-  while (m_phi0 < -M_PI) m_phi0 = m_phi0 + 2.*M_PI;
-  while (m_phi0 > M_PI) m_phi0 = m_phi0 - 2.*M_PI;
-
-}
-
-
-/* ---------------------------------------------------------------------- */
-std::pair<double,double> Trajectory::etaPhiAtCylinder(double rC_mm, double zC_mm) const {
-    
-  double rC = rC_mm/10.; //cm
-  double zC = zC_mm/10.; //cm 
-
-  // Calculate intercept with cylinder
-  
-  double phiC = 0;
-  // double etaC = 0; // etaC is not being used -> compiler warnings
-  if (rC > 0  && fabs(zC) > 0 && m_pT != 0 && fabs(m_z0) < zC) {
-
-    /* r, z of intersection with cylinder */
-    
-    double r;
-    double z = m_z0 + m_pz * (rC - fabs(m_d0)) / m_pT;
-    if (fabs(z) > fabs(zC)) {
-      /* track passes through the end of the cylinder */
-      if (z > 0) z = fabs(zC); else z = -fabs(zC); 
-      r = fabs(m_d0) + (z - m_z0) * m_pT / m_pz;
-      r = fabs(r);   /* NOT SURE IF -ve r is handled correctly */
-    } else r = rC;      /* hits barrel of cylinder */
-    
-    /* etaC is not being used -> compiler warnings
-       double theta = atan2(r, fabs(z)) / 2.;
-
-       if (z > 0) etaC = -log(tan(theta));
-       else etaC = log(tan(theta));
-    */
-
-    /* Now calculate phiC */
-
-    if (m_q == 0) {                /* Neutral Track */
-      if (fabs(m_d0) <= r) phiC = m_phi0 - asin(fabs(m_d0)/r);
-    } else {                      /* Charged track */
-      double xD = 2. * r*(m_Rcurv + m_d0);
-      if (xD != 0) {
-	double xN = m_d0 * m_d0 + r * r + 2. * m_Rcurv * m_d0;
-	if (fabs(xN)/fabs(xD) > 1) {
-	  /* trajectory does not reach r, track loops
-	  ***temporary set dphi to 0 for this case */
-	  phiC = 2. * M_PI;
-	} else {
-	  double dphi = m_q*acos(xN/xD);
-	  /* two solutions from the 2 intersections of the 2 circles,
-	     but phi0 defines a direction, so the first solution
-	     should be the one we want....*/
-	  phiC = m_phi0 - m_q*M_PI_2 + dphi;
-	}
-      }   else phiC = 0; /* means track is orbiting the origin */
-      
-    }
-    /* fold back into 0-2pi */
-    while (phiC > M_PI) phiC = phiC - 2. * M_PI;
-    while (phiC < -M_PI) phiC = phiC + 2. * M_PI;
-  }
-
-  std::pair<double, double> etaPhi(m_eta, phiC);
-  return etaPhi;
-}
-
-}
diff --git a/Trigger/TrigFake/src/Trajectory.h b/Trigger/TrigFake/src/Trajectory.h
deleted file mode 100755
index ccff309d50212056ac1db670da43932f72c94a63..0000000000000000000000000000000000000000
--- a/Trigger/TrigFake/src/Trajectory.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef TRAJECTORY_H
-#define TRAJECTORY_H
-#include <string> 
-#include <utility>
-
-namespace TrigFake{
-
-class Trajectory {
- public:
-  Trajectory(double px, double py, double pz, double vx, double vy, double vz, double q);
-  ~Trajectory(){};
-
- public:
-  
-  double d0() const { return m_d0; };
-  double phi0() const { return m_phi0; };
-  double z0() const { return m_z0; };
-  double Rcurv() const { return m_Rcurv; };
-  double eta() const { return m_eta; };
-  double theta() const { return m_theta; };
-  double pz() const { return m_pz; };
-  double pT() const { return m_pT; };
-
-  std::pair<double,double> etaPhiAtCylinder(double rC, double zC) const ;
-  
-
- private:
-  
-  double m_d0; 
-  double m_phi0;
-  double m_Rcurv;
-  double m_z0;
-  double m_q;
-  double m_eta;
-  double m_theta;
-  double m_pz;
-  double m_pT;
-
-
-};
-}
-#endif
diff --git a/Trigger/TrigFake/src/ZVertexFromKine.cxx b/Trigger/TrigFake/src/ZVertexFromKine.cxx
deleted file mode 100644
index 9b0f9d3b6e1c6e1a58579fb14cb800e45ffcec64..0000000000000000000000000000000000000000
--- a/Trigger/TrigFake/src/ZVertexFromKine.cxx
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-/********************************************************************                               
-                               
-NAME:     ZVertexFromKine.cxx                               
-PACKAGE:                                 
-                               
-AUTHOR:   Nikos Konstantinidis
-         
-CREATED:  May 2005                               
-                               
-PURPOSE:  Make z of first MC particle available to algorithms
-                               
-Modified :
-         
-                               
-********************************************************************/                               
-
-#include "AtlasHepMC/GenEvent.h"
-#include "AtlasHepMC/GenParticle.h"
-#include "GeneratorObjects/McEventCollection.h"
-
-#include "TrigInDetEvent/TrigVertexCollection.h"
-#include "TrigInDetEvent/TrigVertex.h"
-
-#include "ZVertexFromKine.h"                               
-
-
-
-      
-////////////////////////////////////////////////////////////////                               
-//  CONSTRUCTOR:                               
-                                   
-ZVertexFromKine::ZVertexFromKine(const std::string& name, ISvcLocator* pSvcLocator):                                
-  AthAlgorithm(name, pSvcLocator)
-{
-
-  declareProperty("McEventCollectionName", m_mcEventCollectionName="GEN_EVENT");
-
-}                               
-                               
-// DESTRUCTOR:                               
-                                  
-ZVertexFromKine::~ZVertexFromKine()                               
-{ }                               
-                               
-/////////////////////////////////////////////////////////////////                               
-// INITIALIZE METHOD:                               
-                                      
-StatusCode ZVertexFromKine::initialize()                               
-{                               
-  return StatusCode::SUCCESS;                               
-}                               
-                               
-/////////////////////////////////////////////////////////////////                               
-// FINALIZE METHOD:                               
-                                 
-StatusCode ZVertexFromKine::finalize() { return StatusCode::SUCCESS; }                               
-                               
-/////////////////////////////////////////////////////////////////                               
-// EXECUTE METHOD:                               
-                                 
-StatusCode ZVertexFromKine::execute()                               
-{                                
-                               
-   ATH_MSG_DEBUG("Executing ZVertexFromKine");
-
-  //  Get the collection generator events (physics and pile-up) making up this event 
-  
-  const McEventCollection* mcEvents;
-  StatusCode sc = evtStore()->retrieve( mcEvents, m_mcEventCollectionName );
-  if( sc.isFailure() ) {
-     ATH_MSG_INFO( "Could not retrieve mcEventCollection with key " << m_mcEventCollectionName); 
-     return StatusCode::SUCCESS; 
-  };
-
-  McEventCollection::const_iterator  event = mcEvents->begin();
-  HepMC::GenVertex* vertex = *((*event)->vertices_begin());
-
-  TrigVertexCollection* zinfo = new TrigVertexCollection();
-  TrigVertex* zvert = new TrigVertex( vertex->position().z() );
-  zinfo->push_back(zvert);
-
-  if( evtStore()->record( zinfo, "TrueTrigVertexColl" ) ) {
-     ATH_MSG_DEBUG("Stored TrueTrigVertexColl");
-  }
-  else {
-     ATH_MSG_WARNING("Failed to Store TrueTrigVertexColl");
-  }
-
-  return StatusCode::SUCCESS;
-}
-
diff --git a/Trigger/TrigFake/src/ZVertexFromKine.h b/Trigger/TrigFake/src/ZVertexFromKine.h
deleted file mode 100755
index 16caa84c5f48bd494ccc35060c8e406fbbff0916..0000000000000000000000000000000000000000
--- a/Trigger/TrigFake/src/ZVertexFromKine.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef ZVERTEXFROMKINE_H
-#define ZVERTEXFROMKINE_H
-
-#include <string>
-
-#include "AthenaBaseComps/AthAlgorithm.h"
-
-class ZVertexFromKine : public AthAlgorithm 
-{
-public:
-  
-   ZVertexFromKine(const std::string& name, ISvcLocator* pSvcLocator);
-   ~ZVertexFromKine();
-  
-   StatusCode initialize();
-   StatusCode execute();
-   StatusCode finalize();
-
-private:
-
-   std::string m_mcEventCollectionName;
-};
-
-
-#endif
diff --git a/Trigger/TrigFake/src/components/TrigFake_entries.cxx b/Trigger/TrigFake/src/components/TrigFake_entries.cxx
deleted file mode 100644
index 78d495b978e998191ded7e3a0ef949e21539dc19..0000000000000000000000000000000000000000
--- a/Trigger/TrigFake/src/components/TrigFake_entries.cxx
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "../FakeLvl1RoIatFixedEtaPhi.h"
-#include "../FakeLvl1MultipleRoIsatFixedEtaPhi.h"
-//#include "TrigFake/FakeLvl1ConversionTestBeam.h"
-#include "../FakeLvl1RoIfromKine.h"
-#include "../ZVertexFromKine.h"
-
-
-DECLARE_COMPONENT( FakeLvl1RoIfromKine )
-  //DECLARE_COMPONENT( FakeLvl1ConversionTestBeam )
-DECLARE_COMPONENT( FakeLvl1RoIatFixedEtaPhi )
-DECLARE_COMPONENT( FakeLvl1MultipleRoIsatFixedEtaPhi )
-DECLARE_COMPONENT( ZVertexFromKine )
-
diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEgammaFastCaloHypoAlgMT.cxx b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEgammaFastCaloHypoAlgMT.cxx
index adfa2745c0d70ebc5bef78809c50ffd0710dd811..8186dabbabe4afadac1560cb024d378aa5ae4f3a 100644
--- a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEgammaFastCaloHypoAlgMT.cxx
+++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEgammaFastCaloHypoAlgMT.cxx
@@ -20,7 +20,7 @@ StatusCode TrigEgammaFastCaloHypoAlgMT::initialize() {
   ATH_CHECK( m_hypoTools.retrieve() );
   
   ATH_CHECK( m_clustersKey.initialize() );
-  ATH_CHECK( m_ringsKey.initialize());
+  ATH_CHECK( m_ringsKey.initialize(SG::AllowEmpty));
 
   renounce( m_clustersKey );// clusters are made in views, so they are not in the EvtStore: hide them
   renounce( m_ringsKey );
@@ -63,25 +63,30 @@ StatusCode TrigEgammaFastCaloHypoAlgMT::execute( const EventContext& context ) c
     ATH_CHECK( clusterHandle.isValid() );
     ATH_MSG_DEBUG ( "Cluster handle size: " << clusterHandle->size() << "..." );
 
+    auto d = newDecisionIn( decisions, name() );
+    
     // get Rings
-    auto ringerShapeHandle = ViewHelper::makeHandle( *viewEL, m_ringsKey, context);
-    ATH_CHECK( ringerShapeHandle.isValid() );
+    const xAOD::TrigRingerRingsContainer* rings = nullptr;    
+    if ( not m_ringsKey.empty() ) {      
+      auto ringerShapeHandle = ViewHelper::makeHandle( *viewEL, m_ringsKey, context);
+      ATH_CHECK( ringerShapeHandle.isValid() );
+      rings = ringerShapeHandle.cptr();	
+      ATH_MSG_DEBUG ( "Ringer handle size: " << ringerShapeHandle->size() << "..." );
+
+      // link the rings      
+      auto el = ViewHelper::makeLink( *viewEL, ringerShapeHandle, 0 );
+      ATH_CHECK( el.isValid() );
+      d->setObjectLink( "ringer",  el );
+      
+    }
 
-    ATH_MSG_DEBUG ( "Ringer handle size: " << ringerShapeHandle->size() << "..." );
 
 
 
     // create new decision
-    auto d = newDecisionIn( decisions, name() );
-
-    toolInput.emplace_back( d, roi, clusterHandle.cptr()->at(0), ringerShapeHandle.cptr()->at(0), previousDecision );
+    toolInput.emplace_back( d, roi, clusterHandle.cptr()->at(0), (rings ? rings->at(0) : nullptr) , previousDecision );
     
-    // link the rings
-    {
-      auto el = ViewHelper::makeLink( *viewEL, ringerShapeHandle, 0 );
-      ATH_CHECK( el.isValid() );
-      d->setObjectLink( "ringer",  el );
-    }
+
     // link the cluster
     { 
       auto clus = ViewHelper::makeLink( *viewEL, clusterHandle, 0 );
diff --git a/Trigger/TrigMonitoring/TrigBjetMonitoring/src/components/TrigBjetMonitoring_entries.cxx b/Trigger/TrigMonitoring/TrigBjetMonitoring/src/components/TrigBjetMonitoring_entries.cxx
index eacb278d2c7b6828b86f91eadfae99154fb694d3..b1e0e9968a14c1f999bca678863db13698818d46 100644
--- a/Trigger/TrigMonitoring/TrigBjetMonitoring/src/components/TrigBjetMonitoring_entries.cxx
+++ b/Trigger/TrigMonitoring/TrigBjetMonitoring/src/components/TrigBjetMonitoring_entries.cxx
@@ -1,5 +1,5 @@
 /* 
-Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration

+Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 #include "../HLTBjetMonTool.h"
 #include "../TrigBjetMonitorAlgorithm.h"
diff --git a/Trigger/TrigMonitoring/TrigBphysMonitoring/python/TrigBphysMonitCategory.py b/Trigger/TrigMonitoring/TrigBphysMonitoring/python/TrigBphysMonitCategory.py
index bcd080533a137767597a0fd49d6f8aa7b7b465d5..c5417da529f72a6569f8aadb6262d4db268519f0 100644
--- a/Trigger/TrigMonitoring/TrigBphysMonitoring/python/TrigBphysMonitCategory.py
+++ b/Trigger/TrigMonitoring/TrigBphysMonitoring/python/TrigBphysMonitCategory.py
@@ -3,7 +3,29 @@
 from TriggerJobOpts.TriggerFlags import TriggerFlags
 
 monitoring_bphys = [
-                    #'HLT_mu11_mu6_bDimu', 
+                    # For individual chain monitoring folders, to fill DetailedIndividualChains - put them first
+                    '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_mu11_mu6_bPhi_L1MU11_2MU6',
+                    'HLT_mu11_mu6_bTau_L1MU11_2MU6',
+                    'HLT_mu11_mu6_bBmumu_L1MU11_2MU6',
+                    'HLT_mu11_mu6_bDimu2700_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',
+                    # Other chains that used to be here
+                    'HLT_mu11_mu6_bDimu', 
                     'HLT_mu11_mu6_bBmumuxv2', 
                     'HLT_mu6_2mu4_bJpsi',
                     'HLT_mu20_bJpsi_Trkloose', 
@@ -14,7 +36,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,23 +47,7 @@ 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 = [ 
@@ -83,6 +89,10 @@ if TriggerFlags.EDMDecodingVersion == 3 :
                       'HLT_mu11_mu6_bJpsimumu_L1MU11_2MU6',
                       'HLT_mu11_mu6_bUpsimumu_L1MU11_2MU6',
                       'HLT_mu11_mu6_bDimu_L1MU11_2MU6',
+                      'HLT_mu11_mu6_bPhi_L1MU11_2MU6',
+                      'HLT_mu11_mu6_bTau_L1MU11_2MU6',
+                      'HLT_mu11_mu6_bBmumu_L1MU11_2MU6',
+                      'HLT_mu11_mu6_bDimu2700_L1MU11_2MU6',
                       'HLT_2mu4_bBmumux_BsmumuPhi_L12MU4',
                       'HLT_mu6_mu4_bBmumux_BsmumuPhi_L1MU6_2MU4',
                       'HLT_2mu4_bBmumux_BpmumuKp_L12MU4',
diff --git a/Trigger/TrigMonitoring/TrigBphysMonitoring/python/TrigBphysMonitoringConfig.py b/Trigger/TrigMonitoring/TrigBphysMonitoring/python/TrigBphysMonitoringConfig.py
index 5d3ce0d7874e4fe7c73aba1f3eb22c2a73c111b1..de36f5b2fefc17f517754483344fb8eb9d4fbcce 100644
--- a/Trigger/TrigMonitoring/TrigBphysMonitoring/python/TrigBphysMonitoringConfig.py
+++ b/Trigger/TrigMonitoring/TrigBphysMonitoring/python/TrigBphysMonitoringConfig.py
@@ -47,6 +47,10 @@ DetailedIndividualChains = {
                   "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_mu11_mu6_bPhi"     : "HLT_mu11_mu6_bPhi(_L1(?!BPH).*)?$",
+                  "HLT_mu11_mu6_bTau"     : "HLT_mu11_mu6_bTau(_L1(?!BPH).*)?$",
+                  "HLT_mu11_mu6_bBmumu"     : "HLT_mu11_mu6_bBmumu(_L1(?!BPH).*)?$",
+                  "HLT_mu11_mu6_bDimu2700"     : "HLT_mu11_mu6_bDimu2700(_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).*)?$",
@@ -155,8 +159,8 @@ def TrigBphysMonitoringTool():
                                   DeltaR_max          =  3.,
                                   PtSum_min           =  0.,
                                   PtSum_max           =  100.,
-                                  OniaMass_min        =  2000,
-                                  OniaMass_max        =  12000,
+                                  OniaMass_min        =  0,
+                                  OniaMass_max        =  14000,
                                   TauMass_min         =  0,
                                   TauMass_max         =  3000,
                                   OniaPt_min          =  8,
diff --git a/Trigger/TrigMonitoring/TrigCaloMonitoring/src/HLTCaloFEBTool.cxx b/Trigger/TrigMonitoring/TrigCaloMonitoring/src/HLTCaloFEBTool.cxx
index da0752ae2fd2093dfc845227c7bb87f4924215d4..149e560d00ad9f0b854eba2dbe814079406c0ca1 100644
--- a/Trigger/TrigMonitoring/TrigCaloMonitoring/src/HLTCaloFEBTool.cxx
+++ b/Trigger/TrigMonitoring/TrigCaloMonitoring/src/HLTCaloFEBTool.cxx
@@ -42,7 +42,6 @@ HLTCaloFEBTool::HLTCaloFEBTool(const std::string & type, const std::string & nam
         declareProperty ("sigma", m_nsigma);
         declareProperty ("useLoadFullCollection", m_useloadfullcoll);
         declareProperty ("DiffLimit", m_difflimit);
-        declareProperty ("TCRTools", m_tcrAlgTools);
 	// Nothing for the moment
 	return;
 }
diff --git a/Trigger/TrigMonitoring/TrigCostMonitor/share/readTrigCost.py b/Trigger/TrigMonitoring/TrigCostMonitor/share/readTrigCost.py
deleted file mode 100644
index ceff0d601a144c8a1f85eafd50f3b27bceb5c891..0000000000000000000000000000000000000000
--- a/Trigger/TrigMonitoring/TrigCostMonitor/share/readTrigCost.py
+++ /dev/null
@@ -1,119 +0,0 @@
-
-#----------------------------------------------------------------------
-# Global and trigger flags
-#
-
-if (not 'costD3PD_doL2' in dir()):
-  costD3PD_doL2 = False
-
-if (not 'costD3PD_doEF' in dir()):
-  costD3PD_doEF = False
-
-if (not 'costD3PD_doHLT' in dir()):
-  costD3PD_doHLT = True
-
-if (not 'costOutput' in dir()):
-  costOutput = "COST RATE EB"
-
-#BSRDOInput=['data_test.00212967.Single_Stream.daq.RAW._lb0291._Athena._0101.data']
-
-if not ('BSRDOInput' in dir()):
-    print 'ERROR! Please supply a BSRDOInput to run over'
-    sys.exit(1)
-
-if not ('EvtMax' in dir()):
-    EvtMax=-1
-from AthenaCommon.AppMgr import theApp
-theApp.EvtMax = EvtMax
-
-if ('setEvent' in dir()) and type(setEvent) == int:
-    from AthenaCommon.AppMgr import theApp
-    theApp.setEvent = setEvent
-
-from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
-#athenaCommonFlags.isOnline = True
-athenaCommonFlags.BSRDOInput=BSRDOInput
-
-
-from RecExConfig.RecFlags import rec
-rec.readRDO = False
-rec.AutoConfiguration=['everything']
-
-from AthenaCommon.AlgSequence import AlgSequence
-topSeq = AlgSequence()
-
-#----------------------------------------------------------------------
-# Set services for reading BS files
-#
-include("ByteStreamCnvSvc/BSEventStorageEventSelector_jobOptions.py")
-
-svcMgr.ByteStreamCnvSvc.InitCnvs += [ "EventInfo",
-                                      "HLT::HLTResult"]
-
-svcMgr.ByteStreamAddressProviderSvc.TypeNames += [ "HLT::HLTResult/HLTResult_L2",
-                                                   "HLT::HLTResult/HLTResult_EF",
-                                                   "HLT::HLTResult/HLTResult_HLT"]
-
-
-#----------------------------------------------------------------------
-# Set input files
-#
-if ('BSRDOInput' in dir()):
-    svcMgr.EventSelector.Input = BSRDOInput
-
-if len(svcMgr.EventSelector.Input) == 0:
-    print 'ERROR! svcMgr.EventSelector.Input is empty'
-    sys.exit(1)
-
-#----------------------------------------------------------------------
-# Setup cost algorithm
-#
-from TrigCostMonitor.TrigCostMonitorConfig import prepareCostRun, setupCostDebug
-
-costRunString = " "
-if ('costD3PD_doL2' in dir() and bool(costD3PD_doL2) == True): costRunString += "l2 "
-if ('costD3PD_doEF' in dir() and bool(costD3PD_doEF) == True): costRunString += "ef "
-if ('costD3PD_doHLT' in dir() and bool(costD3PD_doHLT) == True): costRunString += "hlt "
-
-print "Setting up TrigCostRun algorithm: Running over levels - " + costRunString
-runAlg = prepareCostRun('TrigCostRun', costRunString)
-
-#setDebug = 1
-
-if ('enableCostDebug' in dir() and bool(enableCostDebug) == True):
-    print 'Setting TrigCostRun to DEBUG output level'
-    setupCostDebug()
-    runAlg.OutputLevel = DEBUG
-    runAlg.navigation.OutputLevel = DEBUG
-    for tool in runAlg.tools:
-        tool.OutputLevel = DEBUG
-    print runAlg
-
-topSeq += runAlg
-
-from AthenaCommon.Include import include
-if ("COST" in costOutput):
-  include("TrigCostD3PDMaker/TrigCostD3PDMaker_prodJobOFragment.py")
-
-if ("RATE" in costOutput):
-  include("TrigCostD3PDMaker/TrigRateD3PDMaker_prodJobOFragment.py")
-
-if ("EB" in costOutput):
-  include("TrigCostD3PDMaker/TrigEBWeightD3PDMaker_prodJobOFragment.py")
-
-#----------------------------------------------------------------------
-# Message service and loop manager options
-#
-ServiceMgr.MessageSvc.OutputLevel = 3
-#ServiceMgr.MessageSvc.defaultLimit = 0
-#ServiceMgr.MessageSvc.enableSuppression = False
-ServiceMgr.MessageSvc.Format = "% F%35W%S%7W%R%T %0W%M"
-ServiceMgr.MessageSvc.showStats = True
-ServiceMgr.MessageSvc.statLevel = WARNING
-
-if not hasattr(ServiceMgr, "AthenaEventLoopMgr"):
-    from AthenaServices.AthenaServicesConf import AthenaEventLoopMgr
-    ServiceMgr += AthenaEventLoopMgr()
-    
-ServiceMgr.AthenaEventLoopMgr.EventPrintoutInterval = 100
-
diff --git a/Trigger/TrigMonitoring/TrigHLTMonitoring/python/TrigGeneralMonitorAlgorithm.py b/Trigger/TrigMonitoring/TrigHLTMonitoring/python/TrigGeneralMonitorAlgorithm.py
new file mode 100644
index 0000000000000000000000000000000000000000..ed93bbc43eacbb79d6155aad14720a7f5963d6d9
--- /dev/null
+++ b/Trigger/TrigMonitoring/TrigHLTMonitoring/python/TrigGeneralMonitorAlgorithm.py
@@ -0,0 +1,145 @@
+#
+#  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+#
+
+'''@file TrigHLTMonitorAlgorithm.py
+@date 2020-09-18
+@brief TrigHLTMonitoring general monitoring
+'''
+
+
+def TrigGeneralMonConfig(inputFlags):
+    '''Function to configure general HLT algorithms in the monitoring system.'''
+
+
+    ### Set up logging functionality 
+    from AthenaCommon.Logging import logging
+    log_trighlt = logging.getLogger( 'TrigGeneralMonitorAlgorithm' )
+
+
+    ################################
+    # HLT general monitoring
+
+    # The following class will make a sequence, configure algorithms, and link
+    # them to GenericMonitoringTools
+    from AthenaMonitoring import AthMonitorCfgHelper
+    helper = AthMonitorCfgHelper(inputFlags,'TrigHLTAthMonitorCfg')
+
+
+    # Adding algorithms to the helper. 
+    # The added algorithm must exist as a .h file 
+
+    from AthenaConfiguration.ComponentFactory import CompFactory
+    cfgsvc = CompFactory.TrigConf.xAODConfigSvc('xAODConfigSvc')
+    helper.resobj.addService(cfgsvc)
+    trigHLTMonAlg = helper.addAlgorithm(CompFactory.TrigHLTMonitorAlgorithm,'TrigHLTMonAlg')
+    trigHLTMonAlg.TrigConfigSvc = cfgsvc
+
+
+
+    # Edit properties of a algorithm
+    # Placeholder
+
+
+    # Add a generic monitoring tool (a "group" in old language). 
+    hltGroup = helper.addGroup(
+        trigHLTMonAlg,
+        'TrigHLTMonitor',
+        'HLT/ResultMon/'
+    )
+
+
+    # Configure histograms
+    #NB! The histograms defined here must match the ones in the cxx file exactly
+
+    ###########################################################
+    ##### HLTResult and ConfigConsistency  ####################
+  
+    hltGroup.defineHistogram('HLTResultHLT', title='HLT Result PLACEHOLDER;result;Events',
+                             path='',xbins=3,xmin=0,xmax=3)
+
+    consistency_names=['SMK DB NULL','SMK BS NULL','SMK Inconsistent','HLT Prescale DB NULL','HLT Prescale BS NULL','HLT Prescale Inconsistent','No HLTResult']
+    hltGroup.defineHistogram('ConfigConsistency_HLT', title='ConfigConsistency_HLT;;Events',
+                             path='',xbins=7,xmin=1,xmax=8,xlabels=consistency_names)
+
+ 
+    ############################################################
+    #### Overall summary histograms ############################
+
+    from AthenaConfiguration.AutoConfigFlags import GetFileMD
+
+    #The HLT chains
+    counter_i = 1
+    for chain_name in GetFileMD(inputFlags.Input.Files)['TriggerMenu']['HLTChains']:
+        counter_i = counter_i+1
+        log_trighlt.debug('HLT chain_name = %s',chain_name)
+    max_hlt_chains = counter_i-1
+    log_trighlt.info('max_hlt_chains = %i', max_hlt_chains)
+
+    #The L1 items
+    counter_L1 = 1
+    for item_name in GetFileMD(inputFlags.Input.Files)['TriggerMenu']['L1Items']:
+        counter_L1 = counter_L1+1
+        log_trighlt.debug('L1 item_name = %s',item_name)
+    max_L1_items = counter_L1-1 
+    log_trighlt.info('max_L1_items = %i', max_L1_items)
+
+    ##### L1 summary histogram ################################
+
+    hltGroup.defineHistogram('L1Events',title='Events per Item at L1;;Events',
+                             path='',xbins=max_L1_items,xmin=1,xmax=max_L1_items+1)
+
+    #### HLT summary histograms #########################
+
+    hltGroup.defineHistogram('HLT_AllChainsRAW',title='AllChains;;Events',
+                             path='AllChains',xbins=max_hlt_chains,
+                             xmin=1,xmax=max_hlt_chains+1)
+
+    hltGroup.defineHistogram('eta,phi;HLT_AllChainsRoIs',type='TH2F',title='AllChains;#eta;#phi',
+                             path='AllChains',xbins=64,xmin=-3.2,xmax=3.2,
+                             ybins=64,ymin=-3.2,ymax=3.2)
+
+
+    #### Summary histograms for the signatures #################
+    hltGroup.defineHistogram('HLT_ElectronsRAW',title='Placeholder;X;Y',
+                             path='Electrons',xbins=1000000,xmin=-0.5,xmax=999999.5)
+
+
+
+    #####################################
+    # Finalize. 
+    return helper.result()
+    
+
+if __name__=='__main__':
+    # Setup the Run III behavior
+    from AthenaCommon.Configurable import Configurable
+    Configurable.configurableRun3Behavior = 1
+
+    # Setup logs
+    from AthenaCommon.Logging import log
+    from AthenaCommon.Constants import DEBUG
+    log.setLevel(DEBUG)
+
+    # Set the Athena configuration flags
+    from AthenaConfiguration.AllConfigFlags import ConfigFlags
+    ConfigFlags.Input.isMC = False
+    ConfigFlags.Output.HISTFileName = 'TrigHLTMonitorOutput.root'
+    
+    ConfigFlags.lock()
+
+    # Initialize configuration object, add accumulator, merge, and run.
+    from AthenaConfiguration.MainServicesConfig import MainServicesCfg 
+    from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
+    cfg = MainServicesCfg(ConfigFlags)
+    cfg.merge(PoolReadCfg(ConfigFlags))
+
+    trigHLTMonitorAcc = TrigGeneralMonConfig(ConfigFlags)
+    cfg.merge(trigHLTMonitorAcc)
+
+    # If you want to turn on more detailed messages ...
+    #trigHLTMonitorAcc.getEventAlgo('TrigHLTMonAlg').OutputLevel = 2 # DEBUG
+    cfg.printConfig(withDetails=True) # set True for exhaustive info
+
+    cfg.run() #use cfg.run(20) to only run on first 20 events
+
diff --git a/Trigger/TrigMonitoring/TrigHLTMonitoring/python/TrigHLTMonitorAlgorithm.py b/Trigger/TrigMonitoring/TrigHLTMonitoring/python/TrigHLTMonitorAlgorithm.py
index 6d8e29bb010a898932b811bea269d9ef876a7914..12576dc04759831b41554f8f397d680d94cd6f50 100644
--- a/Trigger/TrigMonitoring/TrigHLTMonitoring/python/TrigHLTMonitorAlgorithm.py
+++ b/Trigger/TrigMonitoring/TrigHLTMonitoring/python/TrigHLTMonitorAlgorithm.py
@@ -4,8 +4,8 @@
 
 '''@file TrigHLTMonitorAlgorithm.py
 @date 2019-09-10
-@date 2020-08-24
-@brief TrigHLTMonitoring top-level files, general monitoring
+@date 2020-09-18
+@brief TrigHLTMonitoring top-level files
 '''
 
 def createHLTDQConfigFlags():
@@ -13,14 +13,14 @@ def createHLTDQConfigFlags():
     acf=AthConfigFlags()
 
     acf.addFlag('DQ.Steering.HLT.doGeneral', True)
-    acf.addFlag('DQ.Steering.HLT.doEgamma', True)
-    acf.addFlag('DQ.Steering.HLT.doMET', True)
-    acf.addFlag('DQ.Steering.HLT.doJet', True)
     acf.addFlag('DQ.Steering.HLT.doBjet', True)
-    acf.addFlag('DQ.Steering.HLT.doCalo', True)
-    acf.addFlag('DQ.Steering.HLT.doMuon', True)
     acf.addFlag('DQ.Steering.HLT.doBphys', True)
+    acf.addFlag('DQ.Steering.HLT.doCalo', True)
+    acf.addFlag('DQ.Steering.HLT.doEgamma', True)
+    acf.addFlag('DQ.Steering.HLT.doJet', True)
+    acf.addFlag('DQ.Steering.HLT.doMET', True)
     acf.addFlag('DQ.Steering.HLT.doMinBias', True)
+    acf.addFlag('DQ.Steering.HLT.doMuon', True)
     acf.addFlag('DQ.Steering.HLT.doTau', True)
 
     return acf
@@ -32,152 +32,51 @@ def TrigHLTMonTopConfig(inputFlags):
     ########
     #HLT top-level steering
 
-    ### STEP 1 ###
     # Define one top-level monitoring algorithm. The new configuration 
     # framework uses a component accumulator.
+
     from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
     result = ComponentAccumulator()
 
     if inputFlags.DQ.Steering.HLT.doGeneral:
-        from TrigHLTMonitoring.TrigHLTMonitorAlgorithm import TrigHLTMonConfig
-        result.merge(TrigHLTMonConfig(inputFlags))
+        from TrigHLTMonitoring.TrigGeneralMonitorAlgorithm import TrigGeneralMonConfig
+        result.merge(TrigGeneralMonConfig(inputFlags))
+
+    if inputFlags.DQ.Steering.HLT.doBjet:
+        from TrigBjetMonitoring.TrigBjetMonitorAlgorithm import TrigBjetMonConfig
+        result.merge(TrigBjetMonConfig(inputFlags))
+
+    if inputFlags.DQ.Steering.HLT.doBphys:
+        from TrigBphysMonitoring.TrigBphysMonitorAlgorithm import TrigBphysMonConfig
+        result.merge(TrigBphysMonConfig(inputFlags))
+
+    if inputFlags.DQ.Steering.HLT.doCalo:
+        from TrigCaloMonitoring.TrigCaloMonitorAlgorithm import TrigCaloMonConfig
+        result.merge(TrigCaloMonConfig(inputFlags))
 
     if inputFlags.DQ.Steering.HLT.doEgamma:
         from TrigEgammaMonitoring.TrigEgammaMonitorAlgorithm import TrigEgammaMonConfig
         result.merge(TrigEgammaMonConfig(inputFlags))
 
-    if inputFlags.DQ.Steering.HLT.doMET:
-        from TrigMETMonitoring.TrigMETMonitorAlgorithm import TrigMETMonConfig
-        result.merge(TrigMETMonConfig(inputFlags))
-
     if inputFlags.DQ.Steering.HLT.doJet:
         from TrigJetMonitoring.TrigJetMonitorAlgorithm import TrigJetMonConfig
         result.merge(TrigJetMonConfig(inputFlags))
 
-    if inputFlags.DQ.Steering.HLT.doBjet:
-        from TrigBjetMonitoring.TrigBjetMonitorAlgorithm import TrigBjetMonConfig
-        result.merge(TrigBjetMonConfig(inputFlags))
+    if inputFlags.DQ.Steering.HLT.doMET:
+        from TrigMETMonitoring.TrigMETMonitorAlgorithm import TrigMETMonConfig
+        result.merge(TrigMETMonConfig(inputFlags))
 
-    if inputFlags.DQ.Steering.HLT.doCalo:
-        from TrigCaloMonitoring.TrigCaloMonitorAlgorithm import TrigCaloMonConfig
-        result.merge(TrigCaloMonConfig(inputFlags))
+    if inputFlags.DQ.Steering.HLT.doMinBias:
+        from TrigMinBiasMonitoring.TrigMinBiasMonitoringMT import TrigMinBias
+        result.merge(TrigMinBias(inputFlags))
 
     if inputFlags.DQ.Steering.HLT.doMuon:
         from TrigMuonMonitoringMT.TrigMuonMonitoringMTConfig import TrigMuonMonConfig
         result.merge(TrigMuonMonConfig(inputFlags))
 
-    if inputFlags.DQ.Steering.HLT.doBphys:
-        from TrigBphysMonitoring.TrigBphysMonitorAlgorithm import TrigBphysMonConfig
-        result.merge(TrigBphysMonConfig(inputFlags))
-        
-    if inputFlags.DQ.Steering.HLT.doMinBias:
-        from TrigMinBiasMonitoring.TrigMinBiasMonitoringMT import TrigMinBias
-        result.merge(TrigMinBias(inputFlags))
-
     if inputFlags.DQ.Steering.HLT.doTau:
         from TrigTauMonitoring.TrigTauMonitorAlgorithm import TrigTauMonConfig
         result.merge(TrigTauMonConfig(inputFlags))
 
     return result
 
-
-
-def TrigHLTMonConfig(inputFlags):
-    '''Function to configure general HLT algorithms in the monitoring system.'''
-
-    ################################
-    # HLT general monitoring
-
-
-    # The following class will make a sequence, configure algorithms, and link
-    # them to GenericMonitoringTools
-    from AthenaMonitoring import AthMonitorCfgHelper
-    helper = AthMonitorCfgHelper(inputFlags,'TrigHLTAthMonitorCfg')
-
-
-    ### STEP 2 ###
-    # Adding algorithms to the helper. 
-    # The added algorithm must exist as a .h file 
-
-    from AthenaConfiguration.ComponentFactory import CompFactory
-    #trigHLTMonAlg = helper.addAlgorithm(CompFactory.TrigHLTMonitorAlgorithm,'TrigHLTMonAlg')
-    cfgsvc = CompFactory.TrigConf.xAODConfigSvc('xAODConfigSvc')
-    helper.resobj.addService(cfgsvc)
-    trigHLTMonAlg = helper.addAlgorithm(CompFactory.TrigHLTMonitorAlgorithm,'TrigHLTMonAlg')
-    trigHLTMonAlg.TrigConfigSvc = cfgsvc
-
-
-
-    #signatureTrigHLTMonAlg = helper.addAlgorithm(CompFactory.TrigHLTMonitorAlgorithm,'SignatureTrigHLTMonAlg')
-
-
-    ### STEP 3 ###
-    # Edit properties of a algorithm
-    # Placeholder
-
-    ### STEP 4 ###
-    # Add a generic monitoring tool (a "group" in old language). 
-    hltGroup = helper.addGroup(
-        trigHLTMonAlg,
-        'TrigHLTMonitor',
-        'HLT/ResultMon/'
-    )
-
-    # Add a GMT for the other example monitor algorithm
-    #signatureGroup = helper.addGroup(signatureTrigHLTMonAlg,'TrigHLTMonitor','HLT/ResultMon/')
-
-    ### STEP 5 ###
-    # Configure histograms
-    #NB! The histograms defined here must match the ones in the cxx file exactly
-    
-    hltGroup.defineHistogram('HLTResultHLT', title='HLT Result PLACEHOLDER;result;Events',
-                            path='',xbins=3,xmin=0,xmax=3)
-
-    consistency_names=['SMK DB NULL','SMK BS NULL','SMK Inconsistent','HLT Prescale DB NULL','HLT Prescale BS NULL','HLT Prescale Inconsistent','No HLTResult']
-    hltGroup.defineHistogram('ConfigConsistency_HLT', title='ConfigConsistency_HLT;;Events',
-                             path='',xbins=7,xmin=1,xmax=8,xlabels=consistency_names)
-
-    hltGroup.defineHistogram('placeholder_hlt',title='Placeholder;X;Y',
-                                  path='AllChains',xbins=1000000,xmin=-0.5,xmax=999999.5)
-
-    #Summary histograms for the signatures
-    hltGroup.defineHistogram('placeholder_ele',title='Placeholder;X;Y',
-                                  path='Electrons',xbins=1000000,xmin=-0.5,xmax=999999.5)
-
-    ### STEP 6 ###
-    # Finalize. 
-    return helper.result()
-    
-
-if __name__=='__main__':
-    # Setup the Run III behavior
-    from AthenaCommon.Configurable import Configurable
-    Configurable.configurableRun3Behavior = 1
-
-    # Setup logs
-    from AthenaCommon.Logging import log
-    from AthenaCommon.Constants import DEBUG
-    log.setLevel(DEBUG)
-
-    # Set the Athena configuration flags
-    from AthenaConfiguration.AllConfigFlags import ConfigFlags
-    ConfigFlags.Input.isMC = False
-    ConfigFlags.Output.HISTFileName = 'TrigHLTMonitorOutput.root'
-    
-    ConfigFlags.lock()
-
-    # Initialize configuration object, add accumulator, merge, and run.
-    from AthenaConfiguration.MainServicesConfig import MainServicesCfg 
-    from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
-    cfg = MainServicesCfg(ConfigFlags)
-    cfg.merge(PoolReadCfg(ConfigFlags))
-
-    trigHLTMonitorAcc = TrigHLTMonConfig(ConfigFlags)
-    cfg.merge(trigHLTMonitorAcc)
-
-    # If you want to turn on more detailed messages ...
-    #trigHLTMonitorAcc.getEventAlgo('TrigHLTMonAlg').OutputLevel = 2 # DEBUG
-    cfg.printConfig(withDetails=True) # set True for exhaustive info
-
-    cfg.run() #use cfg.run(20) to only run on first 20 events
-
diff --git a/Trigger/TrigMonitoring/TrigHLTMonitoring/src/TrigHLTMonitorAlgorithm.cxx b/Trigger/TrigMonitoring/TrigHLTMonitoring/src/TrigHLTMonitorAlgorithm.cxx
index fcaffe752b88f828d44332c77c8f56ebfba33d88..051c8b4cf78034efbd22b0ce5e50cdd9cb2c2b82 100644
--- a/Trigger/TrigMonitoring/TrigHLTMonitoring/src/TrigHLTMonitorAlgorithm.cxx
+++ b/Trigger/TrigMonitoring/TrigHLTMonitoring/src/TrigHLTMonitorAlgorithm.cxx
@@ -4,9 +4,12 @@
 
 #include "TrigHLTMonitorAlgorithm.h"
 
+using namespace TrigCompositeUtils;
+
 TrigHLTMonitorAlgorithm::TrigHLTMonitorAlgorithm( const std::string& name, ISvcLocator* pSvcLocator )
   : AthMonitorAlgorithm(name,pSvcLocator)
   , m_trigDecTool("Trig::TrigDecisionTool/TrigDecisionTool") 
+
 {
 }
 
@@ -28,27 +31,98 @@ StatusCode TrigHLTMonitorAlgorithm::fillHistograms( const EventContext& ctx ) co
   using namespace Monitored;
   StatusCode sc = StatusCode::FAILURE;
 
-  ////////////////////////////////////
-  // Chain monitoring
+  auto tool = getGroup("TrigHLTMonitor");
 
+  ////////////////////////////////////////
   // Declare the quantities which should be monitored
-  //NB! The variables and histograms defined here must match the ones in the py file exactly!
-  auto placeholder_ele = Monitored::Scalar<int>("placeholder_ele",0);
-  auto placeholder_hlt = Monitored::Scalar<int>("placeholder_hlt",0);
-  
-  //// Set the values of the monitored variables for the event		
-  placeholder_ele = GetEventInfo(ctx)->runNumber(); //DUMMY; to be updated.
-  placeholder_hlt = GetEventInfo(ctx)->runNumber(); //DUMMY; to be updated.
-  
+  // NB! The variables and histograms defined here must match the ones in the py file exactly!
+
+  auto HLT_ElectronsRAW = Monitored::Scalar<int>("HLT_ElectronsRAW",0);
+  auto HLT_AllChainsRAW = Monitored::Scalar<std::string>("HLT_AllChainsRAW");
+  auto L1Events = Monitored::Scalar<std::string>("L1Events");
+
+
+  ////////////////////////////////////
+  // L1 items monitoring
+
+  std::vector<std::string> L1items = m_trigDecTool->getChainGroup("L1_.*")->getListOfTriggers();
+  unsigned int nL1Items = L1items.size();
+
   // Fill. First argument is the tool (GMT) name as defined in the py file, 
   // all others are the variables to be saved.
   // Alternative fill method. Get the group yourself, and pass it to the fill function.
-  auto tool = getGroup("TrigHLTMonitor");
-  
-  fill(tool,placeholder_hlt);
-  fill(tool,placeholder_ele);
-  
+
+  ATH_MSG_INFO("Filling L1Events histogram");
+  for(unsigned int it=0; it<nL1Items; ++it) {
+    if( L1items[it] != "" ) {
+      
+      ATH_MSG_DEBUG("L1Item " << it << " " << L1items << m_trigDecTool->isPassed(L1items[it]));
+      if(m_trigDecTool->isPassed(L1items[it])) {
+	
+	/// Fill L1 histogram
+	L1Events = L1items[it];
+	ATH_MSG_DEBUG("L1Chain " << it << L1items[it]  << " is passed");
+	fill(tool,L1Events);
+      }
+    }
+  }
+
+
+  ////////////////////////////////////
+  // HLT chain monitoring
+
+  //// Set the values of the monitored variables for the event		
+  HLT_ElectronsRAW = GetEventInfo(ctx)->runNumber(); //DUMMY; to be updated.
+
+  ATH_MSG_INFO( "Filling HLT_AllChains and RoI information" );
+  std::vector< std::string > chainNames = m_trigDecTool->getChainGroup("HLT_.*")->getListOfTriggers();
+  unsigned int nHLTChains = chainNames.size();
+
+  for(unsigned int ith=0; ith<nHLTChains; ++ith) {
+    if( chainNames[ith] != "" ) {
+
+      ATH_MSG_DEBUG("HLTChain " << ith << " " << chainNames << m_trigDecTool->isPassed(chainNames[ith]));
+      if(m_trigDecTool->isPassed(chainNames[ith])) {
+	ATH_MSG_DEBUG( "    Chain " << chainNames[ith] << " IS passed");
+
+	/// Fill plain chains histogram
+	HLT_AllChainsRAW = chainNames[ith];
+	ATH_MSG_DEBUG( "Fill HLT_AllChainsRAW" ); // with " << HLT_AllChainsRAW );
+	fill(tool,HLT_AllChainsRAW);
+	
+	/// Fill RoIs histogram
+	ATH_MSG_DEBUG("Fill RoI histograms for chain " << chainNames[ith] );
+	std::vector<LinkInfo<TrigRoiDescriptorCollection>> fvec = m_trigDecTool->features<TrigRoiDescriptorCollection>(chainNames[ith], TrigDefs::Physics, "", TrigDefs::lastFeatureOfType, "initialRoI"); //initialRoiString()
+
+	//Loop over RoIs
+	for (const LinkInfo<TrigRoiDescriptorCollection>& li : fvec) {
+
+	  if( li.isValid() ) {
+	    auto phi = Monitored::Scalar("phi", 0.0);
+	    auto eta = Monitored::Scalar("eta", 0.0);
+	    auto HLT_AllChainsRoIs = Monitored::Group(tool, eta, phi); //filled when going out of scope
+
+	    const TrigRoiDescriptor* roi = *(li.link).cptr();
+    	    eta = roi->eta();
+	    phi = roi->phi();
+	    ATH_MSG_DEBUG( "RoI: eta = " << eta << ", phi = " << phi ); 
+	  }
+
+	  else {
+	    ATH_MSG_WARNING( "TrigRoiDescriptorCollection for chain " << chainNames[ith] << " is not valid");
+	  }
+
+	}//end for (const LinkInfo<TrigRoiDescriptorCollection>& li : fvec)
+      }// end if(m_trigDecTool->isPassed(chainNames[ith]))
+    }// end if( chainNames[ith] != "" )
+  }//end for(unsigned int ith=0; ith<nHLTChains; ++ith)
+
+
+  //Placeholder   
+  ATH_MSG_DEBUG( "Fill HLT_ElectronsRAW with " << HLT_ElectronsRAW );
+  fill(tool,HLT_ElectronsRAW);
   
+
   //////////////////////////////////////
   // HLTResult and ConfigConsistency
   
@@ -57,11 +131,13 @@ StatusCode TrigHLTMonitorAlgorithm::fillHistograms( const EventContext& ctx ) co
   
   //////////////////////////////////////
   // End
+  ATH_MSG_INFO( "Finalizing the TrigHLTMonitorAlgorithm..." );
   return StatusCode::SUCCESS;
 }
 
 
 StatusCode TrigHLTMonitorAlgorithm::fillResultAndConsistencyHistograms( const EventContext& ctx ) const {
+
   using namespace Monitored;
   StatusCode sc_trigDec = StatusCode::FAILURE; 
   StatusCode sc_hltResult = StatusCode::FAILURE; 
@@ -77,9 +153,6 @@ StatusCode TrigHLTMonitorAlgorithm::fillResultAndConsistencyHistograms( const Ev
   //////////////////////////////////////
   // HLTResult and ConfigConsistency
 
-  //Use the m_trigConfigSvc rather than the m_configTool. You should remove the m_configTool.
-  //But use the TrigConf::xAODConfigSvc rather than the old TrigConf::TrigConfigSvc/TrigConfigSvc
-    
   uint32_t bskeys_1 = 9999; uint32_t bskeys_2 = 9999;
   HLTResultHLT = 1; //DUMMY; to be updated.
   sc_hltResult = StatusCode::FAILURE; //no HLTResult yet
@@ -99,7 +172,9 @@ StatusCode TrigHLTMonitorAlgorithm::fillResultAndConsistencyHistograms( const Ev
   }
   else {
     //For now, this will always happen    
-    ATH_MSG_WARNING("No HLTResult found"); //Prints a warning message in the log file
+    ATH_MSG_INFO("No HLTResult monitored (because it has not been implemented yet)");
+    //FIXME: When the HLTResult IS implemented this should be a WARNING // ebergeas Sept 2020
+    //ATH_MSG_WARNING("No HLTResult found"); //Prints a warning message in the log file
     ConfigConsistency_HLT=7;
     fill(tool,ConfigConsistency_HLT); //Fills the warning bin in the ConfigConsistency histogram
     bskeys_1 = 0;
@@ -108,7 +183,6 @@ StatusCode TrigHLTMonitorAlgorithm::fillResultAndConsistencyHistograms( const Ev
 
   }
 
-  
   uint32_t bskeys[] = {bskeys_1, bskeys_2};
   uint32_t dbkeys[2];
   dbkeys[0]=m_trigConfigSvc->masterKey();
@@ -133,7 +207,6 @@ StatusCode TrigHLTMonitorAlgorithm::fillResultAndConsistencyHistograms( const Ev
     } 
   }
     
-
   fill(tool,HLTResultHLT);
 
   return StatusCode::SUCCESS;
diff --git a/Trigger/TrigMonitoring/TrigHLTMonitoring/src/TrigHLTMonitorAlgorithm.h b/Trigger/TrigMonitoring/TrigHLTMonitoring/src/TrigHLTMonitorAlgorithm.h
index c8ae56432f36af7a998a60e9ff44d20b78754e54..2b5ea0b571d7bdac71e447ff86ed452a5a91b3cb 100644
--- a/Trigger/TrigMonitoring/TrigHLTMonitoring/src/TrigHLTMonitorAlgorithm.h
+++ b/Trigger/TrigMonitoring/TrigHLTMonitoring/src/TrigHLTMonitorAlgorithm.h
@@ -5,11 +5,17 @@
 #ifndef TRIGHLTMONITORING_TRIGHLTMONITORALGORITHM_H
 #define TRIGHLTMONITORING_TRIGHLTMONITORALGORITHM_H
 
+#include <set>
+#include <string>
+#include <vector>
+
 #include "AthenaMonitoring/AthMonitorAlgorithm.h"
 #include "AthenaMonitoringKernel/Monitored.h"
 
 #include "TrigSteeringEvent/HLTResultMT.h"   
 #include "StoreGate/ReadHandleKey.h"
+#include "TrigSteeringEvent/TrigRoiDescriptor.h"
+#include "TrigSteeringEvent/TrigRoiDescriptorCollection.h"
 
 class TrigHLTMonitorAlgorithm : public AthMonitorAlgorithm {
  public:
diff --git a/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitorAlgorithm.py b/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitorAlgorithm.py
index a220da0c8d691d0d35dc4de8dfaa7a1ea23f8cee..994f265356beb1d40d11dbdd48aaf9378b191613 100644
--- a/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitorAlgorithm.py
+++ b/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitorAlgorithm.py
@@ -127,9 +127,9 @@ from JetMonitoring.JetMonitoringConfig import JetMonAlgSpec, HistoSpec, EventHis
 
 # All offline jet collections
 ExtraOfflineHists = [
-  HistoSpec('HECFrac', (50,0,1), title="HECFrac;HEC fraction;Entries" ),
-  HistoSpec('EMFrac', (50,0,1), title="EMFrac;EM fraction;Entries" ),
-  HistoSpec('Jvt', (50,-0.1,1), title="JVT;JVT;Entries" ),
+  "EMFrac",
+  "HECFrac",
+  "Jvt",
   "JVFCorr",
   "JvtRpt",
   "NumTrkPt1000[0]",
@@ -140,11 +140,11 @@ ExtraOfflineHists = [
 
 # All online small-R jet collections
 ExtraSmallROnlineHists = [
-  HistoSpec('HECFrac', (50,0,1), title="HECFrac;HEC fraction;Entries" ),
-  HistoSpec('EMFrac', (50,0,1), title="EMFrac;EM fraction;Entries" ),
-  HistoSpec('DetectorEta', (100,-5,5), title="DetectorEta;Detector #eta;Entries" ), 
-  HistoSpec('ActiveArea', (80,0,0.8), title="ActiveArea;Active Area;Entries" ), 
   HistoSpec('et:GeV;eta',  (100,0,750, 50,-5,5) , title='#eta vs E_{T};E_{T} [GeV];#eta;Entries'),
+  "EMFrac",
+  "HECFrac",
+  "DetectorEta",
+  "ActiveArea", 
   "EM3Frac",
   "Tile0Frac",
 ]
@@ -204,8 +204,11 @@ def TrigJetMonConfig(inputFlags):
   # Loop over HLT jet chains
   for chain,jetcoll in Chain2JetCollDict[InputType].items():
     # kinematic plots
-    chainMonitorConf = jetChainMonitoringConfig(inputFlags,jetcoll,chain,AthenaMT)
-    chainMonitorConf.toAlg(helper)
+    if AthenaMT:
+      chainMonitorConfT = jetChainMonitoringConfig(inputFlags,jetcoll,chain,AthenaMT,True)
+      chainMonitorConfT.toAlg(helper)
+    chainMonitorConfF = jetChainMonitoringConfig(inputFlags,jetcoll,chain,AthenaMT,False)
+    chainMonitorConfF.toAlg(helper)
     # efficiency plots
     refChain       = 'NONE'
     offlineJetColl = 'NONE'
@@ -268,7 +271,9 @@ def basicJetMonAlgSpec(jetcoll,isOnline,athenaMT):
     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('njetsPt20', (20,0,20), title='NJetsPt20;NJetsPt20;Entries' ),
+    EventHistoSpec('njets', (25,0,25), title='NJets;NJets;Entries' ),
+    EventHistoSpec('njetsPt20', (25,0,25), title='NJetsPt20;NJetsPt20;Entries' ),
+    EventHistoSpec('njetsPt50', (25,0,25), title='NJetsPt50;NJetsPt50;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):
@@ -331,7 +336,7 @@ def l1JetMonitoringConfig(inputFlags,jetcoll,chain=''):
   conf = L1JetMonAlg(name,jetcoll,chain)
   return conf
 
-def jetChainMonitoringConfig(inputFlags,jetcoll,chain,athenaMT):
+def jetChainMonitoringConfig(inputFlags,jetcoll,chain,athenaMT,onlyUsePassingJets=True):
    '''Function to configures some algorithms in the monitoring system.'''
 
    # Remap online Run 2 jet collections
@@ -347,14 +352,45 @@ def jetChainMonitoringConfig(inputFlags,jetcoll,chain,athenaMT):
    else:
      chainFolder = chain
 
-   trigConf = JetMonAlgSpec( # the usual JetMonAlgSpec
-       chain+"TrigMon",
+   if not athenaMT:
+     onlyUsePassingJets = False #does not work for legacy samples yet
+   jetMonAlgSpecName = chain+"TrigMon"
+   if not onlyUsePassingJets:
+     chainFolder = chainFolder + "/ExpertHistos"
+     jetMonAlgSpecName = jetMonAlgSpecName + "_ExpertHistos"
+
+   # Define helper functions to automatize ET & eta selection strings for NJet histograms of chains
+   def getThreshold(parts):
+     return parts[1].split('_')[0]
+
+   def getEtaRangeString(chain):
+     if 'eta' in chain:
+       etaParts    = chain.split('eta')
+       etaMinTemp  = etaParts[0].split('_')
+       etaMin      = etaMinTemp[len(etaMinTemp)-1]
+       if int(etaMin) > 0 : etaMin = str(int(int(etaMin)/10))
+       etaMax      = etaParts[1].split('_')[0]
+       if int(etaMax) > 0 : etaMax = str(int(int(etaMax)/10))
+       return 'Eta{}_{}'.format(etaMin,etaMax)
+     else: return 'Eta0_32'
+
+   def getNjetHistName(chain):
+     parts         = chain.split('j')
+     # check if it is a multi-threshold multijet chain or a single-threshold multijet chain
+     multiplicity  = parts[0].split('_')[1] # for single-threshold multijet chains
+     if (chain.count('_j')-chain.count('_jes')) > 1  or multiplicity != '':
+       return 'njetsEt{}{}'.format(getThreshold(parts),getEtaRangeString(chain))
+     else: return 'NONE'
+
+   trigConf = JetMonAlgSpec( # the usual JetMonAlgSpec 
+       jetMonAlgSpecName,
        JetContainerName = jetcoll,
        TriggerChain = chain,
        defaultPath = chainFolder,
        topLevelDir="HLT/JetMon/Online/",
        bottomLevelDir=jetcollFolder,
        failureOnMissingContainer=True,
+       onlyPassingJets=onlyUsePassingJets,
        )
    trigConf.appendHistos(
            "pt",
@@ -362,7 +398,16 @@ def jetChainMonitoringConfig(inputFlags,jetcoll,chain,athenaMT):
            "eta",
            "et",
            "phi",
+           EventHistoSpec('njets', (25,0,25), title='njets;njets;Entries' ),
+           EventHistoSpec('njetsEt20Eta0_32', (25,0,25), title='njetsEt20Eta0_32;njetsEt20Eta0_32;Entries' ),
+           EventHistoSpec('njetsEt50Eta0_32', (25,0,25), title='njetsEt50Eta0_32;njetsEt50Eta0_32;Entries' ),
    )
+   NjetHistName = getNjetHistName(chain)
+   from JetMonitoring.JetStandardHistoSpecs import knownEventVar
+   if knownEventVar.get(NjetHistName,None) is not None:
+     trigConf.appendHistos(
+       EventHistoSpec(NjetHistName, (25,0,25), title=NjetHistName+';'+NjetHistName+';Entries' ),
+     )
 
    return trigConf
 
@@ -409,6 +454,7 @@ def jetEfficiencyMonitoringConfig(inputFlags,onlinejetcoll,offlinejetcoll,chain,
        topLevelDir               = "HLT/JetMon/Online/",
        bottomLevelDir            = jetcollFolder,
        failureOnMissingContainer = True,
+       onlyPassingJets           = False,
        )
    trigConf.appendHistos(
        SelectSpec( 'eff', '{}<|eta|<{}'.format(etaMin,etaMax), chainFolder, SelectedIndex=index, FillerTools = [
@@ -442,7 +488,6 @@ def jetEfficiencyMonitoringConfig(inputFlags,onlinejetcoll,offlinejetcoll,chain,
 
    return trigConf
 
-
 if __name__=='__main__':
 
   # Read arguments
@@ -520,11 +565,13 @@ if __name__=='__main__':
 
   # Loop over HLT jet chains
   for chain,jetcoll in Chain2JetCollDict[InputType].items():
-    chainMonitorConf = jetChainMonitoringConfig(ConfigFlags,jetcoll,chain,AthenaMT)
-    chainMonitorConf.toAlg(helper)
+    if AthenaMT:
+      chainMonitorConfT = jetChainMonitoringConfig(ConfigFlags,jetcoll,chain,AthenaMT,True)
+      chainMonitorConfT.toAlg(helper)
+    chainMonitorConfF = jetChainMonitoringConfig(ConfigFlags,jetcoll,chain,AthenaMT,False)
+    chainMonitorConfF.toAlg(helper)
 
-  # Produce efficiency plots
-  for chain in Chain2JetCollDict[InputType]:
+    # Produce efficiency plots
     refChain       = 'NONE'
     offlineJetColl = 'NONE'
     if chain in TurnOnCurves[InputType]:
diff --git a/Trigger/TrigMonitoring/TrigMinBiasMonitoring/src/HLTMinBiasMonTool.cxx b/Trigger/TrigMonitoring/TrigMinBiasMonitoring/src/HLTMinBiasMonTool.cxx
index c8422a49cb086da1416a9e097b8c66cbbb802909..d01ebe5a5513971b98232d90805a1006a964e25e 100755
--- a/Trigger/TrigMonitoring/TrigMinBiasMonitoring/src/HLTMinBiasMonTool.cxx
+++ b/Trigger/TrigMonitoring/TrigMinBiasMonitoring/src/HLTMinBiasMonTool.cxx
@@ -108,9 +108,6 @@ HLTMinBiasMonTool::HLTMinBiasMonTool(const std::string & type, const std::string
 	//Lvl-2 containers
 	declareProperty("SPContainerName", m_spContainerName);
 
-	// Cut made on time over-threshold before any multiplicities are calculated.
-	declareProperty("PixelCLToTCut", m_timeOverThresholdCut = 20.);
-
 	// If set to false the trigger combination of Pixel and SCT is an OR.
 	declareProperty("TriggerTypeAND", m_triggerTypeAND = true);
 
diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoring/python/TrigMuonMonitoringConfig.py b/Trigger/TrigMonitoring/TrigMuonMonitoring/python/TrigMuonMonitoringConfig.py
index 9bb36266a5781279716c9f0abb64d4237dceaf71..14fd384f1e0a51485a0a1bf71b2fa23f620a3317 100644
--- a/Trigger/TrigMonitoring/TrigMuonMonitoring/python/TrigMuonMonitoringConfig.py
+++ b/Trigger/TrigMonitoring/TrigMuonMonitoring/python/TrigMuonMonitoringConfig.py
@@ -38,9 +38,8 @@ def TrigMuonMonitoringTool():
 
 
 def getTriggerStreamOfFile():
-	from PyUtils.MetaReaderPeeker import metadata
-	stag = metadata['triggerStreamOfFile']
-	return stag
+	from RecExConfig.RecFlags import rec
+	return rec.triggerStream()
 
 
 def setL2HypoTENames( HLTMuonMon, hltmonList):
diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/EFMuonMonConfig.py b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/EFMuonMonConfig.py
index e5a8303c0368b62126ad9f5b6875cfd2b70b2bd9..0561a361f78a55d3db02614c84fc23e6cba0f695 100644
--- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/EFMuonMonConfig.py
+++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/EFMuonMonConfig.py
@@ -5,90 +5,109 @@ import ROOT
 def EFMuonMonConfig(helper):
     
     from AthenaConfiguration.ComponentFactory import CompFactory
+
+    GroupName = 'EFMuon'
+
+    monAlg = helper.addAlgorithm(CompFactory.EFMuonMonMT,'EFMuonMonMT')
     # HLT_mu6_L1MU6 is test chain for small statistics, so it will be removed.
-    Chains = ['HLT_mu6_L1MU6', 'HLT_mu26_ivarmedium_L1MU20', 'HLT_mu50_L1MU20']
+    monAlg.MonitoredChains = ['HLT_mu6_L1MU6', 'HLT_mu26_ivarmedium_L1MU20', 'HLT_mu50_L1MU20']
+    monAlg.Group = GroupName
 
-    for chain in Chains:
+    # configuration of etaphi2D and Ratio plots for non-specific chain
+    histGroupNonSpecificChain = helper.addGroup(monAlg, GroupName, 'HLT/MuonMon/')
 
-        GroupName = 'EFMuon_'+chain
+    histGroupNonSpecificChain.defineHistogram('EFSAEta,EFSAPhi;EFSA_Eta_vs_Phi',
+                                              title='EFSA Eta vs Phi ;#eta;#phi',
+                                              type='TH2F', path='etaphi2D',xbins=108,xmin=-2.7,xmax=2.7, ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi())
 
-        monAlg = helper.addAlgorithm(CompFactory.EFMuonMonMT,'EFMuonMonMT_'+chain)
-        monAlg.MuonType = ROOT.xAOD.Muon_v1.MuonStandAlone
-        monAlg.MonitoredChains = [chain]
-        monAlg.Group = GroupName
+    histGroupNonSpecificChain.defineHistogram('EFCBEta,EFCBPhi;EFCB_Eta_vs_Phi',
+                                              title='EFCB Eta vs Phi ;#eta;#phi',
+                                              type='TH2F', path='etaphi2D',xbins=108,xmin=-2.7,xmax=2.7, ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi())
 
-        histGroup = helper.addGroup(monAlg, GroupName, 'HLT/MuonMon/EFMuon/'+chain)
-    
+    histGroupNonSpecificChain.defineHistogram('EFSAAboveCut,LB;EFSA_Over_OfflineSA_4GeV_Cut',
+                                              title='EFSA Over OfflineSA 4GeV Cut;LB;Ratio',
+                                              type='TEfficiency', path='Ratio',xbins=400,xmin=1.,xmax=801.)
+
+    histGroupNonSpecificChain.defineHistogram('EFCBAboveCut,LB;EFCB_Over_OfflineCB_4GeV_Cut',
+                                              title='EFCB Over OfflineCB 4GeV Cut;LB;Ratio',
+                                              type='TEfficiency', path='Ratio',xbins=400,xmin=1.,xmax=801.)
+
+
+    # configration for specific chain
+    for chain in monAlg.MonitoredChains:
+
+        histGroup = helper.addGroup(monAlg, GroupName+'_'+chain, 'HLT/MuonMon/EFMuon/'+chain)
     
+
         # basic EDM variables
         # EFSA
-        histGroup.defineHistogram(GroupName+'_EFSA_Pt;EFSA_Pt',
+        histGroup.defineHistogram(chain+'_EFSA_Pt;EFSA_Pt',
                                   title='EFSA Pt '+chain+';p_{T} [GeV];Events', 
                                   type='TH1F', path='',xbins=210,xmin=-105.,xmax=105.)
 
-        histGroup.defineHistogram(GroupName+'_EFSA_Eta;EFSA_Eta',
+        histGroup.defineHistogram(chain+'_EFSA_Eta;EFSA_Eta',
                                   title='EFSA Eta '+chain+';#eta;Events', 
                                   type='TH1F', path='',xbins=108,xmin=-2.7,xmax=2.7)
 
-        histGroup.defineHistogram(GroupName+'_EFSA_Phi;EFSA_Phi',
+        histGroup.defineHistogram(chain+'_EFSA_Phi;EFSA_Phi',
                                   title='EFSA Phi '+chain+';#phi;Events', 
                                   type='TH1F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi())
 
-        histGroup.defineHistogram(GroupName+'_EFSA_Eta,'+GroupName+'_EFSA_Phi;EFSA_Eta_vs_Phi',
+        histGroup.defineHistogram(chain+'_EFSA_Eta,'+chain+'_EFSA_Phi;EFSA_Eta_vs_Phi',
                                   title='EFSA Eta vs Phi '+chain+';#eta;#phi', 
                                   type='TH2F', path='',xbins=108,xmin=-2.7,xmax=2.7, ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi())
 
 
         # EFCB
-        histGroup.defineHistogram(GroupName+'_EFCB_Pt;EFCB_Pt',
+        histGroup.defineHistogram(chain+'_EFCB_Pt;EFCB_Pt',
                                   title='EFCB Pt '+chain+';p_{T} [GeV];Events', 
                                   type='TH1F', path='',xbins=210,xmin=-105.,xmax=105.)
 
-        histGroup.defineHistogram(GroupName+'_EFCB_Eta;EFCB_Eta',
+        histGroup.defineHistogram(chain+'_EFCB_Eta;EFCB_Eta',
                                   title='EFCB Eta '+chain+';#eta;Events', 
                                   type='TH1F', path='',xbins=108,xmin=-2.7,xmax=2.7)
 
-        histGroup.defineHistogram(GroupName+'_EFCB_Phi;EFCB_Phi',
+        histGroup.defineHistogram(chain+'_EFCB_Phi;EFCB_Phi',
                                   title='EFCB Phi '+chain+';#phi;Events', 
                                   type='TH1F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi())
 
-        histGroup.defineHistogram(GroupName+'_EFCB_Eta,'+GroupName+'_EFCB_Phi;EFCB_Eta_vs_Phi',
+        histGroup.defineHistogram(chain+'_EFCB_Eta,'+chain+'_EFCB_Phi;EFCB_Eta_vs_Phi',
                                   title='EFCB Eta vs Phi '+chain+';#eta;#phi', 
                                   type='TH2F', path='',xbins=108,xmin=-2.7,xmax=2.7, ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi())
 
 
         # OfflineSA
-        histGroup.defineHistogram(GroupName+'_OfflineSA_Pt;OfflineSA_Pt',
+        histGroup.defineHistogram(chain+'_OfflineSA_Pt;OfflineSA_Pt',
                                   title='OfflineSA Pt '+chain+';p_{T} [GeV];Events', 
                                   type='TH1F', path='',xbins=210,xmin=-105.,xmax=105.)
 
-        histGroup.defineHistogram(GroupName+'_OfflineSA_Eta;OfflineSA_Eta',
+        histGroup.defineHistogram(chain+'_OfflineSA_Eta;OfflineSA_Eta',
                                   title='OfflineSA Eta '+chain+';#eta;Events', 
                                   type='TH1F', path='',xbins=108,xmin=-2.7,xmax=2.7)
 
-        histGroup.defineHistogram(GroupName+'_OfflineSA_Phi;OfflineSA_Phi',
+        histGroup.defineHistogram(chain+'_OfflineSA_Phi;OfflineSA_Phi',
                                   title='OfflineSA Phi '+chain+';#phi;Events', 
                                   type='TH1F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi())
 
-        histGroup.defineHistogram(GroupName+'_OfflineSA_Eta,'+GroupName+'_OfflineSA_Phi;OfflineSA_Eta_vs_Phi',
+        histGroup.defineHistogram(chain+'_OfflineSA_Eta,'+chain+'_OfflineSA_Phi;OfflineSA_Eta_vs_Phi',
                                   title='OfflineSA Eta vs Phi '+chain+';#eta;#phi', 
                                   type='TH2F', path='',xbins=108,xmin=-2.7,xmax=2.7, ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi())
 
 
         # OfflineCB
-        histGroup.defineHistogram(GroupName+'_OfflineCB_Pt;OfflineCB_Pt',
+        histGroup.defineHistogram(chain+'_OfflineCB_Pt;OfflineCB_Pt',
                                   title='OfflineCB Pt '+chain+';p_{T} [GeV];Events', 
                                   type='TH1F', path='',xbins=210,xmin=-105.,xmax=105.)
 
-        histGroup.defineHistogram(GroupName+'_OfflineCB_Eta;OfflineCB_Eta',
+        histGroup.defineHistogram(chain+'_OfflineCB_Eta;OfflineCB_Eta',
                                   title='OfflineCB Eta '+chain+';#eta;Events', 
                                   type='TH1F', path='',xbins=108,xmin=-2.7,xmax=2.7)
 
-        histGroup.defineHistogram(GroupName+'_OfflineCB_Phi;OfflineCB_Phi',
+        histGroup.defineHistogram(chain+'_OfflineCB_Phi;OfflineCB_Phi',
                                   title='OfflineCB Phi '+chain+';#phi;Events', 
                                   type='TH1F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi())
 
-        histGroup.defineHistogram(GroupName+'_OfflineCB_Eta,'+GroupName+'_OfflineCB_Phi;OfflineCB_Eta_vs_Phi',
+        histGroup.defineHistogram(chain+'_OfflineCB_Eta,'+chain+'_OfflineCB_Phi;OfflineCB_Eta_vs_Phi',
                                   title='OfflineCB Eta vs Phi '+chain+';#eta;#phi', 
                                   type='TH2F', path='',xbins=108,xmin=-2.7,xmax=2.7, ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi())
 
@@ -96,140 +115,140 @@ def EFMuonMonConfig(helper):
 
         # correlation histograms
         # EFSA vs. OfflineSA muons
-        histGroup.defineHistogram(GroupName+'_OfflineSA_Pt,'+GroupName+'_MatchedEFSA_Pt;EFSA_OfflineSA_PtCor',
+        histGroup.defineHistogram(chain+'_OfflineSA_Pt,'+chain+'_MatchedEFSA_Pt;EFSA_OfflineSA_PtCor',
                                   title='PtCor EFSA OfflineSA '+chain+';OfflineSA p_{T} [GeV];EFSA p_{T} [GeV]',
-                                  cutmask=GroupName+'_matchedEFSA',
+                                  cutmask=chain+'_matchedEFSA',
                                   type='TH2F', path='',xbins=210,xmin=-105.,xmax=105., ybins=210,ymin=-105.,ymax=105.)
 
-        histGroup.defineHistogram(GroupName+'_OfflineSA_Phi,'+GroupName+'_MatchedEFSA_Phi;EFSA_OfflineSA_PhiCor',
+        histGroup.defineHistogram(chain+'_OfflineSA_Phi,'+chain+'_MatchedEFSA_Phi;EFSA_OfflineSA_PhiCor',
                                   title='PhiCor EFSA OfflineSA '+chain+';OfflineSA #phi;EFSA #phi',
-                                  cutmask=GroupName+'_matchedEFSA',
+                                  cutmask=chain+'_matchedEFSA',
                                   type='TH2F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi(), ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi())
 
-        histGroup.defineHistogram(GroupName+'_OfflineSA_Eta,'+GroupName+'_MatchedEFSA_Eta;EFSA_OfflineSA_EtaCor',
+        histGroup.defineHistogram(chain+'_OfflineSA_Eta,'+chain+'_MatchedEFSA_Eta;EFSA_OfflineSA_EtaCor',
                                   title='EtaCor EFSA OfflineSA '+chain+';OfflineSA #eta;EFSA #eta',
-                                  cutmask=GroupName+'_matchedEFSA',
+                                  cutmask=chain+'_matchedEFSA',
                                   type='TH2F', path='',xbins=108,xmin=-2.7,xmax=2.7, ybins=108,ymin=-2.7,ymax=2.7)
 
-        histGroup.defineHistogram(GroupName+'_SAdPt;EFSA_OfflineSA_dPt',
+        histGroup.defineHistogram(chain+'_SAdPt;EFSA_OfflineSA_dPt',
                                   title='dPt EFSA OfflineSA '+chain+';dPt [GeV];Events', 
-                                  cutmask=GroupName+'_matchedEFSA',
+                                  cutmask=chain+'_matchedEFSA',
                                   type='TH1F', path='',xbins=100,xmin=-10.,xmax=10.)
 
-        histGroup.defineHistogram(GroupName+'_SAdEta;EFSA_OfflineSA_dEta',
+        histGroup.defineHistogram(chain+'_SAdEta;EFSA_OfflineSA_dEta',
                                   title='dEta EFSA OfflineSA '+chain+';dEta;Events', 
-                                  cutmask=GroupName+'_matchedEFSA',
+                                  cutmask=chain+'_matchedEFSA',
                                   type='TH1F', path='',xbins=200,xmin=-5.,xmax=5.)
 
-        histGroup.defineHistogram(GroupName+'_SAdPhi;EFSA_OfflineSA_dPhi',
+        histGroup.defineHistogram(chain+'_SAdPhi;EFSA_OfflineSA_dPhi',
                                   title='dPhi EFSA OfflineSA '+chain+';dPhi;Events', 
-                                  cutmask=GroupName+'_matchedEFSA',
+                                  cutmask=chain+'_matchedEFSA',
                                   type='TH1F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi())
 
-        histGroup.defineHistogram(GroupName+'_SAdR;EFSA_OfflineSA_dR',
+        histGroup.defineHistogram(chain+'_SAdR;EFSA_OfflineSA_dR',
                                   title='dR EFSA OfflineSA '+chain+';dR;Events', 
-                                  cutmask=GroupName+'_matchedEFSA',
+                                  cutmask=chain+'_matchedEFSA',
                                   type='TH1F', path='',xbins=110,xmin=0.,xmax=11.)
 
-        histGroup.defineHistogram(GroupName+'_OfflineSA_Pt;OfflineSA_Pt_AwareEFSA',
+        histGroup.defineHistogram(chain+'_OfflineSA_Pt;OfflineSA_Pt_AwareEFSA',
                                   title='OfflineSA Pt AwareEFSA '+chain+';OfflineSA p_{T} [GeV];Events',
-                                  cutmask=GroupName+'_matchedEFSA',
+                                  cutmask=chain+'_matchedEFSA',
                                   type='TH1F', path='',xbins=210,xmin=-105.,xmax=105.)
 
-        histGroup.defineHistogram(GroupName+'_OfflineSA_Phi;OfflineSA_Phi_AwareEFSA',
+        histGroup.defineHistogram(chain+'_OfflineSA_Phi;OfflineSA_Phi_AwareEFSA',
                                   title='OfflineSA Phi AwareEFSA '+chain+';OfflineSA #phi;Events',
-                                  cutmask=GroupName+'_matchedEFSA',
+                                  cutmask=chain+'_matchedEFSA',
                                   type='TH1F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi())
 
-        histGroup.defineHistogram(GroupName+'_OfflineSA_Eta;OfflineSA_Eta_AwareEFSA',
+        histGroup.defineHistogram(chain+'_OfflineSA_Eta;OfflineSA_Eta_AwareEFSA',
                                   title='OfflineSA Eta AwareEFSA '+chain+';OfflineSA #eta;Events',
-                                  cutmask=GroupName+'_matchedEFSA',
+                                  cutmask=chain+'_matchedEFSA',
                                   type='TH1F', path='',xbins=108,xmin=-2.7,xmax=2.7)
 
 
         # OfflineSA (matched to EFSA) vs. OfflineSA (matched to L2SA)
-        histGroup.defineHistogram(GroupName+'_OfflineSA_Pt,'+GroupName+'_OfflineSAmatchedL2SA_Pt;OfflineSA_matchedEFSA_matchedL2SA_PtCor',
+        histGroup.defineHistogram(chain+'_OfflineSA_Pt,'+chain+'_OfflineSAmatchedL2SA_Pt;OfflineSA_matchedEFSA_matchedL2SA_PtCor',
                                   title='PtCor OfflineSA (matched to EFSA) vs. OfflineSA (matched to L2SA) '+chain+';OfflineSA matched to EFSA p_{T} [GeV];OfflineSA matched to L2SA p_{T} [GeV]',
-                                  cutmask=GroupName+'_matchedL2SA',
+                                  cutmask=chain+'_matchedL2SA',
                                   type='TH2F', path='',xbins=210,xmin=-105.,xmax=105., ybins=210,ymin=-105.,ymax=105.)
 
-        histGroup.defineHistogram(GroupName+'_OfflineSA_Phi,'+GroupName+'_OfflineSAmatchedL2SA_Phi;OfflineSA_matchedEFSA_matchedL2SA_PhiCor',
+        histGroup.defineHistogram(chain+'_OfflineSA_Phi,'+chain+'_OfflineSAmatchedL2SA_Phi;OfflineSA_matchedEFSA_matchedL2SA_PhiCor',
                                   title='PhiCor OfflineSA (matched to EFSA) vs. OfflineSA (matched to L2SA) '+chain+';OfflineSA matched to EFSA #phi;OfflineSA matched to L2SA #phi',
-                                  cutmask=GroupName+'_matchedL2SA',
+                                  cutmask=chain+'_matchedL2SA',
                                   type='TH2F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi(), ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi())
 
-        histGroup.defineHistogram(GroupName+'_OfflineSA_Eta,'+GroupName+'_OfflineSAmatchedL2SA_Eta;OfflineSA_matchedEFSA_matchedL2SA_EtaCor',
+        histGroup.defineHistogram(chain+'_OfflineSA_Eta,'+chain+'_OfflineSAmatchedL2SA_Eta;OfflineSA_matchedEFSA_matchedL2SA_EtaCor',
                                   title='EtaCor OfflineSA (matched to EFSA) vs. OfflineSA (matched to L2SA) '+chain+';OfflineSA matched to EFSA #eta;OfflineSA matched to L2SA #eta',
-                                  cutmask=GroupName+'_matchedL2SA',
+                                  cutmask=chain+'_matchedL2SA',
                                   type='TH2F', path='',xbins=108,xmin=-2.7,xmax=2.7, ybins=108,ymin=-2.7,ymax=2.7)
 
 
         # EFCB vs. OfflineCB muons
-        histGroup.defineHistogram(GroupName+'_OfflineCB_Pt,'+GroupName+'_MatchedEFCB_Pt;EFCB_OfflineCB_PtCor',
+        histGroup.defineHistogram(chain+'_OfflineCB_Pt,'+chain+'_MatchedEFCB_Pt;EFCB_OfflineCB_PtCor',
                                   title='PtCor EFCB OfflineCB '+chain+';OfflineCB p_{T} [GeV];EFCB p_{T} [GeV];',
-                                  cutmask=GroupName+'_matchedEFCB',
+                                  cutmask=chain+'_matchedEFCB',
                                   type='TH2F', path='',xbins=210,xmin=-105.,xmax=105., ybins=210,ymin=-105.,ymax=105.)
 
-        histGroup.defineHistogram(GroupName+'_OfflineCB_Phi,'+GroupName+'_MatchedEFCB_Phi;EFCB_OfflineCB_PhiCor',
+        histGroup.defineHistogram(chain+'_OfflineCB_Phi,'+chain+'_MatchedEFCB_Phi;EFCB_OfflineCB_PhiCor',
                                   title='PhiCor EFCB OfflineCB '+chain+';OfflineCB #phi;EFCB #phi;',
-                                  cutmask=GroupName+'_matchedEFCB',
+                                  cutmask=chain+'_matchedEFCB',
                                   type='TH2F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi(), ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi())
 
-        histGroup.defineHistogram(GroupName+'_OfflineCB_Eta,'+GroupName+'_MatchedEFCB_Eta;EFCB_OfflineCB_EtaCor',
+        histGroup.defineHistogram(chain+'_OfflineCB_Eta,'+chain+'_MatchedEFCB_Eta;EFCB_OfflineCB_EtaCor',
                                   title='EtaCor EFCB OfflineCB '+chain+';OfflineCB #eta;EFCB #eta;',
-                                  cutmask=GroupName+'_matchedEFCB',
+                                  cutmask=chain+'_matchedEFCB',
                                   type='TH2F', path='',xbins=108,xmin=-2.7,xmax=2.7, ybins=108,ymin=-2.7,ymax=2.7)
 
-        histGroup.defineHistogram(GroupName+'_CBdPt;EFCB_OfflineCB_dPt',
+        histGroup.defineHistogram(chain+'_CBdPt;EFCB_OfflineCB_dPt',
                                   title='dPt EFCB OfflineCB '+chain+';dPt [GeV];Events', 
-                                  cutmask=GroupName+'_matchedEFCB',
+                                  cutmask=chain+'_matchedEFCB',
                                   type='TH1F', path='',xbins=100,xmin=-10.,xmax=10.)
 
-        histGroup.defineHistogram(GroupName+'_CBdEta;EFCB_OfflineCB_dEta',
+        histGroup.defineHistogram(chain+'_CBdEta;EFCB_OfflineCB_dEta',
                                   title='dEta EFCB OfflineCB '+chain+';dEta;Events', 
-                                  cutmask=GroupName+'_matchedEFCB',
+                                  cutmask=chain+'_matchedEFCB',
                                   type='TH1F', path='',xbins=200,xmin=-5.,xmax=5.)
 
-        histGroup.defineHistogram(GroupName+'_CBdPhi;EFCB_OfflineCB_dPhi',
+        histGroup.defineHistogram(chain+'_CBdPhi;EFCB_OfflineCB_dPhi',
                                   title='dPhi EFCB OfflineCB '+chain+';dPhi;Events', 
-                                  cutmask=GroupName+'_matchedEFCB',
+                                  cutmask=chain+'_matchedEFCB',
                                   type='TH1F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi())
 
-        histGroup.defineHistogram(GroupName+'_CBdR;EFCB_OfflineCB_dR',
+        histGroup.defineHistogram(chain+'_CBdR;EFCB_OfflineCB_dR',
                                   title='dR EFCB OfflineCB '+chain+';dR;Events', 
-                                  cutmask=GroupName+'_matchedEFCB',
+                                  cutmask=chain+'_matchedEFCB',
                                   type='TH1F', path='',xbins=110,xmin=0.,xmax=11.)
 
-        histGroup.defineHistogram(GroupName+'_OfflineCB_Pt;OfflineCB_Pt_AwareEFCB',
+        histGroup.defineHistogram(chain+'_OfflineCB_Pt;OfflineCB_Pt_AwareEFCB',
                                   title='OfflineCB Pt AwareEFCB '+chain+';OfflineCB p_{T} [GeV];Events',
-                                  cutmask=GroupName+'_matchedEFCB',
+                                  cutmask=chain+'_matchedEFCB',
                                   type='TH1F', path='',xbins=210,xmin=-105.,xmax=105.)
 
-        histGroup.defineHistogram(GroupName+'_OfflineCB_Phi;OfflineCB_Phi_AwareEFCB',
+        histGroup.defineHistogram(chain+'_OfflineCB_Phi;OfflineCB_Phi_AwareEFCB',
                                   title='OfflineCB Phi AwareEFCB '+chain+';OfflineCB #phi;Events',
-                                  cutmask=GroupName+'_matchedEFCB',
+                                  cutmask=chain+'_matchedEFCB',
                                   type='TH1F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi())
 
-        histGroup.defineHistogram(GroupName+'_OfflineCB_Eta;OfflineCB_Eta_AwareEFCB',
+        histGroup.defineHistogram(chain+'_OfflineCB_Eta;OfflineCB_Eta_AwareEFCB',
                                   title='OfflineCB Eta AwareEFCB '+chain+';OfflineCB #eta;Events',
-                                  cutmask=GroupName+'_matchedEFCB',
+                                  cutmask=chain+'_matchedEFCB',
                                   type='TH1F', path='',xbins=108,xmin=-2.7,xmax=2.7)
 
 
         # OfflineCB (matched to EFCB) vs. OfflineCB (matched to L2CB)
-        histGroup.defineHistogram(GroupName+'_OfflineCB_Pt,'+GroupName+'_OfflineCBmatchedL2CB_Pt;OfflineCB_matchedEFCB_matchedL2CB_PtCor',
+        histGroup.defineHistogram(chain+'_OfflineCB_Pt,'+chain+'_OfflineCBmatchedL2CB_Pt;OfflineCB_matchedEFCB_matchedL2CB_PtCor',
                                   title='PtCor OfflineCB (matched to EFCB) vs. OfflineCB (matched to L2CB) '+chain+';OfflineCB matched to EFCB p_{T} [GeV];OfflineCB matched to L2CB p_{T} [GeV]',
-                                  cutmask=GroupName+'_matchedL2CB',
+                                  cutmask=chain+'_matchedL2CB',
                                   type='TH2F', path='',xbins=210,xmin=-105.,xmax=105., ybins=210,ymin=-105.,ymax=105.)
 
-        histGroup.defineHistogram(GroupName+'_OfflineCB_Phi,'+GroupName+'_OfflineCBmatchedL2CB_Phi;OfflineCB_matchedEFCB_matchedL2CB_PhiCor',
+        histGroup.defineHistogram(chain+'_OfflineCB_Phi,'+chain+'_OfflineCBmatchedL2CB_Phi;OfflineCB_matchedEFCB_matchedL2CB_PhiCor',
                                   title='PhiCor OfflineCB (matched to EFCB) vs. OfflineCB (matched to L2CB) '+chain+';OfflineCB matched to EFCB #phi;OfflineCB matched to L2CB #phi',
-                                  cutmask=GroupName+'_matchedL2CB',
+                                  cutmask=chain+'_matchedL2CB',
                                   type='TH2F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi(), ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi())
 
-        histGroup.defineHistogram(GroupName+'_OfflineCB_Eta,'+GroupName+'_OfflineCBmatchedL2CB_Eta;OfflineCB_matchedEFCB_matchedL2CB_EtaCor',
+        histGroup.defineHistogram(chain+'_OfflineCB_Eta,'+chain+'_OfflineCBmatchedL2CB_Eta;OfflineCB_matchedEFCB_matchedL2CB_EtaCor',
                                   title='EtaCor OfflineCB (matched to EFCB) vs. OfflineCB (matched to L2CB) '+chain+';OfflineCB matched to EFCB #eta;OfflineCB matched to L2CB #eta',
-                                  cutmask=GroupName+'_matchedL2CB',
+                                  cutmask=chain+'_matchedL2CB',
                                   type='TH2F', path='',xbins=108,xmin=-2.7,xmax=2.7, ybins=108,ymin=-2.7,ymax=2.7)
 
     return
diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L1MuonMonConfig.py b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L1MuonMonConfig.py
index 6e1713a725f46291828016e2d1350935e6670182..740775e1965572040f322fe3b3b1be366430e8bd 100644
--- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L1MuonMonConfig.py
+++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L1MuonMonConfig.py
@@ -7,12 +7,13 @@ def L1MuonMonConfig(helper):
     monAlg = helper.addAlgorithm(CompFactory.L1MuonMonMT,'L1MuonMonMT')
 
 
-    histGroup = helper.addGroup(monAlg, 'L1MuonMonMT', 'HLT/MuonMon/L1Muon')
+    histGroup = helper.addGroup(monAlg, 'L1MuonMonMT', 'HLT/MuonMon/')
 
 
     import ROOT
-    histGroup.defineHistogram('l1Thres',title='L1Muon Thresholds;L1 threshold number;Events', type='TH1F', path='',xbins=6,xmin=1.0,xmax=7.0)
-    histGroup.defineHistogram('l1Eta',title='L1Muon Eta;#eta;Events', type='TH1F', path='',xbins=25,xmin=-3.0,xmax=3.0)
-    histGroup.defineHistogram('l1Phi',title='L1Muon Phi;#phi;Events', type='TH1F', path='',xbins=25,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi())
+    histGroup.defineHistogram('l1Thres',title='L1Muon Thresholds;L1 threshold number;Events', type='TH1F', path='L1Muon',xbins=6,xmin=1.0,xmax=7.0)
+    histGroup.defineHistogram('l1Eta',title='L1Muon Eta;#eta;Events', type='TH1F', path='L1Muon',xbins=25,xmin=-3.0,xmax=3.0)
+    histGroup.defineHistogram('l1Phi',title='L1Muon Phi;#phi;Events', type='TH1F', path='L1Muon',xbins=25,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi())
+    histGroup.defineHistogram('l1Eta,l1Phi;L1Muon_Eta_vs_Phi',title='L1Muon Eta vs Phi;#eta;#phi;Events', type='TH2F', path='etaphi2D',xbins=108,xmin=-2.7,xmax=2.7, ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi())
 
     return
diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L2MuonSAMonConfig.py b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L2MuonSAMonConfig.py
index 849df16bc87738d9a7e6787594d1464c6567dd37..c28dd2979f506cafd178f7aa536b3834271f20f5 100644
--- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L2MuonSAMonConfig.py
+++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L2MuonSAMonConfig.py
@@ -1,459 +1,472 @@
 #  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
+import ROOT
 
 def L2MuonSAMonConfig(helper):
     
     from AthenaConfiguration.ComponentFactory import CompFactory
+
+    GroupName = 'L2MuonSA'
+
+    monAlg = helper.addAlgorithm(CompFactory.L2MuonSAMonMT,'L2MuonSAMonMT')
     # HLT_mu6_L1MU6 is test chain for small statistics, so it will be removed.
-    Chains = ['HLT_mu6_L1MU6', 'HLT_mu26_ivarmedium_L1MU20']
+    monAlg.MonitoredChains = ['HLT_mu6_L1MU6', 'HLT_mu26_ivarmedium_L1MU20']
+    monAlg.Group = GroupName
+
+    # configuration of etaphi2D and Ratio plots for non-specific chain
+    histGroupNonSpecificChain = helper.addGroup(monAlg, GroupName, 'HLT/MuonMon/')
 
-    for chain in Chains:
+    histGroupNonSpecificChain.defineHistogram('L2SAEta,L2SAPhi;L2MuonSA_Eta_vs_Phi',
+                                              title='L2MuonSA Eta vs Phi ;#eta;#phi',
+                                              type='TH2F', path='etaphi2D',xbins=108,xmin=-2.7,xmax=2.7, ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi())
 
-        GroupName = 'L2MuonSA_'+chain
+    histGroupNonSpecificChain.defineHistogram('L2SAAboveCut,LB;L2MuonSA_Over_OfflineSA_4GeV_Cut',
+                                              title='L2MuonSA Over OfflineSA 4GeV Cut;LB;Ratio', 
+                                              type='TEfficiency', path='Ratio',xbins=400,xmin=1.,xmax=801.)
 
-        monAlg = helper.addAlgorithm(CompFactory.L2MuonSAMonMT,'L2MuonSAMonMT_'+chain)
-        monAlg.MonitoredChains = [chain]
-        monAlg.Group = GroupName
 
-        histGroup = helper.addGroup(monAlg, GroupName, 'HLT/MuonMon/L2MuonSA/'+chain)
+    # configration for specific chain
+    for chain in monAlg.MonitoredChains:
+
+        histGroup = helper.addGroup(monAlg, GroupName+'_'+chain, 'HLT/MuonMon/L2MuonSA/'+chain)
     
     
-        import ROOT
         # basic EDM variables
-        histGroup.defineHistogram(GroupName+'_Pt;L2MuonSA_Pt',
+        histGroup.defineHistogram(chain+'_Pt;L2MuonSA_Pt',
                                   title='L2MuonSA Pt '+chain+';p_{T} [GeV];Events', 
                                   type='TH1F', path='',xbins=210,xmin=-105.,xmax=105.)
 
-        histGroup.defineHistogram(GroupName+'_Pt;L2MuonSA_Pt_Barrel',
+        histGroup.defineHistogram(chain+'_Pt;L2MuonSA_Pt_Barrel',
                                   title='L2MuonSA Pt Barrel '+chain+';p_{T} [GeV];Events', 
-                                  cutmask=GroupName+'_isBarrel',
+                                  cutmask=chain+'_isBarrel',
                                   type='TH1F', path='',xbins=210,xmin=-105.,xmax=105.)
 
-        histGroup.defineHistogram(GroupName+'_Pt;L2MuonSA_Pt_Endcap',
+        histGroup.defineHistogram(chain+'_Pt;L2MuonSA_Pt_Endcap',
                                   title='L2MuonSA Pt Endcap '+chain+';p_{T} [GeV];Events',
-                                  cutmask=GroupName+'_isEndcap',
+                                  cutmask=chain+'_isEndcap',
                                   type='TH1F', path='',xbins=210,xmin=-105.,xmax=105.)
 
-        histGroup.defineHistogram(GroupName+'_Eta;L2MuonSA_Eta',
+        histGroup.defineHistogram(chain+'_Eta;L2MuonSA_Eta',
                                   title='L2MuonSA Eta '+chain+';#eta;Events', 
                                   type='TH1F', path='',xbins=108,xmin=-2.7,xmax=2.7)
 
-        histGroup.defineHistogram(GroupName+'_Phi;L2MuonSA_Phi',
+        histGroup.defineHistogram(chain+'_Phi;L2MuonSA_Phi',
                                   title='L2MuonSA Phi '+chain+';#phi;Events', 
                                   type='TH1F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi())
 
-        histGroup.defineHistogram(GroupName+'_Phi;L2MuonSA_Phi_Barrel',
+        histGroup.defineHistogram(chain+'_Phi;L2MuonSA_Phi_Barrel',
                                   title='L2MuonSA Phi Barrel '+chain+';#phi;Events', 
-                                  cutmask=GroupName+'_isBarrel',
+                                  cutmask=chain+'_isBarrel',
                                   type='TH1F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi())
 
-        histGroup.defineHistogram(GroupName+'_Phi;L2MuonSA_Phi_Endcap',
+        histGroup.defineHistogram(chain+'_Phi;L2MuonSA_Phi_Endcap',
                                   title='L2MuonSA Phi Endcap '+chain+';#phi;Events', 
-                                  cutmask=GroupName+'_isEndcap',
+                                  cutmask=chain+'_isEndcap',
                                   type='TH1F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi())
 
-        histGroup.defineHistogram(GroupName+'_Eta,'+GroupName+'_Phi;L2MuonSA_Eta_vs_Phi',
+        histGroup.defineHistogram(chain+'_Eta,'+chain+'_Phi;L2MuonSA_Eta_vs_Phi',
                                   title='L2MuonSA Eta vs Phi '+chain+';#eta;#phi', 
                                   type='TH2F', path='',xbins=108,xmin=-2.7,xmax=2.7, ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi())
 
 
 
         # position and superpoint
-        histGroup.defineHistogram(GroupName+'_saddr;L2MuonSA_saddr',
+        histGroup.defineHistogram(chain+'_saddr;L2MuonSA_saddr',
                                   title='L2MuonSA station address '+chain+';address;Events',
                                   type='TH1I', path='',xbins=6,xmin=-1,xmax=5)
 
-        histGroup.defineHistogram(GroupName+'_MDTpoints_z,'+GroupName+'_MDTpoints_r;L2MuonSA_MDTpoints_z_vs_r',
+        histGroup.defineHistogram(chain+'_MDTpoints_z,'+chain+'_MDTpoints_r;L2MuonSA_MDTpoints_z_vs_r',
                                   title='L2MuonSA MDT superpoint Z vs R (mm) '+chain+';Z[mm];R[mm]', 
                                   type='TH2F', path='',xbins=200,xmin=-24000,xmax=24000, ybins=200,ymin=-14000,ymax=14000)
 
 
 
         # L1 RoI eta vs. phi in case mF failed
-        histGroup.defineHistogram(GroupName+'_roiEta,'+GroupName+'_roiPhi;L2MuonSA_failed_L1_eta_vs_phi',
+        histGroup.defineHistogram(chain+'_roiEta,'+chain+'_roiPhi;L2MuonSA_failed_L1_eta_vs_phi',
                                   title='L1 RoI Eta vs. Phi in case of L2MuonSA failure '+chain+';#eta;#phi', 
-                                  cutmask=GroupName+'_mf_failure',
+                                  cutmask=chain+'_mf_failure',
                                   type='TH2F', path='',xbins=108,xmin=-2.7,xmax=2.7, ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi())
 
 
 
         # MuonFeatureDetails
         # process floe
-        histGroup.defineHistogram(GroupName+'_proc_flow;L2MuonSA_proc_flow',
+        histGroup.defineHistogram(chain+'_proc_flow;L2MuonSA_proc_flow',
                                   title='L2MuonSA process flow '+chain+';;Events', 
                                   type='TH1I', path='',xbins=6,xmin=1,xmax=7,
                                   xlabels=["input","n L1 hits > 0","L1 emu ok at trigger layer","n MDT hits > 0 at middle layer","MDT fit ok at middle layer","MDT fit ok at >= 2 layers"])
 
 
         # RPC
-        histGroup.defineHistogram(GroupName+'_RPC_Pad_N;L2MuonSA_RPC_Pad_N',
+        histGroup.defineHistogram(chain+'_RPC_Pad_N;L2MuonSA_RPC_Pad_N',
                                   title='L2MuonSA RPC number of hits '+chain+';RPC number of hits;Events', 
-                                  cutmask=GroupName+'_isBarrel',
+                                  cutmask=chain+'_isBarrel',
                                   type='TH1I', path='',xbins=20,xmin=0,xmax=20)
 
 
         # TGC
-        histGroup.defineHistogram(GroupName+'_TGC_Mid_rho_chi2;L2MuonSA_TGC_Mid_rho_chi2',
+        histGroup.defineHistogram(chain+'_TGC_Mid_rho_chi2;L2MuonSA_TGC_Mid_rho_chi2',
                                   title='L2MuonSA TGC big wheel rho fit chi2 '+chain+';chi2;Events', 
-                                  cutmask=GroupName+'_isEndcap',
+                                  cutmask=chain+'_isEndcap',
                                   type='TH1F', path='',xbins=100,xmin=0,xmax=10)
 
-        histGroup.defineHistogram(GroupName+'_TGC_Mid_phi_chi2;L2MuonSA_TGC_Mid_phi_chi2',
+        histGroup.defineHistogram(chain+'_TGC_Mid_phi_chi2;L2MuonSA_TGC_Mid_phi_chi2',
                                   title='L2MuonSA TGC big wheel phi fit chi2 '+chain+';chi2;Events', 
-                                  cutmask=GroupName+'_isEndcap',
+                                  cutmask=chain+'_isEndcap',
                                   type='TH1F', path='',xbins=100,xmin=0,xmax=10)
 
-        histGroup.defineHistogram(GroupName+'_TGC_Mid_rho_N;L2MuonSA_TGC_Mid_rho_N',
+        histGroup.defineHistogram(chain+'_TGC_Mid_rho_N;L2MuonSA_TGC_Mid_rho_N',
                                   title='L2MuonSA TGC big wheel number of hits in rho '+chain+';TGC BW rho nhits;Events', 
-                                  cutmask=GroupName+'_isEndcap',
+                                  cutmask=chain+'_isEndcap',
                                   type='TH1I', path='',xbins=20,xmin=0,xmax=20)
 
-        histGroup.defineHistogram(GroupName+'_TGC_Mid_phi_N;L2MuonSA_TGC_Mid_phi_N',
+        histGroup.defineHistogram(chain+'_TGC_Mid_phi_N;L2MuonSA_TGC_Mid_phi_N',
                                   title='L2MuonSA TGC big wheel number of hits in phi '+chain+';TGC BW phi nhits;Events', 
-                                  cutmask=GroupName+'_isEndcap',
+                                  cutmask=chain+'_isEndcap',
                                   type='TH1I', path='',xbins=20,xmin=0,xmax=20)
 
 
         # MDT
-        histGroup.defineHistogram(GroupName+'_MDT_Inn_fit_chi2;L2MuonSA_MDT_Inn_fit_chi2_barrel',
+        histGroup.defineHistogram(chain+'_MDT_Inn_fit_chi2;L2MuonSA_MDT_Inn_fit_chi2_barrel',
                                   title='L2MuonSA barrel MDT Inner station fit chi2 '+chain+';chi2;Events', 
-                                  cutmask=GroupName+'_isBarrel',
+                                  cutmask=chain+'_isBarrel',
                                   type='TH1F', path='',xbins=100,xmin=0,xmax=10)
 
-        histGroup.defineHistogram(GroupName+'_MDT_Mid_fit_chi2;L2MuonSA_MDT_Mid_fit_chi2_barrel',
+        histGroup.defineHistogram(chain+'_MDT_Mid_fit_chi2;L2MuonSA_MDT_Mid_fit_chi2_barrel',
                                   title='L2MuonSA barrel MDT Middle station fit chi2 '+chain+';chi2;Events', 
-                                  cutmask=GroupName+'_isBarrel',
+                                  cutmask=chain+'_isBarrel',
                                   type='TH1F', path='',xbins=100,xmin=0,xmax=10)
 
-        histGroup.defineHistogram(GroupName+'_MDT_Out_fit_chi2;L2MuonSA_MDT_Out_fit_chi2_barrel',
+        histGroup.defineHistogram(chain+'_MDT_Out_fit_chi2;L2MuonSA_MDT_Out_fit_chi2_barrel',
                                   title='L2MuonSA barrel MDT Outer station fit chi2 '+chain+';chi2;Events', 
-                                  cutmask=GroupName+'_isBarrel',
+                                  cutmask=chain+'_isBarrel',
                                   type='TH1F', path='',xbins=100,xmin=0,xmax=10)
 
-        histGroup.defineHistogram(GroupName+'_MDT_Inn_fit_chi2;L2MuonSA_MDT_Inn_fit_chi2_endcap',
+        histGroup.defineHistogram(chain+'_MDT_Inn_fit_chi2;L2MuonSA_MDT_Inn_fit_chi2_endcap',
                                   title='L2MuonSA endcap MDT Inner station fit chi2 '+chain+';chi2;Events', 
-                                  cutmask=GroupName+'_isEndcap',
+                                  cutmask=chain+'_isEndcap',
                                   type='TH1F', path='',xbins=100,xmin=0,xmax=10)
 
-        histGroup.defineHistogram(GroupName+'_MDT_Mid_fit_chi2;L2MuonSA_MDT_Mid_fit_chi2_endcap',
+        histGroup.defineHistogram(chain+'_MDT_Mid_fit_chi2;L2MuonSA_MDT_Mid_fit_chi2_endcap',
                                   title='L2MuonSA endcap MDT Middle station fit chi2 '+chain+';chi2;Events', 
-                                  cutmask=GroupName+'_isEndcap',
+                                  cutmask=chain+'_isEndcap',
                                   type='TH1F', path='',xbins=100,xmin=0,xmax=10)
 
-        histGroup.defineHistogram(GroupName+'_MDT_Out_fit_chi2;L2MuonSA_MDT_Out_fit_chi2_endcap',
+        histGroup.defineHistogram(chain+'_MDT_Out_fit_chi2;L2MuonSA_MDT_Out_fit_chi2_endcap',
                                   title='L2MuonSA endcap MDT Outer station fit chi2 '+chain+';chi2;Events', 
-                                  cutmask=GroupName+'_isEndcap',
+                                  cutmask=chain+'_isEndcap',
                                   type='TH1F', path='',xbins=100,xmin=0,xmax=10)
 
-        histGroup.defineHistogram(GroupName+'_MDT_N;L2MuonSA_MDT_N_barrel',
+        histGroup.defineHistogram(chain+'_MDT_N;L2MuonSA_MDT_N_barrel',
                                   title='L2MuonSA barrel MDT number of hits '+chain+';MDT nhits;Events', 
-                                  cutmask=GroupName+'_isBarrel',
+                                  cutmask=chain+'_isBarrel',
                                   type='TH1I', path='',xbins=40,xmin=0,xmax=40)
 
-        histGroup.defineHistogram(GroupName+'_MDT_Inn_N;L2MuonSA_MDT_Inn_N_barrel',
+        histGroup.defineHistogram(chain+'_MDT_Inn_N;L2MuonSA_MDT_Inn_N_barrel',
                                   title='L2MuonSA barrel MDT Inner number of hits '+chain+';MDT nhits Inner;Events', 
-                                  cutmask=GroupName+'_isBarrel',
+                                  cutmask=chain+'_isBarrel',
                                   type='TH1I', path='',xbins=40,xmin=0,xmax=40)
 
-        histGroup.defineHistogram(GroupName+'_MDT_Mid_N;L2MuonSA_MDT_Mid_N_barrel',
+        histGroup.defineHistogram(chain+'_MDT_Mid_N;L2MuonSA_MDT_Mid_N_barrel',
                                   title='L2MuonSA barrel MDT Middle number of hits '+chain+';MDT nhits Middle;Events', 
-                                  cutmask=GroupName+'_isBarrel',
+                                  cutmask=chain+'_isBarrel',
                                   type='TH1I', path='',xbins=40,xmin=0,xmax=40)
 
-        histGroup.defineHistogram(GroupName+'_MDT_Out_N;L2MuonSA_MDT_Out_N_barrel',
+        histGroup.defineHistogram(chain+'_MDT_Out_N;L2MuonSA_MDT_Out_N_barrel',
                                   title='L2MuonSA barrel MDT Outer number of hits '+chain+';MDT nhits Outer;Events', 
-                                  cutmask=GroupName+'_isBarrel',
+                                  cutmask=chain+'_isBarrel',
                                   type='TH1I', path='',xbins=40,xmin=0,xmax=40)
 
-        histGroup.defineHistogram(GroupName+'_MDT_N;L2MuonSA_MDT_N_endcap',
+        histGroup.defineHistogram(chain+'_MDT_N;L2MuonSA_MDT_N_endcap',
                                   title='L2MuonSA endcap MDT number of hits '+chain+';MDT nhits;Events', 
-                                  cutmask=GroupName+'_isEndcap',
+                                  cutmask=chain+'_isEndcap',
                                   type='TH1I', path='',xbins=40,xmin=0,xmax=40)
 
-        histGroup.defineHistogram(GroupName+'_MDT_Inn_N;L2MuonSA_MDT_Inn_N_endcap',
+        histGroup.defineHistogram(chain+'_MDT_Inn_N;L2MuonSA_MDT_Inn_N_endcap',
                                   title='L2MuonSA endcap MDT Inner number of hits '+chain+';MDT nhits Inner;Events', 
-                                  cutmask=GroupName+'_isEndcap',
+                                  cutmask=chain+'_isEndcap',
                                   type='TH1I', path='',xbins=40,xmin=0,xmax=40)
 
-        histGroup.defineHistogram(GroupName+'_MDT_Mid_N;L2MuonSA_MDT_Mid_N_endcap',
+        histGroup.defineHistogram(chain+'_MDT_Mid_N;L2MuonSA_MDT_Mid_N_endcap',
                                   title='L2MuonSA endcap MDT Middle number of hits '+chain+';MDT nhits Middle;Events', 
-                                  cutmask=GroupName+'_isEndcap',
+                                  cutmask=chain+'_isEndcap',
                                   type='TH1I', path='',xbins=40,xmin=0,xmax=40)
 
-        histGroup.defineHistogram(GroupName+'_MDT_Out_N;L2MuonSA_MDT_Out_N_endcap',
+        histGroup.defineHistogram(chain+'_MDT_Out_N;L2MuonSA_MDT_Out_N_endcap',
                                   title='L2MuonSA endcap MDT Outer number of hits '+chain+';MDT nhits Outer;Events', 
-                                  cutmask=GroupName+'_isEndcap',
+                                  cutmask=chain+'_isEndcap',
                                   type='TH1I', path='',xbins=40,xmin=0,xmax=40)
 
-        histGroup.defineHistogram(GroupName+'_MDT_Inn_residual;L2MuonSA_MDT_Inn_residual_barrel',
+        histGroup.defineHistogram(chain+'_MDT_Inn_residual;L2MuonSA_MDT_Inn_residual_barrel',
                                   title='L2MuonSA barrel MDT Inner station residual '+chain+';MDT Inner barrel residual [cm];Events', 
-                                  cutmask=GroupName+'_isBarrel',
+                                  cutmask=chain+'_isBarrel',
                                   type='TH1F', path='',xbins=100,xmin=-20,xmax=20)
 
-        histGroup.defineHistogram(GroupName+'_MDT_Mid_residual;L2MuonSA_MDT_Mid_residual_barrel',
+        histGroup.defineHistogram(chain+'_MDT_Mid_residual;L2MuonSA_MDT_Mid_residual_barrel',
                                   title='L2MuonSA barrel MDT Middle station residual '+chain+';MDT Middle barrel residual [cm];Events', 
-                                  cutmask=GroupName+'_isBarrel',
+                                  cutmask=chain+'_isBarrel',
                                   type='TH1F', path='',xbins=100,xmin=-20,xmax=20)
 
-        histGroup.defineHistogram(GroupName+'_MDT_Out_residual;L2MuonSA_MDT_Out_residual_barrel',
+        histGroup.defineHistogram(chain+'_MDT_Out_residual;L2MuonSA_MDT_Out_residual_barrel',
                                   title='L2MuonSA barrel MDT Outer station residual '+chain+';MDT Outer barrel residual [cm];Events', 
-                                  cutmask=GroupName+'_isBarrel',
+                                  cutmask=chain+'_isBarrel',
                                   type='TH1F', path='',xbins=100,xmin=-20,xmax=20)
 
-        histGroup.defineHistogram(GroupName+'_MDT_Inn_residual_OffMatch;L2MuonSA_MDT_Inn_residual_barrel_OffMatch',
+        histGroup.defineHistogram(chain+'_MDT_Inn_residual_OffMatch;L2MuonSA_MDT_Inn_residual_barrel_OffMatch',
                                   title='L2MuonSA barrel MDT Inner station residual matched with Offline '+chain+';MDT Inner barrel residual [cm];Events', 
-                                  cutmask=GroupName+'_isBarrel',
+                                  cutmask=chain+'_isBarrel',
                                   type='TH1F', path='',xbins=100,xmin=-20,xmax=20)
 
-        histGroup.defineHistogram(GroupName+'_MDT_Mid_residual_OffMatch;L2MuonSA_MDT_Mid_residual_barrel_OffMatch',
+        histGroup.defineHistogram(chain+'_MDT_Mid_residual_OffMatch;L2MuonSA_MDT_Mid_residual_barrel_OffMatch',
                                   title='L2MuonSA barrel MDT Middle station residual matched with Offline '+chain+';MDT Middle barrel residual [cm];Events', 
-                                  cutmask=GroupName+'_isBarrel',
+                                  cutmask=chain+'_isBarrel',
                                   type='TH1F', path='',xbins=100,xmin=-20,xmax=20)
 
-        histGroup.defineHistogram(GroupName+'_MDT_Out_residual_OffMatch;L2MuonSA_MDT_Out_residual_barrel_OffMatch',
+        histGroup.defineHistogram(chain+'_MDT_Out_residual_OffMatch;L2MuonSA_MDT_Out_residual_barrel_OffMatch',
                                   title='L2MuonSA barrel MDT Outer station residual matched with Offline '+chain+';MDT Outer barrel residual [cm];Events', 
-                                  cutmask=GroupName+'_isBarrel',
+                                  cutmask=chain+'_isBarrel',
                                   type='TH1F', path='',xbins=100,xmin=-20,xmax=20)
 
-        histGroup.defineHistogram(GroupName+'_LB,'+GroupName+'_MDT_Inn_residual;L2MuonSA_MDT_Inn_residual_barrel_vs_LB',
+        histGroup.defineHistogram(chain+'_LB,'+chain+'_MDT_Inn_residual;L2MuonSA_MDT_Inn_residual_barrel_vs_LB',
                                   title='L2MuonSA barrel MDT Inner station residual vs LB '+chain+';LB;MDT Inner barrel residual [cm]', 
-                                  cutmask=GroupName+'_isBarrel',
+                                  cutmask=chain+'_isBarrel',
                                   type='TH2F', path='',xbins=750,xmin=1.,xmax=1501.,ybins=80,ymin=-20,ymax=20)
 
-        histGroup.defineHistogram(GroupName+'_LB,'+GroupName+'_MDT_Mid_residual;L2MuonSA_MDT_Mid_residual_barrel_vs_LB',
+        histGroup.defineHistogram(chain+'_LB,'+chain+'_MDT_Mid_residual;L2MuonSA_MDT_Mid_residual_barrel_vs_LB',
                                   title='L2MuonSA barrel MDT Middle station residual vs LB '+chain+';LB;MDT Middle barrel residual [cm]', 
-                                  cutmask=GroupName+'_isBarrel',
+                                  cutmask=chain+'_isBarrel',
                                   type='TH2F', path='',xbins=750,xmin=1.,xmax=1501.,ybins=80,ymin=-20,ymax=20)
 
-        histGroup.defineHistogram(GroupName+'_LB,'+GroupName+'_MDT_Out_residual;L2MuonSA_MDT_Out_residual_barrel_vs_LB',
+        histGroup.defineHistogram(chain+'_LB,'+chain+'_MDT_Out_residual;L2MuonSA_MDT_Out_residual_barrel_vs_LB',
                                   title='L2MuonSA barrel MDT Outer station residual vs LB '+chain+';LB;MDT Outer barrel residual [cm]', 
-                                  cutmask=GroupName+'_isBarrel',
+                                  cutmask=chain+'_isBarrel',
                                   type='TH2F', path='',xbins=750,xmin=1.,xmax=1501.,ybins=80,ymin=-20,ymax=20)
 
-        histGroup.defineHistogram(GroupName+'_MDT_Inn_residual;L2MuonSA_MDT_Inn_residual_endcap',
+        histGroup.defineHistogram(chain+'_MDT_Inn_residual;L2MuonSA_MDT_Inn_residual_endcap',
                                   title='L2MuonSA endcap MDT Inner station residual '+chain+';MDT Inner endcap residual [cm];Events', 
-                                  cutmask=GroupName+'_isEndcap',
+                                  cutmask=chain+'_isEndcap',
                                   type='TH1F', path='',xbins=100,xmin=-20,xmax=20)
 
-        histGroup.defineHistogram(GroupName+'_MDT_Mid_residual;L2MuonSA_MDT_Mid_residual_endcap',
+        histGroup.defineHistogram(chain+'_MDT_Mid_residual;L2MuonSA_MDT_Mid_residual_endcap',
                                   title='L2MuonSA endcap MDT Middle station residual '+chain+';MDT Middle endcap residual [cm];Events', 
-                                  cutmask=GroupName+'_isEndcap',
+                                  cutmask=chain+'_isEndcap',
                                   type='TH1F', path='',xbins=100,xmin=-20,xmax=20)
 
-        histGroup.defineHistogram(GroupName+'_MDT_Out_residual;L2MuonSA_MDT_Out_residual_endcap',
+        histGroup.defineHistogram(chain+'_MDT_Out_residual;L2MuonSA_MDT_Out_residual_endcap',
                                   title='L2MuonSA endcap MDT Outer station residual '+chain+';MDT Outer endcap residual [cm];Events', 
-                                  cutmask=GroupName+'_isEndcap',
+                                  cutmask=chain+'_isEndcap',
                                   type='TH1F', path='',xbins=100,xmin=-20,xmax=20)
 
-        histGroup.defineHistogram(GroupName+'_MDT_Inn_residual_OffMatch;L2MuonSA_MDT_Inn_residual_endcap_OffMatch',
+        histGroup.defineHistogram(chain+'_MDT_Inn_residual_OffMatch;L2MuonSA_MDT_Inn_residual_endcap_OffMatch',
                                   title='L2MuonSA endcap MDT Inner station residual matched with Offline '+chain+';MDT Inner endcap residual [cm];Events', 
-                                  cutmask=GroupName+'_isEndcap',
+                                  cutmask=chain+'_isEndcap',
                                   type='TH1F', path='',xbins=100,xmin=-20,xmax=20)
 
-        histGroup.defineHistogram(GroupName+'_MDT_Mid_residual_OffMatch;L2MuonSA_MDT_Mid_residual_endcap_OffMatch',
+        histGroup.defineHistogram(chain+'_MDT_Mid_residual_OffMatch;L2MuonSA_MDT_Mid_residual_endcap_OffMatch',
                                   title='L2MuonSA endcap MDT Middle station residual matched with Offline '+chain+';MDT Middle endcap residual [cm];Events', 
-                                  cutmask=GroupName+'_isEndcap',
+                                  cutmask=chain+'_isEndcap',
                                   type='TH1F', path='',xbins=100,xmin=-20,xmax=20)
 
-        histGroup.defineHistogram(GroupName+'_MDT_Out_residual_OffMatch;L2MuonSA_MDT_Out_residual_endcap_OffMatch',
+        histGroup.defineHistogram(chain+'_MDT_Out_residual_OffMatch;L2MuonSA_MDT_Out_residual_endcap_OffMatch',
                                   title='L2MuonSA endcap MDT Outer station residual matched with Offline '+chain+';MDT Outer endcap residual [cm];Events', 
-                                  cutmask=GroupName+'_isEndcap',
+                                  cutmask=chain+'_isEndcap',
                                   type='TH1F', path='',xbins=100,xmin=-20,xmax=20)
 
-        histGroup.defineHistogram(GroupName+'_LB,'+GroupName+'_MDT_Inn_residual;L2MuonSA_MDT_Inn_residual_endcap_vs_LB',
+        histGroup.defineHistogram(chain+'_LB,'+chain+'_MDT_Inn_residual;L2MuonSA_MDT_Inn_residual_endcap_vs_LB',
                                   title='L2MuonSA endcap MDT Inner station residual vs LB '+chain+';LB;MDT Inner endcap residual [cm]', 
-                                  cutmask=GroupName+'_isEndcap',
+                                  cutmask=chain+'_isEndcap',
                                   type='TH2F', path='',xbins=750,xmin=1.,xmax=1501.,ybins=80,ymin=-20,ymax=20)
 
-        histGroup.defineHistogram(GroupName+'_LB,'+GroupName+'_MDT_Mid_residual;L2MuonSA_MDT_Mid_residual_endcap_vs_LB',
+        histGroup.defineHistogram(chain+'_LB,'+chain+'_MDT_Mid_residual;L2MuonSA_MDT_Mid_residual_endcap_vs_LB',
                                   title='L2MuonSA endcap MDT Middle station residual vs LB '+chain+';LB;MDT Middle endcap residual [cm]', 
-                                  cutmask=GroupName+'_isEndcap',
+                                  cutmask=chain+'_isEndcap',
                                   type='TH2F', path='',xbins=750,xmin=1.,xmax=1501.,ybins=80,ymin=-20,ymax=20)
 
-        histGroup.defineHistogram(GroupName+'_LB,'+GroupName+'_MDT_Out_residual;L2MuonSA_MDT_Out_residual_endcap_vs_LB',
+        histGroup.defineHistogram(chain+'_LB,'+chain+'_MDT_Out_residual;L2MuonSA_MDT_Out_residual_endcap_vs_LB',
                                   title='L2MuonSA endcap MDT Outer station residual vs LB '+chain+';LB;MDT Outer endcap residual [cm]', 
-                                  cutmask=GroupName+'_isEndcap',
+                                  cutmask=chain+'_isEndcap',
                                   type='TH2F', path='',xbins=750,xmin=1.,xmax=1501.,ybins=80,ymin=-20,ymax=20)
 
 
 
         # Comparison to Offline
         # dR wrt Offline
-        histGroup.defineHistogram(GroupName+'_dRmin;L2MuonSA_dR_toRecMuonCB',
+        histGroup.defineHistogram(chain+'_dRmin;L2MuonSA_dR_toRecMuonCB',
                                   title='dR between L2MuonSA and Offline '+chain+';#DeltaR;Events', 
                                   type='TH1F', path='',xbins=100,xmin=0,xmax=2)
 
 
         # L1 RoI wrt offline
-        histGroup.defineHistogram(GroupName+'_initialRoI_dR;L2MuonSA_initialRoI_dR_toRecMuonCB',
+        histGroup.defineHistogram(chain+'_initialRoI_dR;L2MuonSA_initialRoI_dR_toRecMuonCB',
                                   title='L2MuonSA initialRoI dR wrt offline CB '+chain+';dR(initialRoI vs offl CB);Events', 
                                   type='TH1F', path='',xbins=100,xmin=0.,xmax=0.5)
 
-        histGroup.defineHistogram(GroupName+'_offEta,'+GroupName+'_initialRoI_dEta;L2MuonSA_initialRoI_dEta_vs_Eta_toRecMuonCB',
+        histGroup.defineHistogram(chain+'_offEta,'+chain+'_initialRoI_dEta;L2MuonSA_initialRoI_dEta_vs_Eta_toRecMuonCB',
                                   title='L2MuonSA initialRoI wrt Offline CB muon, d#eta '+chain+';offl CB #eta;d#eta(initialRoI vs offl CB)', 
                                   type='TH2F', path='',xbins=54,xmin=-2.7,xmax=2.7, ybins=60,ymin=-0.3,ymax=0.3)
 
-        histGroup.defineHistogram(GroupName+'_offEta,'+GroupName+'_initialRoI_dPhi;L2MuonSA_initialRoI_dPhi_vs_Eta_toRecMuonCB',
+        histGroup.defineHistogram(chain+'_offEta,'+chain+'_initialRoI_dPhi;L2MuonSA_initialRoI_dPhi_vs_Eta_toRecMuonCB',
                                   title='L2MuonSA initialRoI wrt Offline CB muon, d#phi '+chain+';offl CB #eta;d#phi(initialRoI vs offl CB)', 
                                   type='TH2F', path='',xbins=54,xmin=-2.7,xmax=2.7, ybins=44,ymin=-0.2,ymax=0.2)
 
 
         # pt resolution (barrel, endcap1, endcap2, or endcap3) (A-side or C-side)
-        histGroup.defineHistogram(GroupName+'_ptresol;L2MuonSA_ptresol_toRecMuonCB',
+        histGroup.defineHistogram(chain+'_ptresol;L2MuonSA_ptresol_toRecMuonCB',
                                   title='L2MuonSA pT resolution wrt Offline '+chain+';p_{T} resol;Events', 
                                   type='TH1F', path='',xbins=100,xmin=-2.,xmax=2.)
 
-        histGroup.defineHistogram(GroupName+'_ptresol;L2MuonSA_ptresol_toRecMuonCB_BR',
+        histGroup.defineHistogram(chain+'_ptresol;L2MuonSA_ptresol_toRecMuonCB_BR',
                                   title='L2MuonSA pT resolution wrt Offline Barrel '+chain+';p_{T} resol;Events', 
-                                  cutmask=GroupName+'_isBarrel',
+                                  cutmask=chain+'_isBarrel',
                                   type='TH1F', path='',xbins=100,xmin=-2.,xmax=2.)
 
-        histGroup.defineHistogram(GroupName+'_ptresol;L2MuonSA_ptresol_toRecMuonCB_EC1',
+        histGroup.defineHistogram(chain+'_ptresol;L2MuonSA_ptresol_toRecMuonCB_EC1',
                                   title='L2MuonSA pT resolution wrt Offline Endcap1 '+chain+';p_{T} resol;Events', 
-                                  cutmask=GroupName+'_isEndcap1',
+                                  cutmask=chain+'_isEndcap1',
                                   type='TH1F', path='',xbins=100,xmin=-2.,xmax=2.)
 
-        histGroup.defineHistogram(GroupName+'_ptresol;L2MuonSA_ptresol_toRecMuonCB_EC2',
+        histGroup.defineHistogram(chain+'_ptresol;L2MuonSA_ptresol_toRecMuonCB_EC2',
                                   title='L2MuonSA pT resolution wrt Offline Endcap2 '+chain+';p_{T} resol;Events', 
-                                  cutmask=GroupName+'_isEndcap2',
+                                  cutmask=chain+'_isEndcap2',
                                   type='TH1F', path='',xbins=100,xmin=-2.,xmax=2.)
 
-        histGroup.defineHistogram(GroupName+'_ptresol;L2MuonSA_ptresol_toRecMuonCB_EC3',
+        histGroup.defineHistogram(chain+'_ptresol;L2MuonSA_ptresol_toRecMuonCB_EC3',
                                   title='L2MuonSA pT resolution wrt Offline Endcap3 '+chain+';p_{T} resol;Events', 
-                                  cutmask=GroupName+'_isEndcap3',
+                                  cutmask=chain+'_isEndcap3',
                                   type='TH1F', path='',xbins=100,xmin=-2.,xmax=2.)
 
 
-        histGroup.defineHistogram(GroupName+'_offPt_signed,'+GroupName+'_ptresol;L2MuonSA_ptresol_toRecMuonCB_pt_barrel_A',
+        histGroup.defineHistogram(chain+'_offPt_signed,'+chain+'_ptresol;L2MuonSA_ptresol_toRecMuonCB_pt_barrel_A',
                                   title='L2MuonSA barrel A pT resolution wrt Offline in pt '+chain+';p_{T} [GeV/c];p_{T} resol', 
-                                  cutmask=GroupName+'_isBarrelA',
+                                  cutmask=chain+'_isBarrelA',
                                   type='TH2F', path='',xbins=104,xmin=-52.,xmax=52.,ybins=100,ymin=-2.,ymax=2.)
 
-        histGroup.defineHistogram(GroupName+'_offPt_signed,'+GroupName+'_ptresol;L2MuonSA_ptresol_toRecMuonCB_pt_barrel_C',
+        histGroup.defineHistogram(chain+'_offPt_signed,'+chain+'_ptresol;L2MuonSA_ptresol_toRecMuonCB_pt_barrel_C',
                                   title='L2MuonSA barrel C pT resolution wrt Offline in pt '+chain+';p_{T} [GeV/c];p_{T} resol', 
-                                  cutmask=GroupName+'_isBarrelC',
+                                  cutmask=chain+'_isBarrelC',
                                   type='TH2F', path='',xbins=104,xmin=-52.,xmax=52.,ybins=100,ymin=-2.,ymax=2.)
 
-        histGroup.defineHistogram(GroupName+'_offPt_signed,'+GroupName+'_ptresol;L2MuonSA_ptresol_toRecMuonCB_pt_endcap_A',
+        histGroup.defineHistogram(chain+'_offPt_signed,'+chain+'_ptresol;L2MuonSA_ptresol_toRecMuonCB_pt_endcap_A',
                                   title='L2MuonSA endcap A pT resolution wrt Offline in pt '+chain+';p_{T} [GeV/c];p_{T} resol', 
-                                  cutmask=GroupName+'_isEndcapA',
+                                  cutmask=chain+'_isEndcapA',
                                   type='TH2F', path='',xbins=104,xmin=-52.,xmax=52.,ybins=100,ymin=-2.,ymax=2.)
 
-        histGroup.defineHistogram(GroupName+'_offPt_signed,'+GroupName+'_ptresol;L2MuonSA_ptresol_toRecMuonCB_pt_endcap_C',
+        histGroup.defineHistogram(chain+'_offPt_signed,'+chain+'_ptresol;L2MuonSA_ptresol_toRecMuonCB_pt_endcap_C',
                                   title='L2MuonSA endcap C pT resolution wrt Offline in pt '+chain+';p_{T} [GeV/c];p_{T} resol', 
-                                  cutmask=GroupName+'_isEndcapC',
+                                  cutmask=chain+'_isEndcapC',
                                   type='TH2F', path='',xbins=104,xmin=-52.,xmax=52.,ybins=100,ymin=-2.,ymax=2.)
 
 
-        histGroup.defineHistogram(GroupName+'_offEta,'+GroupName+'_ptresol;L2MuonSA_ptresol_toRecMuonCB_eta',
+        histGroup.defineHistogram(chain+'_offEta,'+chain+'_ptresol;L2MuonSA_ptresol_toRecMuonCB_eta',
                                   title='L2MuonSA pT resolution wrt Offline in eta '+chain+';#eta;p_{T} resol', 
                                   type='TH2F', path='',xbins=27,xmin=-2.7,xmax=2.7,ybins=100,ymin=-2.,ymax=2.)
 
-        histGroup.defineHistogram(GroupName+'_offEta,'+GroupName+'_ptresol;L2MuonSA_ptresol_toRecMuonCB_eta_pT4_6',
+        histGroup.defineHistogram(chain+'_offEta,'+chain+'_ptresol;L2MuonSA_ptresol_toRecMuonCB_eta_pT4_6',
                                   title='L2MuonSA pT resolution wrt Offline in eta (pT4GeV-6GeV) '+chain+';#eta;p_{T} resol', 
-                                  cutmask=GroupName+'_pt4to6',
+                                  cutmask=chain+'_pt4to6',
                                   type='TH2F', path='',xbins=27,xmin=-2.7,xmax=2.7,ybins=100,ymin=-2.,ymax=2.)
 
-        histGroup.defineHistogram(GroupName+'_offEta,'+GroupName+'_ptresol;L2MuonSA_ptresol_toRecMuonCB_eta_pT6_8',
+        histGroup.defineHistogram(chain+'_offEta,'+chain+'_ptresol;L2MuonSA_ptresol_toRecMuonCB_eta_pT6_8',
                                   title='L2MuonSA pT resolution wrt Offline in eta (pT6GeV-8GeV) '+chain+';#eta;p_{T} resol', 
-                                  cutmask=GroupName+'_pt6to8',
+                                  cutmask=chain+'_pt6to8',
                                   type='TH2F', path='',xbins=27,xmin=-2.7,xmax=2.7,ybins=100,ymin=-2.,ymax=2.)
 
-        histGroup.defineHistogram(GroupName+'_offEta,'+GroupName+'_ptresol;L2MuonSA_ptresol_toRecMuonCB_eta_pT8_x',
+        histGroup.defineHistogram(chain+'_offEta,'+chain+'_ptresol;L2MuonSA_ptresol_toRecMuonCB_eta_pT8_x',
                                   title='L2MuonSA pT resolution wrt Offline in eta (pT over 8GeV) '+chain+';#eta;p_{T} resol', 
-                                  cutmask=GroupName+'_ptover8',
+                                  cutmask=chain+'_ptover8',
                                   type='TH2F', path='',xbins=27,xmin=-2.7,xmax=2.7,ybins=100,ymin=-2.,ymax=2.)
 
 
         # inverse pt resolution (positive or negative muon) (A-side or C-side) (barrel, endcap1, endcap2, or endcap3)
-        histGroup.defineHistogram(GroupName+'_invptresol_pos;L2MuonSA_invptresol_toRecMuonCB_pos',
+        histGroup.defineHistogram(chain+'_invptresol_pos;L2MuonSA_invptresol_toRecMuonCB_pos',
                                   title='L2MuonSA pT resolution wrt Offline positive muons '+chain+';1/p_{T} resol;Events', 
                                   type='TH1F', path='',xbins=100,xmin=-2.,xmax=2.)
 
-        histGroup.defineHistogram(GroupName+'_invptresol_neg;L2MuonSA_invptresol_toRecMuonCB_neg',
+        histGroup.defineHistogram(chain+'_invptresol_neg;L2MuonSA_invptresol_toRecMuonCB_neg',
                                   title='L2MuonSA pT resolution wrt Offline negative muons '+chain+';1/p_{T} resol;Events', 
                                   type='TH1F', path='',xbins=100,xmin=-2.,xmax=2.)
 
 
-        histGroup.defineHistogram(GroupName+'_invptresol_pos;L2MuonSA_invptresol_toRecMuonCB_pos_BR_A',
+        histGroup.defineHistogram(chain+'_invptresol_pos;L2MuonSA_invptresol_toRecMuonCB_pos_BR_A',
                                   title='L2MuonSA pT resolution wrt Offline pos muons Barrel A-side '+chain+';1/p_{T} resol;Events', 
-                                  cutmask=GroupName+'_isBarrelA',
+                                  cutmask=chain+'_isBarrelA',
                                   type='TH1F', path='',xbins=100,xmin=-2.,xmax=2.)
 
-        histGroup.defineHistogram(GroupName+'_invptresol_neg;L2MuonSA_invptresol_toRecMuonCB_neg_BR_A',
+        histGroup.defineHistogram(chain+'_invptresol_neg;L2MuonSA_invptresol_toRecMuonCB_neg_BR_A',
                                   title='L2MuonSA pT resolution wrt Offline neg muons Barrel A-side '+chain+';1/p_{T} resol;Events', 
-                                  cutmask=GroupName+'_isBarrelA',
+                                  cutmask=chain+'_isBarrelA',
                                   type='TH1F', path='',xbins=100,xmin=-2.,xmax=2.)
 
-        histGroup.defineHistogram(GroupName+'_invptresol_pos;L2MuonSA_invptresol_toRecMuonCB_pos_EC1_A',
+        histGroup.defineHistogram(chain+'_invptresol_pos;L2MuonSA_invptresol_toRecMuonCB_pos_EC1_A',
                                   title='L2MuonSA pT resolution wrt Offline pos muons EndCap1 A-side '+chain+';1/p_{T} resol;Events', 
-                                  cutmask=GroupName+'_isEndcap1A',
+                                  cutmask=chain+'_isEndcap1A',
                                   type='TH1F', path='',xbins=100,xmin=-2.,xmax=2.)
 
-        histGroup.defineHistogram(GroupName+'_invptresol_neg;L2MuonSA_invptresol_toRecMuonCB_neg_EC1_A',
+        histGroup.defineHistogram(chain+'_invptresol_neg;L2MuonSA_invptresol_toRecMuonCB_neg_EC1_A',
                                   title='L2MuonSA pT resolution wrt Offline neg muons EndCap1 A-side '+chain+';1/p_{T} resol;Events', 
-                                  cutmask=GroupName+'_isEndcap1A',
+                                  cutmask=chain+'_isEndcap1A',
                                   type='TH1F', path='',xbins=100,xmin=-2.,xmax=2.)
 
-        histGroup.defineHistogram(GroupName+'_invptresol_pos;L2MuonSA_invptresol_toRecMuonCB_pos_EC2_A',
+        histGroup.defineHistogram(chain+'_invptresol_pos;L2MuonSA_invptresol_toRecMuonCB_pos_EC2_A',
                                   title='L2MuonSA pT resolution wrt Offline pos muons EndCap2 A-side '+chain+';1/p_{T} resol;Events', 
-                                  cutmask=GroupName+'_isEndcap2A',
+                                  cutmask=chain+'_isEndcap2A',
                                   type='TH1F', path='',xbins=100,xmin=-2.,xmax=2.)
 
-        histGroup.defineHistogram(GroupName+'_invptresol_neg;L2MuonSA_invptresol_toRecMuonCB_neg_EC2_A',
+        histGroup.defineHistogram(chain+'_invptresol_neg;L2MuonSA_invptresol_toRecMuonCB_neg_EC2_A',
                                   title='L2MuonSA pT resolution wrt Offline neg muons EndCap2 A-side '+chain+';1/p_{T} resol;Events', 
-                                  cutmask=GroupName+'_isEndcap2A',
+                                  cutmask=chain+'_isEndcap2A',
                                   type='TH1F', path='',xbins=100,xmin=-2.,xmax=2.)
 
-        histGroup.defineHistogram(GroupName+'_invptresol_pos;L2MuonSA_invptresol_toRecMuonCB_pos_EC3_A',
+        histGroup.defineHistogram(chain+'_invptresol_pos;L2MuonSA_invptresol_toRecMuonCB_pos_EC3_A',
                                   title='L2MuonSA pT resolution wrt Offline pos muons EndCap3 A-side '+chain+';1/p_{T} resol;Events', 
-                                  cutmask=GroupName+'_isEndcap3A',
+                                  cutmask=chain+'_isEndcap3A',
                                   type='TH1F', path='',xbins=100,xmin=-2.,xmax=2.)
 
-        histGroup.defineHistogram(GroupName+'_invptresol_neg;L2MuonSA_invptresol_toRecMuonCB_neg_EC3_A',
+        histGroup.defineHistogram(chain+'_invptresol_neg;L2MuonSA_invptresol_toRecMuonCB_neg_EC3_A',
                                   title='L2MuonSA pT resolution wrt Offline neg muons EndCap3 A-side '+chain+';1/p_{T} resol;Events', 
-                                  cutmask=GroupName+'_isEndcap3A',
+                                  cutmask=chain+'_isEndcap3A',
                                   type='TH1F', path='',xbins=100,xmin=-2.,xmax=2.)
 
 
-        histGroup.defineHistogram(GroupName+'_invptresol_pos;L2MuonSA_invptresol_toRecMuonCB_pos_BR_C',
+        histGroup.defineHistogram(chain+'_invptresol_pos;L2MuonSA_invptresol_toRecMuonCB_pos_BR_C',
                                   title='L2MuonSA pT resolution wrt Offline pos muons Barrel C-side '+chain+';1/p_{T} resol;Events', 
-                                  cutmask=GroupName+'_isBarrelC',
+                                  cutmask=chain+'_isBarrelC',
                                   type='TH1F', path='',xbins=100,xmin=-2.,xmax=2.)
 
-        histGroup.defineHistogram(GroupName+'_invptresol_neg;L2MuonSA_invptresol_toRecMuonCB_neg_BR_C',
+        histGroup.defineHistogram(chain+'_invptresol_neg;L2MuonSA_invptresol_toRecMuonCB_neg_BR_C',
                                   title='L2MuonSA pT resolution wrt Offline neg muons Barrel C-side '+chain+';1/p_{T} resol;Events', 
-                                  cutmask=GroupName+'_isBarrelC',
+                                  cutmask=chain+'_isBarrelC',
                                   type='TH1F', path='',xbins=100,xmin=-2.,xmax=2.)
 
-        histGroup.defineHistogram(GroupName+'_invptresol_pos;L2MuonSA_invptresol_toRecMuonCB_pos_EC1_C',
+        histGroup.defineHistogram(chain+'_invptresol_pos;L2MuonSA_invptresol_toRecMuonCB_pos_EC1_C',
                                   title='L2MuonSA pT resolution wrt Offline pos muons EndCap1 C-side '+chain+';1/p_{T} resol;Events', 
-                                  cutmask=GroupName+'_isEndcap1C',
+                                  cutmask=chain+'_isEndcap1C',
                                   type='TH1F', path='',xbins=100,xmin=-2.,xmax=2.)
 
-        histGroup.defineHistogram(GroupName+'_invptresol_neg;L2MuonSA_invptresol_toRecMuonCB_neg_EC1_C',
+        histGroup.defineHistogram(chain+'_invptresol_neg;L2MuonSA_invptresol_toRecMuonCB_neg_EC1_C',
                                   title='L2MuonSA pT resolution wrt Offline neg muons EndCap1 C-side '+chain+';1/p_{T} resol;Events', 
-                                  cutmask=GroupName+'_isEndcap1C',
+                                  cutmask=chain+'_isEndcap1C',
                                   type='TH1F', path='',xbins=100,xmin=-2.,xmax=2.)
 
-        histGroup.defineHistogram(GroupName+'_invptresol_pos;L2MuonSA_invptresol_toRecMuonCB_pos_EC2_C',
+        histGroup.defineHistogram(chain+'_invptresol_pos;L2MuonSA_invptresol_toRecMuonCB_pos_EC2_C',
                                   title='L2MuonSA pT resolution wrt Offline pos muons EndCap2 C-side '+chain+';1/p_{T} resol;Events', 
-                                  cutmask=GroupName+'_isEndcap2C',
+                                  cutmask=chain+'_isEndcap2C',
                                   type='TH1F', path='',xbins=100,xmin=-2.,xmax=2.)
 
-        histGroup.defineHistogram(GroupName+'_invptresol_neg;L2MuonSA_invptresol_toRecMuonCB_neg_EC2_C',
+        histGroup.defineHistogram(chain+'_invptresol_neg;L2MuonSA_invptresol_toRecMuonCB_neg_EC2_C',
                                   title='L2MuonSA pT resolution wrt Offline neg muons EndCap2 C-side '+chain+';1/p_{T} resol;Events', 
-                                  cutmask=GroupName+'_isEndcap2C',
+                                  cutmask=chain+'_isEndcap2C',
                                   type='TH1F', path='',xbins=100,xmin=-2.,xmax=2.)
 
-        histGroup.defineHistogram(GroupName+'_invptresol_pos;L2MuonSA_invptresol_toRecMuonCB_pos_EC3_C',
+        histGroup.defineHistogram(chain+'_invptresol_pos;L2MuonSA_invptresol_toRecMuonCB_pos_EC3_C',
                                   title='L2MuonSA pT resolution wrt Offline pos muons EndCap3 C-side '+chain+';1/p_{T} resol;Events', 
-                                  cutmask=GroupName+'_isEndcap3C',
+                                  cutmask=chain+'_isEndcap3C',
                                   type='TH1F', path='',xbins=100,xmin=-2.,xmax=2.)
 
-        histGroup.defineHistogram(GroupName+'_invptresol_neg;L2MuonSA_invptresol_toRecMuonCB_neg_EC3_C',
+        histGroup.defineHistogram(chain+'_invptresol_neg;L2MuonSA_invptresol_toRecMuonCB_neg_EC3_C',
                                   title='L2MuonSA pT resolution wrt Offline neg muons EndCap3 C-side '+chain+';1/p_{T} resol;Events', 
-                                  cutmask=GroupName+'_isEndcap3C',
+                                  cutmask=chain+'_isEndcap3C',
                                   type='TH1F', path='',xbins=100,xmin=-2.,xmax=2.)
 
+
     return
diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L2muCombMonConfig.py b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L2muCombMonConfig.py
index 05d0edcb00bb63351902fcd2d013813078468160..d76221f436dd48ab321dee9da0321921ef06fc1c 100644
--- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L2muCombMonConfig.py
+++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L2muCombMonConfig.py
@@ -1,162 +1,176 @@
 #  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
+import ROOT
 
 def L2muCombMonConfig(helper):
     
     from AthenaConfiguration.ComponentFactory import CompFactory
+
+    GroupName = 'L2muComb'
+
+    monAlg = helper.addAlgorithm(CompFactory.L2muCombMonMT,'L2muCombMonMT')
     # HLT_mu6_L1MU6 is test chain for small statistics, so it will be removed.
-    Chains = ['HLT_mu6_L1MU6', 'HLT_mu26_ivarmedium_L1MU20']
+    monAlg.MonitoredChains =  ['HLT_mu6_L1MU6', 'HLT_mu26_ivarmedium_L1MU20']
+    monAlg.Group = GroupName
 
-    for chain in Chains:
+    # configuration of etaphi2D and Ratio plots for non-specific chain
+    histGroupNonSpecificChain = helper.addGroup(monAlg, GroupName, 'HLT/MuonMon/')
 
-        GroupName = 'L2muComb_'+chain
+    histGroupNonSpecificChain.defineHistogram('L2CBEta,L2CBPhi;L2muComb_Eta_vs_Phi',
+                                              title='L2muComb Eta vs Phi ;#eta;#phi',
+                                              type='TH2F', path='etaphi2D',xbins=108,xmin=-2.7,xmax=2.7, ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi())
 
-        monAlg = helper.addAlgorithm(CompFactory.L2muCombMonMT,'L2muCombMonMT_'+chain)
-        monAlg.MonitoredChains = [chain]
-        monAlg.Group = GroupName
+    histGroupNonSpecificChain.defineHistogram('L2CBAboveCut,LB;L2muComb_Over_OfflineCB_4GeV_Cut',
+                                              title='L2muComb Over OfflineCB 4GeV Cut;LB;Ratio',
+                                              type='TEfficiency', path='Ratio',xbins=400,xmin=1.,xmax=801.)
 
-        histGroup = helper.addGroup(monAlg, GroupName, 'HLT/MuonMon/L2muComb/'+chain)
-    
+
+    # configration for specific chain
+    for chain in monAlg.MonitoredChains:
+
+        histGroup = helper.addGroup(monAlg, GroupName+'_'+chain, 'HLT/MuonMon/L2muComb/'+chain)
     
-        import ROOT
+
         # basic EDM variables
-        histGroup.defineHistogram(GroupName+'_Pt;L2muComb_Pt',
+        histGroup.defineHistogram(chain+'_Pt;L2muComb_Pt',
                                   title='L2muComb Pt '+chain+';p_{T} [GeV];Events', 
                                   type='TH1F', path='',xbins=210,xmin=-105.,xmax=105.)
 
-        histGroup.defineHistogram(GroupName+'_Eta;L2muComb_Eta',
+        histGroup.defineHistogram(chain+'_Eta;L2muComb_Eta',
                                   title='L2muComb Eta '+chain+';#eta;Events', 
                                   type='TH1F', path='',xbins=108,xmin=-2.7,xmax=2.7)
 
-        histGroup.defineHistogram(GroupName+'_Phi;L2muComb_Phi',
+        histGroup.defineHistogram(chain+'_Phi;L2muComb_Phi',
                                   title='L2muComb Phi '+chain+';#phi;Events', 
                                   type='TH1F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi())
 
-        histGroup.defineHistogram(GroupName+'_Eta,'+GroupName+'_Phi;L2muComb_Eta_vs_Phi',
+        histGroup.defineHistogram(chain+'_Eta,'+chain+'_Phi;L2muComb_Eta_vs_Phi',
                                   title='L2muComb Eta vs Phi '+chain+';#eta;#phi', 
                                   type='TH2F', path='',xbins=108,xmin=-2.7,xmax=2.7, ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi())
 
 
         #  eta vs. phi Combine success or failure, and matched or not offline muon
-        histGroup.defineHistogram(GroupName+'_Eta,'+GroupName+'_Phi;L2muComb_Eta_vs_Phi_L2CB_success',
+        histGroup.defineHistogram(chain+'_Eta,'+chain+'_Phi;L2muComb_Eta_vs_Phi_L2CB_success',
                                   title='L2muComb Eta vs Phi (L2CB reconstruction success) '+chain+';#eta;#phi', 
-                                  cutmask=GroupName+'_L2CB_success',
+                                  cutmask=chain+'_L2CB_success',
                                   type='TH2F', path='',xbins=108,xmin=-2.7,xmax=2.7, ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi())
 
-        histGroup.defineHistogram(GroupName+'_Eta,'+GroupName+'_Phi;L2muComb_Eta_vs_Phi_L2CBOFFmatching_failure',
+        histGroup.defineHistogram(chain+'_Eta,'+chain+'_Phi;L2muComb_Eta_vs_Phi_L2CBOFFmatching_failure',
                                   title='L2muComb Eta vs Phi (L2CB reconstruction success Off match failure) '+chain+';#eta;#phi', 
-                                  cutmask=GroupName+'_L2CBOFFmatching_failure',
+                                  cutmask=chain+'_L2CBOFFmatching_failure',
                                   type='TH2F', path='',xbins=108,xmin=-2.7,xmax=2.7, ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi())
 
-        histGroup.defineHistogram(GroupName+'_saEta,'+GroupName+'_saPhi;L2MuonSA_Eta_vs_Phi_L2CB_failure',
+        histGroup.defineHistogram(chain+'_saEta,'+chain+'_saPhi;L2MuonSA_Eta_vs_Phi_L2CB_failure',
                                   title='L2MuonSA Eta vs Phi (L2CB reconstruction failure L2SA Off match success) '+chain+';#eta;#phi', 
-                                  cutmask=GroupName+'_L2CB_failure',
+                                  cutmask=chain+'_L2CB_failure',
                                   type='TH2F', path='',xbins=108,xmin=-2.7,xmax=2.7, ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi())
 
 
         # L2MuonSA EDM variables in case of L2muComb failure
-        histGroup.defineHistogram(GroupName+'_saPt;L2muComb_failed_saPt',
+        histGroup.defineHistogram(chain+'_saPt;L2muComb_failed_saPt',
                                   title='L2MuonSA Pt (GeV/c) for muComb fails '+chain+';p_{T} [GeV];Events', 
-                                  cutmask=GroupName+'_L2SA_success',
+                                  cutmask=chain+'_L2SA_success',
                                   type='TH1F', path='',xbins=210,xmin=-105.,xmax=105.)
 
-        histGroup.defineHistogram(GroupName+'_saEta;L2muComb_failed_saEta',
+        histGroup.defineHistogram(chain+'_saEta;L2muComb_failed_saEta',
                                   title='L2MuonSA Eta for muComb fails '+chain+';#eta;Events', 
-                                  cutmask=GroupName+'_L2SA_success',
+                                  cutmask=chain+'_L2SA_success',
                                   type='TH1F', path='',xbins=108,xmin=-2.7,xmax=2.7)
 
-        histGroup.defineHistogram(GroupName+'_saPhi;L2muComb_failed_saPhi',
+        histGroup.defineHistogram(chain+'_saPhi;L2muComb_failed_saPhi',
                                   title='L2MuonSA Phi for muComb fails '+chain+';#phi;Events', 
-                                  cutmask=GroupName+'_L2SA_success',
+                                  cutmask=chain+'_L2SA_success',
                                   type='TH1F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi())
 
 
         # comparison L2muComb vs L2MuonSA
-        histGroup.defineHistogram(GroupName+'_ptratio_toSA;L2muComb_ptratio_toSA',
+        histGroup.defineHistogram(chain+'_ptratio_toSA;L2muComb_ptratio_toSA',
                                   title='L2muComb pt / L2MuonSA pt '+chain+';p_{T} ratio;Events', 
                                   type='TH1F', path='',xbins=140,xmin=-0.5,xmax=3.)
 
-        histGroup.defineHistogram(GroupName+'_dR_toSA;L2muComb_dR_toSA',
+        histGroup.defineHistogram(chain+'_dR_toSA;L2muComb_dR_toSA',
                                   title='L2muComb delta R to L2MuonSA '+chain+';#DeltaR;Events', 
                                   type='TH1F', path='',xbins=100,xmin=0.,xmax=0.5)
 
-        histGroup.defineHistogram(GroupName+'_dEta_toSA;L2muComb_dEta_toSA',
+        histGroup.defineHistogram(chain+'_dEta_toSA;L2muComb_dEta_toSA',
                                   title='L2muComb delta eta to L2MuonSA '+chain+';#Delta#eta;Events', 
                                   type='TH1F', path='',xbins=120,xmin=-0.2,xmax=0.2)
 
-        histGroup.defineHistogram(GroupName+'_dPhi_toSA;L2muComb_dPhi_toSA',
+        histGroup.defineHistogram(chain+'_dPhi_toSA;L2muComb_dPhi_toSA',
                                   title='L2muComb delta phi to L2MuonSA '+chain+';#Delta#phi;Events', 
                                   type='TH1F', path='',xbins=120,xmin=-0.2,xmax=0.2)
 
-        histGroup.defineHistogram(GroupName+'_MF_error;L2muComb_MF_error',
+        histGroup.defineHistogram(chain+'_MF_error;L2muComb_MF_error',
                                   title='L2muComb pointer to MuonFeature Error '+chain+';;Events',
                                   type='TH1I', path='',xbins=4,xmin=0,xmax=4,
                                   xlabels=["No error","Missing muSATrackLink","TrackLink and ElementLinnk matching error","SA reconstruction Error"])
 
 
         # ID variables
-        histGroup.defineHistogram(GroupName+'_trkPt;L2muComb_trkPt',
+        histGroup.defineHistogram(chain+'_trkPt;L2muComb_trkPt',
                                   title='L2muComb Trk Pt (GeV/c) '+chain+';p_{T} [GeV];Events', 
                                   type='TH1F', path='',xbins=210,xmin=-105.,xmax=105.)
 
-        histGroup.defineHistogram(GroupName+'_trkEta;L2muComb_trkEta',
+        histGroup.defineHistogram(chain+'_trkEta;L2muComb_trkEta',
                                   title='L2muComb Trk Eta '+chain+';#eta;Events', 
                                   type='TH1F', path='',xbins=108,xmin=-2.7,xmax=2.7)
 
-        histGroup.defineHistogram(GroupName+'_trkPhi;L2muComb_trkPhi',
+        histGroup.defineHistogram(chain+'_trkPhi;L2muComb_trkPhi',
                                   title='L2muComb Trk Phi '+chain+';#phi;Events', 
                                   type='TH1F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi())
 
-        histGroup.defineHistogram(GroupName+'_trkZ0;L2muComb_trkZ0',
+        histGroup.defineHistogram(chain+'_trkZ0;L2muComb_trkZ0',
                                   title='L2muComb Trk z0 (mm) '+chain+';z0[mm];Events', 
                                   type='TH1F', path='',xbins=150,xmin=-300.,xmax=300.)
 
-        histGroup.defineHistogram(GroupName+'_trkChi2;L2muComb_trkChi2',
+        histGroup.defineHistogram(chain+'_trkChi2;L2muComb_trkChi2',
                                   title='L2muComb Trk chi2 '+chain+';#chi^{2};Events', 
                                   type='TH1F', path='',xbins=50,xmin=0.,xmax=10.)
 
 
         # comparison L2muComb (ID track) vs L2MuonSA
-        histGroup.defineHistogram(GroupName+'_ptratio_TrktoSA;L2muComb_ptratio_TrktoSA',
+        histGroup.defineHistogram(chain+'_ptratio_TrktoSA;L2muComb_ptratio_TrktoSA',
                                   title='L2muComb Trk  pt / L2MuonSA pt '+chain+';p_{T} ratio;Events', 
                                   type='TH1F', path='',xbins=140,xmin=-0.5,xmax=3.)
 
-        histGroup.defineHistogram(GroupName+'_dR_TrktoSA;L2muComb_dR_TrktoSA',
+        histGroup.defineHistogram(chain+'_dR_TrktoSA;L2muComb_dR_TrktoSA',
                                   title='L2muComb delta R Trk to L2MuonSA '+chain+';#DeltaR;Events', 
                                   type='TH1F', path='',xbins=100,xmin=0.,xmax=0.5)
 
-        histGroup.defineHistogram(GroupName+'_dEta_TrktoSA;L2muComb_dEta_TrktoSA',
+        histGroup.defineHistogram(chain+'_dEta_TrktoSA;L2muComb_dEta_TrktoSA',
                                   title='L2muComb delta eta Trk to L2MuonSA '+chain+';#Delta#eta;Events', 
                                   type='TH1F', path='',xbins=120,xmin=-0.2,xmax=0.2)
 
-        histGroup.defineHistogram(GroupName+'_dPhi_TrktoSA;L2muComb_dPhi_TrktoSA',
+        histGroup.defineHistogram(chain+'_dPhi_TrktoSA;L2muComb_dPhi_TrktoSA',
                                   title='L2muComb delta phi Trk to L2MuonSA '+chain+';#Delta#phi;Events', 
                                   type='TH1F', path='',xbins=120,xmin=-0.2,xmax=0.2)
 
 
         # Comparison to Offline
-        histGroup.defineHistogram(GroupName+'_dRmin;L2muComb_dR_toOffl',
+        histGroup.defineHistogram(chain+'_dRmin;L2muComb_dR_toOffl',
                                   title='dR between L2muComb and Offline '+chain+';#DeltaR;Events', 
                                   type='TH1F', path='',xbins=100,xmin=0.,xmax=2.)
 
-        histGroup.defineHistogram(GroupName+'_ptresol;L2muComb_ptresol_toOffl',
+        histGroup.defineHistogram(chain+'_ptresol;L2muComb_ptresol_toOffl',
                                   title='L2muComb pT resolution wrt Offline '+chain+';p_{T} resol;Events', 
                                   type='TH1F', path='',xbins=100,xmin=-2.,xmax=2.)
 
-        histGroup.defineHistogram(GroupName+'_offEta,'+GroupName+'_ptresol;L2muComb_ptresol_toOffl_eta',
+        histGroup.defineHistogram(chain+'_offEta,'+chain+'_ptresol;L2muComb_ptresol_toOffl_eta',
                                   title='L2muComb pT resolution wrt Offline in eta '+chain+';#eta;p_{T} resol', 
                                   type='TH2F', path='',xbins=16,xmin=-3.2,xmax=3.2, ybins=100,ymin=-2.,ymax=2.)
 
 
         # Comparison HLT_Roi_L2SAMuon variables to Offline
-        histGroup.defineHistogram(GroupName+'_L2SARoI_dR;L2MuonSA_L2SARoI_dR_toRecMuonCB',
+        histGroup.defineHistogram(chain+'_L2SARoI_dR;L2MuonSA_L2SARoI_dR_toRecMuonCB',
                                   title='L2MuonSA L2SARoI dR wrt offline CB '+chain+';dR(L2SARoI vs offl CB);Events', 
                                   type='TH1F', path='',xbins=100,xmin=0.,xmax=0.5)
 
-        histGroup.defineHistogram(GroupName+'_offEta,'+GroupName+'_L2SARoI_dEta;L2MuonSA_L2SARoI_dEta_vs_Eta_toRecMuonCB',
+        histGroup.defineHistogram(chain+'_offEta,'+chain+'_L2SARoI_dEta;L2MuonSA_L2SARoI_dEta_vs_Eta_toRecMuonCB',
                                   title='L2MuonSA L2SARoI wrt Offline CB muon, d#eta '+chain+';offl CB #eta;d#eta(L2SARoI vs offl CB)', 
                                   type='TH2F', path='',xbins=54,xmin=-2.7,xmax=2.7, ybins=60,ymin=-0.3,ymax=0.3)
 
-        histGroup.defineHistogram(GroupName+'_offEta,'+GroupName+'_L2SARoI_dPhi;L2MuonSA_L2SARoI_dPhi_vs_Eta_toRecMuonCB',
+        histGroup.defineHistogram(chain+'_offEta,'+chain+'_L2SARoI_dPhi;L2MuonSA_L2SARoI_dPhi_vs_Eta_toRecMuonCB',
                                   title='L2MuonSA L2SARoI wrt Offline CB muon, d#phi '+chain+';offl CB #eta;d#phi(L2SARoI vs offl CB)', 
                                   type='TH2F', path='',xbins=54,xmin=-2.7,xmax=2.7, ybins=44,ymin=-0.2,ymax=0.2)
+
+    return
diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/EFMuonMonMT.cxx b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/EFMuonMonMT.cxx
index 3247ad55b4406926e57aeac03244bf55117da617..bd5fb0120e73d8d913fbb48120ad278fdaa73108 100644
--- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/EFMuonMonMT.cxx
+++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/EFMuonMonMT.cxx
@@ -11,6 +11,15 @@ EFMuonMonMT :: EFMuonMonMT(const std::string& name, ISvcLocator* pSvcLocator )
   : TrigMuonMonitorAlgorithm(name, pSvcLocator)
 {}
 
+
+StatusCode EFMuonMonMT :: initialize(){
+  StatusCode sc = TrigMuonMonitorAlgorithm::initialize();
+  ATH_CHECK( m_EFSAMuonContainerKey.initialize() );
+  ATH_CHECK( m_EFCBMuonContainerKey.initialize() );
+  return sc;
+}
+
+
 StatusCode EFMuonMonMT :: fillVariablesPerChain(const EventContext& , const std::string &chain) const {
 
   ATH_MSG_DEBUG ("Filling histograms for " << name() << "...");
@@ -20,18 +29,19 @@ StatusCode EFMuonMonMT :: fillVariablesPerChain(const EventContext& , const std:
   for (const TrigCompositeUtils::LinkInfo<xAOD::MuonContainer>& muSALinkInfo : featureContSA) {
     ATH_CHECK( muSALinkInfo.isValid() );
     const ElementLink<xAOD::MuonContainer> muSAEL = muSALinkInfo.link;
-    if ( ! (*muSAEL)->trackParticle(xAOD::Muon::TrackParticleType::ExtrapolatedMuonSpectrometerTrackParticle) ) continue;
+    const xAOD::TrackParticle* EFSATrack = (*muSAEL)->trackParticle(xAOD::Muon::TrackParticleType::ExtrapolatedMuonSpectrometerTrackParticle);
+    if ( !EFSATrack ) continue;
 
     // basic EDM variables
-    auto EFSAPt = Monitored::Scalar<float>(m_group+"_EFSA_Pt",-999.);
-    auto EFSAEta = Monitored::Scalar<float>(m_group+"_EFSA_Eta",-999.);
-    auto EFSAPhi = Monitored::Scalar<float>(m_group+"_EFSA_Phi",-999.);
+    auto EFSAPt = Monitored::Scalar<float>(chain+"_EFSA_Pt",-999.);
+    auto EFSAEta = Monitored::Scalar<float>(chain+"_EFSA_Eta",-999.);
+    auto EFSAPhi = Monitored::Scalar<float>(chain+"_EFSA_Phi",-999.);
 
-    EFSAPt = (*muSAEL)->pt()/1e3 * (*muSAEL)->charge(); // convert to GeV
-    EFSAEta = (*muSAEL)->eta();
-    EFSAPhi = (*muSAEL)->phi();
+    EFSAPt = EFSATrack->pt()/1e3 * EFSATrack->charge(); // convert to GeV
+    EFSAEta = EFSATrack->eta();
+    EFSAPhi = EFSATrack->phi();
 
-    fill(m_group, EFSAPt, EFSAEta, EFSAPhi);
+    fill(m_group+"_"+chain, EFSAPt, EFSAEta, EFSAPhi);
   }
 
 
@@ -40,18 +50,19 @@ StatusCode EFMuonMonMT :: fillVariablesPerChain(const EventContext& , const std:
   for (const TrigCompositeUtils::LinkInfo<xAOD::MuonContainer>& muCBLinkInfo : featureContCB) {
     ATH_CHECK( muCBLinkInfo.isValid() );
     const ElementLink<xAOD::MuonContainer> muCBEL = muCBLinkInfo.link;
-    if ( ! (*muCBEL)->trackParticle(xAOD::Muon::TrackParticleType::CombinedTrackParticle) ) continue;
+    const xAOD::TrackParticle* EFCBTrack = (*muCBEL)->trackParticle(xAOD::Muon::TrackParticleType::CombinedTrackParticle);
+    if ( !EFCBTrack ) continue;
 
     // basic EDM variables
-    auto EFCBPt = Monitored::Scalar<float>(m_group+"_EFCB_Pt",-999.);
-    auto EFCBEta = Monitored::Scalar<float>(m_group+"_EFCB_Eta",-999.);
-    auto EFCBPhi = Monitored::Scalar<float>(m_group+"_EFCB_Phi",-999.);
+    auto EFCBPt = Monitored::Scalar<float>(chain+"_EFCB_Pt",-999.);
+    auto EFCBEta = Monitored::Scalar<float>(chain+"_EFCB_Eta",-999.);
+    auto EFCBPhi = Monitored::Scalar<float>(chain+"_EFCB_Phi",-999.);
 
-    EFCBPt = (*muCBEL)->pt()/1e3 * (*muCBEL)->charge(); // convert to GeV
-    EFCBEta = (*muCBEL)->eta();
-    EFCBPhi = (*muCBEL)->phi();
+    EFCBPt = EFCBTrack->pt()/1e3 * EFCBTrack->charge(); // convert to GeV
+    EFCBEta = EFCBTrack->eta();
+    EFCBPhi = EFCBTrack->phi();
 
-    fill(m_group, EFCBPt, EFCBEta, EFCBPhi);
+    fill(m_group+"_"+chain, EFCBPt, EFCBEta, EFCBPhi);
   }
 
   return StatusCode::SUCCESS;
@@ -68,25 +79,25 @@ StatusCode EFMuonMonMT :: fillVariablesPerOfflineMuonPerChain(const EventContext
 
   // OfflineSA
   if( OfflineSATrack ){
-    auto OfflineSAPt = Monitored::Scalar<float>(m_group+"_OfflineSA_Pt",-999.);
-    auto OfflineSAEta = Monitored::Scalar<float>(m_group+"_OfflineSA_Eta",-999.);
-    auto OfflineSAPhi = Monitored::Scalar<float>(m_group+"_OfflineSA_Phi",-999.);
+    auto OfflineSAPt = Monitored::Scalar<float>(chain+"_OfflineSA_Pt",-999.);
+    auto OfflineSAEta = Monitored::Scalar<float>(chain+"_OfflineSA_Eta",-999.);
+    auto OfflineSAPhi = Monitored::Scalar<float>(chain+"_OfflineSA_Phi",-999.);
 
-    auto matchedEFSA = Monitored::Scalar<bool>(m_group+"_matchedEFSA",false);
-    auto matchedL2SA = Monitored::Scalar<bool>(m_group+"_matchedL2SA",false);
+    auto matchedEFSA = Monitored::Scalar<bool>(chain+"_matchedEFSA",false);
+    auto matchedL2SA = Monitored::Scalar<bool>(chain+"_matchedL2SA",false);
 
-    auto OfflineSAmatchedL2SAPt = Monitored::Scalar<float>(m_group+"_OfflineSAmatchedL2SA_Pt",-999.);
-    auto OfflineSAmatchedL2SAEta = Monitored::Scalar<float>(m_group+"_OfflineSAmatchedL2SA_Eta",-999.);
-    auto OfflineSAmatchedL2SAPhi = Monitored::Scalar<float>(m_group+"_OfflineSAmatchedL2SA_Phi",-999.);
+    auto OfflineSAmatchedL2SAPt = Monitored::Scalar<float>(chain+"_OfflineSAmatchedL2SA_Pt",-999.);
+    auto OfflineSAmatchedL2SAEta = Monitored::Scalar<float>(chain+"_OfflineSAmatchedL2SA_Eta",-999.);
+    auto OfflineSAmatchedL2SAPhi = Monitored::Scalar<float>(chain+"_OfflineSAmatchedL2SA_Phi",-999.);
  
-    auto MatchedEFSAPt = Monitored::Scalar<float>(m_group+"_MatchedEFSA_Pt",-999.);
-    auto MatchedEFSAEta = Monitored::Scalar<float>(m_group+"_MatchedEFSA_Eta",-999.);
-    auto MatchedEFSAPhi = Monitored::Scalar<float>(m_group+"_MatchedEFSA_Phi",-999.);
+    auto MatchedEFSAPt = Monitored::Scalar<float>(chain+"_MatchedEFSA_Pt",-999.);
+    auto MatchedEFSAEta = Monitored::Scalar<float>(chain+"_MatchedEFSA_Eta",-999.);
+    auto MatchedEFSAPhi = Monitored::Scalar<float>(chain+"_MatchedEFSA_Phi",-999.);
 
-    auto SAdR = Monitored::Scalar<float>(m_group+"_SAdR",1000.);
-    auto SAdPt = Monitored::Scalar<float>(m_group+"_SAdPt",-999.);
-    auto SAdEta = Monitored::Scalar<float>(m_group+"_SAdEta",-999.);
-    auto SAdPhi = Monitored::Scalar<float>(m_group+"_SAdPhi",-999.);
+    auto SAdR = Monitored::Scalar<float>(chain+"_SAdR",1000.);
+    auto SAdPt = Monitored::Scalar<float>(chain+"_SAdPt",-999.);
+    auto SAdEta = Monitored::Scalar<float>(chain+"_SAdEta",-999.);
+    auto SAdPhi = Monitored::Scalar<float>(chain+"_SAdPhi",-999.);
 
     // basic EDM variables
     OfflineSAPt = OfflineSATrack->pt()/1e3 * OfflineSATrack->charge(); // convert to GeV
@@ -132,32 +143,32 @@ StatusCode EFMuonMonMT :: fillVariablesPerOfflineMuonPerChain(const EventContext
         }
       }
     }
-    fill(m_group, OfflineSAPt, OfflineSAEta, OfflineSAPhi, OfflineSAmatchedL2SAPt, OfflineSAmatchedL2SAEta, OfflineSAmatchedL2SAPhi,
+    fill(m_group+"_"+chain, OfflineSAPt, OfflineSAEta, OfflineSAPhi, OfflineSAmatchedL2SAPt, OfflineSAmatchedL2SAEta, OfflineSAmatchedL2SAPhi,
          MatchedEFSAPt, MatchedEFSAEta, MatchedEFSAPhi, SAdPt, SAdEta, SAdPhi, SAdR, matchedEFSA, matchedL2SA);
   }
 
 
   // OfflineCB
   if( OfflineCBTrack ){
-    auto OfflineCBPt = Monitored::Scalar<float>(m_group+"_OfflineCB_Pt",-999.);
-    auto OfflineCBEta = Monitored::Scalar<float>(m_group+"_OfflineCB_Eta",-999.);
-    auto OfflineCBPhi = Monitored::Scalar<float>(m_group+"_OfflineCB_Phi",-999.);
+    auto OfflineCBPt = Monitored::Scalar<float>(chain+"_OfflineCB_Pt",-999.);
+    auto OfflineCBEta = Monitored::Scalar<float>(chain+"_OfflineCB_Eta",-999.);
+    auto OfflineCBPhi = Monitored::Scalar<float>(chain+"_OfflineCB_Phi",-999.);
 
-    auto matchedEFCB = Monitored::Scalar<bool>(m_group+"_matchedEFCB",false);
-    auto matchedL2CB = Monitored::Scalar<bool>(m_group+"_matchedL2CB",false);
+    auto matchedEFCB = Monitored::Scalar<bool>(chain+"_matchedEFCB",false);
+    auto matchedL2CB = Monitored::Scalar<bool>(chain+"_matchedL2CB",false);
 
-    auto OfflineCBmatchedL2CBPt = Monitored::Scalar<float>(m_group+"_OfflineCBmatchedL2CB_Pt",-999.);
-    auto OfflineCBmatchedL2CBEta = Monitored::Scalar<float>(m_group+"_OfflineCBmatchedL2CB_Eta",-999.);
-    auto OfflineCBmatchedL2CBPhi = Monitored::Scalar<float>(m_group+"_OfflineCBmatchedL2CB_Phi",-999.);
+    auto OfflineCBmatchedL2CBPt = Monitored::Scalar<float>(chain+"_OfflineCBmatchedL2CB_Pt",-999.);
+    auto OfflineCBmatchedL2CBEta = Monitored::Scalar<float>(chain+"_OfflineCBmatchedL2CB_Eta",-999.);
+    auto OfflineCBmatchedL2CBPhi = Monitored::Scalar<float>(chain+"_OfflineCBmatchedL2CB_Phi",-999.);
  
-    auto MatchedEFCBPt = Monitored::Scalar<float>(m_group+"_MatchedEFCB_Pt",-999.);
-    auto MatchedEFCBEta = Monitored::Scalar<float>(m_group+"_MatchedEFCB_Eta",-999.);
-    auto MatchedEFCBPhi = Monitored::Scalar<float>(m_group+"_MatchedEFCB_Phi",-999.);
+    auto MatchedEFCBPt = Monitored::Scalar<float>(chain+"_MatchedEFCB_Pt",-999.);
+    auto MatchedEFCBEta = Monitored::Scalar<float>(chain+"_MatchedEFCB_Eta",-999.);
+    auto MatchedEFCBPhi = Monitored::Scalar<float>(chain+"_MatchedEFCB_Phi",-999.);
   
-    auto CBdR = Monitored::Scalar<float>(m_group+"_CBdR",1000.);
-    auto CBdPt = Monitored::Scalar<float>(m_group+"_CBdPt",-999.);
-    auto CBdEta = Monitored::Scalar<float>(m_group+"_CBdEta",-999.);
-    auto CBdPhi = Monitored::Scalar<float>(m_group+"_CBdPhi",-999.);
+    auto CBdR = Monitored::Scalar<float>(chain+"_CBdR",1000.);
+    auto CBdPt = Monitored::Scalar<float>(chain+"_CBdPt",-999.);
+    auto CBdEta = Monitored::Scalar<float>(chain+"_CBdEta",-999.);
+    auto CBdPhi = Monitored::Scalar<float>(chain+"_CBdPhi",-999.);
 
     // basic EDM variables
     OfflineCBPt = OfflineCBTrack->pt()/1e3 * OfflineCBTrack->charge(); // convert to GeV
@@ -203,9 +214,36 @@ StatusCode EFMuonMonMT :: fillVariablesPerOfflineMuonPerChain(const EventContext
         }
       }
     }
-    fill(m_group, OfflineCBPt, OfflineCBEta, OfflineCBPhi, OfflineCBmatchedL2CBPt, OfflineCBmatchedL2CBEta, OfflineCBmatchedL2CBPhi,
+    fill(m_group+"_"+chain, OfflineCBPt, OfflineCBEta, OfflineCBPhi, OfflineCBmatchedL2CBPt, OfflineCBmatchedL2CBEta, OfflineCBmatchedL2CBPhi,
          MatchedEFCBPt, MatchedEFCBEta, MatchedEFCBPhi, CBdPt, CBdEta, CBdPhi, CBdR, matchedEFCB, matchedL2CB);
   }
 
   return StatusCode::SUCCESS;
 }
+
+
+StatusCode EFMuonMonMT :: fillVariables(const EventContext &ctx) const {
+
+  ATH_MSG_DEBUG ("Filling histograms for " << name() << "...");
+
+  ATH_CHECK( fillVariableEtaPhi<xAOD::Muon>(ctx, m_EFSAMuonContainerKey, "EFSA", &MuonMatchingTool::PosForMatchSATrack));
+  ATH_CHECK( fillVariableEtaPhi<xAOD::Muon>(ctx, m_EFCBMuonContainerKey, "EFCB", &MuonMatchingTool::PosForMatchCBTrack));
+
+  return StatusCode::SUCCESS;
+
+}
+
+
+StatusCode EFMuonMonMT :: fillVariablesPerOfflineMuon(const EventContext &ctx, const xAOD::Muon* mu) const {
+
+  ATH_CHECK( fillVariablesRatioPlots<xAOD::Muon>(ctx, mu, "EFSA", xAOD::Muon::TrackParticleType::ExtrapolatedMuonSpectrometerTrackParticle,
+                                                 [this](const EventContext &ctx, const xAOD::Muon *mu){ return m_matchTool->matchEFSAReadHandle(ctx,mu); }
+                                                 )); 
+
+  ATH_CHECK( fillVariablesRatioPlots<xAOD::Muon>(ctx, mu, "EFCB", xAOD::Muon::TrackParticleType::CombinedTrackParticle,
+                                                 [this](const EventContext &ctx, const xAOD::Muon *mu){ return m_matchTool->matchEFCBReadHandle(ctx,mu); }
+                                                 )); 
+
+  return StatusCode::SUCCESS;
+
+}
diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/EFMuonMonMT.h b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/EFMuonMonMT.h
index 24b80ad36ba7a93dc60488d36c1a2ca9d815a6fe..1475e7fe8af5cee6524dc51461ea0d931ec4c219 100644
--- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/EFMuonMonMT.h
+++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/EFMuonMonMT.h
@@ -16,9 +16,17 @@ class EFMuonMonMT : public TrigMuonMonitorAlgorithm{
  public:
   EFMuonMonMT(const std::string& name, ISvcLocator* pSvcLocator );
 
+  virtual StatusCode initialize() override;
+
  protected:
   virtual StatusCode fillVariablesPerChain(const EventContext &ctx, const std::string &chain) const override;
   virtual StatusCode fillVariablesPerOfflineMuonPerChain(const EventContext &ctx, const xAOD::Muon* mu, const std::string &chain) const override;
+  virtual StatusCode fillVariables(const EventContext& ctx) const override;
+  virtual StatusCode fillVariablesPerOfflineMuon(const EventContext &ctx, const xAOD::Muon* mu) const override;
+
+ private:
+  SG::ReadHandleKey<xAOD::MuonContainer> m_EFSAMuonContainerKey {this, "EFSAMuonContainerName", "HLT_Muons_RoI", "EFSAMuon container"};
+  SG::ReadHandleKey<xAOD::MuonContainer> m_EFCBMuonContainerKey {this, "EFCBMuonContainerName", "HLT_MuonsCB_RoI", "EFCBMuon container"};
 
 };
 
diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/L2MuonSAMonMT.cxx b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/L2MuonSAMonMT.cxx
index bbbb10f6010e68dd7c19d7010353ab99e3ef1608..c6efdba50540378d9a44652d3e7836604fb6bc7e 100644
--- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/L2MuonSAMonMT.cxx
+++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/L2MuonSAMonMT.cxx
@@ -12,11 +12,18 @@ L2MuonSAMonMT :: L2MuonSAMonMT(const std::string& name, ISvcLocator* pSvcLocator
 {}
 
 
+StatusCode L2MuonSAMonMT :: initialize(){
+  StatusCode sc = TrigMuonMonitorAlgorithm::initialize();
+  ATH_CHECK( m_L2MuonSAContainerKey.initialize() );
+  return sc;
+}
+
+
 StatusCode L2MuonSAMonMT :: fillVariablesPerChain(const EventContext &ctx, const std::string &chain) const {
 
   ATH_MSG_DEBUG ("Filling histograms for " << name() << "...");
 
-  auto lb = Monitored::Scalar<int>(m_group+"_LB",-1.0);
+  auto lb = Monitored::Scalar<int>(chain+"_LB",-1.0);
   lb = GetEventInfo(ctx)->lumiBlock();
 
   const float ZERO_LIMIT = 0.00001;
@@ -28,13 +35,13 @@ StatusCode L2MuonSAMonMT :: fillVariablesPerChain(const EventContext &ctx, const
 
 
     // basic EDM variables
-    auto saPt = Monitored::Scalar<float>(m_group+"_Pt",-999.);
-    auto saEta = Monitored::Scalar<float>(m_group+"_Eta",-999.);
-    auto saPhi = Monitored::Scalar<float>(m_group+"_Phi",-999.);
-    auto saddr = Monitored::Scalar<int>(m_group+"_saddr",-999.);
-    auto roiEta = Monitored::Scalar<float>(m_group+"_roiEta",-999.);
-    auto roiPhi = Monitored::Scalar<float>(m_group+"_roiPhi",-999.);
-    auto mf_failure = Monitored::Scalar<bool>(m_group+"_mf_failure",false);
+    auto saPt = Monitored::Scalar<float>(chain+"_Pt",-999.);
+    auto saEta = Monitored::Scalar<float>(chain+"_Eta",-999.);
+    auto saPhi = Monitored::Scalar<float>(chain+"_Phi",-999.);
+    auto saddr = Monitored::Scalar<int>(chain+"_saddr",-999.);
+    auto roiEta = Monitored::Scalar<float>(chain+"_roiEta",-999.);
+    auto roiPhi = Monitored::Scalar<float>(chain+"_roiPhi",-999.);
+    auto mf_failure = Monitored::Scalar<bool>(chain+"_mf_failure",false);
 
     saPt = (*muEL)->pt();
     saEta = (*muEL)->eta();
@@ -46,22 +53,22 @@ StatusCode L2MuonSAMonMT :: fillVariablesPerChain(const EventContext &ctx, const
     ATH_MSG_DEBUG("saPt = " << saPt << ", saEta =" << saEta << ", saPhi = " << saPhi << ", saddr = " << saddr);
     if(std::abs(saPt) < ZERO_LIMIT) mf_failure = true;
 
-    fill(m_group, roiEta, roiPhi, mf_failure);
+    fill(m_group+"_"+chain, roiEta, roiPhi, mf_failure);
     if( mf_failure ) continue;
 
     // define barrel or endcap
-    auto isBarrel = Monitored::Scalar<bool>(m_group+"_isBarrel",false);
-    auto isEndcap = Monitored::Scalar<bool>(m_group+"_isEndcap",false);
+    auto isBarrel = Monitored::Scalar<bool>(chain+"_isBarrel",false);
+    auto isEndcap = Monitored::Scalar<bool>(chain+"_isEndcap",false);
 
     if(saddr == -1)  isEndcap = true;
     else isBarrel = true;;
 
-    fill(m_group, saPt, saEta, saPhi, saddr, isBarrel, isEndcap);
+    fill(m_group+"_"+chain, saPt, saEta, saPhi, saddr, isBarrel, isEndcap);
 
 
     // define process flow
     std::vector<int> proc_flow;
-    auto mon_proc_flow = Monitored::Collection(m_group+"_proc_flow", proc_flow);
+    auto mon_proc_flow = Monitored::Collection(chain+"_proc_flow", proc_flow);
 
     bool isL1hitThere               = false;
     bool isL1emuOkForTriggerPlane   = false;
@@ -72,11 +79,11 @@ StatusCode L2MuonSAMonMT :: fillVariablesPerChain(const EventContext &ctx, const
 
     // detector variables
     // RPC and TGC
-    auto nRPC = Monitored::Scalar<int>(m_group+"_RPC_Pad_N",0);
-    auto TGCMidRhoChi2 = Monitored::Scalar<float>(m_group+"_TGC_Mid_rho_chi2",-1.0);
-    auto TGCMidPhiChi2 = Monitored::Scalar<float>(m_group+"_TGC_Mid_phi_chi2",-1.0);
-    auto nTGCMidRho = Monitored::Scalar<int>(m_group+"_TGC_Mid_rho_N",0);
-    auto nTGCMidPhi = Monitored::Scalar<int>(m_group+"_TGC_Mid_phi_N",0);
+    auto nRPC = Monitored::Scalar<int>(chain+"_RPC_Pad_N",0);
+    auto TGCMidRhoChi2 = Monitored::Scalar<float>(chain+"_TGC_Mid_rho_chi2",-1.0);
+    auto TGCMidPhiChi2 = Monitored::Scalar<float>(chain+"_TGC_Mid_phi_chi2",-1.0);
+    auto nTGCMidRho = Monitored::Scalar<int>(chain+"_TGC_Mid_rho_N",0);
+    auto nTGCMidPhi = Monitored::Scalar<int>(chain+"_TGC_Mid_phi_N",0);
 
     nRPC = (*muEL)->rpcHitLayer().size();
     TGCMidRhoChi2 = (*muEL)->tgcMidRhoChi2();
@@ -84,7 +91,7 @@ StatusCode L2MuonSAMonMT :: fillVariablesPerChain(const EventContext &ctx, const
     nTGCMidRho = (*muEL)->tgcMidRhoN();
     nTGCMidPhi = (*muEL)->tgcMidPhiN();
 
-    fill(m_group, nRPC, TGCMidRhoChi2, TGCMidPhiChi2, nTGCMidRho, nTGCMidPhi, isBarrel, isEndcap);
+    fill(m_group+"_"+chain, nRPC, TGCMidRhoChi2, TGCMidPhiChi2, nTGCMidRho, nTGCMidPhi, isBarrel, isEndcap);
 
 
     // use process flow
@@ -124,8 +131,8 @@ StatusCode L2MuonSAMonMT :: fillVariablesPerChain(const EventContext &ctx, const
     sp_r.clear();
     sp_z.clear();
 
-    auto mon_sp_r= Monitored::Collection(m_group+"_MDTpoints_r", sp_r);
-    auto mon_sp_z= Monitored::Collection(m_group+"_MDTpoints_z", sp_z);
+    auto mon_sp_r= Monitored::Collection(chain+"_MDTpoints_r", sp_r);
+    auto mon_sp_z= Monitored::Collection(chain+"_MDTpoints_z", sp_z);
 
     if( std::abs((*muEL)->superPointR(inner)) > ZERO_LIMIT ) {
       sp_r.push_back( sign * (*muEL)->superPointR(inner) );
@@ -140,17 +147,17 @@ StatusCode L2MuonSAMonMT :: fillVariablesPerChain(const EventContext &ctx, const
       sp_z.push_back( (*muEL)->superPointZ(outer) );
     }
 
-    fill(m_group, mon_sp_r, mon_sp_z);
+    fill(m_group+"_"+chain, mon_sp_r, mon_sp_z);
 
 
     // MDT
-    auto MDTInnChi2 = Monitored::Scalar<float>(m_group+"_MDT_Inn_fit_chi2",-1.0);
-    auto MDTMidChi2 = Monitored::Scalar<float>(m_group+"_MDT_Mid_fit_chi2",-1.0);
-    auto MDTOutChi2 = Monitored::Scalar<float>(m_group+"_MDT_Out_fit_chi2",-1.0);
-    auto n_mdt_hits = Monitored::Scalar<int>(m_group+"_MDT_N",0);
-    auto n_mdt_hits_inner = Monitored::Scalar<int>(m_group+"_MDT_Inn_N",0);
-    auto n_mdt_hits_middle = Monitored::Scalar<int>(m_group+"_MDT_Mid_N",0);
-    auto n_mdt_hits_outer = Monitored::Scalar<int>(m_group+"_MDT_Out_N",0);
+    auto MDTInnChi2 = Monitored::Scalar<float>(chain+"_MDT_Inn_fit_chi2",-1.0);
+    auto MDTMidChi2 = Monitored::Scalar<float>(chain+"_MDT_Mid_fit_chi2",-1.0);
+    auto MDTOutChi2 = Monitored::Scalar<float>(chain+"_MDT_Out_fit_chi2",-1.0);
+    auto n_mdt_hits = Monitored::Scalar<int>(chain+"_MDT_N",0);
+    auto n_mdt_hits_inner = Monitored::Scalar<int>(chain+"_MDT_Inn_N",0);
+    auto n_mdt_hits_middle = Monitored::Scalar<int>(chain+"_MDT_Mid_N",0);
+    auto n_mdt_hits_outer = Monitored::Scalar<int>(chain+"_MDT_Out_N",0);
 
     MDTInnChi2 = (*muEL)->superPointChi2(inner);
     MDTMidChi2 = (*muEL)->superPointChi2(middle);
@@ -162,9 +169,9 @@ StatusCode L2MuonSAMonMT :: fillVariablesPerChain(const EventContext &ctx, const
     res_mid.clear();
     res_out.clear();
 
-    auto mon_res_inn = Monitored::Collection(m_group+"_MDT_Inn_residual",res_inn);
-    auto mon_res_mid = Monitored::Collection(m_group+"_MDT_Mid_residual",res_mid);
-    auto mon_res_out = Monitored::Collection(m_group+"_MDT_Out_residual",res_out);
+    auto mon_res_inn = Monitored::Collection(chain+"_MDT_Inn_residual",res_inn);
+    auto mon_res_mid = Monitored::Collection(chain+"_MDT_Mid_residual",res_mid);
+    auto mon_res_out = Monitored::Collection(chain+"_MDT_Out_residual",res_out);
 
 
     n_mdt_hits = (*muEL)->nMdtHits();
@@ -187,7 +194,7 @@ StatusCode L2MuonSAMonMT :: fillVariablesPerChain(const EventContext &ctx, const
       }
     }
 
-    fill(m_group, MDTInnChi2, MDTMidChi2, MDTOutChi2, n_mdt_hits, n_mdt_hits_inner, n_mdt_hits_middle, n_mdt_hits_outer, mon_res_inn, mon_res_mid, mon_res_out, lb, isBarrel, isEndcap);
+    fill(m_group+"_"+chain, MDTInnChi2, MDTMidChi2, MDTOutChi2, n_mdt_hits, n_mdt_hits_inner, n_mdt_hits_middle, n_mdt_hits_outer, mon_res_inn, mon_res_mid, mon_res_out, lb, isBarrel, isEndcap);
 
 
     // use process flow
@@ -206,7 +213,7 @@ StatusCode L2MuonSAMonMT :: fillVariablesPerChain(const EventContext &ctx, const
     if( isMDTFitOkForTriggerPlane )    proc_flow.push_back(5);
     if( isMDTFitOkFor2Plane )          proc_flow.push_back(6);
 
-    fill(m_group, mon_proc_flow);
+    fill(m_group+"_"+chain, mon_proc_flow);
 
 
     // matching to offline
@@ -217,11 +224,11 @@ StatusCode L2MuonSAMonMT :: fillVariablesPerChain(const EventContext &ctx, const
     std::vector<float> res_mid_OffMatch = res_mid;
     std::vector<float> res_out_OffMatch = res_out;
 
-    auto mon_res_inn_OffMatch = Monitored::Collection(m_group+"_MDT_Inn_residual_OffMatch",res_inn_OffMatch);
-    auto mon_res_mid_OffMatch = Monitored::Collection(m_group+"_MDT_Mid_residual_OffMatch",res_mid_OffMatch);
-    auto mon_res_out_OffMatch = Monitored::Collection(m_group+"_MDT_Out_residual_OffMatch",res_out_OffMatch);
+    auto mon_res_inn_OffMatch = Monitored::Collection(chain+"_MDT_Inn_residual_OffMatch",res_inn_OffMatch);
+    auto mon_res_mid_OffMatch = Monitored::Collection(chain+"_MDT_Mid_residual_OffMatch",res_mid_OffMatch);
+    auto mon_res_out_OffMatch = Monitored::Collection(chain+"_MDT_Out_residual_OffMatch",res_out_OffMatch);
 
-    fill(m_group, mon_res_inn_OffMatch, mon_res_mid_OffMatch, mon_res_out_OffMatch, isBarrel, isEndcap);
+    fill(m_group+"_"+chain, mon_res_inn_OffMatch, mon_res_mid_OffMatch, mon_res_out_OffMatch, isBarrel, isEndcap);
 
   }
 
@@ -238,8 +245,8 @@ StatusCode L2MuonSAMonMT :: fillVariablesPerOfflineMuonPerChain(const EventConte
 
 
   // offline muon variables
-  auto offEta = Monitored::Scalar<float>(m_group+"_offEta",-999.);
-  auto offPt_signed = Monitored::Scalar<float>(m_group+"_offPt_signed",-999.);
+  auto offEta = Monitored::Scalar<float>(chain+"_offEta",-999.);
+  auto offPt_signed = Monitored::Scalar<float>(chain+"_offPt_signed",-999.);
   offEta = mu->eta();
 
   float offPt = mu->pt()/1e3;
@@ -255,10 +262,10 @@ StatusCode L2MuonSAMonMT :: fillVariablesPerOfflineMuonPerChain(const EventConte
 
 
   // dR wrt offline
-  auto dRmin = Monitored::Scalar<float>(m_group+"_dRmin",1000.);
+  auto dRmin = Monitored::Scalar<float>(chain+"_dRmin",1000.);
   dRmin = xAOD::P4Helpers::deltaR(mu, *muEL, false); 
 
-  fill(m_group, dRmin);
+  fill(m_group+"_"+chain, dRmin);
   if( ! m_matchTool->isMatchedL2SA( *muEL, mu) ) return StatusCode::SUCCESS; // not matched to L2MuonSA
 
   
@@ -267,20 +274,20 @@ StatusCode L2MuonSAMonMT :: fillVariablesPerOfflineMuonPerChain(const EventConte
   float roiEta = (*muEL)->roiEta();
   float roiPhi = (*muEL)->roiPhi();
 
-  auto roidEta = Monitored::Scalar<float>(m_group+"_initialRoI_dEta",-999.);
-  auto roidPhi = Monitored::Scalar<float>(m_group+"_initialRoI_dPhi",-999.);
-  auto roidR = Monitored::Scalar<float>(m_group+"_initialRoI_dR",-999.);
+  auto roidEta = Monitored::Scalar<float>(chain+"_initialRoI_dEta",-999.);
+  auto roidPhi = Monitored::Scalar<float>(chain+"_initialRoI_dPhi",-999.);
+  auto roidR = Monitored::Scalar<float>(chain+"_initialRoI_dR",-999.);
 
   roidEta = roiEta - offEta;
   roidPhi = xAOD::P4Helpers::deltaPhi(offPhi, roiPhi);
   roidR = sqrt(roidEta*roidEta + roidPhi*roidPhi);
   
-  fill(m_group, roidEta, roidPhi, roidR, offEta);
+  fill(m_group+"_"+chain, roidEta, roidPhi, roidR, offEta);
 
 
   // pt resolution, inverse pt resolution
-  auto ptresol = Monitored::Scalar<float>(m_group+"_ptresol",-999.);
-  auto invptresol = Monitored::Scalar<float>(m_group+"_invptresol",-999.);
+  auto ptresol = Monitored::Scalar<float>(chain+"_ptresol",-999.);
+  auto invptresol = Monitored::Scalar<float>(chain+"_invptresol",-999.);
   if ( std::abs(offPt) > ZERO_LIMIT && std::abs(saPt) > ZERO_LIMIT ) {
     ptresol = std::abs(saPt)/std::abs(offPt) - 1.;
     invptresol = (1./(offPt * offCharge) - 1./saPt) / (1./(offPt * offCharge));
@@ -292,8 +299,8 @@ StatusCode L2MuonSAMonMT :: fillVariablesPerOfflineMuonPerChain(const EventConte
   invptresol_pos.clear();
   invptresol_neg.clear();
 
-  auto mon_invptresol_pos = Monitored::Collection(m_group+"_invptresol_pos",invptresol_pos);
-  auto mon_invptresol_neg = Monitored::Collection(m_group+"_invptresol_neg",invptresol_neg);
+  auto mon_invptresol_pos = Monitored::Collection(chain+"_invptresol_pos",invptresol_pos);
+  auto mon_invptresol_neg = Monitored::Collection(chain+"_invptresol_neg",invptresol_neg);
 
   if( offCharge > 0. ) invptresol_pos.push_back(invptresol);
   else invptresol_neg.push_back(invptresol);
@@ -305,25 +312,25 @@ StatusCode L2MuonSAMonMT :: fillVariablesPerOfflineMuonPerChain(const EventConte
   const float ETA_OF_ENDCAP2   = 2.0;
   const float ETA_OF_ENDCAP3   = 2.5;
 
-  auto isBarrel = Monitored::Scalar<bool>(m_group+"_isBarrel",false);
-  auto isBarrelA = Monitored::Scalar<bool>(m_group+"_isBarrelA",false);
-  auto isBarrelC = Monitored::Scalar<bool>(m_group+"_isBarrelC",false);
-  auto isEndcapA = Monitored::Scalar<bool>(m_group+"_isEndcapA",false);
-  auto isEndcapC = Monitored::Scalar<bool>(m_group+"_isEndcapC",false);
-  auto isEndcap1 = Monitored::Scalar<bool>(m_group+"_isEndcap1",false);
-  auto isEndcap2 = Monitored::Scalar<bool>(m_group+"_isEndcap2",false);
-  auto isEndcap3 = Monitored::Scalar<bool>(m_group+"_isEndcap3",false);
-  auto isEndcap1A = Monitored::Scalar<bool>(m_group+"_isEndcap1A",false);
-  auto isEndcap2A = Monitored::Scalar<bool>(m_group+"_isEndcap2A",false);
-  auto isEndcap3A = Monitored::Scalar<bool>(m_group+"_isEndcap3A",false);
-  auto isEndcap1C = Monitored::Scalar<bool>(m_group+"_isEndcap1C",false);
-  auto isEndcap2C = Monitored::Scalar<bool>(m_group+"_isEndcap2C",false);
-  auto isEndcap3C = Monitored::Scalar<bool>(m_group+"_isEndcap3C",false);
+  auto isBarrel = Monitored::Scalar<bool>(chain+"_isBarrel",false);
+  auto isBarrelA = Monitored::Scalar<bool>(chain+"_isBarrelA",false);
+  auto isBarrelC = Monitored::Scalar<bool>(chain+"_isBarrelC",false);
+  auto isEndcapA = Monitored::Scalar<bool>(chain+"_isEndcapA",false);
+  auto isEndcapC = Monitored::Scalar<bool>(chain+"_isEndcapC",false);
+  auto isEndcap1 = Monitored::Scalar<bool>(chain+"_isEndcap1",false);
+  auto isEndcap2 = Monitored::Scalar<bool>(chain+"_isEndcap2",false);
+  auto isEndcap3 = Monitored::Scalar<bool>(chain+"_isEndcap3",false);
+  auto isEndcap1A = Monitored::Scalar<bool>(chain+"_isEndcap1A",false);
+  auto isEndcap2A = Monitored::Scalar<bool>(chain+"_isEndcap2A",false);
+  auto isEndcap3A = Monitored::Scalar<bool>(chain+"_isEndcap3A",false);
+  auto isEndcap1C = Monitored::Scalar<bool>(chain+"_isEndcap1C",false);
+  auto isEndcap2C = Monitored::Scalar<bool>(chain+"_isEndcap2C",false);
+  auto isEndcap3C = Monitored::Scalar<bool>(chain+"_isEndcap3C",false);
 
   // offline pt variables
-  auto pt4to6 = Monitored::Scalar<bool>(m_group+"_pt4to6",false);
-  auto pt6to8 = Monitored::Scalar<bool>(m_group+"_pt6to8",false);
-  auto ptover8 = Monitored::Scalar<bool>(m_group+"_ptover8",false);
+  auto pt4to6 = Monitored::Scalar<bool>(chain+"_pt4to6",false);
+  auto pt6to8 = Monitored::Scalar<bool>(chain+"_pt6to8",false);
+  auto ptover8 = Monitored::Scalar<bool>(chain+"_ptover8",false);
 
 
   // define region
@@ -366,9 +373,33 @@ StatusCode L2MuonSAMonMT :: fillVariablesPerOfflineMuonPerChain(const EventConte
   }
 
 
-  fill(m_group, ptresol, offPt_signed, offEta, isBarrel, isEndcap1, isEndcap2, isEndcap3, isBarrelA, isBarrelC, isEndcapA, isEndcapC, pt4to6, pt6to8, ptover8);  
-  fill(m_group, mon_invptresol_pos, mon_invptresol_neg, isBarrelA, isBarrelC, isEndcap1A, isEndcap2A, isEndcap3A, isEndcap1C, isEndcap2C, isEndcap3C);
+  fill(m_group+"_"+chain, ptresol, offPt_signed, offEta, isBarrel, isEndcap1, isEndcap2, isEndcap3, isBarrelA, isBarrelC, isEndcapA, isEndcapC, pt4to6, pt6to8, ptover8);  
+  fill(m_group+"_"+chain, mon_invptresol_pos, mon_invptresol_neg, isBarrelA, isBarrelC, isEndcap1A, isEndcap2A, isEndcap3A, isEndcap1C, isEndcap2C, isEndcap3C);
 
   
   return StatusCode::SUCCESS;
 }
+
+
+
+StatusCode L2MuonSAMonMT :: fillVariables(const EventContext &ctx) const {
+
+  ATH_MSG_DEBUG ("Filling histograms for " << name() << "...");
+
+  ATH_CHECK( fillVariableEtaPhi<xAOD::L2StandAloneMuon>(ctx, m_L2MuonSAContainerKey, "L2SA"));
+
+  return StatusCode::SUCCESS;
+
+}
+
+
+
+StatusCode L2MuonSAMonMT :: fillVariablesPerOfflineMuon(const EventContext &ctx, const xAOD::Muon* mu) const {
+
+  ATH_CHECK( fillVariablesRatioPlots<xAOD::L2StandAloneMuon>(ctx, mu, "L2SA", xAOD::Muon::TrackParticleType::ExtrapolatedMuonSpectrometerTrackParticle,
+                                                             [this](const EventContext &ctx, const xAOD::Muon *mu){ return m_matchTool->matchL2SAReadHandle(ctx,mu); }
+                                                             ));
+
+  return StatusCode::SUCCESS;
+
+}
diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/L2MuonSAMonMT.h b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/L2MuonSAMonMT.h
index 5edf8cc10ba8589a997ea9688245e8acd3255748..92f23b13f5dabf135735df567e3e0b4c1e245ddd 100644
--- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/L2MuonSAMonMT.h
+++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/L2MuonSAMonMT.h
@@ -16,10 +16,16 @@ class L2MuonSAMonMT : public TrigMuonMonitorAlgorithm{
  public:
   L2MuonSAMonMT(const std::string& name, ISvcLocator* pSvcLocator );
 
+  virtual StatusCode initialize() override;
+
  protected:
   virtual StatusCode fillVariablesPerChain(const EventContext &ctx, const std::string &chain) const override;
   virtual StatusCode fillVariablesPerOfflineMuonPerChain(const EventContext& ctx, const xAOD::Muon* mu, const std::string &chain) const override;
+  virtual StatusCode fillVariables(const EventContext& ctx) const override;
+  virtual StatusCode fillVariablesPerOfflineMuon(const EventContext &ctx, const xAOD::Muon* mu) const override;
 
+ private:
+  SG::ReadHandleKey<xAOD::L2StandAloneMuonContainer> m_L2MuonSAContainerKey {this, "L2StandAloneMuonContainerName", "HLT_MuonL2SAInfo", "L2MuonSA container"};
 
 };
 
diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/L2muCombMonMT.cxx b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/L2muCombMonMT.cxx
index 606678a98e7b798828ee3c2c18871168f397322c..f35b45fead82f70bd2396826ac345aad3d327b99 100644
--- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/L2muCombMonMT.cxx
+++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/L2muCombMonMT.cxx
@@ -12,6 +12,13 @@ L2muCombMonMT :: L2muCombMonMT(const std::string& name, ISvcLocator* pSvcLocator
 {}
 
 
+StatusCode L2muCombMonMT :: initialize(){
+  StatusCode sc = TrigMuonMonitorAlgorithm::initialize();
+  ATH_CHECK( m_L2muCombContainerKey.initialize() );
+  return sc;
+}
+
+
 StatusCode L2muCombMonMT :: fillVariablesPerChain(const EventContext &ctx, const std::string &chain) const {
 
   ATH_MSG_DEBUG ("Filling histograms for " << name() << "...");
@@ -33,17 +40,17 @@ StatusCode L2muCombMonMT :: fillVariablesPerChain(const EventContext &ctx, const
 
 
     // basic EDM variables
-    auto cbPt = Monitored::Scalar<float>(m_group+"_Pt",-999.);
-    auto cbEta = Monitored::Scalar<float>(m_group+"_Eta",-999.);
-    auto cbPhi = Monitored::Scalar<float>(m_group+"_Phi",-999.);
+    auto cbPt = Monitored::Scalar<float>(chain+"_Pt",-999.);
+    auto cbEta = Monitored::Scalar<float>(chain+"_Eta",-999.);
+    auto cbPhi = Monitored::Scalar<float>(chain+"_Phi",-999.);
 
     cbPt = (*muEL)->pt()/1e3 * (*muEL)->charge(); // convert to GeV
     cbEta = (*muEL)->eta();
     cbPhi = (*muEL)->phi();
 
-    auto saPt = Monitored::Scalar<float>(m_group+"_saPt",-999.);
-    auto saEta = Monitored::Scalar<float>(m_group+"_saEta",-999.);
-    auto saPhi = Monitored::Scalar<float>(m_group+"_saPhi",-999.);
+    auto saPt = Monitored::Scalar<float>(chain+"_saPt",-999.);
+    auto saEta = Monitored::Scalar<float>(chain+"_saEta",-999.);
+    auto saPhi = Monitored::Scalar<float>(chain+"_saPhi",-999.);
 
     saPt = (*saEL)->pt();
     saEta = (*saEL)->eta();
@@ -60,10 +67,10 @@ StatusCode L2muCombMonMT :: fillVariablesPerChain(const EventContext &ctx, const
 
 
     // CB and Offline matching
-    auto L2SA_success = Monitored::Scalar<bool>(m_group+"_L2SA_success",false);
-    auto L2CB_success = Monitored::Scalar<bool>(m_group+"_L2CB_success",false);
-    auto L2CBOFFmatching_failure = Monitored::Scalar<bool>(m_group+"_L2CBOFFmatching_failure",false);
-    auto L2CB_failure = Monitored::Scalar<bool>(m_group+"_L2CB_failure",false);
+    auto L2SA_success = Monitored::Scalar<bool>(chain+"_L2SA_success",false);
+    auto L2CB_success = Monitored::Scalar<bool>(chain+"_L2CB_success",false);
+    auto L2CBOFFmatching_failure = Monitored::Scalar<bool>(chain+"_L2CBOFFmatching_failure",false);
+    auto L2CB_failure = Monitored::Scalar<bool>(chain+"_L2CB_failure",false);
     bool off_cb_match = false;
     bool off_sa_match = false;
     L2SA_success = (std::abs(saPt) > ZERO_LIMIT)? true:false;
@@ -83,18 +90,18 @@ StatusCode L2muCombMonMT :: fillVariablesPerChain(const EventContext &ctx, const
     else if (off_sa_match) L2CB_failure = true;
 
     if( !L2CB_success ){
-      fill(m_group, saPt, saEta, saPhi, L2SA_success, L2CB_failure);
+      fill(m_group+"_"+chain, saPt, saEta, saPhi, L2SA_success, L2CB_failure);
       continue;
     }
 
-    fill(m_group, cbPt, cbEta, cbPhi, L2CB_success, L2CBOFFmatching_failure);
+    fill(m_group+"_"+chain, cbPt, cbEta, cbPhi, L2CB_success, L2CBOFFmatching_failure);
 
 
     // comparison L2muComb vs L2MuonSA
-    auto ptratio_toSA = Monitored::Scalar<float>(m_group+"_ptratio_toSA",-999.);
-    auto dEta_toSA = Monitored::Scalar<float>(m_group+"_dEta_toSA",-999.);
-    auto dPhi_toSA = Monitored::Scalar<float>(m_group+"_dPhi_toSA",-999.);
-    auto dR_toSA = Monitored::Scalar<float>(m_group+"_dR_toSA",-999.);
+    auto ptratio_toSA = Monitored::Scalar<float>(chain+"_ptratio_toSA",-999.);
+    auto dEta_toSA = Monitored::Scalar<float>(chain+"_dEta_toSA",-999.);
+    auto dPhi_toSA = Monitored::Scalar<float>(chain+"_dPhi_toSA",-999.);
+    auto dR_toSA = Monitored::Scalar<float>(chain+"_dR_toSA",-999.);
   
     if( (*muEL)->muSATrackLink().isValid() && std::abs(saPt) > ZERO_LIMIT ){
       ptratio_toSA = std::abs(cbPt / saPt);
@@ -102,16 +109,16 @@ StatusCode L2muCombMonMT :: fillVariablesPerChain(const EventContext &ctx, const
       dPhi_toSA = xAOD::P4Helpers::deltaPhi(cbPhi, saPhi);
       dR_toSA = sqrt(dEta_toSA*dEta_toSA + dPhi_toSA*dPhi_toSA);
      
-      fill(m_group, ptratio_toSA, dEta_toSA, dPhi_toSA, dR_toSA);
+      fill(m_group+"_"+chain, ptratio_toSA, dEta_toSA, dPhi_toSA, dR_toSA);
     }
 
 
     // get IDTrack
-    auto trkPt = Monitored::Scalar<float>(m_group+"_trkPt",-999.);
-    auto trkEta = Monitored::Scalar<float>(m_group+"_trkEta",-999.);
-    auto trkPhi = Monitored::Scalar<float>(m_group+"_trkPhi",-999.);
-    auto trkZ0 = Monitored::Scalar<float>(m_group+"_trkZ0",-999.);
-    auto trkChi2 = Monitored::Scalar<float>(m_group+"_trkChi2",-999.);
+    auto trkPt = Monitored::Scalar<float>(chain+"_trkPt",-999.);
+    auto trkEta = Monitored::Scalar<float>(chain+"_trkEta",-999.);
+    auto trkPhi = Monitored::Scalar<float>(chain+"_trkPhi",-999.);
+    auto trkZ0 = Monitored::Scalar<float>(chain+"_trkZ0",-999.);
+    auto trkChi2 = Monitored::Scalar<float>(chain+"_trkChi2",-999.);
 
     const xAOD::TrackParticle* idtrk = nullptr;
     if( (*muEL)->idTrackLink().isValid() ) {
@@ -123,15 +130,15 @@ StatusCode L2muCombMonMT :: fillVariablesPerChain(const EventContext &ctx, const
       trkChi2 = idtrk->chiSquared();
     }
 
-    fill(m_group, trkPt);
-    if( std::abs(trkPt) > ZERO_LIMIT)  fill(m_group, trkEta, trkPhi, trkZ0, trkChi2);
+    fill(m_group+"_"+chain, trkPt);
+    if( std::abs(trkPt) > ZERO_LIMIT)  fill(m_group+"_"+chain, trkEta, trkPhi, trkZ0, trkChi2);
 
 
     // comparison L2muComb (IDTrack) vs L2MuonSA
-    auto ptratio_TrktoSA = Monitored::Scalar<float>(m_group+"_ptratio_TrktoSA",-999.);
-    auto dEta_TrktoSA = Monitored::Scalar<float>(m_group+"_dEta_TrktoSA",-999.);
-    auto dPhi_TrktoSA = Monitored::Scalar<float>(m_group+"_dPhi_TrktoSA",-999.);
-    auto dR_TrktoSA = Monitored::Scalar<float>(m_group+"_dR_TrktoSA",-999.);
+    auto ptratio_TrktoSA = Monitored::Scalar<float>(chain+"_ptratio_TrktoSA",-999.);
+    auto dEta_TrktoSA = Monitored::Scalar<float>(chain+"_dEta_TrktoSA",-999.);
+    auto dPhi_TrktoSA = Monitored::Scalar<float>(chain+"_dPhi_TrktoSA",-999.);
+    auto dR_TrktoSA = Monitored::Scalar<float>(chain+"_dR_TrktoSA",-999.);
     
     if( (*muEL)->idTrackLink().isValid() && std::abs(saPt) > ZERO_LIMIT ){
       ptratio_TrktoSA = std::abs(cbPt / saPt);
@@ -139,14 +146,14 @@ StatusCode L2muCombMonMT :: fillVariablesPerChain(const EventContext &ctx, const
       dPhi_TrktoSA = xAOD::P4Helpers::deltaPhi(cbPhi, saPhi);
       dR_TrktoSA = sqrt(dEta_TrktoSA*dEta_TrktoSA + dPhi_TrktoSA*dPhi_TrktoSA);
       
-      fill(m_group, ptratio_TrktoSA, dEta_TrktoSA, dPhi_TrktoSA, dR_TrktoSA);
+      fill(m_group+"_"+chain, ptratio_TrktoSA, dEta_TrktoSA, dPhi_TrktoSA, dR_TrktoSA);
     } 
 
 
     // Muon Feature error
     std::vector<int> vec_MF_error;
     vec_MF_error.clear();
-    auto MF_error = Monitored::Collection(m_group+"_MF_error",vec_MF_error);
+    auto MF_error = Monitored::Collection(chain+"_MF_error",vec_MF_error);
 
     bool error = false;
     if( SATrack ){
@@ -164,7 +171,7 @@ StatusCode L2muCombMonMT :: fillVariablesPerChain(const EventContext &ctx, const
     }
     if(!error)  vec_MF_error.push_back(0);
 
-    fill(m_group, MF_error);
+    fill(m_group+"_"+chain, MF_error);
 
   }
 
@@ -178,9 +185,9 @@ StatusCode L2muCombMonMT :: fillVariablesPerOfflineMuonPerChain(const EventConte
 
   const float ZERO_LIMIT = 0.00001;
 
-  auto offEta = Monitored::Scalar<float>(m_group+"_offEta",-999.);
-  auto ptresol = Monitored::Scalar<float>(m_group+"_ptresol",-999.);
-  auto dR = Monitored::Scalar<float>(m_group+"_dR",-999.);
+  auto offEta = Monitored::Scalar<float>(chain+"_offEta",-999.);
+  auto ptresol = Monitored::Scalar<float>(chain+"_ptresol",-999.);
+  auto dR = Monitored::Scalar<float>(chain+"_dR",-999.);
 
   float offPt = mu->pt()/1e3;
   float offPhi = mu->phi();
@@ -194,16 +201,16 @@ StatusCode L2muCombMonMT :: fillVariablesPerOfflineMuonPerChain(const EventConte
 
 
   // dR wrt offline
-  auto dRmin = Monitored::Scalar<float>(m_group+"_dRmin",1000.);
+  auto dRmin = Monitored::Scalar<float>(chain+"_dRmin",1000.);
   dRmin = xAOD::P4Helpers::deltaR(mu, *muEL, false);
-  fill(m_group, dRmin);
+  fill(m_group+"_"+chain, dRmin);
   if( ! m_matchTool->isMatchedL2CB(*muEL, mu) ) return StatusCode::SUCCESS; // not matched to L2muComb
 
 
   // pt resolution
   float cbPt  = (*muEL)->pt()/1e3;
   if ( std::abs(offPt) > ZERO_LIMIT && std::abs(cbPt) > ZERO_LIMIT ) ptresol = std::abs(cbPt)/std::abs(offPt) - 1.;
-  fill(m_group, offEta, ptresol);
+  fill(m_group+"_"+chain, offEta, ptresol);
 
 
   // HLT_Roi_L2SAMuon variables
@@ -214,16 +221,38 @@ StatusCode L2muCombMonMT :: fillVariablesPerOfflineMuonPerChain(const EventConte
   float SAroiEta = (*roiEL)->eta();
   float SAroiPhi = (*roiEL)->phi();
 
-  auto roidEta = Monitored::Scalar<float>(m_group+"_L2SARoI_dEta",-999.);
-  auto roidPhi = Monitored::Scalar<float>(m_group+"_L2SARoI_dPhi",-999.);
-  auto roidR = Monitored::Scalar<float>(m_group+"_L2SARoI_dR",-999.);
+  auto roidEta = Monitored::Scalar<float>(chain+"_L2SARoI_dEta",-999.);
+  auto roidPhi = Monitored::Scalar<float>(chain+"_L2SARoI_dPhi",-999.);
+  auto roidR = Monitored::Scalar<float>(chain+"_L2SARoI_dR",-999.);
 
   roidEta = SAroiEta - offEta;
   roidPhi = xAOD::P4Helpers::deltaPhi(offPhi, SAroiPhi);
   roidR = sqrt(roidEta*roidEta + roidPhi*roidPhi);
   
-  fill(m_group, roidEta, roidPhi, roidR, offEta);
+  fill(m_group+"_"+chain, roidEta, roidPhi, roidR, offEta);
 
 
   return StatusCode::SUCCESS;
 }
+
+
+StatusCode L2muCombMonMT :: fillVariables(const EventContext &ctx) const {
+
+  ATH_MSG_DEBUG ("Filling histograms for " << name() << "...");
+
+  ATH_CHECK( fillVariableEtaPhi<xAOD::L2CombinedMuon>(ctx, m_L2muCombContainerKey, "L2CB"));
+
+  return StatusCode::SUCCESS;
+
+}
+
+
+StatusCode L2muCombMonMT :: fillVariablesPerOfflineMuon(const EventContext &ctx, const xAOD::Muon* mu) const {
+
+  ATH_CHECK( fillVariablesRatioPlots<xAOD::L2CombinedMuon>(ctx, mu, "L2CB", xAOD::Muon::TrackParticleType::CombinedTrackParticle,
+                                                           [this](const EventContext &ctx, const xAOD::Muon *mu){ return m_matchTool->matchL2CBReadHandle(ctx,mu); }
+                                                           ));
+
+  return StatusCode::SUCCESS;
+
+}
diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/L2muCombMonMT.h b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/L2muCombMonMT.h
index 0e0f5a8629be87f97ce373c16c2e89f53123150c..b6dae880c4f3e3362943e987c54fb5858bb44c5e 100644
--- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/L2muCombMonMT.h
+++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/L2muCombMonMT.h
@@ -16,10 +16,16 @@ class L2muCombMonMT : public TrigMuonMonitorAlgorithm{
  public:
   L2muCombMonMT(const std::string& name, ISvcLocator* pSvcLocator );
 
+  virtual StatusCode initialize() override;
+
  protected:
   virtual StatusCode fillVariablesPerChain(const EventContext &ctx, const std::string &chain) const override;
   virtual StatusCode fillVariablesPerOfflineMuonPerChain(const EventContext&, const xAOD::Muon* mu, const std::string &chain) const override;
+  virtual StatusCode fillVariables(const EventContext& ctx) const override;
+  virtual StatusCode fillVariablesPerOfflineMuon(const EventContext &ctx, const xAOD::Muon* mu) const override;
 
+ private:
+  SG::ReadHandleKey<xAOD::L2CombinedMuonContainer> m_L2muCombContainerKey {this, "L2CombinedMuonContainerName", "HLT_MuonL2CBInfo", "L2muComb container"};
 
 };
 
diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/MuonMatchingTool.cxx b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/MuonMatchingTool.cxx
index ad4e8c749e0f5e4efd1f1453ab3242cbfcca56fb..527b9503a059ad8ddb82da870cc76f6fd077b748 100644
--- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/MuonMatchingTool.cxx
+++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/MuonMatchingTool.cxx
@@ -20,6 +20,10 @@ StatusCode MuonMatchingTool :: initialize(){
   }
   ATH_CHECK( m_MuonContainerKey.initialize() );
   ATH_CHECK( m_MuonRoIContainerKey.initialize() );
+  ATH_CHECK( m_L2MuonSAContainerKey.initialize() );
+  ATH_CHECK( m_L2muCombContainerKey.initialize() );
+  ATH_CHECK( m_EFSAMuonContainerKey.initialize() );
+  ATH_CHECK( m_EFCBMuonContainerKey.initialize() );
 
   return StatusCode::SUCCESS;
 }
@@ -79,6 +83,20 @@ const TrigCompositeUtils::LinkInfo<xAOD::MuonContainer> MuonMatchingTool :: matc
   return MuonTrack ? matchLinkInfo<xAOD::Muon>(MuonTrack, trig, m_EFreqdR, pass, "HLT_Muons_", &MuonMatchingTool::PosForMatchSATrack) : muonLinkInfo;
 }
 
+const xAOD::Muon* MuonMatchingTool :: matchEFSAReadHandle( const EventContext& ctx, const xAOD::Muon *mu) const {
+  ATH_MSG_DEBUG("MuonMonitoring::matchEFSAReadHandle()");
+  const xAOD::TrackParticle* MuonTrack = nullptr;
+  using Type = xAOD::Muon::TrackParticleType;
+  std::vector<Type> types { Type::ExtrapolatedMuonSpectrometerTrackParticle,
+                            Type::MSOnlyExtrapolatedMuonSpectrometerTrackParticle,
+                            Type::MuonSpectrometerTrackParticle};
+  for (Type type : types){
+    MuonTrack = mu->trackParticle(type);
+    if (MuonTrack) break;
+  }
+  return MuonTrack ? matchReadHandle<xAOD::Muon>( MuonTrack, m_EFreqdR, m_EFSAMuonContainerKey, ctx, &MuonMatchingTool::PosForMatchSATrack) : nullptr;
+}
+
 
 const xAOD::Muon* MuonMatchingTool :: matchEFCB(  const xAOD::Muon *mu, std::string trig, bool &pass) const {
   ATH_MSG_DEBUG("MuonMonitoring::matchEFCB()");
@@ -94,6 +112,12 @@ const TrigCompositeUtils::LinkInfo<xAOD::MuonContainer> MuonMatchingTool :: matc
   return MuonTrack ? matchLinkInfo<xAOD::Muon>(MuonTrack, trig, m_EFreqdR, pass, "HLT_MuonsCB", &MuonMatchingTool::PosForMatchCBTrack) : muonLinkInfo;
 }
 
+const xAOD::Muon* MuonMatchingTool :: matchEFCBReadHandle( const EventContext& ctx, const xAOD::Muon *mu) const {
+  ATH_MSG_DEBUG("MuonMonitoring::matchEFCBReadHandle()");
+  const xAOD::TrackParticle* MuonTrack = mu->trackParticle(xAOD::Muon::TrackParticleType::Primary);
+  return MuonTrack ? matchReadHandle<xAOD::Muon>( MuonTrack, m_EFreqdR, m_EFCBMuonContainerKey, ctx, &MuonMatchingTool::PosForMatchCBTrack) : nullptr;
+}
+
 
 const xAOD::Muon* MuonMatchingTool :: matchEFIso(  const xAOD::Muon *mu, std::string trig, bool &pass) const {
   ATH_MSG_DEBUG("MuonMonitoring::matchEFIso()");
@@ -121,6 +145,28 @@ const TrigCompositeUtils::LinkInfo<xAOD::L2StandAloneMuonContainer> MuonMatching
   return matchLinkInfo<xAOD::L2StandAloneMuon>( mu, trig, 1000., pass, "HLT_MuonL2SAInfo");
 }
 
+const xAOD::L2StandAloneMuon* MuonMatchingTool :: matchL2SAReadHandle( const EventContext& ctx, const xAOD::Muon *mu) const {
+  ATH_MSG_DEBUG("MuonMonitoring::matchL2SAReadHandle()");
+  float reqdR = m_L2SAreqdR;
+  if(m_use_extrapolator){
+    reqdR = reqdRL1byPt(mu->pt());
+    const Amg::Vector3D extPos = offlineMuonAtPivot(mu);
+    if(extPos.norm()>ZERO_LIMIT){
+      return matchReadHandle<xAOD::L2StandAloneMuon>( &extPos, reqdR, m_L2MuonSAContainerKey, ctx);
+    }
+  }
+  const xAOD::TrackParticle* MuonTrack = nullptr;
+  using Type = xAOD::Muon::TrackParticleType;
+  std::vector<Type> types { Type::ExtrapolatedMuonSpectrometerTrackParticle,
+                            Type::MSOnlyExtrapolatedMuonSpectrometerTrackParticle,
+                            Type::MuonSpectrometerTrackParticle};
+  for (Type type : types){
+    MuonTrack = mu->trackParticle(type);
+    if (MuonTrack) break;
+  }
+  return MuonTrack ? matchReadHandle<xAOD::L2StandAloneMuon>( MuonTrack, reqdR, m_L2MuonSAContainerKey, ctx) : nullptr;
+}
+
 
 const xAOD::L2CombinedMuon* MuonMatchingTool :: matchL2CB(  const xAOD::Muon *mu, std::string trig, bool &pass) const {
   ATH_MSG_DEBUG("MuonMonitoring::matchL2CB()");
@@ -133,6 +179,12 @@ const TrigCompositeUtils::LinkInfo<xAOD::L2CombinedMuonContainer> MuonMatchingTo
   return matchLinkInfo<xAOD::L2CombinedMuon>( mu, trig,  1000., pass, "HLT_MuonL2CBInfo");
 }
 
+const xAOD::L2CombinedMuon* MuonMatchingTool :: matchL2CBReadHandle( const EventContext& ctx, const xAOD::Muon *mu) const {
+  ATH_MSG_DEBUG("MuonMonitoring::matchL2CBReadHandle()");
+  const xAOD::TrackParticle* MuonTrack = mu->trackParticle(xAOD::Muon::TrackParticleType::Primary);
+  return MuonTrack ? matchReadHandle<xAOD::L2CombinedMuon>( MuonTrack, m_L2CBreqdR, m_L2muCombContainerKey, ctx) : nullptr;
+}
+
 
 const xAOD::MuonRoI* MuonMatchingTool :: matchL1(  const xAOD::Muon *mu, const EventContext& ctx, std::string trig, bool &pass) const {
 
diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/MuonMatchingTool.h b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/MuonMatchingTool.h
index 9db618a7f43ff18360060ed5a7f8cb431c4aa496..9a39791eb98b22dd2d10d84d0c8145fb97f69b5b 100644
--- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/MuonMatchingTool.h
+++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/MuonMatchingTool.h
@@ -63,6 +63,13 @@ class MuonMatchingTool : public AthAlgTool {
    */
   const TrigCompositeUtils::LinkInfo<xAOD::L2StandAloneMuonContainer> searchL2SALinkInfo(const xAOD::Muon *mu, std::string trigger) const;
 
+  /**
+   * @brief Function that searches for an L2 standalone muon (L2MuonSA) candidate by ReadHandle and judges if it is matched to a given offlineSA muon.
+   * @param mu Offline muon around which L2MuonSA candidates are searched.
+   * @return Pointer to the matched candidate. This is @c nullptr when there is no candidate found.
+   */
+  const xAOD::L2StandAloneMuon* matchL2SAReadHandle( const EventContext& ctx, const xAOD::Muon *mu) const;
+
   /**
    * @brief Function that searches for an L2 combined muon (L2muComb) candidate and judges if it is matched to a given offline muon.
    * @param mu Offline muon around which L2muComb candidates are searched.
@@ -84,6 +91,13 @@ class MuonMatchingTool : public AthAlgTool {
    */
   const TrigCompositeUtils::LinkInfo<xAOD::L2CombinedMuonContainer> searchL2CBLinkInfo(const xAOD::Muon *mu, std::string trigger) const;
 
+  /**
+   * @brief Function that searches for an L2 combined muon (L2muComb) candidate by ReadHandle and judges if it is matched to a given offlineCB muon.
+   * @param mu Offline muon around which L2muComb candidates are searched.
+   * @return Pointer to the matched candidate. This is @c nullptr when there is no candidate found.
+   */
+  const xAOD::L2CombinedMuon* matchL2CBReadHandle( const EventContext& ctx, const xAOD::Muon *mu) const;
+
   /**
    * @brief Function that searches for an EF standalone muon (EFSA) candidate and judges if it is matched to a given offline muon.
    * @param mu Offline muon around which EFSA candidates are searched.
@@ -103,6 +117,13 @@ class MuonMatchingTool : public AthAlgTool {
    */
   const TrigCompositeUtils::LinkInfo<xAOD::MuonContainer> matchEFSALinkInfo( const xAOD::Muon *mu, std::string trig) const;
 
+  /**
+   * @brief Function that searches for an EF standalone muon (EFSA) candidate by ReadHandle and judges if it is matched to a given offlineSA muon.
+   * @param mu Offline muon around which EFSA candidates are searched.
+   * @return Pointer to the matched candidate. This is @c nullptr when there is no candidate found.
+   */
+  const xAOD::Muon* matchEFSAReadHandle( const EventContext& ctx, const xAOD::Muon *mu) const;
+
   /**
    * @brief Function that searches for an EF combined muon (EFCB) candidate and judges if it is matched to a given offline muon.
    * @param mu Offline muon around which EFCB candidates are searched.
@@ -122,6 +143,13 @@ class MuonMatchingTool : public AthAlgTool {
    */
   const TrigCompositeUtils::LinkInfo<xAOD::MuonContainer> matchEFCBLinkInfo( const xAOD::Muon *mu, std::string trig) const;
 
+  /**
+   * @brief Function that searches for an EF combined muon (EFCB) candidate by ReadHandle and judges if it is matched to a given offlineCB muon.
+   * @param mu Offline muon around which EFCB candidates are searched.
+   * @return Pointer to the matched candidate. This is @c nullptr when there is no candidate found.
+   */
+  const xAOD::Muon* matchEFCBReadHandle( const EventContext& ctx, const xAOD::Muon *mu) const;
+
   /**
    * @brief Function that searches for an EF isolation muon (EFIso) candidate and judges if it is matched to a given offline muon.
    * @param mu Offline muon around which EFIso candidates are searched.
@@ -172,6 +200,10 @@ class MuonMatchingTool : public AthAlgTool {
   static double reqdRL1byPt(double mupt);
 
 
+  static std::tuple<bool,double,double> PosForMatchSATrack(const xAOD::Muon *mu);
+  static std::tuple<bool,double,double> PosForMatchCBTrack(const xAOD::Muon *mu);
+
+  
  private:
 
   enum L1Items{ L1_MU4=1, L1_MU6, L1_MU10, L1_MU11, L1_MU15, L1_MU20, L1_MU21,ERROR};
@@ -191,6 +223,22 @@ class MuonMatchingTool : public AthAlgTool {
   const float m_EFreqdR = 0.03;
 
   // private methods
+  /**
+   * @brief Function that searches for an online muon candidate of type T by ReadHandle and judges if it is matched to a given offline muon.
+   * @param offl Position of the offline muon used for computing dR.
+   * @param reqdR Requirement of dR used for the matching. Note that reqdR is updated with the dR of the found candidate.
+   * @param ReadHandleKey SG::ReadHandleKey of online muon.
+   * @param ctx EventContext. 
+   * @param trigPosForMatchFunc Function pointer that implements cuts for the online muon candidates.
+   * @return Pointer to the matched candidate. This is @c nullptr when there is no candidate found.
+   * @see MuonMatchingTool.icc for the implementation and MuonMatchingTool.cxx for the instantiation.
+   * @todo Consider improving the argument list.
+   */
+  template<class T, class OFFL> const T* matchReadHandle(const OFFL* offl, float reqdR,
+                                                         SG::ReadHandleKey<DataVector<T> > ReadHandleKey, const EventContext& ctx,
+                                                         std::tuple<bool,double,double> (*trigPosForMatchFunc)(const T*) = &MuonMatchingTool::trigPosForMatch<T>) const;
+
+
   /**
    * @brief Function that searches for an online muon candidate of type T closest to a given offline muon. 
    * @param offl Position of the offline muon used for computing dR.
@@ -245,11 +293,13 @@ class MuonMatchingTool : public AthAlgTool {
   // static methods
   // Template methods that perform different matching schemes for T=xAOD::L2StandAloneMuon, xAOD::L2CombinedMuon and xAOD::Muon (EF).
   template<class T> static inline std::tuple<bool,double,double> trigPosForMatch(const T *trig);
-  static inline std::tuple<bool,double,double> PosForMatchSATrack(const xAOD::Muon *mu);
-  static inline std::tuple<bool,double,double> PosForMatchCBTrack(const xAOD::Muon *mu);
 
   SG::ReadHandleKey<xAOD::MuonRoIContainer> m_MuonRoIContainerKey {this, "MuonRoIContainerName", "LVL1MuonRoIs", "Level 1 muon container"};
   SG::ReadHandleKey<xAOD::MuonContainer> m_MuonContainerKey {this, "MuonContainerName", "Muons", "Offline muon container"};
+  SG::ReadHandleKey<xAOD::L2StandAloneMuonContainer> m_L2MuonSAContainerKey {this, "L2StandAloneMuonContainerName", "HLT_MuonL2SAInfo", "L2MuonSA container"};
+  SG::ReadHandleKey<xAOD::L2CombinedMuonContainer> m_L2muCombContainerKey {this, "L2CombinedMuonContainerName", "HLT_MuonL2CBInfo", "L2muComb container"};
+  SG::ReadHandleKey<xAOD::MuonContainer> m_EFSAMuonContainerKey {this, "EFSAMuonContainerName", "HLT_Muons_RoI", "EFSAMuon container"};
+  SG::ReadHandleKey<xAOD::MuonContainer> m_EFCBMuonContainerKey {this, "EFCBMuonContainerName", "HLT_MuonsCB_RoI", "EFCBMuon container"};
 
   // properties
   Gaudi::Property<bool> m_use_extrapolator {this, "UseExtrapolator", false, "Flag to enable the extrapolator for matching offline and trigger muons"};
diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/MuonMatchingTool.icc b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/MuonMatchingTool.icc
index 37d1da447becc432e61062440f624b273fab669a..cc8ddca2c77fb51b69338ad232d846f450c06012 100644
--- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/MuonMatchingTool.icc
+++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/MuonMatchingTool.icc
@@ -8,6 +8,45 @@ template<class T> std::tuple<bool,double,double> MuonMatchingTool :: trigPosForM
 }
 
 
+template<class T, class OFFL>
+const T* MuonMatchingTool :: matchReadHandle(const OFFL* offl, float reqdR,
+                                             SG::ReadHandleKey<DataVector<T> > ReadHandleKey, const EventContext& ctx,
+                                             std::tuple<bool,double,double> (*trigPosForMatchFunc)(const T*)) const {
+
+  ATH_MSG_DEBUG("MuonMonitoring::matchReadHandle<T>");
+
+  using CONTAINER = DataVector<T>;
+  const T* ptr = nullptr;
+
+  SG::ReadHandle<CONTAINER> trigmuons(ReadHandleKey, ctx);
+  if (! trigmuons.isValid() ) {
+    ATH_MSG_ERROR("evtStore() does not contain collection with name " << ReadHandleKey);
+    return ptr;
+  }
+
+  double offlEta = offl->eta();
+  double offlPhi = offl->phi();
+
+  for(const auto& trigmu : *trigmuons){
+    const auto [status, trigEta, trigPhi] = trigPosForMatchFunc(trigmu);
+    if(!status) continue;
+    double deta = offlEta - trigEta;
+    double dphi = xAOD::P4Helpers::deltaPhi(offlPhi, trigPhi);
+    double dR = sqrt(deta*deta + dphi*dphi);
+
+    ATH_MSG_VERBOSE("Trigger muon candidate eta=" << trigEta << " phi=" << trigPhi  << " pt=" << trigmu->pt() << " dR=" << dR);
+    if( dR<reqdR ){
+      reqdR = dR;
+      ATH_MSG_DEBUG("* Trigger muon eta=" << trigEta << " phi=" << trigPhi  << " pt=" << trigmu->pt() << " dR=" << dR);
+      ptr = trigmu; 
+    }
+  }
+  
+  return ptr;
+
+}
+
+
 template<class T, class OFFL>
 const T* MuonMatchingTool :: match(const OFFL* offl, std::string trig, float reqdR, bool &pass,
                                    const std::string containerSGKey,
@@ -100,3 +139,4 @@ const xAOD::Muon* MuonMatchingTool :: matchOff(const EventContext& ctx, const T*
 
   return muon;
 } 
+
diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/TrigMuonMonitorAlgorithm.h b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/TrigMuonMonitorAlgorithm.h
index 0268054dcef808c885dd42e3ccbbaf05419816e7..80b1cefce2ae8db51eff63dd63461eb27cf635d7 100644
--- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/TrigMuonMonitorAlgorithm.h
+++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/TrigMuonMonitorAlgorithm.h
@@ -91,6 +91,39 @@ class TrigMuonMonitorAlgorithm : public AthMonitorAlgorithm {
    */
   virtual StatusCode fillVariablesPerOfflineMuonPerChain(const EventContext &ctx, const xAOD::Muon* mu, const std::string &chain) const;
 
+
+  /**
+   * @brief Function that fills variables of ratio plots.
+   * @see @c TrigMuonMonitorAlgorithm.icc for the implementation
+   * @param ctx @c EventContext provided by athenaMT
+   * @param mu Pointer to an offline muon provided in @c fillHistograms
+   * @param trigstep trigger step
+   * @param type xAOD::Muon::TrackParticleType of offline muon
+   * @param matchFunc Function pointer that implements cuts for the online muon candidates gotten by ReadHandle. 
+   */
+  template <class T, class FUNCT>
+  StatusCode fillVariablesRatioPlots(const EventContext &ctx, const xAOD::Muon* mu,
+                                     std::string &&trigstep,
+                                     xAOD::Muon::TrackParticleType type,
+                                     FUNCT matchFunc) const;
+
+  /**
+   * @brief Function that fills variables of etaphi2D plots.
+   * @see @c TrigMuonMonitorAlgorithm.icc for the implementation
+   * @param ctx @c EventContext provided by athenaMT
+   * @param ReadHandleKey SG::ReadHandleKey of online muon.
+   * @param trigstep trigger step
+   * @param PosFunc Function pointer that implements cuts for the online muon candidates. 
+   */
+  template<class T>
+  StatusCode fillVariableEtaPhi(const EventContext &ctx,
+                                SG::ReadHandleKey<DataVector<T> > ReadHandleKey,
+                                std::string &&trigstep,
+                                std::tuple<bool,double,double> (*PosFunc)(const T*) = &TrigMuonMonitorAlgorithm::defaultPosFunc<T>) const;
+
+  template<class T> static inline std::tuple<bool, double, double> defaultPosFunc(const T* trig);
+
+
   // ToolHandle
   ToolHandle<MuonMatchingTool> m_matchTool {this, "MuonMatchingTool", "MuonMatchingTool", "Tool for matching offline and online objects"};
 
@@ -105,7 +138,11 @@ class TrigMuonMonitorAlgorithm : public AthMonitorAlgorithm {
   /// Name of monitored group
   Gaudi::Property<std::string> m_group {this, "Group", "", "Histogram group"};
 
+  /// Threshold for ratio measurement
+  const float m_ratio_measurement_threshold = 4;
 
 };
 
+#include "TrigMuonMonitorAlgorithm.icc"
+
 #endif //TRIGMUONMONITORINGMT_TRIGMUONMONITORALGORITHM_H
diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/TrigMuonMonitorAlgorithm.icc b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/TrigMuonMonitorAlgorithm.icc
new file mode 100644
index 0000000000000000000000000000000000000000..16b2cd8f9324644e841470a123c867484809a4c2
--- /dev/null
+++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/TrigMuonMonitorAlgorithm.icc
@@ -0,0 +1,65 @@
+/* -*- mode:c++ -*-
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+
+template <class T, class FUNCT>
+StatusCode TrigMuonMonitorAlgorithm::fillVariablesRatioPlots(const EventContext &ctx, const xAOD::Muon* mu,
+                                                             std::string &&trigstep,
+                                                             xAOD::Muon::TrackParticleType type, 
+                                                             FUNCT matchFunc) const
+{
+
+  const xAOD::TrackParticle* OfflineTrack = mu->trackParticle(type);
+  if ( OfflineTrack ){
+    auto AboveCut = Monitored::Scalar<bool>(trigstep+"AboveCut",false);
+    float OffPt = OfflineTrack->pt()/1e3;
+    if ( OffPt > m_ratio_measurement_threshold ){
+      const T *trigMu = matchFunc(ctx, mu);
+      if ( trigMu ){
+        if ( std::abs( trigMu->pt() ) > m_ratio_measurement_threshold ) AboveCut = true;
+      }
+    }
+
+    auto lb = Monitored::Scalar<int>("LB",-1.0);
+    lb = GetEventInfo(ctx)->lumiBlock();
+    fill(m_group, lb, AboveCut);
+  }
+
+  return StatusCode::SUCCESS;
+
+}
+
+template<class T>
+StatusCode TrigMuonMonitorAlgorithm::fillVariableEtaPhi(const EventContext &ctx,
+                                                        SG::ReadHandleKey<DataVector<T> > ReadHandleKey,
+                                                        std::string &&trigstep,
+                                                        std::tuple<bool,double,double> (*PosFunc)(const T*)) const
+{
+
+  using CONTAINER = DataVector<T>;
+  SG::ReadHandle<CONTAINER> trigmuons(ReadHandleKey, ctx);
+  if (! trigmuons.isValid() ) {
+    ATH_MSG_ERROR("evtStore() does not contain collection with name "<< ReadHandleKey);
+    return StatusCode::FAILURE;
+  }
+
+  for (const auto& trigmu : *trigmuons) {
+
+    auto Eta = Monitored::Scalar<float>(trigstep+"Eta",-999.);
+    auto Phi = Monitored::Scalar<float>(trigstep+"Phi",-999.);
+
+    const auto [status, trigEta, trigPhi] = PosFunc(trigmu);
+    if(!status) continue;
+    Eta = trigEta;
+    Phi = trigPhi;
+    fill(m_group, Eta, Phi);
+
+  }
+
+  return StatusCode::SUCCESS;
+
+}
+
+template<class T>
+std::tuple<bool, double, double> TrigMuonMonitorAlgorithm::defaultPosFunc(const T* trig){ return std::forward_as_tuple(true, trig->eta(), trig->phi()); }
diff --git a/Trigger/TrigMonitoring/TrigSteerMonitor/python/TrigSteerMonitorConfig.py b/Trigger/TrigMonitoring/TrigSteerMonitor/python/TrigSteerMonitorConfig.py
index 3b6a9030b49430bb1ca121b13e87e6812ea06ba1..99c55a6258959c6c21e818a897bdb3ebd2a3ab4c 100644
--- a/Trigger/TrigMonitoring/TrigSteerMonitor/python/TrigSteerMonitorConfig.py
+++ b/Trigger/TrigMonitoring/TrigSteerMonitor/python/TrigSteerMonitorConfig.py
@@ -8,39 +8,53 @@ def SchedulerMonSvcCfg(flags, name='SchedulerMonSvc'):
     monsvc = CompFactory.SchedulerMonSvc(name)
     monsvc.MonTool = GenericMonitoringTool('MonTool', HistPath='HLTFramework/'+name)
 
+    # Plots vs snapshot number can be enabled with flags.SchedulerMonSvc.enablePlotsVsSnapNumber
+    # They are disabled by default as they don't give much information on top of the plots vs walltime
+    enablePlotsVsSnapNumber = False
+    if flags.hasCategory('SchedulerMonSvc') and flags.SchedulerMonSvc.hasFlag('enablePlotsVsSnapNumber'):
+        enablePlotsVsSnapNumber = flags.SchedulerMonSvc.enablePlotsVsSnapNumber
+
     # From GaudiHive AlgsExecutionStates::State enum
     stateNames = ['INITIAL', 'CONTROLREADY', 'DATAREADY', 'RESOURCELESS',
                   'SCHEDULED', 'EVTACCEPTED', 'EVTREJECTED', 'ERROR']
+    activeStates = ['CONTROLREADY', 'DATAREADY', 'RESOURCELESS', 'SCHEDULED']
+
+    # Helper functions
+    def defineHist1D(varName, varLabel, labels=None, **kwargs):
+        monsvc.MonTool.defineHistogram(varName, path='EXPERT', type='TH1D',
+                                title=varLabel+';'+varLabel+';Snapshots',
+                                xlabels=labels, opt='kCanRebin', **kwargs)
+
+    def defineHistVsWallTime(varName, varLabel, _type, labels=None, **kwargs):
+        monsvc.MonTool.defineHistogram(
+            'WallTimeSeconds,'+varName, path='EXPERT', type=_type,
+            title=varLabel+' vs time;Time [s];'+varLabel,
+            xbins=600, xmin=0, xmax=60, ylabels=labels, opt='kCanRebin', **kwargs)
+
+    def defineHistVsSnapNumber(varName, varLabel, _type, labels=None, **kwargs):
+        monsvc.MonTool.defineHistogram(
+            'SnapNumber,'+varName, path='EXPERT', type=_type,
+            title=varLabel+' vs time (snap number);Snap number;'+varLabel,
+            xbins=1000, xmin=0, xmax=1000, ylabels=labels, opt='kCanRebin', **kwargs)
+
+    def defineStandardHistogramSet(varName, varLabel, nbins, min, max, labels=None, type2D='TProfile', **kwargs):
+        defineHist1D(varName, varLabel, labels, xbins=nbins, xmin=min, xmax=max, **kwargs)
+        defineHistVsWallTime(varName, varLabel, type2D, labels, ybins=nbins, ymin=min, ymax=max, **kwargs)
+        if enablePlotsVsSnapNumber:
+            defineHistVsSnapNumber(varName, varLabel, type2D, labels, ybins=nbins, ymin=min, ymax=max, **kwargs)
+
+    # Histogram definitions
+    defineStandardHistogramSet('AlgStates', 'Algorithm state', 8, -0.5, 7.5, labels=stateNames, type2D='TH2D', weight='StateTotalCounts')
+    defineStandardHistogramSet('FreeSlots', 'Number of free slots', 10, 0, 10)
+    for state in stateNames:
+        defineStandardHistogramSet(state, 'N algs in '+state+' state', 100, 0, 100)
+    for state in activeStates:
+        defineStandardHistogramSet(state+'_Over_Threads', 'N '+state+' / N threads', 100, 0, 10)
+        defineStandardHistogramSet(state+'_Over_Active', 'N '+state+' / N active states', 100, 0, 1)
 
-    monsvc.MonTool.defineHistogram('SnapNumber,AlgStates', weight='StateTotalCounts', path='EXPERT', type='TH2D',
-                            title='Scheduler algorithm states vs time (snap number);Snap number;Algorithm state',
-                            xbins=1000, xmin=0, xmax=1000,
-                            ybins=8, ymin=-0.5, ymax=7.5, ylabels=stateNames,
-                            opt='kCanRebin')
-    monsvc.MonTool.defineHistogram('WallTimeSeconds,AlgStates', weight='StateTotalCounts', path='EXPERT', type='TH2D',
-                            title='Scheduler algorithm states vs time;Time [s];Algorithm state',
-                            xbins=600, xmin=0, xmax=60,
-                            ybins=8, ymin=-0.5, ymax=7.5, ylabels=stateNames,
-                            opt='kCanRebin')
-    monsvc.MonTool.defineHistogram('SnapNumber,FreeSlots', path='EXPERT', type='TProfile',
-                            title='Number of free slots vs time (snap number);Snap number;Number of free slots',
-                            xbins=1000, xmin=0, xmax=1000,
-                            ybins=10, ymin=0, ymax=10,
-                            opt='kCanRebin')
-    monsvc.MonTool.defineHistogram('WallTimeSeconds,FreeSlots', path='EXPERT', type='TProfile',
-                            title='Number of free slots vs time ;Time [s];Number of free slots',
-                            xbins=600, xmin=0, xmax=60,
-                            ybins=10, ymin=0, ymax=10,
-                            opt='kCanRebin')
-    monsvc.MonTool.defineHistogram('AlgStates', weight='StateTotalCounts', path='EXPERT', type='TH1D',
-                            title='Scheduler algorithm states;Algorithm states;Snapshots',
-                            xbins=8, xmin=-0.5, xmax=7.5, xlabels=stateNames)
-    monsvc.MonTool.defineHistogram('FreeSlots', path='EXPERT', type='TH1D',
-                            title='Number of free slots;Free slots;Snapshots',
-                            xbins=10, xmin=0, xmax=10, opt='kCanRebin')
     monsvc.MonTool.defineHistogram('TIME_monCallback', path='EXPERT', type='TH1D',
-                            title='Time of callback calls;Time [us];Calls',
-                            xbins=500, xmin=0, xmax=5000)
+                                    title='Time of callback calls;Time [us];Calls',
+                                    xbins=500, xmin=0, xmax=5000)
 
     acc = ComponentAccumulator()
     acc.addService(monsvc)
diff --git a/Trigger/TrigMonitoring/TrigSteerMonitor/src/SchedulerMonSvc.cxx b/Trigger/TrigMonitoring/TrigSteerMonitor/src/SchedulerMonSvc.cxx
index e6665eb8afa7215f70e020d737c6fba2766e830e..25d8339038613b280d5f51f0bae1db8b1e1118f1 100644
--- a/Trigger/TrigMonitoring/TrigSteerMonitor/src/SchedulerMonSvc.cxx
+++ b/Trigger/TrigMonitoring/TrigSteerMonitor/src/SchedulerMonSvc.cxx
@@ -4,10 +4,39 @@
 
 #include "SchedulerMonSvc.h"
 
+using namespace std::string_literals;
+using namespace std::literals::string_view_literals;
+
 namespace {
-  /// This is AlgsExecutionStates::State::MAXVALUE which cannot be used here directly because it is not in a public header
-  static constexpr size_t s_numAlgStates = 8;
+  /// This is AlgsExecutionStates::State which cannot be used here directly because it is not in a public header
+  enum class AlgState : size_t {
+    INITIAL      = 0,
+    CONTROLREADY = 1,
+    DATAREADY    = 2,
+    RESOURCELESS = 3,
+    SCHEDULED    = 4,
+    EVTACCEPTED  = 5,
+    EVTREJECTED  = 6,
+    ERROR        = 7,
+    MAXVALUE     = 8
+  };
+  /// AlgState enum as strings
+  static constexpr std::array<std::string_view,8> s_algStateNames = {{
+    "INITIAL"sv, "CONTROLREADY"sv, "DATAREADY"sv, "RESOURCELESS"sv, "SCHEDULED"sv, "EVTACCEPTED"sv, "EVTREJECTED"sv, "ERROR"sv
+  }};
+  /// AlgState enum as size_t
   static constexpr std::array<size_t,8> s_algStateNumbers = {0,1,2,3,4,5,6,7};
+  /// AlgStates counted as "active"
+  static constexpr std::array<size_t,4> s_activeAlgStateNumbers = {
+    static_cast<size_t>(AlgState::CONTROLREADY),
+    static_cast<size_t>(AlgState::DATAREADY),
+    static_cast<size_t>(AlgState::RESOURCELESS),
+    static_cast<size_t>(AlgState::SCHEDULED)
+  };
+  /// Cast two numbers to double and divide one by the other
+  template<typename Ta, typename Tb> constexpr double divAsDouble(const Ta& a, const Tb& b) {
+    return static_cast<double>(a) / static_cast<double>(b);
+  }
 }
 
 // =============================================================================
@@ -31,6 +60,9 @@ StatusCode SchedulerMonSvc::startMonitoring() {
     }
   }
 
+  // Get the number of threads
+  int numThreads = std::stoi( SmartIF<IProperty>(m_scheduler)->getProperty("ThreadPoolSize").toString() );
+
   // Flag the monitoring as running (prevents going past this point twice)
   if (bool expected = false; not m_running.compare_exchange_strong(expected, true)) {
     ATH_MSG_ERROR("startMonitoring called but it is already running");
@@ -38,7 +70,7 @@ StatusCode SchedulerMonSvc::startMonitoring() {
   }
 
   // Construct the callback and pass it to the scheduler monitoring API
-  auto monCallback = [this](IScheduler::OccupancySnapshot snap) -> void {
+  auto monCallback = [this, &numThreads](IScheduler::OccupancySnapshot snap) -> void {
     auto monTime = Monitored::Timer("TIME_monCallback");
     // Calculate and update snap counters
     const ClockType::duration wallTime = snap.time - m_startTime;
@@ -53,7 +85,7 @@ StatusCode SchedulerMonSvc::startMonitoring() {
     }
 
     // Monitor total state counts across all slots
-    std::vector<int> stateTotalCounts(s_numAlgStates, 0);
+    std::vector<int> stateTotalCounts(static_cast<size_t>(AlgState::MAXVALUE), 0);
     for (size_t slot=0; slot < snap.states.size(); ++slot) {
       for (size_t state=0; state < snap.states[slot].size(); ++state) {
         stateTotalCounts[state] += snap.states[slot][state];
@@ -62,15 +94,41 @@ StatusCode SchedulerMonSvc::startMonitoring() {
     auto mon_stateNumber = Monitored::Collection("AlgStates", s_algStateNumbers);
     auto mon_stateTotalCounts = Monitored::Collection("StateTotalCounts", stateTotalCounts);
 
+    // Monitor alg state counts absolute numbers and ratios to N threads and N active states
+    std::vector<Monitored::Scalar<int>> mon_stateCounts;
+    std::vector<Monitored::Scalar<double>> mon_stateCountsOverThreads;
+    std::vector<Monitored::Scalar<double>> mon_stateCountsOverActive;
+    mon_stateCounts.reserve(static_cast<size_t>(AlgState::MAXVALUE));
+    mon_stateCountsOverThreads.reserve(static_cast<size_t>(AlgState::MAXVALUE));
+    mon_stateCountsOverActive.reserve(static_cast<size_t>(AlgState::MAXVALUE));
+    int activeCount = 0;
+    for (size_t i : s_activeAlgStateNumbers) {
+      activeCount += stateTotalCounts[i];
+    }
+    for (size_t i : s_algStateNumbers) {
+      mon_stateCounts.emplace_back(s_algStateNames[i].data(), stateTotalCounts[i]);
+      mon_stateCountsOverThreads.emplace_back(s_algStateNames[i].data()+"_Over_Threads"s, divAsDouble(stateTotalCounts[i], numThreads));
+      double toActive = (activeCount > 0) ? divAsDouble(stateTotalCounts[i], activeCount) : 0;
+      mon_stateCountsOverActive.emplace_back(s_algStateNames[i].data()+"_Over_Active"s, toActive);
+    }
+
     // Monitor number of free slots
     auto mon_freeSlots = Monitored::Scalar("FreeSlots", m_scheduler->freeSlots());
 
+    // Reserve vector of references with size equal to the number of variables added into the vector in the loop below
+    std::vector<std::reference_wrapper<Monitored::IMonitoredVariable>> allMonVars;
+    allMonVars.reserve(5 + mon_stateCounts.size() + mon_stateCountsOverThreads.size() + mon_stateCountsOverActive.size());
     // Fill monitoring histograms once for each sampling period passed since the last fill
     // If multiple sampling periods passed, it means the scheduler state didn't change during that time
     for (size_t snapNumber=lastSnapCounter+1; snapNumber<=thisSnapCounter; ++snapNumber) {
       auto mon_snapNumber = Monitored::Scalar("SnapNumber", snapNumber);
       auto mon_wallTimeSec = Monitored::Scalar("WallTimeSeconds", snapNumber*m_samplingPeriodMillisec.value()*1e-3);
-      Monitored::Group(m_monTool, mon_snapNumber, mon_wallTimeSec, mon_freeSlots, mon_stateNumber, mon_stateTotalCounts);
+      allMonVars.clear();
+      allMonVars.insert(allMonVars.end(), mon_stateCounts.begin(), mon_stateCounts.end());
+      allMonVars.insert(allMonVars.end(), mon_stateCountsOverThreads.begin(), mon_stateCountsOverThreads.end());
+      allMonVars.insert(allMonVars.end(), mon_stateCountsOverActive.begin(), mon_stateCountsOverActive.end());
+      allMonVars.insert(allMonVars.end(), {mon_stateNumber, mon_stateTotalCounts, mon_freeSlots, mon_snapNumber, mon_wallTimeSec});
+      Monitored::Group(m_monTool, allMonVars);
     }
     monTime.stop();
     Monitored::Group(m_monTool, monTime);
diff --git a/Trigger/TrigMonitoring/TrigTauMonitoring/src/TrigTauMonitorAlgorithm.cxx b/Trigger/TrigMonitoring/TrigTauMonitoring/src/TrigTauMonitorAlgorithm.cxx
index d479100e0f7872a3552f2f39dc5fd346e5566def..114a3df0814b56cc22dd195efdb75959638d2c5b 100644
--- a/Trigger/TrigMonitoring/TrigTauMonitoring/src/TrigTauMonitorAlgorithm.cxx
+++ b/Trigger/TrigMonitoring/TrigTauMonitoring/src/TrigTauMonitorAlgorithm.cxx
@@ -135,6 +135,7 @@ void TrigTauMonitorAlgorithm::fillDistributions(std::vector< std::pair< const xA
     if(nTracks==1){
        tau_vec_1p.push_back(pairObj.first);
     }else if(nTracks>1){
+       ATH_MSG_DEBUG("NTracks Offline: " << nTracks);
        tau_vec_np.push_back(pairObj.first);
     }
   }
@@ -162,6 +163,7 @@ void TrigTauMonitorAlgorithm::fillDistributions(std::vector< std::pair< const xA
     if(nTracks==1){
       tau_vec_1p.push_back(feat);
     }else if(nTracks>1){
+      ATH_MSG_DEBUG("NTracks Online: " << nTracks);
       tau_vec_np.push_back(feat);
     }
   }
@@ -223,17 +225,14 @@ void TrigTauMonitorAlgorithm::fillRNNInputVars(const std::string trigger, std::v
                                                     }return detail;});
   auto ptDetectorAxis     = Monitored::Collection("ptDetectorAxis", tau_vec,  [] (const xAOD::TauJet* tau){
                                                     return TMath::Log10(std::min(tau->ptDetectorAxis() / 1000.0, 100.0));});
-
-  auto massTrkSys         = Monitored::Collection("massTrkSys", tau_vec,  [] (const xAOD::TauJet* tau){
+  auto massTrkSys         = Monitored::Collection("massTrkSys", tau_vec,  [&nProng] (const xAOD::TauJet* tau){
                                                 float detail = -999;
-                                                if ((tau->detail(xAOD::TauJetParameters::massTrkSys, detail))&&(tau->nTracks()>1)){
+                                                if ( tau->detail(xAOD::TauJetParameters::massTrkSys, detail) && nProng.find("MP") != std::string::npos ){
                                                   detail = TMath::Log10(std::max(detail, 140.0f));
                                                 }return detail;});
 
-
-
     
-  fill(monGroup, centFrac,etOverPtLeadTrk,dRmax,absipSigLeadTrk,sumPtTrkFrac,emPOverTrkSysP,ptRatioEflowApprox,mEflowApprox,ptDetectorAxis,massTrkSys);                                              
+  fill(monGroup, centFrac,etOverPtLeadTrk,dRmax,absipSigLeadTrk,sumPtTrkFrac,emPOverTrkSysP,ptRatioEflowApprox,mEflowApprox,ptDetectorAxis,massTrkSys);     
   
 }
 
@@ -316,7 +315,7 @@ void TrigTauMonitorAlgorithm::fillRNNCluster(const std::string trigger, std::vec
 
     float max_cluster_dr = 1.0;
     
-    if(tau->jetLink().isValid()) {
+    if(!tau->jetLink().isValid()) {
       continue;
     }
 
@@ -325,8 +324,6 @@ void TrigTauMonitorAlgorithm::fillRNNCluster(const std::string trigger, std::vec
       ATH_MSG_ERROR("Tau jet link is invalid.");
     } 
 
-    ATH_MSG_DEBUG("After trying to get the jet link " << jetSeed->pt());
-
     if(!jetSeed->getConstituents().isValid()) {
       continue;
     }
@@ -344,8 +341,6 @@ void TrigTauMonitorAlgorithm::fillRNNCluster(const std::string trigger, std::vec
 	clusters.push_back(cl);
       }
     }
-
-    ATH_MSG_DEBUG("After loop on jet constituents");
   
     auto et_cmp = [](const xAOD::CaloCluster *lhs,
 		     const xAOD::CaloCluster *rhs) {
diff --git a/Trigger/TrigSteer/DecisionHandling/python/jetMenuHelper.py b/Trigger/TrigSteer/DecisionHandling/python/jetMenuHelper.py
index 3196b89e2a16b158108006f81b18c97028bd2a99..818527083c4b4ca4cab367b9ab3ac5ac9151b8ff 100644
--- a/Trigger/TrigSteer/DecisionHandling/python/jetMenuHelper.py
+++ b/Trigger/TrigSteer/DecisionHandling/python/jetMenuHelper.py
@@ -2,6 +2,7 @@
 #
 
 from TriggerMenuMT.HLTMenuConfig.Jet.JetMenuSequences import jetMenuSequence, jetCFSequence
+from AthenaConfiguration.AllConfigFlags import ConfigFlags
 
 def jetDictFromString(jet_def_string):
     """ Function to retrieve the jet dictionaory from string"""
@@ -36,10 +37,10 @@ def jetDictFromString(jet_def_string):
 def jetCFSequenceFromString(jet_def_string):
     """ Function to retrieve jet Reco sequence from string"""
     jetRecoDict=jetDictFromString(jet_def_string)
-    return jetCFSequence(None,**jetRecoDict)	
+    return jetCFSequence(ConfigFlags,**jetRecoDict)	
     
  
 def jetMenuSequenceFromString(jet_def_string):
     """ Function to retrieve jet menu sequence from string"""
     jetRecoDict=jetDictFromString(jet_def_string)
-    return jetMenuSequence(None,**jetRecoDict) # First arg dummy flags for RecoFragmentsPool
+    return jetMenuSequence(ConfigFlags,**jetRecoDict) # First arg dummy flags for RecoFragmentsPool
diff --git a/Trigger/TrigSteer/TrigCompositeUtils/CMakeLists.txt b/Trigger/TrigSteer/TrigCompositeUtils/CMakeLists.txt
index 889df3253c328fba01a93011f94a5b7f6a50c65e..dca99bc423be15cc1f4c03ed5cebae46eba38d86 100644
--- a/Trigger/TrigSteer/TrigCompositeUtils/CMakeLists.txt
+++ b/Trigger/TrigSteer/TrigCompositeUtils/CMakeLists.txt
@@ -6,7 +6,7 @@ atlas_subdir( TrigCompositeUtils )
 # Set up the (non-)standalone compilation.
 set( extra_libs )
 if( NOT XAOD_STANDALONE )
-  set( extra_libs GaudiKernel AthenaKernel AthLinks StoreGateLib AthContainers )
+  set( extra_libs GaudiKernel AthenaKernel AthLinks StoreGateLib AthContainers AthenaBaseComps TrigConfData )
 endif()
 
 # Add the package's dual use library.
@@ -15,6 +15,12 @@ atlas_add_library( TrigCompositeUtilsLib
   PUBLIC_HEADERS TrigCompositeUtils
   LINK_LIBRARIES TrigConfHLTUtilsLib CxxUtils AsgMessagingLib AsgDataHandlesLib AsgTools TrigDecisionInterface xAODBase xAODTrigger ${extra_libs}  )
 
+if( NOT XAOD_STANDALONE )
+  atlas_add_component( TrigCompositeUtils
+    TrigCompositeUtils/components/*.cxx
+    LINK_LIBRARIES TrigCompositeUtilsLib )
+endif()
+
 # Install files from the package.
 atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
 
diff --git a/Trigger/TrigSteer/TrigCompositeUtils/Root/AlgToChainTool.cxx b/Trigger/TrigSteer/TrigCompositeUtils/Root/AlgToChainTool.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..91c6e8acd60a228f0590169342576c3f13018a97
--- /dev/null
+++ b/Trigger/TrigSteer/TrigCompositeUtils/Root/AlgToChainTool.cxx
@@ -0,0 +1,123 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "TrigCompositeUtils/AlgToChainTool.h"
+
+#ifndef XAOD_STANDALONE
+
+TrigCompositeUtils::AlgToChainTool::AlgToChainTool(const std::string& type,
+                        const std::string& name,
+                        const IInterface* parent)
+    : AthAlgTool (type, name, parent) 
+    {}
+
+
+TrigCompositeUtils::AlgToChainTool::~AlgToChainTool() {}
+
+
+StatusCode TrigCompositeUtils::AlgToChainTool::initialize() {
+    ATH_CHECK( m_HLTMenuKey.initialize() );
+
+    return StatusCode::SUCCESS;
+}
+
+
+StatusCode TrigCompositeUtils::AlgToChainTool::start() {
+    SG::ReadHandle<TrigConf::HLTMenu>  hltMenuHandle = SG::makeHandle( m_HLTMenuKey );
+    ATH_CHECK( hltMenuHandle.isValid() );
+
+    // Fill the maps
+    for ( const TrigConf::Chain& chain : *hltMenuHandle ) {
+        for ( const std::string& sequencer : chain.sequencers() ) {
+            m_sequencerToChainMap[sequencer].push_back(chain.name());
+        }
+    }
+
+    for ( const auto& sequencer : hltMenuHandle->sequencers() ) {
+        for ( const std::string& algorithm : sequencer.second ) {
+            // Save just second part of algorithm ex. RoRSeqFilter/FFastCaloElectron -> FFastCaloElectron
+            m_algToSequencersMap[algorithm.substr(algorithm.find('/') + 1)]
+                .push_back(sequencer.first);
+        }
+    }
+
+    return StatusCode::SUCCESS;
+}
+
+
+std::set<std::string> TrigCompositeUtils::AlgToChainTool::getChainsForAlg(const std::string& algorithmName) const {
+    std::set<std::string> result;
+
+    try {
+        for ( const std::string& sequencer : m_algToSequencersMap.at(algorithmName) ) {
+            result.insert(m_sequencerToChainMap.at(sequencer).begin(), m_sequencerToChainMap.at(sequencer).end());
+        }
+    } catch ( const std::out_of_range & ex ) {
+        ATH_MSG_ERROR ( algorithmName << " is not part of the menu!" );
+    }
+
+    return result;
+}
+
+std::set<std::string> TrigCompositeUtils::AlgToChainTool::getActiveChainsForAlg(const std::string& algorithmName, const EventContext& context) const {
+    std::set<std::string> result;
+
+    std::set<std::string> allActiveChains = retrieveActiveChains(context);
+    std::set<std::string> allAlgChains = getChainsForAlg(algorithmName);
+
+    // Save the chains that are used by selected algorithm and active
+    std::set_intersection(allAlgChains.begin(), allAlgChains.end(),
+        allActiveChains.begin(), allActiveChains.end(),
+        std::inserter(result, result.begin()));
+
+    return result;
+}
+
+std::set<std::string> TrigCompositeUtils::AlgToChainTool::retrieveActiveChains(const EventContext& context) const {
+    std::set<TrigCompositeUtils::DecisionID> activeChainsID;
+
+    // Retrieve EventStore and keys
+    IProxyDict* storeProxy = Atlas::getExtendedEventContext(context).proxy();
+    SmartIF<SGImplSvc> eventStore (storeProxy);
+
+    std::vector<std::string> keys;
+    eventStore->keys(static_cast<CLID>( ClassID_traits<TrigCompositeUtils::DecisionContainer>::ID() ), keys);
+
+    // Retrieve active chains
+    std::set<std::string> activeChains;
+
+    for ( const std::string& key : keys ) {
+        if( key.find("HLTNav") != 0 || key == "HLTNav_Summary" ) {
+            continue;
+        }
+
+        SG::DataProxy* dp = eventStore->proxy(
+            static_cast<CLID>(ClassID_traits<TrigCompositeUtils::DecisionContainer>::ID()), key, true);
+
+        SG::ReadHandle<TrigCompositeUtils::DecisionContainer> dc (dp);
+        if ( !dc.isValid() ) {            
+            ATH_MSG_WARNING("Failed to retrieve " << key << " from event store.");            
+            continue;        
+        }
+
+        for ( const TrigCompositeUtils::Decision* d : *dc ) {
+            TrigCompositeUtils::DecisionIDContainer chainsID;
+            TrigCompositeUtils::decisionIDs( d, chainsID );
+
+            // Save the active chains IDs
+            activeChainsID.insert( chainsID.begin(), chainsID.end() );
+        } 
+    }
+
+    // Convert DecisionID to names
+    std::set<std::string> activeChainsNames;
+
+    for ( const TrigCompositeUtils::DecisionID& id : activeChainsID ) {
+        activeChainsNames.insert( HLT::Identifier(id).name() );
+    }
+
+    return activeChainsNames;
+}
+
+#endif // XAOD_STANDALONE
\ No newline at end of file
diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/src/AlgToChainTool.h b/Trigger/TrigSteer/TrigCompositeUtils/TrigCompositeUtils/AlgToChainTool.h
similarity index 57%
rename from Trigger/TrigConfiguration/TrigConfigSvc/src/AlgToChainTool.h
rename to Trigger/TrigSteer/TrigCompositeUtils/TrigCompositeUtils/AlgToChainTool.h
index de01f55feb692b780fa3eb94708da9541b6a8545..e305a802019319ba68196a6604a38898ccfb302f 100644
--- a/Trigger/TrigConfiguration/TrigConfigSvc/src/AlgToChainTool.h
+++ b/Trigger/TrigSteer/TrigCompositeUtils/TrigCompositeUtils/AlgToChainTool.h
@@ -2,8 +2,10 @@
   Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
-#ifndef TRIGCONFDATA_ALGTOCHAINTOOL_H
-#define TRIGCONFDATA_ALGTOCHAINTOOL_H
+#ifndef TrigCompositeUtils_AlgToChainTool_h
+#define TrigCompositeUtils_AlgToChainTool_h
+
+#ifndef XAOD_STANDALONE
 
 #include <string>
 #include <set>
@@ -11,13 +13,14 @@
 #include <map>
 
 #include "AthenaBaseComps/AthAlgTool.h"
+#include "TrigCompositeUtils/TrigCompositeUtils.h"
 #include "TrigConfData/HLTMenu.h"
 
 
-namespace TrigConf {
+namespace TrigCompositeUtils {
 
   /** @class AlgToChainTool
-   *  @brief Provide the reverse mapping: algorithms to set fo chain names
+   *  @brief Provide the reverse mapping: algorithm name to set of chain names
    **/
 
   class AlgToChainTool : public AthAlgTool {
@@ -29,14 +32,22 @@ namespace TrigConf {
 
       virtual StatusCode start() override;
 
-      /// Request set of chains for given algorithm
+      /// Request set of chains for given algorithm - static lookup
       std::set<std::string> getChainsForAlg(const std::string& algorithmName) const;
 
+      /// Request set of active chains for given algorithm - dynamic lookup
+      std::set<std::string> getActiveChainsForAlg(const std::string& algorithmName, const EventContext& context) const;
+
   private:
+      std::set<std::string> retrieveActiveChains(const EventContext& context) const;
+
       SG::ReadHandleKey<TrigConf::HLTMenu> m_HLTMenuKey{ this, "HLTTriggerMenu", "DetectorStore+HLTTriggerMenu", "HLT Menu" };
+
       std::map<std::string, std::vector<std::string>> m_sequencerToChainMap;
       std::map<std::string, std::vector<std::string>> m_algToSequencersMap;
   };
 }
 
-#endif // TRIGCONFDATA_ALGTOCHAINTOOL_H
+#endif // XAOD_STANDALONE
+
+#endif // TrigCompositeUtils_AlgToChainTool_h
\ No newline at end of file
diff --git a/Trigger/TrigSteer/TrigCompositeUtils/TrigCompositeUtils/components/TrigCompositeUtils_entries.cxx b/Trigger/TrigSteer/TrigCompositeUtils/TrigCompositeUtils/components/TrigCompositeUtils_entries.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..67816acc2ce4c7bdf03ee560ebc477a7ad7cf26f
--- /dev/null
+++ b/Trigger/TrigSteer/TrigCompositeUtils/TrigCompositeUtils/components/TrigCompositeUtils_entries.cxx
@@ -0,0 +1,3 @@
+#include "../AlgToChainTool.h"
+
+DECLARE_COMPONENT( TrigCompositeUtils::AlgToChainTool )
\ No newline at end of file
diff --git a/Trigger/TrigSteer/TrigSteering/share/pureSteering_jobOptions.py b/Trigger/TrigSteer/TrigSteering/share/pureSteering_jobOptions.py
index b0661a7e89cc8e7b093533669f78796803309ca8..1f389d2ad7c3f20c71d5663b6ad6c038d4b79f58 100755
--- a/Trigger/TrigSteer/TrigSteering/share/pureSteering_jobOptions.py
+++ b/Trigger/TrigSteer/TrigSteering/share/pureSteering_jobOptions.py
@@ -27,7 +27,6 @@ if not "usePrescaleMenu" in dir(): usePrescaleMenu = False
 if not "useMultiSeedingMenu" in dir(): useMultiSeedingMenu = False
 if not "useMenuWithAcceptInput" in dir(): useMenuWithAcceptInput = False
 if not "useBusyEventSetup" in dir(): useBusyEventSetup = False
-if not "l1SeedingTest" in dir(): l1SeedingTest = False
 
 # Default L1 RoIs if not set otherwise below
 
@@ -100,24 +99,6 @@ EM15i,EM25i
 EM15i,EM25i
 """
 
-elif l1SeedingTest:
-    include("TrigSteering/pureSteering_l1Seeding_menu.py")
-    RoIs = "MU6, MU20\n"*7
-    # see for info about 
-    # 106 is ctp ID of L1_MU06 120 is for L1_MU20 and 121 for L1_MU21
-    #
-    ctpbits = "106:1,0 120:1,1\n" 
-    ctpbits += "106:1,1 120:0,0 121:1,1\n" # L1_MU21 active
-    ctpbits += "106:1,0 120:1,1 121:0,0\n"  # L1_MU20 acts ( the other is inactive )
-    ctpbits += "106:1,1 120:1,1 121:0,0\n"
-    ctpbits += "106:1,1 120:1,1 121:0,0\n"
-    ctpbits += "106:1,1 120:1,1 121:0,0\n"
-    ctpbits += "106:1,1 120:1,0 121:0,0\n" # L1_MU20 activated but prescaled
-
-    ctpfile=open("Lvl1CTPResults.txt", "w")
-    ctpfile.write(ctpbits)
-    ctpfile.close()
-
 else:
     include("TrigSteering/pureSteering_menu.py")
 
@@ -191,21 +172,6 @@ if runMergedSteering:
         hltSteer.ResultBuilder.ErrorStreamTags = ["ABORT_CHAIN ALGO_ERROR GAUDI_EXCEPTION: hltexceptions physics", "ABORT_EVENT ALGO_ERROR TIMEOUT: hlttimeout debug"]
         hltSteer.softEventTimeout = 1 * Units.s
 
-    if l1SeedingTest:
-        from TrigSteering.TestingTrigSteeringConfig import TestingLvl1Converter
-        lvl1Converter = TestingLvl1Converter()
-        hltSteer += lvl1Converter        
-        hltSteer.LvlConverterTool = lvl1Converter
-        hltSteer.LvlConverterTool.useL1Calo = False
-        hltSteer.LvlConverterTool.useL1Muon = False
-        hltSteer.LvlConverterTool.useL1JetEnergy = False
-        hltSteer.LvlConverterTool.OutputLevel = DEBUG
-        from TrigFake.TrigFakeConf import FakeRoIB
-        fakeRoIB = FakeRoIB()
-        fakeRoIB.OutputLevel = DEBUG
-        fakeRoIB.InputFile="Lvl1CTPResults.txt"
-        job += fakeRoIB
-
     job += hltSteer
 
 
diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/xaod/CmxRoIByteStreamAuxCnv.cxx b/Trigger/TrigT1/TrigT1CaloByteStream/src/xaod/CmxRoIByteStreamAuxCnv.cxx
index 15cc5487a9fa7232e1d191b97032f6ca1f7d7de1..fe8f2e9d65fe553f3b20733e1e4082c731a32031 100644
--- a/Trigger/TrigT1/TrigT1CaloByteStream/src/xaod/CmxRoIByteStreamAuxCnv.cxx
+++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/xaod/CmxRoIByteStreamAuxCnv.cxx
@@ -109,7 +109,7 @@ StatusCode CmxRoIByteStreamAuxCnv::createObj(IOpaqueAddress* pAddr,
   item->initialize(source.ex(), source.ey(), source.et(),
     source.exError(), source.eyError(), source.etError(),
     //source.sumEtHits(), source.missingEtHits(),
-    // amazurov: values for EtHits and missingEtHits are swaзув in source 
+    // amazurov: values for EtHits and missingEtHits are swaped in source 
     source.missingEtHits(), source.sumEtHits(),
     source.missingEtSigHits(),
     source.ex(LVL1::CMXRoI::SumType::MASKED),
@@ -119,7 +119,7 @@ StatusCode CmxRoIByteStreamAuxCnv::createObj(IOpaqueAddress* pAddr,
     source.eyError(LVL1::CMXRoI::SumType::MASKED),
     source.etError(LVL1::CMXRoI::SumType::MASKED),
     // source.sumEtHits(LVL1::CMXRoI::SumType::MASKED), source.missingEtHits(LVL1::CMXRoI::SumType::MASKED)
-    // amazurov: values for EtHits and missingEtHits are swaзув in source  
+    // amazurov: values for EtHits and missingEtHits are swaped in source  
     source.missingEtHits(LVL1::CMXRoI::SumType::MASKED), source.sumEtHits(LVL1::CMXRoI::SumType::MASKED)
   );
 
diff --git a/Trigger/TrigT1/TrigT1CaloMonitoring/share/TrigT1CaloMonitoring_forRecExCommission_Run1.py b/Trigger/TrigT1/TrigT1CaloMonitoring/share/TrigT1CaloMonitoring_forRecExCommission_Run1.py
index 3d3e33ca0ae7d3166806f84e663c1dae7dd23239..f0c78923b0e1da3672dc6a868781aa5a3ad1a401 100644
--- a/Trigger/TrigT1/TrigT1CaloMonitoring/share/TrigT1CaloMonitoring_forRecExCommission_Run1.py
+++ b/Trigger/TrigT1/TrigT1CaloMonitoring/share/TrigT1CaloMonitoring_forRecExCommission_Run1.py
@@ -5,7 +5,7 @@
 # @authors Johanna Fleckner, Andrea Neusiedl, Peter Faulkner
 #
 if not 'DQMonFlags' in dir():
-    print "TrigT1CaloMonitoring_forRecExCommission.py: DQMonFlags not yet imported - I import them now"
+    print("TrigT1CaloMonitoring_forRecExCommission.py: DQMonFlags not yet imported - I import them now")
     from AthenaMonitoring.DQMonFlags import DQMonFlags
     
 # On Tier0 select monitoring tools according to processing step
diff --git a/Trigger/TrigT1/TrigT1CaloMonitoring/share/TrigT1CaloMonitoring_forRecExCommission_cpu.py b/Trigger/TrigT1/TrigT1CaloMonitoring/share/TrigT1CaloMonitoring_forRecExCommission_cpu.py
index 61c7dc8413d4ac5a579cca92668e0720f6381363..8f94f119c5768276b5dbda457308186ecf384281 100644
--- a/Trigger/TrigT1/TrigT1CaloMonitoring/share/TrigT1CaloMonitoring_forRecExCommission_cpu.py
+++ b/Trigger/TrigT1/TrigT1CaloMonitoring/share/TrigT1CaloMonitoring_forRecExCommission_cpu.py
@@ -6,7 +6,7 @@
 # @author Peter Faulkner
 #
 if not 'DQMonFlags' in dir():
-    print "TrigT1CaloMonitoring_forRecExCommission.py: DQMonFlags not yet imported - I import them now"
+    print("TrigT1CaloMonitoring_forRecExCommission.py: DQMonFlags not yet imported - I import them now")
     from AthenaMonitoring.DQMonFlags import DQMonFlags
     
 # On Tier0 select monitoring tools according to processing step
diff --git a/Trigger/TrigT1/TrigT1Monitoring/share/TrigT1Monitoring_forRecExCommission_cpu.py b/Trigger/TrigT1/TrigT1Monitoring/share/TrigT1Monitoring_forRecExCommission_cpu.py
index 41a39a3e8078cf5697b1b051378d68c35fec3242..2d758fc57c791c7000ed6625488130330da25708 100644
--- a/Trigger/TrigT1/TrigT1Monitoring/share/TrigT1Monitoring_forRecExCommission_cpu.py
+++ b/Trigger/TrigT1/TrigT1Monitoring/share/TrigT1Monitoring_forRecExCommission_cpu.py
@@ -6,7 +6,7 @@
 #
 from AthenaCommon.GlobalFlags import globalflags
 if not 'DQMonFlags' in dir():
-    print "TrigT1CaloMonitoring_forRecExCommission.py: DQMonFlags not yet imported - I import them now"
+    print("TrigT1CaloMonitoring_forRecExCommission.py: DQMonFlags not yet imported - I import them now")
     from AthenaMonitoring.DQMonFlags import DQMonFlags
 
 # On Tier0 select monitoring tools according to processing step
diff --git a/Trigger/TrigT1/TrigT1NSWSimTools/src/StripSegmentTool.cxx b/Trigger/TrigT1/TrigT1NSWSimTools/src/StripSegmentTool.cxx
index 91cb62d41dac8a265ed80137cf9941afd515ad25..198d12de34f1da654eb714a9ae6f456e43e75960 100644
--- a/Trigger/TrigT1/TrigT1NSWSimTools/src/StripSegmentTool.cxx
+++ b/Trigger/TrigT1/TrigT1NSWSimTools/src/StripSegmentTool.cxx
@@ -142,6 +142,11 @@ namespace NSWL1 {
     float step=(range.second-range.first)/nSlices;
     if(val<=range.first) return 0;
     if(val>=range.second) return nSlices-1;
+
+    //the loop gets stuck if the value is between the last and second-to-last step (255-256)
+    if(val>=range.first+(nSlices-1)*step){
+      return nSlices-1;
+    }
     for(uint8_t i=0;i<nSlices;i++){
             if(range.first+i*step>=val){
                 return i;
@@ -288,6 +293,7 @@ namespace NSWL1 {
             continue;
          }
          
+         //S.I instead of doing all these stuff like below, which is quite error prone  why dont we use TVectors?
          if(glx>=0 && gly>=0){
              phi=atan(gly/glx);
          }
@@ -304,7 +310,7 @@ namespace NSWL1 {
          else{
             ATH_MSG_ERROR("Unexpected error, global x or global y are not a number");//S.I does this even necessary ? then what ?
          }
-        
+
         //However it needs to be kept an eye on... will be something in between 7 and 15 mrad needs to be decided 
         //if(std::abs(dtheta)>15) return StatusCode::SUCCESS; 
         
@@ -315,14 +321,12 @@ namespace NSWL1 {
         sign= (std::abs(theta_inf)<std::abs(theta)) ? 1: -1;
         float delta_r=delta_z*tan(theta_inf);
         float rfar=avg_r+sign*delta_r;
-
  
         if( rfar > m_rbounds.second || rfar < m_rbounds.first ){
             ATH_MSG_WARNING("measured r is out of detector envelope! rfar="<<rfar<<" rmax="<<m_rbounds.second);
             return StatusCode::SUCCESS;
         }
         
-        
         uint8_t rIndex=0;
         switch(m_ridxScheme){
             case 0:
@@ -335,7 +339,6 @@ namespace NSWL1 {
                 break;   
         }
         
-        
         bool phiRes=true;
         bool lowRes=false;//we do not have a recipe  for a singlewedge trigger.  so lowres is always false for now
         uint8_t dtheta_int=findDtheta(dtheta);
@@ -441,3 +444,4 @@ namespace NSWL1 {
     }
 
 }
+ 
diff --git a/Trigger/TrigTools/IDScanHitFilter/src/FilterBin.cxx b/Trigger/TrigTools/IDScanHitFilter/src/FilterBin.cxx
index 38784fc8a17aab7842f9ff1ef4c7ea7415208588..59b6feb0d1d740b26eb3c0200a2069eb4c7ca992 100644
--- a/Trigger/TrigTools/IDScanHitFilter/src/FilterBin.cxx
+++ b/Trigger/TrigTools/IDScanHitFilter/src/FilterBin.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
 */
 //
 //   @file    FilterBin.cxx         
@@ -12,6 +12,3 @@
 
 
 #include "FilterBin.h"
-
-long FilterBin::m_maxLayers      = 19;
-long FilterBin::m_maxBarrelLayer = 6;
diff --git a/Trigger/TrigTools/IDScanHitFilter/src/FilterBin.h b/Trigger/TrigTools/IDScanHitFilter/src/FilterBin.h
index 144e603b72f98ea5e1149e13505dc269442948c9..c93b01262fdce05f830d9f4abc13d7d473e0cb20 100644
--- a/Trigger/TrigTools/IDScanHitFilter/src/FilterBin.h
+++ b/Trigger/TrigTools/IDScanHitFilter/src/FilterBin.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
 */
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -40,7 +40,7 @@ class FilterBin
   void AddLdirect( long layer_id );
   void AddLindirect( FixedBitSet& bits );
 
-  void AddHit( IdScanSpPoint* spptr );
+  void AddHit( IdScanSpPoint* spptr, long maxLayers, long maxBarrelLayer);
   void AddTriplet( IdScanSpPoint* iPtr,
 		   IdScanSpPoint* jPtr,
 		   IdScanSpPoint* kPtr );
@@ -49,9 +49,6 @@ class FilterBin
   std::list<IdScanSpPoint* >&       hitList();
   const std::list<IdScanSpPoint* >& hitList() const;
 
-  static void setMaxLayers ATLAS_NOT_THREAD_SAFE (long layer)      { m_maxLayers = layer; }
-  static void setMaxBarrelLayer ATLAS_NOT_THREAD_SAFE (long layer) { m_maxBarrelLayer = layer; }
-
 private:
   void neighborKeys( long key, long* np ) const; 
 
@@ -60,20 +57,16 @@ private:
 
   FixedBitSet m_Ldirect;                        // keeps direct layers
   FixedBitSet m_Ltotal;                         // keeps direct+indirect layers
-
-  // statics set once during initialize() via the above non-thread-safe methods:
-  static long m_maxLayers ATLAS_THREAD_SAFE;
-  static long m_maxBarrelLayer ATLAS_THREAD_SAFE;
 };
 
 
 inline std::ostream& operator<<(std::ostream& s, const FilterBin& f) { 
   s << "[ Nhits="    << f.NumberOfHits() 
     << "\t Nlayers=" << f.NumberOfLayers() << "\taddr=" << (void*)&f << "\t]";
-  
-  std::list<IdScanSpPoint*>::const_iterator spitr(f.hitList().begin());
-  std::list<IdScanSpPoint*>::const_iterator spend(f.hitList().end());
-  for ( ; spitr!=spend ; spitr++ ) s << "\n\t" << *(*spitr);
+
+  for (const IdScanSpPoint* hit : f.hitList()) {
+    s << "\n\t" << *hit;
+  }
   return s;
 }
 
@@ -102,14 +95,14 @@ inline void FilterBin::AddLindirect( FixedBitSet& bits ) {
 }
 
 
-inline void FilterBin::AddHit(IdScanSpPoint* spptr) 
+inline void FilterBin::AddHit(IdScanSpPoint* spptr, long maxLayers, long maxBarrelLayer) 
 { 
 
   m_HitList.push_back( spptr ); 
   long lr = spptr->layer();
   this->AddLdirect( lr );
-  if ( lr==0 || lr==m_maxBarrelLayer ){
-    this->AddLdirect( m_maxLayers+lr );
+  if ( lr==0 || lr==maxBarrelLayer ){
+    this->AddLdirect( maxLayers+lr );
   }
 
 }
diff --git a/Trigger/TrigTools/IDScanHitFilter/src/FixedBitSet.h b/Trigger/TrigTools/IDScanHitFilter/src/FixedBitSet.h
index 390cb42b1cd6685ddc89be3c9da853fe7cde1d37..da4311ccd464bb58e15478a9f27e6795cb583223 100755
--- a/Trigger/TrigTools/IDScanHitFilter/src/FixedBitSet.h
+++ b/Trigger/TrigTools/IDScanHitFilter/src/FixedBitSet.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
 */
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -26,25 +26,25 @@
 
 
   // Create the masks for each bit.
-  static const int setMask[] = { 
-    ((int) 1<< 0), ((int) 1<< 1), ((int) 1<< 2), ((int) 1<< 3), 
-    ((int) 1<< 4), ((int) 1<< 5), ((int) 1<< 6), ((int) 1<< 7), 
-    ((int) 1<< 8), ((int) 1<< 9), ((int) 1<<10), ((int) 1<<11), 
-    ((int) 1<<12), ((int) 1<<13), ((int) 1<<14), ((int) 1<<15), 
-    ((int) 1<<16), ((int) 1<<17), ((int) 1<<18), ((int) 1<<19), 
-    ((int) 1<<20), ((int) 1<<21), ((int) 1<<22), ((int) 1<<23), 
-    ((int) 1<<24), ((int) 1<<25), ((int) 1<<26), ((int) 1<<27), 
-    ((int) 1<<28), ((int) 1<<29), ((int) 1<<30), ((int) 1<<31)};
+  static const unsigned int setMask[] = { 
+    (1u<< 0), (1u<< 1), (1u<< 2), (1u<< 3), 
+    (1u<< 4), (1u<< 5), (1u<< 6), (1u<< 7), 
+    (1u<< 8), (1u<< 9), (1u<<10), (1u<<11), 
+    (1u<<12), (1u<<13), (1u<<14), (1u<<15), 
+    (1u<<16), (1u<<17), (1u<<18), (1u<<19), 
+    (1u<<20), (1u<<21), (1u<<22), (1u<<23), 
+    (1u<<24), (1u<<25), (1u<<26), (1u<<27), 
+    (1u<<28), (1u<<29), (1u<<30), (1u<<31)};
   
-  static const int clearMask[] = { 
-    ~((int) 1<< 0),~((int) 1<< 1),~((int) 1<< 2),~((int) 1<< 3), 
-    ~((int) 1<< 4),~((int) 1<< 5),~((int) 1<< 6),~((int) 1<< 7), 
-    ~((int) 1<< 8),~((int) 1<< 9),~((int) 1<<10),~((int) 1<<11), 
-    ~((int) 1<<12),~((int) 1<<13),~((int) 1<<14),~((int) 1<<15), 
-    ~((int) 1<<16),~((int) 1<<17),~((int) 1<<18),~((int) 1<<19), 
-    ~((int) 1<<20),~((int) 1<<21),~((int) 1<<22),~((int) 1<<23), 
-    ~((int) 1<<24),~((int) 1<<25),~((int) 1<<26),~((int) 1<<27), 
-    ~((int) 1<<28),~((int) 1<<29),~((int) 1<<30),~((int) 1<<31)};
+  static const unsigned int clearMask[] = { 
+    ~(1u<< 0),~(1u<< 1),~(1u<< 2),~(1u<< 3), 
+    ~(1u<< 4),~(1u<< 5),~(1u<< 6),~(1u<< 7), 
+    ~(1u<< 8),~(1u<< 9),~(1u<<10),~(1u<<11), 
+    ~(1u<<12),~(1u<<13),~(1u<<14),~(1u<<15), 
+    ~(1u<<16),~(1u<<17),~(1u<<18),~(1u<<19), 
+    ~(1u<<20),~(1u<<21),~(1u<<22),~(1u<<23), 
+    ~(1u<<24),~(1u<<25),~(1u<<26),~(1u<<27), 
+    ~(1u<<28),~(1u<<29),~(1u<<30),~(1u<<31)};
 
   static const int countLUT0[] = 
   {0,2,1,3,1,3,2,4,1,3,2,4,2,4,3,5,1,3,2,4,2,4,3,5,2,4,3,5,3,5,4,6,
diff --git a/Trigger/TrigTools/IDScanHitFilter/src/IDScanHitFilter.cxx b/Trigger/TrigTools/IDScanHitFilter/src/IDScanHitFilter.cxx
index 32296e9c71cb803f1342887a6513d4e099cf271a..57304efd3e9aa4eb8c4e6b76b26dc4176eee8238 100755
--- a/Trigger/TrigTools/IDScanHitFilter/src/IDScanHitFilter.cxx
+++ b/Trigger/TrigTools/IDScanHitFilter/src/IDScanHitFilter.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -66,7 +66,7 @@ IDScanHitFilter::IDScanHitFilter(const std::string& t,
 
 }
 
-StatusCode IDScanHitFilter::initialize ATLAS_NOT_THREAD_SAFE()
+StatusCode IDScanHitFilter::initialize()
 {
   m_dPhidRCut = 0.3/m_pTcutInMeV;
 
@@ -90,13 +90,10 @@ StatusCode IDScanHitFilter::initialize ATLAS_NOT_THREAD_SAFE()
   /// NB: decrement the endcap pixels, as we want the layer number 
   ///     of the last barrel layer, not the number of the first 
   ///     endcap pixel layer
-  FilterBin::setMaxLayers( maxSiliconLayerNum );
-  FilterBin::setMaxBarrelLayer( offsetEndcapPixels-1 );
-
-  /// initialisise the HitFilter with the correct number of layers
+  /// initialise the HitFilter with the correct number of layers
   /// NB: DO NOT pass in the max eta here, but remember that it can be set here!!
   ///     the parameter initialisation is very messy for this stuff 
-  iHitFilter::initialise( maxSiliconLayerNum ); /// , 3.0 ); 
+  iHitFilter::initialise( maxSiliconLayerNum, offsetEndcapPixels-1 ); /// , 3.0 ); 
 
   // NB: Now set the other way - ie, set m_fullScan=true, 
   //     then this will enforce m_ROIphiHalfWidth=M_PI, but in 
@@ -206,10 +203,9 @@ void IDScanHitFilter::makeTracks( GroupList& idScanGroups, TrigInDetTrackCollect
 							      1.0/ptInv );
 
     std::vector<const TrigSiSpacePoint*> spacePointsOnTrack;
-    for(std::list<IdScanSpPoint *>::iterator hitItr=gItr->groupHits().begin();
-	hitItr!=gItr->groupHits().end();hitItr++) 
+    for (IdScanSpPoint* sp : gItr->groupHits())
       {
-	spacePointsOnTrack.push_back( (**hitItr).commonSP() );
+	spacePointsOnTrack.push_back( sp->commonSP() );
       }
     std::vector<const TrigSiSpacePoint*>* spv = new std::vector<const TrigSiSpacePoint*>;
     spv->assign(spacePointsOnTrack.begin(),spacePointsOnTrack.end());
diff --git a/Trigger/TrigTools/IDScanHitFilter/src/iHitFilter.cxx b/Trigger/TrigTools/IDScanHitFilter/src/iHitFilter.cxx
index 8892d4dfc174714bf7d54d16518bd77d3eec0bfd..8812d32fc30732ea6106a8c72cefff4be574e4e3 100755
--- a/Trigger/TrigTools/IDScanHitFilter/src/iHitFilter.cxx
+++ b/Trigger/TrigTools/IDScanHitFilter/src/iHitFilter.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
 */
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -32,10 +32,11 @@ using std::cerr;
 using std::endl;
 using std::memset;
 
-int iHitFilter::initialise(long maxlayers, double maxeta) 
+int iHitFilter::initialise(long maxlayers, long maxBarrelLayer, double maxeta) 
 {
 
   m_IdScan_MaxNumLayers = maxlayers;
+  m_maxBarrelLayer      = maxBarrelLayer;
   m_IdScan_MaxEta       = maxeta;
 
   if ( m_fullScan ) m_useROIphiHalfWidth = M_PI;
@@ -272,7 +273,7 @@ GroupList iHitFilter::execute()
 
   for ( ; hitItr != hitEnd;  ++hitItr ) {
     sp_key = makeHashKey( (*hitItr)->rotatedPhi(), (*hitItr)->eta() );
-    (*m_binMap)[sp_key].AddHit( *hitItr );
+    (*m_binMap)[sp_key].AddHit( *hitItr, m_IdScan_MaxNumLayers, m_maxBarrelLayer );
 #ifdef IDSCAN_DEBUG
     std::cout << "IDSCAN_DEBUG hitfilter: layer/phi/z/eta/sp_key: " 
 	      << (*hitItr)->layer() << " / " << (*hitItr)->phi() << " / " << (*hitItr)->z() << " / " << sp_key << std::endl;
@@ -289,8 +290,8 @@ GroupList iHitFilter::execute()
     for ( hitItr = m_internalSPs->begin(); hitItr != hitEnd;  ++hitItr ) {
       if ( (*hitItr)->layer() == 0 ) {
  	sp_key = this->makeHashKey( (*hitItr)->rotatedPhi(), (*hitItr)->eta() );
-	(*m_binMap)[sp_key+offset].AddHit( *hitItr );
-	(*m_binMap)[sp_key-offset].AddHit( *hitItr );
+	(*m_binMap)[sp_key+offset].AddHit( *hitItr, m_IdScan_MaxNumLayers, m_maxBarrelLayer );
+	(*m_binMap)[sp_key-offset].AddHit( *hitItr, m_IdScan_MaxNumLayers, m_maxBarrelLayer );
       }
     }
   }
@@ -434,9 +435,7 @@ void iHitFilter::groupCleaner( GroupList::iterator& inputItr, GroupList& cleanGr
 		    << std::endl;
 #endif
 
-	  std::list<IdScanSpPoint *>::iterator hitItr=(*gItr2).groupHits().begin();
-	  for( ; hitItr!=(*gItr2).groupHits().end(); hitItr++) {
-	    IdScanSpPoint* pSP=(*hitItr);
+          for (IdScanSpPoint* pSP : gItr2->groupHits()) {
 	    pSP->setUsed(1);
 #ifdef IDSCAN_DEBUG
 	    std::cout << "IDSCAN_DEBUG: new group - layer = " << pSP->layer()
@@ -450,14 +449,14 @@ void iHitFilter::groupCleaner( GroupList::iterator& inputItr, GroupList& cleanGr
 	  int badHit=0;
 	  //setting used=0 to spacepoints in the same layer
 	  for(std::list<IdScanSpPoint *>::iterator phIt1=(*gItr2).groupHits().begin();
-	      phIt1!=(*gItr2).groupHits().end();phIt1++) 
+	      phIt1!=(*gItr2).groupHits().end();++phIt1) 
 	    {
 	      //if((*phIt1)->used()==0) continue;
 	      int lay1=(*phIt1)->layer();
 	      int type1=((*phIt1)->dz()<(*phIt1)->dr())?1:0;
 	      std::list<IdScanSpPoint *>::iterator phIt2=phIt1;
-	      phIt2++;
-	      for(;phIt2!=(*gItr2).groupHits().end();phIt2++)
+	      ++phIt2;
+	      for(;phIt2!=(*gItr2).groupHits().end();++phIt2)
 		{
 		  //if((*phIt2)->used()==0) continue;
 		  int lay2=(*phIt2)->layer();
@@ -498,7 +497,7 @@ void iHitFilter::groupCleaner( GroupList::iterator& inputItr, GroupList& cleanGr
 		    }
 		  else 
 		    {
-		      hitItr++;pSP->setUsed(1);
+		      ++hitItr;pSP->setUsed(1);
 		    }
 		}
 	    }
@@ -898,10 +897,8 @@ void TrackFilterClass::removeClones(int cut)
       (*pTCCIt)->m_nHitShift=nTrackCounter*nSign;
       memset(nContribHisto,0,sizeof(nContribHisto));
 
-      for(std::list<IdScanSpPoint *>::iterator hitItr=(*pTCCIt)->m_pGroup->groupHits().begin();
-	  hitItr!=(*pTCCIt)->m_pGroup->groupHits().end();hitItr++) 
+      for (IdScanSpPoint* pSP : (*pTCCIt)->m_pGroup->groupHits())
 	{
-	  IdScanSpPoint* pSP=(*hitItr);
 	  if(pSP->used()==0) continue;
 	  if(pSP->used()==1)
 	    pSP->setUsed((*pTCCIt)->m_nHitShift);
@@ -976,17 +973,15 @@ void iHitFilter::fitGroup(Group& G)
 
   double minPhi=(*G.groupHits().begin())->phi();
 
-  for(std::list<IdScanSpPoint *>::iterator hitItr=G.groupHits().begin();
-      hitItr!=G.groupHits().end();hitItr++) 
+  for (IdScanSpPoint* pSP : G.groupHits())
     {
-      if(minPhi>(*hitItr)->phi()) minPhi=(*hitItr)->phi();
-      spVec.push_back((*hitItr));
+      if(minPhi>pSP->phi()) minPhi=pSP->phi();
+      spVec.push_back(pSP);
     }
   std::sort(spVec.begin(),spVec.end(),CompareSpByLayer);
 
-  for(std::vector<IdScanSpPoint *>::iterator hitItr=spVec.begin();hitItr!=spVec.end();hitItr++) 
+  for (IdScanSpPoint* pSP : spVec)
     {
-      IdScanSpPoint* pSP=(*hitItr);
       nHits++;
       double delta=pSP->phi()-minPhi;
       if(std::fabs(delta)>M_PI) delta-=2.0*M_PI;
@@ -998,7 +993,7 @@ void iHitFilter::fitGroup(Group& G)
   printf("Average PHI0=%f Initial Pt=%f\n",averagePhi0,1.0/G.getPtInv());
 #endif
 
-  for(std::vector<IdScanSpPoint *>::reverse_iterator hitItr=spVec.rbegin();hitItr!=spVec.rend();hitItr++) 
+  for(std::vector<IdScanSpPoint *>::reverse_iterator hitItr=spVec.rbegin();hitItr!=spVec.rend();++hitItr) 
     {
       IdScanSpPoint* pSP=(*hitItr);
       if(pSP->used()!=0)
@@ -1308,17 +1303,15 @@ void iHitFilter::fitGroupWithoutHitRemoval(Group& G)
 
   double minPhi=(*G.groupHits().begin())->phi();
 
-  for(std::list<IdScanSpPoint *>::iterator hitItr=G.groupHits().begin();
-      hitItr!=G.groupHits().end();hitItr++) 
+  for (IdScanSpPoint* pSP : G.groupHits())
     {
-      if(minPhi>(*hitItr)->phi()) minPhi=(*hitItr)->phi();
-      spVec.push_back((*hitItr));
+      if(minPhi>pSP->phi()) minPhi=pSP->phi();
+      spVec.push_back(pSP);
     }
   std::sort(spVec.begin(),spVec.end(),CompareSpByLayer);
 
-  for(std::vector<IdScanSpPoint *>::iterator hitItr=spVec.begin();hitItr!=spVec.end();hitItr++) 
+  for (IdScanSpPoint* pSP : spVec)
     {
-      IdScanSpPoint* pSP=(*hitItr);
       if(pSP->used()==0)
 	pSP->setUsed(1);
       nHits++;
@@ -1332,7 +1325,7 @@ void iHitFilter::fitGroupWithoutHitRemoval(Group& G)
   printf("Average PHI0=%f Initial Pt=%f\n",averagePhi0,1.0/G.getPtInv());
 #endif
 
-  for(std::vector<IdScanSpPoint *>::reverse_iterator hitItr=spVec.rbegin();hitItr!=spVec.rend();hitItr++) 
+  for(std::vector<IdScanSpPoint *>::reverse_iterator hitItr=spVec.rbegin();hitItr!=spVec.rend();++hitItr) 
     {
       IdScanSpPoint* pSP=(*hitItr);
       int LayId=pSP->layer();
diff --git a/Trigger/TrigTools/IDScanHitFilter/src/iHitFilter.h b/Trigger/TrigTools/IDScanHitFilter/src/iHitFilter.h
index 18c7c969433195d0a2f25ef15c419ba445d68b87..99b92cf2816b3fbc71001480844406b186be26d8 100644
--- a/Trigger/TrigTools/IDScanHitFilter/src/iHitFilter.h
+++ b/Trigger/TrigTools/IDScanHitFilter/src/iHitFilter.h
@@ -1,7 +1,7 @@
 // emacs: this is -*- 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
 */
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -51,7 +51,7 @@ public:
  
   ~iHitFilter();
   
-  int initialise(long maxlayers=19, double maxeta=3.0);
+  int initialise(long maxlayers, long maxBarrelLayer, double maxeta=3.0);
 
   double  getLayerThreshold() const { return m_layerThreshold; }
 
@@ -145,7 +145,8 @@ protected:                      // data members
   /// locally set parameters for number of layers (and max eta ??)
   long   m_IdScan_MaxNumLayers;
   double m_IdScan_MaxEta;
-  
+
+  long m_maxBarrelLayer = 6;
 };
 
 
diff --git a/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py b/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py
index 3663103427a6f48d8ce0ea85c65d094a4c4924cd..b8bb91cab32874b3fb033f4df73952eff8c14548 100644
--- a/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py
+++ b/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py
@@ -4,6 +4,238 @@
 
 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
 from AthenaConfiguration.ComponentFactory import CompFactory
+from AthenaCommon.Constants import DEBUG
+
+def RungeKuttaPropagatorCfg(flags, **kwargs):
+  acc = ComponentAccumulator()
+  name = kwargs.pop("propagatorName", "InDetTrigPatternPropagator")
+  acc.addPublicTool( CompFactory.Trk.RungeKuttaPropagator( name ) )
+  return acc
+
+def SiDetElementsRoadMaker_xkCfg( flags, **kwargs ):
+  """
+  based  on: InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecLoadTools.py, should be moved elsewhere
+  """
+  acc = ComponentAccumulator()
+  name = kwargs.pop( "rodMakerName", "InDetTrigSiDetElementsRoadMaker" )
+  acc.merge( RungeKuttaPropagatorCfg( flags, **kwargs ) )
+  acc.addCondAlgo( CompFactory.InDet.SiDetElementsRoadCondAlg_xk() )
+  tool = CompFactory.InDet.SiDetElementsRoadMaker_xk( name,
+                                                      PropagatorTool = acc.getPublicTool( "InDetTrigPatternPropagator" ),
+                                                      usePixel     = flags.Detector.RecoPixel, # DetFlags.haveRIO.pixel_on(),
+                                                      useSCT       = flags.Detector.RecoSCT, #DetFlags.haveRIO.SCT_on(),
+                                                      RoadWidth    = 10, #InDetTrigCutValues.RoadWidth()
+                                                        )
+  acc.addPublicTool( tool )
+  return acc
+
+def PixelClusterOnTrackCfg( flags, **kwargs ):
+  """
+  based on: InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecLoadTools.py
+  """
+  acc = ComponentAccumulator()
+  name =  kwargs.pop("pixelOnTrackName", "InDetTrigPixelClusterOnTrackTool")
+  from SiLorentzAngleTool.PixelLorentzAngleConfig import PixelLorentzAngleCfg
+
+  pixelLATool = acc.popToolsAndMerge( PixelLorentzAngleCfg( flags) )
+  acc.addPublicTool( pixelLATool )
+
+  nnTool = CompFactory.InDet.NnClusterizationFactory( name                         = "TrigNnClusterizationFactory",
+                                                      PixelLorentzAngleTool        = pixelLATool,
+                                                      useToT                       = flags.InDet.doNNToTCalibration,
+                                                      NnCollectionReadKey          = 'PixelClusterNN',
+                                                      NnCollectionWithTrackReadKey = 'PixelClusterNNWithTrack')
+
+  tool = CompFactory.InDet.PixelClusterOnTrackTool( name,
+                                                    ErrorStrategy = 2,
+                                                    LorentzAngleTool = acc.getPublicTool( "PixelLorentzAngleTool" ),
+                                                    NnClusterizationFactory = nnTool )
+  acc.addPublicTool( tool )
+  return acc
+
+
+def SCT_ClusterOnTrackToolCfg( flags, **kwargs ):
+  acc = ComponentAccumulator()
+  from SiLorentzAngleTool.SCT_LorentzAngleConfig import SCT_LorentzAngleCfg
+  sctLATool =  acc.popToolsAndMerge( SCT_LorentzAngleCfg( flags ) )
+  acc.addPublicTool( sctLATool )
+  tool = CompFactory.InDet.SCT_ClusterOnTrackTool("SCT_ClusterOnTrackTool",
+                                                    CorrectionStrategy = 0,  # do correct position bias
+                                                    ErrorStrategy      = 2,  # do use phi dependent errors
+                                                    LorentzAngleTool   = acc.getPublicTool( "SCT_LorentzAngleTool" ) # default name
+                                                    )
+  acc.addPublicTool ( tool )
+  return acc
+
+def RIO_OnTrackCreatorCfg( flags, **kwargs ):
+  acc = ComponentAccumulator()
+  name =  kwargs.pop("rioOnTrackCreatorName", "InDetTrigRotCreator")
+  acc.merge( PixelClusterOnTrackCfg( flags, **kwargs ) )
+  acc.merge( SCT_ClusterOnTrackToolCfg( flags, **kwargs ) )
+  tool = CompFactory.Trk.RIO_OnTrackCreator(name,
+                                            ToolPixelCluster = acc.getPublicTool( "InDetTrigPixelClusterOnTrackTool" ), #InDetTrigPixelClusterOnTrackTool,
+                                            ToolSCT_Cluster  = acc.getPublicTool( "SCT_ClusterOnTrackTool" ),
+                                            Mode             = 'indet')
+  acc.addPublicTool( tool )
+  return acc
+
+def SiCombinatorialTrackFinder_xkCfg( flags, **kwargs ):
+  """
+  based  on: InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecLoadTools.py, should be moved elsewhere
+  """
+  acc = ComponentAccumulator()
+  name = kwargs.pop( "combinatorialTrackFinderName", "InDetTrigSiComTrackFinder" )
+  acc.merge( RungeKuttaPropagatorCfg( flags, **kwargs ) )
+  acc.addPublicTool( CompFactory.Trk.KalmanUpdator_xk( "InDetTrigPatternUpdator" ) )
+  acc.merge( RIO_OnTrackCreatorCfg( flags, **kwargs ) )
+
+  from PixelConditionsTools.PixelConditionsSummaryConfig import PixelConditionsSummaryCfg
+  pixelCondSummaryTool = acc.popToolsAndMerge( PixelConditionsSummaryCfg(flags) )
+
+  from InDetConfig.InDetRecToolConfig import InDetSCT_ConditionsSummaryToolCfg
+  sctCondSummaryTool = acc.popToolsAndMerge( InDetSCT_ConditionsSummaryToolCfg( flags, withFlaggedCondTool=False, withTdaqTool=False ) )
+
+
+  tool = CompFactory.InDet.SiCombinatorialTrackFinder_xk(name,
+                                                         PropagatorTool        = acc.getPublicTool( "InDetTrigPatternPropagator" ),
+                                                         UpdatorTool           = acc.getPublicTool( "InDetTrigPatternUpdator" ),
+                                                         RIOonTrackTool        = acc.getPublicTool( "InDetTrigRotCreator" ),
+                                                         usePixel              = flags.Detector.RecoPixel, #DetFlags.haveRIO.pixel_on(),
+                                                         useSCT                = flags.Detector.RecoSCT, #DetFlags.haveRIO.SCT_on(),
+                                                         PixelClusterContainer = 'PixelTrigClusters',
+                                                         SCT_ClusterContainer  = 'SCT_TrigClusters',
+                                                         PixelSummaryTool      = pixelCondSummaryTool,
+                                                         SctSummaryTool        = sctCondSummaryTool
+                                                        )
+  acc.setPrivateTools( tool )
+  return acc
+
+def SiTrackMaker_xkCfg(flags, **kwargs):
+  """
+  based on: InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecNewTracking.py , should be moved elsewhere
+  """
+  import AthenaCommon.SystemOfUnits as Unit
+  name = kwargs.pop("name", "SiTrackMaker_xk")
+  acc = ComponentAccumulator()
+  acc.merge( SiDetElementsRoadMaker_xkCfg( flags, **kwargs ) )
+  combTrackFinderTool = acc.popToolsAndMerge( SiCombinatorialTrackFinder_xkCfg( flags, **kwargs ) )
+
+  from IOVDbSvc.IOVDbSvcConfig import addFoldersSplitOnline
+  acc.merge(addFoldersSplitOnline( flags, "INDET", '/Indet/Onl/TrkErrorScaling', '/Indet/TrkErrorScaling', className="CondAttrListCollection") )
+
+  acc.addCondAlgo( CompFactory.RIO_OnTrackErrorScalingCondAlg(ErrorScalingType = ["PixelRIO_OnTrackErrorScaling", "SCTRIO_OnTrackErrorScaling", "TRTRIO_OnTrackErrorScaling"],
+                                                              OutKeys        = ["ConditionStore+/Indet/TrkErrorScalingPixel", "ConditionStore+/Indet/TrkErrorScalingSCT", "ConditionStore+/Indet/TrkErrorScalingTRT"],
+                                                              ReadKey        = "ConditionStore+/Indet/TrkErrorScaling") )
+
+
+  tool = CompFactory.InDet.SiTrackMaker_xk( name,
+                                            RoadTool                 = acc.getPublicTool( "InDetTrigSiDetElementsRoadMaker" ),
+                                            CombinatorialTrackFinder = combTrackFinderTool,
+                                            pTmin                    = 1000*Unit.MeV, # TODO use flag for these props
+                                            nClustersMin             = 7,
+                                            nHolesMax                = 3,
+                                            nHolesGapMax             = 3,
+                                            SeedsFilterLevel         = 0,
+                                            Xi2max                   = 15,
+                                            Xi2maxNoAdd              = 35,
+                                            nWeightedClustersMin     = 6,
+                                            #CosmicTrack             = InDetFlags.doCosmics(),
+                                            Xi2maxMultiTracks        = 15,
+                                            UseAssociationTool       = False )
+  acc.addPublicTool( tool )
+  return acc
+
+
+
+def InDetTestPixelLayerToolCfg(flags, **kwargs):
+  acc = ComponentAccumulator()
+  from PixelConditionsTools.PixelConditionsSummaryConfig import PixelConditionsSummaryCfg
+  pixelCondSummaryTool = acc.popToolsAndMerge( PixelConditionsSummaryCfg(flags) )
+  from InDetConfig.InDetRecToolConfig import InDetExtrapolatorCfg
+  extrapolator = acc.popToolsAndMerge( InDetExtrapolatorCfg( flags, name = "TrigInDetExtrapolator" ) )
+
+  tool = CompFactory.InDet.InDetTestPixelLayerTool("InDetTrigTestPixelLayerTool",
+                                                               PixelSummaryTool = pixelCondSummaryTool,
+                                                               Extrapolator     = extrapolator,
+                                                               CheckActiveAreas = True,
+                                                               CheckDeadRegions = True)
+  acc.addPublicTool( tool )
+  return acc
+
+
+def InDetHoleSearchToolCfg(flags, **kwargs):
+  acc = ComponentAccumulator()
+
+# a possible change in HoleSearchTool impl? - This two tools do not seem to be needed now, leaving them commented out  TODO - decide if can be removed ( also func above creting the config )
+#  from InDetConfig.InDetRecToolConfig import InDetSCT_ConditionsSummaryToolCfg
+#  sctCondSummaryTool = acc.popToolsAndMerge( InDetSCT_ConditionsSummaryToolCfg( flags,withFlaggedCondTool=False, withTdaqTool=False ) )
+
+#  acc.merge( InDetTestPixelLayerToolCfg( flags, **kwargs ) )
+
+  from InDetConfig.InDetRecToolConfig import InDetExtrapolatorCfg
+  acc.merge( InDetExtrapolatorCfg( flags, name = "TrigInDetExtrapolator" ) )
+
+  name = kwargs.pop("name", "InDetTrigHoleSearchTool")
+  tool = CompFactory.InDet.InDetTrackHoleSearchTool(name,
+                                                    Extrapolator =  acc.getPublicTool( "TrigInDetExtrapolator" ),
+                                                    # SctSummaryTool = sctCondSummaryTool,
+                                                    # PixelLayerTool = acc.getPublicTool( "InDetTrigTestPixelLayerTool" ),
+                                                    )
+  acc.addPublicTool( tool )
+  return acc
+
+def InDetTrackSummaryHelperToolCfg(flags, **kwargs):
+  """
+  based on: InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecLoadTools.py
+  """
+  acc = ComponentAccumulator()
+  name = kwargs.pop("name", "InDetSummaryHelperTool")
+  acc.merge( InDetHoleSearchToolCfg(flags, name = "InDetTrigHoleSearchTool" ) )
+
+  acc.addPublicTool( CompFactory.InDet.InDetPRD_AssociationToolGangedPixels(name = "InDetTrigPrdAssociationTool",
+                                                              PixelClusterAmbiguitiesMapName = "TrigPixelClusterAmbiguitiesMap") )
+
+  from InDetOverlay.TRT_ConditionsConfig import TRTStrawCondAlgCfg,TRT_StrawStatusSummaryToolCfg # this will be moved somewhere else so this import will need adjustment
+  acc.merge( TRTStrawCondAlgCfg(flags) )
+  trtStrawSummaryTool = acc.popToolsAndMerge( TRT_StrawStatusSummaryToolCfg(flags) )
+
+  tool = CompFactory.InDet.InDetTrackSummaryHelperTool(name,
+                                                       HoleSearch    = acc.getPublicTool( "InDetTrigHoleSearchTool" ),
+                                                       AssoTool      = acc.getPublicTool( "InDetTrigPrdAssociationTool" ),
+                                                       TestBLayerTool = None,
+                                                       PixelToTPIDTool= None, #InDetTrigPixelToTPIDTool,
+                                                       DoSharedHits  = False,
+                                                       TRTStrawSummarySvc = trtStrawSummaryTool,
+                                                       usePixel      = flags.Detector.RecoPixel,  #DetFlags.haveRIO.pixel_on(),
+                                                       useSCT        = flags.Detector.RecoSCT,  #DetFlags.haveRIO.SCT_on(),
+                                                       useTRT        = True, # flags.Detector.TRTOn,  #DetFlags.haveRIO.TRT_on()
+                                                         )
+
+  acc.addPublicTool( tool )
+  return acc
+
+def TrackSummaryToolCfg(flags, **kwargs):
+  acc = ComponentAccumulator()
+  name = kwargs.pop("name", "InDetTrackSummaryTool")
+  summaryHelperTool = kwargs.pop( "summaryHelperTool", None )
+  if not summaryHelperTool:
+    acc.merge( InDetTrackSummaryHelperToolCfg( flags ) )
+    summaryHelperTool = acc.getPublicTool( "InDetSummaryHelperTool" )
+
+
+  tool = CompFactory.Trk.TrackSummaryTool(name = name,
+                                          InDetSummaryHelperTool = summaryHelperTool,
+                                          doSharedHits           = False,
+                                          doHolesInDet           = True,
+                                          #this may be temporary #61512 (and used within egamma later)
+                                          #TRT_ElectronPidTool    = InDetTrigTRT_ElectronPidTool,
+                                          TRT_ElectronPidTool    = None,
+                                          )
+
+  acc.addPublicTool( tool )
+  return acc
+
+
 
 class InDetCacheNames(object):
   Pixel_ClusterKey   = "PixelTrigClustersCache"
@@ -34,14 +266,21 @@ def InDetIDCCacheCreatorCfg():
   acc.addEventAlgo( InDetCacheCreatorTrig )
   return acc
 
+
+
+
 #Set up conditions algorithms
-def TrigInDetCondConfig( flags ):
+def TrigInDetCondCfg( flags ):
 
   acc = ComponentAccumulator()
+  from BeamPipeGeoModel.BeamPipeGMConfig import BeamPipeGeometryCfg
+  acc.merge( BeamPipeGeometryCfg( flags ) )
   from AtlasGeoModel.InDetGMConfig import InDetGeometryCfg
-  acc.merge(InDetGeometryCfg(flags))
+  acc.merge( InDetGeometryCfg( flags ) )
   #acc.merge(InDetGMConfig(flags))
 
+
+
   from IOVDbSvc.IOVDbSvcConfig import addFoldersSplitOnline, addFolders
   acc.merge(addFoldersSplitOnline(flags, "INDET","/Indet/Onl/AlignL1/ID","/Indet/AlignL1/ID",className="CondAttrListCollection"))
   acc.merge(addFoldersSplitOnline(flags, "INDET","/Indet/Onl/AlignL2/PIX","/Indet/AlignL2/PIX",className="CondAttrListCollection"))
@@ -49,12 +288,14 @@ def TrigInDetCondConfig( flags ):
   acc.merge(addFoldersSplitOnline(flags, "INDET","/Indet/Onl/AlignL3","/Indet/AlignL3",className="AlignableTransformContainer"))
   acc.merge(addFoldersSplitOnline(flags, "INDET","/Indet/Onl/IBLDist","/Indet/IBLDist",className="CondAttrListCollection"))
 
-  SCT_DCSConditionsTool=CompFactory.SCT_DCSConditionsTool
-  dcsTool = SCT_DCSConditionsTool(ReadAllDBFolders = True, ReturnHVTemp = True)
+  from SCT_ConditionsTools.SCT_DCSConditionsConfig import SCT_DCSConditionsCfg, SCT_DCSConditionsToolCfg
+  dcsTool =  acc.popToolsAndMerge( SCT_DCSConditionsCfg( flags, DCSConditionsTool = SCT_DCSConditionsToolCfg( flags, ReadAllDBFolders = True, ReturnHVTemp = True)) )
+#  SCT_DCSConditionsTool=CompFactory.SCT_DCSConditionsTool
+#  dcsTool = SCT_DCSConditionsTool(ReadAllDBFolders = True, ReturnHVTemp = True)
 
-  from SCT_ConditionsTools.SCT_SiliconConditionsConfig import SCT_SiliconConditionsToolCfg, SCT_SiliconConditionsCfg
+  from SCT_ConditionsTools.SCT_SiliconConditionsConfig import SCT_SiliconConditionsCfg #, SCT_SiliconConditionsToolCfg
   #sctSiliconConditionsTool= SCT_SiliconConditionsCfg(flags, toolName="InDetSCT_SiliconConditionsTool", dcsTool=dcsTool )
-  sctSiliconConditionsTool = SCT_SiliconConditionsToolCfg(flags)
+  #sctSiliconConditionsTool = SCT_SiliconConditionsToolCfg(flags)
   acc.merge(SCT_SiliconConditionsCfg(flags, DCSConditionsTool=dcsTool))
 
   SCT_AlignCondAlg=CompFactory.SCT_AlignCondAlg
@@ -83,33 +324,44 @@ def TrigInDetCondConfig( flags ):
   dbInstance = "DCS_OFL"
   acc.merge(addFolders(flags, [stateFolder, hvFolder, tempFolder], dbInstance, className="CondAttrListCollection"))
 
-  SCT_DCSConditionsTempCondAlg=CompFactory.SCT_DCSConditionsTempCondAlg
-  acc.addCondAlgo(SCT_DCSConditionsTempCondAlg( ReadKey = tempFolder ))
-  SCT_DCSConditionsStatCondAlg=CompFactory.SCT_DCSConditionsStatCondAlg
-  acc.addCondAlgo(SCT_DCSConditionsStatCondAlg(ReturnHVTemp = True,
-                                               ReadKeyHV = hvFolder,
-                                               ReadKeyState = stateFolder))
-  SCT_DCSConditionsHVCondAlg=CompFactory.SCT_DCSConditionsHVCondAlg
-  acc.addCondAlgo(SCT_DCSConditionsHVCondAlg(ReadKey = hvFolder))
-
-  SCT_SiliconHVCondAlg=CompFactory.SCT_SiliconHVCondAlg
-  acc.addCondAlgo(SCT_SiliconHVCondAlg(UseState = dcsTool.ReadAllDBFolders,
-                                       DCSConditionsTool = dcsTool))
-  SCT_SiliconTempCondAlg=CompFactory.SCT_SiliconTempCondAlg
-  acc.addCondAlgo(SCT_SiliconTempCondAlg(UseState = dcsTool.ReadAllDBFolders, DCSConditionsTool = dcsTool))
-
-
-  SCTSiLorentzAngleCondAlg=CompFactory.SCTSiLorentzAngleCondAlg
-  acc.addCondAlgo(SCTSiLorentzAngleCondAlg(name = "SCTSiLorentzAngleCondAlg",
-                                           SiConditionsTool = sctSiliconConditionsTool,
-                                           UseMagFieldCache = True,
-                                           UseMagFieldDcs = False))
-  SiLorentzAngleTool=CompFactory.SiLorentzAngleTool
-  SCTLorentzAngleTool = SiLorentzAngleTool(name = "SCTLorentzAngleTool", DetectorName="SCT", SiLorentzAngleCondData="SCTSiLorentzAngleCondData")
-  SCTLorentzAngleTool.UseMagFieldCache = True
-  acc.addPublicTool(SCTLorentzAngleTool)
+
+  # from InDetConfig.InDetRecToolConfig import InDetSCT_ConditionsSummaryToolCfg
+  # sctCondSummaryTool = acc.popToolsAndMerge( InDetSCT_ConditionsSummaryToolCfg( flags, withFlaggedCondTool=False, withTdaqTool=False ) )
+
+  # SCT_DCSConditionsTempCondAlg=CompFactory.SCT_DCSConditionsTempCondAlg
+  # acc.addCondAlgo(SCT_DCSConditionsTempCondAlg( ReadKey = tempFolder ))
+
+  # SCT_DCSConditionsStatCondAlg=CompFactory.SCT_DCSConditionsStatCondAlg
+  # acc.addCondAlgo(SCT_DCSConditionsStatCondAlg(ReturnHVTemp = True,
+  #                                             ReadKeyHV = hvFolder,
+  #                                             ReadKeyState = stateFolder))
+  # SCT_DCSConditionsHVCondAlg=CompFactory.SCT_DCSConditionsHVCondAlg
+  # acc.addCondAlgo(SCT_DCSConditionsHVCondAlg(ReadKey = hvFolder))
+
+  # SCT_SiliconHVCondAlg=CompFactory.SCT_SiliconHVCondAlg
+  # acc.addCondAlgo(SCT_SiliconHVCondAlg(UseState = dcsTool.ReadAllDBFolders,
+  #                                     DCSConditionsTool = dcsTool))
+  # SCT_SiliconTempCondAlg=CompFactory.SCT_SiliconTempCondAlg
+  # acc.addCondAlgo(SCT_SiliconTempCondAlg(UseState = dcsTool.ReadAllDBFolders, DCSConditionsTool = dcsTool))
+
+
+
+
+  # SCTSiLorentzAngleCondAlg=CompFactory.SCTSiLorentzAngleCondAlg
+  # acc.addCondAlgo(SCTSiLorentzAngleCondAlg(name = "SCTSiLorentzAngleCondAlg",
+  #                                          SiConditionsTool = sctSiliconConditionsTool,
+  #                                          UseMagFieldCache = True,
+  #                                          UseMagFieldDcs = False))
+  # SiLorentzAngleTool=CompFactory.SiLorentzAngleTool
+  # SCTLorentzAngleTool = SiLorentzAngleTool(name = "SCTLorentzAngleTool", DetectorName="SCT", SiLorentzAngleCondData="SCTSiLorentzAngleCondData")
+  # SCTLorentzAngleTool.UseMagFieldCache = True
+  # acc.addPublicTool(SCTLorentzAngleTool)
 
 
+  from SiLorentzAngleTool.SCT_LorentzAngleConfig import SCT_LorentzAngleCfg
+  SCTLorentzAngleTool =  acc.popToolsAndMerge( SCT_LorentzAngleCfg( flags ) )
+  acc.addPublicTool(SCTLorentzAngleTool)
+
   acc.merge(addFoldersSplitOnline(flags, "INDET", "/Indet/Onl/Beampos", "/Indet/Beampos", className="AthenaAttributeList"))
   acc.merge(addFolders(flags, "/TRT/Onl/ROD/Compress","TRT_ONL", className='CondAttrListCollection'))
   acc.merge(addFoldersSplitOnline(flags, "TRT","/TRT/Onl/Calib/RT","/TRT/Calib/RT",className="TRTCond::RtRelationMultChanContainer"))
@@ -126,7 +378,7 @@ def TrigInDetCondConfig( flags ):
       PixelHitDiscCnfgAlgCfg, PixelReadoutSpeedAlgCfg, PixelCablingCondAlgCfg,
       PixelDCSCondStateAlgCfg, PixelDCSCondStatusAlgCfg,
       PixelDistortionAlgCfg, PixelOfflineCalibCondAlgCfg
-# NEW FOR RUN3    PixelDeadMapCondAlgCfg, PixelChargeLUTCalibCondAlgCfg
+# NEW FOR RUN3    PixelDeadMapCondAlgCfg, PixelChargeLUTCalibCondAlgCfg/
   )
 
   from PixelConditionsTools.PixelConditionsSummaryConfig import PixelConditionsSummaryCfg
@@ -143,6 +395,7 @@ def TrigInDetCondConfig( flags ):
                                   UseDCSHVConditions=True,
                                   UseDCSTemperatureConditions=True,
                                   UseTDAQConditions=False))
+
   # charge calibration
   acc.merge(PixelChargeCalibCondAlgCfg(flags))
 # NEW FOR RUN3  acc.merge(PixelChargeLUTCalibCondAlgCfg(flags))
@@ -184,7 +437,7 @@ def TrigInDetConfig( flags, roisKey="EMRoIs", signatureName='' ):
   signature =  "_" + signatureName if signatureName else ''
 
   acc = ComponentAccumulator()
-  acc.merge(TrigInDetCondConfig(flags))
+  acc.merge(TrigInDetCondCfg(flags))
 
   from InDetRecExample.InDetKeys import InDetKeys
 
@@ -193,7 +446,8 @@ def TrigInDetConfig( flags, roisKey="EMRoIs", signatureName='' ):
   RegSelTool_SCT = acc.popToolsAndMerge(regSelTool_SCT_Cfg(flags))
 
   verifier = CompFactory.AthViews.ViewDataVerifier( name = 'VDVInDet'+signature,
-                                                    DataObjects= [('InDet::PixelClusterContainerCache', 'PixelTrigClustersCache'),
+                                                    DataObjects= [('xAOD::EventInfo', 'StoreGateSvc+EventInfo'),
+                                                                  ('InDet::PixelClusterContainerCache', 'PixelTrigClustersCache'),
                                                                   ('PixelRDO_Cache', 'PixRDOCache'),
                                                                   ('InDet::SCT_ClusterContainerCache', 'SCT_ClustersCache'),
                                                                   ('SCT_RDO_Cache', 'SctRDOCache'),
@@ -202,12 +456,12 @@ def TrigInDetConfig( flags, roisKey="EMRoIs", signatureName='' ):
                                                                   ('IDCInDetBSErrContainer_Cache', 'PixelBSErrCache'),
                                                                   ('IDCInDetBSErrContainer_Cache', 'SctBSErrCache'),
                                                                   ('IDCInDetBSErrContainer_Cache', 'SctFlaggedCondCache'),
-                                                                  ('xAOD::EventInfo', 'StoreGateSvc+EventInfo'),
-                                                                      # ('xAOD::TrigEMClusterContainer', 'StoreGateSvc+HLT_L2CaloEMClusters'),
-                                                                  ('TrigRoiDescriptorCollection', 'StoreGateSvc+'+roisKey),
+                                                                  ('xAOD::EventInfo', 'EventInfo'),
+                                                                  ('TrigRoiDescriptorCollection', roisKey),
                                                                   ( 'TagInfo' , 'DetectorStore+ProcessingTags' )] )
 
   acc.addEventAlgo(verifier)
+
   #Only add raw data decoders if we're running over raw data
   isMC = flags.Input.isMC
   if not isMC:
@@ -259,9 +513,7 @@ def TrigInDetConfig( flags, roisKey="EMRoIs", signatureName='' ):
     InDetSCTRawDataProvider.isRoI_Seeded = True
     InDetSCTRawDataProvider.RoIs = roisKey
     InDetSCTRawDataProvider.RDOCacheKey = InDetCacheNames.SCTRDOCacheKey
-
     InDetSCTRawDataProvider.RegSelTool = RegSelTool_SCT
-
     acc.addEventAlgo(InDetSCTRawDataProvider)
 
     # load the SCTEventFlagWriter
@@ -307,6 +559,7 @@ def TrigInDetConfig( flags, roisKey="EMRoIs", signatureName='' ):
   InDetMergedPixelsTool = InDet__MergedPixelsTool(name                    = "InDetMergedPixelsTool"+ signature,
                                                   globalPosAlg            = InDetClusterMakerTool)
   # Enable duplcated RDO check for data15 because duplication mechanism was used.
+
   if len(flags.Input.ProjectName)>=6 and flags.Input.ProjectName[:6]=="data15":
     InDetMergedPixelsTool.CheckDuplicatedRDO = True
   acc.addPublicTool(InDetMergedPixelsTool)
@@ -322,6 +575,7 @@ def TrigInDetConfig( flags, roisKey="EMRoIs", signatureName='' ):
                                                         DataObjectName          = InDetKeys.PixelRDOs(),
                                                         AmbiguitiesMap          = 'TrigPixelClusterAmbiguitiesMap',
                                                         ClustersName            = "PixelTrigClusters",)
+  InDetPixelClusterization
   InDetPixelClusterization.isRoI_Seeded = True
   InDetPixelClusterization.RoIs = roisKey
   InDetPixelClusterization.ClusterContainerCacheKey = InDetCacheNames.Pixel_ClusterKey
@@ -355,7 +609,7 @@ def TrigInDetConfig( flags, roisKey="EMRoIs", signatureName='' ):
   InDetSCT_Clusterization.FlaggedCondCacheKey = InDetCacheNames.SCTFlaggedCondCacheKey
 
   InDetSCT_Clusterization.RegSelTool = RegSelTool_SCT
-
+  InDetSCT_Clusterization.OutputLevel = DEBUG
   acc.addEventAlgo(InDetSCT_Clusterization)
 
 
@@ -367,23 +621,87 @@ def TrigInDetConfig( flags, roisKey="EMRoIs", signatureName='' ):
 
   acc.addCondAlgo( CompFactory.InDet.SiElementPropertiesTableCondAlg(name = "InDetSiElementPropertiesTableCondAlg") )
 
-  from AthenaCommon.DetFlags import DetFlags
   InDet__SiTrackerSpacePointFinder=CompFactory.InDet.SiTrackerSpacePointFinder
-  InDetSiTrackerSpacePointFinder = InDet__SiTrackerSpacePointFinder(name                   = "InDetSiTrackerSpacePointFinder"+ signature,
+  InDetSiTrackerSpacePointFinder = InDet__SiTrackerSpacePointFinder(name                   = "TrigSPFinder"+ signature,
                                                                     SiSpacePointMakerTool  = InDetSiSpacePointMakerTool,
                                                                     PixelsClustersName     = "PixelTrigClusters",
                                                                     SCT_ClustersName       = "SCT_TrigClusters",
                                                                     SpacePointsPixelName   = "PixelTrigSpacePoints",
                                                                     SpacePointsSCTName     = "SCT_TrigSpacePoints",
                                                                     SpacePointsOverlapName = InDetKeys.OverlapSpacePoints(),
-                                                                    ProcessPixels          = DetFlags.haveRIO.pixel_on(),
-                                                                    ProcessSCTs            = DetFlags.haveRIO.SCT_on(),
-                                                                    ProcessOverlaps        = DetFlags.haveRIO.SCT_on(),
+                                                                    ProcessPixels          = flags.Detector.RecoPixel,
+                                                                    ProcessSCTs            = flags.Detector.RecoSCT,
+                                                                    ProcessOverlaps        = flags.Detector.RecoSCT,
                                                                     SpacePointCacheSCT = InDetCacheNames.SpacePointCacheSCT,
                                                                     SpacePointCachePix = InDetCacheNames.SpacePointCachePix,)
-
+  InDetSiTrackerSpacePointFinder.OutputLevel=DEBUG
   acc.addEventAlgo(InDetSiTrackerSpacePointFinder)
 
+  acc.addPublicTool( CompFactory.TrigL2LayerNumberTool( "TrigL2LayerNumberTool_FTF" ) )
+
+  acc.merge( TrackSummaryToolCfg(flags, name="TrigSummaryTool_FTF") )
+
+#  acc.addPublicTool( CompFactory.TrigL2ResidualCalculator( "TrigL2ResidualCalculator" ) )
+  acc.merge( SiTrackMaker_xkCfg( flags, name = "TrigTrackMaker_FTF"+signature ) )
+
+  acc.addPublicTool( CompFactory.TrigInDetTrackFitter( "TrigTrackFitter_FTF" ) )
+  from RegionSelector.RegSelToolConfig import (regSelTool_SCT_Cfg, regSelTool_Pixel_Cfg)
+
+  pixRegSelTool = acc.popToolsAndMerge( regSelTool_Pixel_Cfg( flags) )
+  sctRegSelTool = acc.popToolsAndMerge( regSelTool_SCT_Cfg( flags) )
+
+  from TrkConfig.AtlasTrackingGeometrySvcConfig import TrackingGeometrySvcCfg
+  acc.merge( TrackingGeometrySvcCfg( flags ) )
+  acc.addPublicTool( CompFactory.TrigL2LayerNumberTool( name = "TrigL2LayerNumberTool_FTF",
+                                                        UseNewLayerScheme = True) )
+
+  acc.addPublicTool( CompFactory.TrigSpacePointConversionTool( "TrigSPConversionTool" + signature.lower(), # lowercased to ease comparison to old style conf. TODO, remove
+                                                                 DoPhiFiltering = True,
+                                                                 UseBeamTilt = False,
+                                                                 UseNewLayerScheme = True,
+                                                                 RegSel_Pixel = pixRegSelTool,
+                                                                 RegSel_SCT = sctRegSelTool,
+                                                                 layerNumberTool = acc.getPublicTool("TrigL2LayerNumberTool_FTF") ) )
+
+
+  # TODO remove once offline configured counterparts are available?
+  acc.addCondAlgo( CompFactory.InDet.SiDetElementBoundaryLinksCondAlg_xk(name= "InDetSiDetElementBoundaryLinksSCTCondAlg",
+                                                                         WriteKey = "SCT_DetElementBoundaryLinks_xk") )
+
+  acc.addCondAlgo( CompFactory.InDet.SiDetElementBoundaryLinksCondAlg_xk(name = "InDetSiDetElementBoundaryLinksPixelCondAlg",
+                                                                         ReadKey  = "PixelDetectorElementCollection",
+                                                                         WriteKey = "PixelDetElementBoundaryLinks_xk") )
+
+  ftf = CompFactory.TrigFastTrackFinder( name = "FTF" + signature,
+                                         LayerNumberTool          = acc.getPublicTool( "TrigL2LayerNumberTool_FTF" ),
+                                         SpacePointProviderTool   = acc.getPublicTool( "TrigSPConversionTool" + signature.lower() ),
+                                         TrackSummaryTool         = acc.getPublicTool( "TrigSummaryTool_FTF" ),
+#                                         TrigL2ResidualCalculator = acc.getPublicTool( "TrigL2ResidualCalculator" ),
+                                         initialTrackMaker        = acc.getPublicTool( "TrigTrackMaker_FTF" + signature ),
+                                         trigInDetTrackFitter     = acc.getPublicTool( "TrigTrackFitter_FTF" ),
+                                         RoIs = roisKey,
+                                         trigZFinder = CompFactory.TrigZFinder(),
+                                         doZFinder = False, # this and all below, copied over from comparison with running JOs, TODO find a proper surce of this settings
+                                         SeedRadBinWidth =  2,
+                                         TrackInitialD0Max = 20.0,
+                                         TracksName = "TrigFastTrackFinder_Tracks"+signature,
+                                         OutputCollectionSuffix = signature,
+                                         TripletDoPSS = False,
+                                         Triplet_D0Max = 4.0,
+                                         Triplet_D0_PPS_Max = 1.7,
+                                         Triplet_MaxBufferLength = 3,
+                                         Triplet_MinPtFrac = 1,
+                                         Triplet_nMaxPhiSlice = 53,
+                                         doCloneRemoval = True,
+                                         doResMon = False,
+                                         doSeedRedundancyCheck = True,
+                                         pTmin = 1000.0,
+                                         useNewLayerNumberScheme = True,
+                                         MinHits = 5
+                                           )
+  #ftf.RoIs = roisKey
+  ftf.OutputLevel=DEBUG
+  acc.addEventAlgo( ftf )
 
   #CondSvc=CompFactory.CondSvc
   #acc.addService(CondSvc())
@@ -451,4 +769,3 @@ if __name__ == "__main__":
     acc.printConfig()
     acc.store( open("test.pkl", "wb") )
     print('All ok')
-
diff --git a/Trigger/TrigTools/TrigInDetPattRecoTools/src/TrigTrackSeedGenerator.cxx b/Trigger/TrigTools/TrigInDetPattRecoTools/src/TrigTrackSeedGenerator.cxx
index 03bb1df900e47147abe28c690188ed7f5bf6fe27..e6907a64206f6a10c6c010062ee066dfb6960b4d 100644
--- a/Trigger/TrigTools/TrigInDetPattRecoTools/src/TrigTrackSeedGenerator.cxx
+++ b/Trigger/TrigTools/TrigInDetPattRecoTools/src/TrigTrackSeedGenerator.cxx
@@ -459,7 +459,7 @@ bool TrigTrackSeedGenerator::validateLayerPairNew(int layerI, int layerJ, float
     }
   }
   //if(m_minCoord>m_maxCoord) {
-  // std::cout<<"WRONG ORDER: m_minCoord="<<m_minCoord<<" m_maxCoord="<<m_maxCoord<<std::endl;
+  //std::cout<<"WRONG ORDER: m_minCoord="<<m_minCoord<<" m_maxCoord="<<m_maxCoord<<std::endl;
   // }
   //float tmp = m_maxCoord;m_maxCoord = m_minCoord;m_minCoord = tmp;
   //}
diff --git a/Trigger/TrigTruthEvent/TrigInDetTruthEvent/TrigInDetTruthEvent/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigTruthEvent/TrigInDetTruthEvent/TrigInDetTruthEvent/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..c3222393560828ef4198e8986b6bfe568374a889
--- /dev/null
+++ b/Trigger/TrigTruthEvent/TrigInDetTruthEvent/TrigInDetTruthEvent/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigTruthEvent/TrigInDetTruthEvent
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_mt1_build.ref b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
similarity index 86%
rename from Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_mt1_build.ref
rename to Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
index a281e726a8549dfcf31d762357b131568985881d..5b6bf1006e680a28120e394fdda1ba8bc6ada375 100644
--- a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_mt1_build.ref
+++ b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
@@ -1,3 +1,6 @@
+TrigSignatureMoniMT                                 INFO HLT_2e12_lhloose_mu10_L12EM8VH_MU10 #2518246928
+TrigSignatureMoniMT                                 INFO -- #2518246928 Events         1          1          0          0          0          0          0          0          0          0          -          -          -          -          0
+TrigSignatureMoniMT                                 INFO -- #2518246928 Features                             0          0          0          0          0          0          0          0          -          -          -          -
 TrigSignatureMoniMT                                 INFO HLT_2e17_etcut_L12EM15VH #3136730292
 TrigSignatureMoniMT                                 INFO -- #3136730292 Events         2          2          2          2          2          -          -          -          -          -          -          -          -          -          2
 TrigSignatureMoniMT                                 INFO -- #3136730292 Features                             12         296        14         -          -          -          -          -          -          -          -          -
@@ -13,6 +16,9 @@ TrigSignatureMoniMT                                 INFO -- #1796849979 Features
 TrigSignatureMoniMT                                 INFO HLT_2e3_etcut_L12EM3 #2613484113
 TrigSignatureMoniMT                                 INFO -- #2613484113 Events         20         20         20         20         20         -          -          -          -          -          -          -          -          -          20
 TrigSignatureMoniMT                                 INFO -- #2613484113 Features                             342        3678       780        -          -          -          -          -          -          -          -          -
+TrigSignatureMoniMT                                 INFO HLT_2g10_loose_mu20_L1MU20 #3765708828
+TrigSignatureMoniMT                                 INFO -- #3765708828 Events         8          8          1          1          1          0          0          0          0          0          -          -          -          -          0
+TrigSignatureMoniMT                                 INFO -- #3765708828 Features                             2          2          6          0          0          0          0          0          -          -          -          -
 TrigSignatureMoniMT                                 INFO HLT_2g20_tight_L12EM15VH #3837353071
 TrigSignatureMoniMT                                 INFO -- #3837353071 Events         2          2          0          0          0          0          -          -          -          -          -          -          -          -          0
 TrigSignatureMoniMT                                 INFO -- #3837353071 Features                             0          0          0          0          -          -          -          -          -          -          -          -
@@ -31,12 +37,21 @@ TrigSignatureMoniMT                                 INFO -- #3965466087 Features
 TrigSignatureMoniMT                                 INFO HLT_2g50_loose_L12EM20VH #3590373854
 TrigSignatureMoniMT                                 INFO -- #3590373854 Events         2          2          0          0          0          0          -          -          -          -          -          -          -          -          0
 TrigSignatureMoniMT                                 INFO -- #3590373854 Features                             0          0          0          0          -          -          -          -          -          -          -          -
+TrigSignatureMoniMT                                 INFO HLT_2j330_a10sd_csskpf_jes_ftf_35smcINF_L1J100 #3495282139
+TrigSignatureMoniMT                                 INFO -- #3495282139 Events         3          3          0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #3495282139 Features                             0          0          0          0          0          0          0          0          0          0          -          -
+TrigSignatureMoniMT                                 INFO HLT_2j330_a10sd_csskpf_nojcalib_ftf_35smcINF_L1J100 #2680976232
+TrigSignatureMoniMT                                 INFO -- #2680976232 Events         3          3          0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #2680976232 Features                             0          0          0          0          0          0          0          0          0          0          -          -
 TrigSignatureMoniMT                                 INFO HLT_2j330_a10t_lcw_jes_35smcINF_L1J100 #1295975955
-TrigSignatureMoniMT                                 INFO -- #1295975955 Events         3          3          0          0          0          0          0          0          0          0          0          0          0          -          0
-TrigSignatureMoniMT                                 INFO -- #1295975955 Features                             0          0          0          0          0          0          0          0          0          0          0          -
+TrigSignatureMoniMT                                 INFO -- #1295975955 Events         3          3          0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #1295975955 Features                             0          0          0          0          0          0          0          0          0          0          -          -
+TrigSignatureMoniMT                                 INFO HLT_2j330_a10t_lcw_nojcalib_35smcINF_L1J100 #891415013
+TrigSignatureMoniMT                                 INFO -- #891415013 Events          3          3          0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #891415013 Features                              0          0          0          0          0          0          0          0          0          0          -          -
 TrigSignatureMoniMT                                 INFO HLT_2j60_L1J15 #927735533
-TrigSignatureMoniMT                                 INFO -- #927735533 Events          20         20         0          0          0          0          0          0          0          0          0          0          10         -          10
-TrigSignatureMoniMT                                 INFO -- #927735533 Features                              0          0          0          0          0          0          0          0          0          0          28         -
+TrigSignatureMoniMT                                 INFO -- #927735533 Events          20         20         0          0          0          0          0          0          0          0          0          10         -          -          10
+TrigSignatureMoniMT                                 INFO -- #927735533 Features                              0          0          0          0          0          0          0          0          0          28         -          -
 TrigSignatureMoniMT                                 INFO HLT_2mu10_bJpsimumu_L12MU10 #3498558358
 TrigSignatureMoniMT                                 INFO -- #3498558358 Events         3          3          0          0          0          0          3          3          3          2          -          -          -          -          0
 TrigSignatureMoniMT                                 INFO -- #3498558358 Features                             0          0          0          0          12         12         16         4          -          -          -          -
@@ -80,11 +95,11 @@ TrigSignatureMoniMT                                 INFO HLT_2mu6_muonqual_L12MU
 TrigSignatureMoniMT                                 INFO -- #2398136098 Events         4          4          0          0          0          0          4          3          3          3          -          -          -          -          3
 TrigSignatureMoniMT                                 INFO -- #2398136098 Features                             0          0          0          0          16         12         18         16         -          -          -          -
 TrigSignatureMoniMT                                 INFO HLT_3j200_L1J100 #2199422919
-TrigSignatureMoniMT                                 INFO -- #2199422919 Events         3          3          0          0          0          0          0          0          0          0          0          0          0          -          0
-TrigSignatureMoniMT                                 INFO -- #2199422919 Features                             0          0          0          0          0          0          0          0          0          0          0          -
+TrigSignatureMoniMT                                 INFO -- #2199422919 Events         3          3          0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #2199422919 Features                             0          0          0          0          0          0          0          0          0          0          -          -
 TrigSignatureMoniMT                                 INFO HLT_3j200_L1J20 #493765146
-TrigSignatureMoniMT                                 INFO -- #493765146 Events          19         19         0          0          0          0          0          0          0          0          0          0          0          -          0
-TrigSignatureMoniMT                                 INFO -- #493765146 Features                              0          0          0          0          0          0          0          0          0          0          0          -
+TrigSignatureMoniMT                                 INFO -- #493765146 Events          19         19         0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #493765146 Features                              0          0          0          0          0          0          0          0          0          0          -          -
 TrigSignatureMoniMT                                 INFO HLT_3mu6_L13MU6 #1832399408
 TrigSignatureMoniMT                                 INFO -- #1832399408 Events         0          0          0          0          0          0          0          0          0          0          -          -          -          -          0
 TrigSignatureMoniMT                                 INFO -- #1832399408 Features                             0          0          0          0          0          0          0          0          -          -          -          -
@@ -98,8 +113,11 @@ TrigSignatureMoniMT                                 INFO HLT_4mu4_L14MU4 #183438
 TrigSignatureMoniMT                                 INFO -- #1834383636 Events         0          0          0          0          0          0          0          0          0          0          -          -          -          -          0
 TrigSignatureMoniMT                                 INFO -- #1834383636 Features                             0          0          0          0          0          0          0          0          -          -          -          -
 TrigSignatureMoniMT                                 INFO HLT_5j70_0eta240_L14J20 #1175391812
-TrigSignatureMoniMT                                 INFO -- #1175391812 Events         7          7          0          0          0          0          0          0          0          0          0          0          1          -          1
-TrigSignatureMoniMT                                 INFO -- #1175391812 Features                             0          0          0          0          0          0          0          0          0          0          5          -
+TrigSignatureMoniMT                                 INFO -- #1175391812 Events         7          7          0          0          0          0          0          0          0          0          0          1          -          -          1
+TrigSignatureMoniMT                                 INFO -- #1175391812 Features                             0          0          0          0          0          0          0          0          0          5          -          -
+TrigSignatureMoniMT                                 INFO HLT_alfacalib_AlfaPEB_L1ALFA_ANY #4094852824
+TrigSignatureMoniMT                                 INFO -- #4094852824 Events         0          0          0          -          -          -          -          -          -          -          -          -          -          -          0
+TrigSignatureMoniMT                                 INFO -- #4094852824 Features                             0          -          -          -          -          -          -          -          -          -          -          -
 TrigSignatureMoniMT                                 INFO HLT_beamspot_allTE_trkfast_BeamSpotPEB_L1J15 #3989372080
 TrigSignatureMoniMT                                 INFO -- #3989372080 Events         20         20         20         20         -          -          -          -          -          -          -          -          -          -          20
 TrigSignatureMoniMT                                 INFO -- #3989372080 Features                             20         20         -          -          -          -          -          -          -          -          -          -
@@ -112,6 +130,9 @@ TrigSignatureMoniMT                                 INFO -- #843341480 Features
 TrigSignatureMoniMT                                 INFO HLT_cscmon_L1All #1000936179
 TrigSignatureMoniMT                                 INFO -- #1000936179 Events         20         20         -          -          -          -          -          -          -          -          -          -          -          -          20
 TrigSignatureMoniMT                                 INFO -- #1000936179 Features                             -          -          -          -          -          -          -          -          -          -          -          -
+TrigSignatureMoniMT                                 INFO HLT_e12_lhloose_2mu10_L12MU10 #4167710884
+TrigSignatureMoniMT                                 INFO -- #4167710884 Events         3          3          0          0          0          0          0          0          0          0          -          -          -          -          0
+TrigSignatureMoniMT                                 INFO -- #4167710884 Features                             0          0          0          0          0          0          0          0          -          -          -          -
 TrigSignatureMoniMT                                 INFO HLT_e140_lhloose_L1EM22VHI #3471067710
 TrigSignatureMoniMT                                 INFO -- #3471067710 Events         6          6          0          0          0          0          -          -          -          -          -          -          -          -          0
 TrigSignatureMoniMT                                 INFO -- #3471067710 Features                             0          0          0          0          -          -          -          -          -          -          -          -
@@ -127,6 +148,12 @@ TrigSignatureMoniMT                                 INFO -- #140779220 Features
 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_e24_lhmedium_2g12_loose_L1EM20VH_3EM10VH #2668628593
+TrigSignatureMoniMT                                 INFO -- #2668628593 Events         2          2          0          0          0          0          -          -          -          -          -          -          -          -          0
+TrigSignatureMoniMT                                 INFO -- #2668628593 Features                             0          0          0          0          -          -          -          -          -          -          -          -
+TrigSignatureMoniMT                                 INFO HLT_e24_lhmedium_g25_medium_L12EM20VH #2785977835
+TrigSignatureMoniMT                                 INFO -- #2785977835 Events         2          2          0          0          0          0          -          -          -          -          -          -          -          -          0
+TrigSignatureMoniMT                                 INFO -- #2785977835 Features                             0          0          0          0          -          -          -          -          -          -          -          -
 TrigSignatureMoniMT                                 INFO HLT_e24_lhvloose_2e12_lhvloose_L1EM20VH_3EM10VH #9348946
 TrigSignatureMoniMT                                 INFO -- #9348946 Events            2          2          0          0          0          0          -          -          -          -          -          -          -          -          0
 TrigSignatureMoniMT                                 INFO -- #9348946 Features                                0          0          0          0          -          -          -          -          -          -          -          -
@@ -220,6 +247,9 @@ TrigSignatureMoniMT                                 INFO -- #3370790749 Features
 TrigSignatureMoniMT                                 INFO HLT_g300_etcut_L1EM22VHI #310189774
 TrigSignatureMoniMT                                 INFO -- #310189774 Events          6          6          0          0          0          -          -          -          -          -          -          -          -          -          0
 TrigSignatureMoniMT                                 INFO -- #310189774 Features                              0          0          0          -          -          -          -          -          -          -          -          -
+TrigSignatureMoniMT                                 INFO HLT_g35_loose_mu18_L1EM24VHI #3939387897
+TrigSignatureMoniMT                                 INFO -- #3939387897 Events         6          6          2          2          2          2          2          1          1          1          -          -          -          -          1
+TrigSignatureMoniMT                                 INFO -- #3939387897 Features                             2          2          4          2          2          1          1          1          -          -          -          -
 TrigSignatureMoniMT                                 INFO HLT_g35_medium_g25_medium_L12EM20VH #1158879722
 TrigSignatureMoniMT                                 INFO -- #1158879722 Events         2          2          0          0          0          0          -          -          -          -          -          -          -          -          0
 TrigSignatureMoniMT                                 INFO -- #1158879722 Features                             0          0          0          0          -          -          -          -          -          -          -          -
@@ -239,134 +269,155 @@ TrigSignatureMoniMT                                 INFO HLT_g5_tight_L1EM3 #328
 TrigSignatureMoniMT                                 INFO -- #3280865118 Events         20         20         16         16         16         9          -          -          -          -          -          -          -          -          9
 TrigSignatureMoniMT                                 INFO -- #3280865118 Features                             45         45         84         9          -          -          -          -          -          -          -          -
 TrigSignatureMoniMT                                 INFO HLT_j0_perf_L1J12_EMPTY #1341875780
-TrigSignatureMoniMT                                 INFO -- #1341875780 Events         0          0          0          0          0          0          0          0          0          0          0          0          0          -          0
-TrigSignatureMoniMT                                 INFO -- #1341875780 Features                             0          0          0          0          0          0          0          0          0          0          0          -
+TrigSignatureMoniMT                                 INFO -- #1341875780 Events         0          0          0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #1341875780 Features                             0          0          0          0          0          0          0          0          0          0          -          -
 TrigSignatureMoniMT                                 INFO HLT_j0_vbenfSEP30etSEP34mass35SEP50fbet_L1J20 #4034799151
-TrigSignatureMoniMT                                 INFO -- #4034799151 Events         19         19         0          0          0          0          0          0          0          0          0          0          15         -          15
-TrigSignatureMoniMT                                 INFO -- #4034799151 Features                             0          0          0          0          0          0          0          0          0          0          402        -
-TrigSignatureMoniMT                                 INFO HLT_j225_ftf_subjesgscIS_bmv2c1040_split_L1J100 #3992507557
-TrigSignatureMoniMT                                 INFO -- #3992507557 Events         3          3          0          0          0          0          0          0          0          0          0          0          0          0          0
-TrigSignatureMoniMT                                 INFO -- #3992507557 Features                             0          0          0          0          0          0          0          0          0          0          0          0
+TrigSignatureMoniMT                                 INFO -- #4034799151 Events         19         19         0          0          0          0          0          0          0          0          0          15         -          -          15
+TrigSignatureMoniMT                                 INFO -- #4034799151 Features                             0          0          0          0          0          0          0          0          0          402        -          -
+TrigSignatureMoniMT                                 INFO HLT_j225_subjesgscIS_ftf_bmv2c1040_split_L1J100 #219711753
+TrigSignatureMoniMT                                 INFO -- #219711753 Events          3          3          0          0          0          0          0          0          0          0          0          0          0          -          0
+TrigSignatureMoniMT                                 INFO -- #219711753 Features                              0          0          0          0          0          0          0          0          0          0          0          -
 TrigSignatureMoniMT                                 INFO HLT_j260_320eta490_L1J20 #3084792704
-TrigSignatureMoniMT                                 INFO -- #3084792704 Events         19         19         0          0          0          0          0          0          0          0          0          0          0          -          0
-TrigSignatureMoniMT                                 INFO -- #3084792704 Features                             0          0          0          0          0          0          0          0          0          0          0          -
+TrigSignatureMoniMT                                 INFO -- #3084792704 Events         19         19         0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #3084792704 Features                             0          0          0          0          0          0          0          0          0          0          -          -
 TrigSignatureMoniMT                                 INFO HLT_j260_320eta490_L1J75_31ETA49 #3769257182
-TrigSignatureMoniMT                                 INFO -- #3769257182 Events         2          2          0          0          0          0          0          0          0          0          0          0          0          -          0
-TrigSignatureMoniMT                                 INFO -- #3769257182 Features                             0          0          0          0          0          0          0          0          0          0          0          -
-TrigSignatureMoniMT                                 INFO HLT_j275_ftf_subjesgscIS_bmv2c1060_split_L1J100 #1211559599
-TrigSignatureMoniMT                                 INFO -- #1211559599 Events         3          3          0          0          0          0          0          0          0          0          0          0          0          0          0
-TrigSignatureMoniMT                                 INFO -- #1211559599 Features                             0          0          0          0          0          0          0          0          0          0          0          0
-TrigSignatureMoniMT                                 INFO HLT_j275_ftf_subjesgscIS_boffperf_split_L1J100 #588317894
-TrigSignatureMoniMT                                 INFO -- #588317894 Events          3          3          0          0          0          0          0          0          0          0          0          0          0          0          0
-TrigSignatureMoniMT                                 INFO -- #588317894 Features                              0          0          0          0          0          0          0          0          0          0          0          0
-TrigSignatureMoniMT                                 INFO HLT_j300_ftf_subjesgscIS_bmv2c1070_split_L1J100 #3706723666
-TrigSignatureMoniMT                                 INFO -- #3706723666 Events         3          3          0          0          0          0          0          0          0          0          0          0          0          0          0
-TrigSignatureMoniMT                                 INFO -- #3706723666 Features                             0          0          0          0          0          0          0          0          0          0          0          0
-TrigSignatureMoniMT                                 INFO HLT_j360_ftf_subjesgscIS_bmv2c1077_split_L1J100 #1837565816
-TrigSignatureMoniMT                                 INFO -- #1837565816 Events         3          3          0          0          0          0          0          0          0          0          0          0          0          0          0
-TrigSignatureMoniMT                                 INFO -- #1837565816 Features                             0          0          0          0          0          0          0          0          0          0          0          0
+TrigSignatureMoniMT                                 INFO -- #3769257182 Events         2          2          0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #3769257182 Features                             0          0          0          0          0          0          0          0          0          0          -          -
+TrigSignatureMoniMT                                 INFO HLT_j275_subjesgscIS_ftf_bmv2c1060_split_L1J100 #710546402
+TrigSignatureMoniMT                                 INFO -- #710546402 Events          3          3          0          0          0          0          0          0          0          0          0          0          0          -          0
+TrigSignatureMoniMT                                 INFO -- #710546402 Features                              0          0          0          0          0          0          0          0          0          0          0          -
+TrigSignatureMoniMT                                 INFO HLT_j275_subjesgscIS_ftf_boffperf_split_L1J100 #540369970
+TrigSignatureMoniMT                                 INFO -- #540369970 Events          3          3          0          0          0          0          0          0          0          0          0          0          0          -          0
+TrigSignatureMoniMT                                 INFO -- #540369970 Features                              0          0          0          0          0          0          0          0          0          0          0          -
+TrigSignatureMoniMT                                 INFO HLT_j300_subjesgscIS_ftf_bmv2c1070_split_L1J100 #2074989613
+TrigSignatureMoniMT                                 INFO -- #2074989613 Events         3          3          0          0          0          0          0          0          0          0          0          0          0          -          0
+TrigSignatureMoniMT                                 INFO -- #2074989613 Features                             0          0          0          0          0          0          0          0          0          0          0          -
+TrigSignatureMoniMT                                 INFO HLT_j360_subjesgscIS_ftf_bmv2c1077_split_L1J100 #4176355792
+TrigSignatureMoniMT                                 INFO -- #4176355792 Events         3          3          0          0          0          0          0          0          0          0          0          0          0          -          0
+TrigSignatureMoniMT                                 INFO -- #4176355792 Features                             0          0          0          0          0          0          0          0          0          0          0          -
 TrigSignatureMoniMT                                 INFO HLT_j420_L1J100 #2659902019
-TrigSignatureMoniMT                                 INFO -- #2659902019 Events         3          3          0          0          0          0          0          0          0          0          0          0          0          -          0
-TrigSignatureMoniMT                                 INFO -- #2659902019 Features                             0          0          0          0          0          0          0          0          0          0          0          -
+TrigSignatureMoniMT                                 INFO -- #2659902019 Events         3          3          0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #2659902019 Features                             0          0          0          0          0          0          0          0          0          0          -          -
 TrigSignatureMoniMT                                 INFO HLT_j420_L1J20 #2205518067
-TrigSignatureMoniMT                                 INFO -- #2205518067 Events         19         19         0          0          0          0          0          0          0          0          0          0          0          -          0
-TrigSignatureMoniMT                                 INFO -- #2205518067 Features                             0          0          0          0          0          0          0          0          0          0          0          -
-TrigSignatureMoniMT                                 INFO HLT_j420_ftf_subjesgscIS_L1J20 #4179085188
-TrigSignatureMoniMT                                 INFO -- #4179085188 Events         19         19         0          0          0          0          0          0          0          0          0          0          0          -          0
-TrigSignatureMoniMT                                 INFO -- #4179085188 Features                             0          0          0          0          0          0          0          0          0          0          0          -
+TrigSignatureMoniMT                                 INFO -- #2205518067 Events         19         19         0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #2205518067 Features                             0          0          0          0          0          0          0          0          0          0          -          -
+TrigSignatureMoniMT                                 INFO HLT_j420_subjesgscIS_ftf_L1J20 #2116995085
+TrigSignatureMoniMT                                 INFO -- #2116995085 Events         19         19         0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #2116995085 Features                             0          0          0          0          0          0          0          0          0          0          -          -
 TrigSignatureMoniMT                                 INFO HLT_j45_L1J15 #1364976160
-TrigSignatureMoniMT                                 INFO -- #1364976160 Events         20         20         0          0          0          0          0          0          0          0          0          0          19         -          19
-TrigSignatureMoniMT                                 INFO -- #1364976160 Features                             0          0          0          0          0          0          0          0          0          0          50         -
+TrigSignatureMoniMT                                 INFO -- #1364976160 Events         20         20         0          0          0          0          0          0          0          0          0          19         -          -          19
+TrigSignatureMoniMT                                 INFO -- #1364976160 Features                             0          0          0          0          0          0          0          0          0          49         -          -
+TrigSignatureMoniMT                                 INFO HLT_j45_csskpf_nojcalib_ftf_L1J20 #2528888897
+TrigSignatureMoniMT                                 INFO -- #2528888897 Events         19         19         0          0          0          0          0          0          0          0          0          16         -          -          16
+TrigSignatureMoniMT                                 INFO -- #2528888897 Features                             0          0          0          0          0          0          0          0          0          30         -          -
 TrigSignatureMoniMT                                 INFO HLT_j45_cssktc_nojcalib_L1J20 #3295122398
-TrigSignatureMoniMT                                 INFO -- #3295122398 Events         19         19         0          0          0          0          0          0          0          0          0          0          15         -          15
-TrigSignatureMoniMT                                 INFO -- #3295122398 Features                             0          0          0          0          0          0          0          0          0          0          27         -
+TrigSignatureMoniMT                                 INFO -- #3295122398 Events         19         19         0          0          0          0          0          0          0          0          0          15         -          -          15
+TrigSignatureMoniMT                                 INFO -- #3295122398 Features                             0          0          0          0          0          0          0          0          0          27         -          -
 TrigSignatureMoniMT                                 INFO HLT_j45_ftf_L1J15 #868405538
-TrigSignatureMoniMT                                 INFO -- #868405538 Events          20         20         0          0          0          0          0          0          0          0          0          0          19         -          19
-TrigSignatureMoniMT                                 INFO -- #868405538 Features                              0          0          0          0          0          0          0          0          0          0          50         -
-TrigSignatureMoniMT                                 INFO HLT_j45_ftf_csskpf_nojcalib_L1J20 #3533281867
-TrigSignatureMoniMT                                 INFO -- #3533281867 Events         19         19         0          0          0          0          0          0          0          0          0          0          16         -          16
-TrigSignatureMoniMT                                 INFO -- #3533281867 Features                             0          0          0          0          0          0          0          0          0          0          30         -
-TrigSignatureMoniMT                                 INFO HLT_j45_ftf_pf_L1J20 #1335156103
-TrigSignatureMoniMT                                 INFO -- #1335156103 Events         19         19         0          0          0          0          0          0          0          0          0          0          18         -          18
-TrigSignatureMoniMT                                 INFO -- #1335156103 Features                             0          0          0          0          0          0          0          0          0          0          39         -
-TrigSignatureMoniMT                                 INFO HLT_j45_ftf_pf_nojcalib_L1J20 #3658890913
-TrigSignatureMoniMT                                 INFO -- #3658890913 Events         19         19         0          0          0          0          0          0          0          0          0          0          17         -          17
-TrigSignatureMoniMT                                 INFO -- #3658890913 Features                             0          0          0          0          0          0          0          0          0          0          37         -
-TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subjesgscIS_011jvt_L1J15 #2857031468
-TrigSignatureMoniMT                                 INFO -- #2857031468 Events         20         20         0          0          0          0          0          0          0          0          0          0          16         -          16
-TrigSignatureMoniMT                                 INFO -- #2857031468 Features                             0          0          0          0          0          0          0          0          0          0          33         -
-TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subjesgscIS_015jvt_L1J15 #2938374624
-TrigSignatureMoniMT                                 INFO -- #2938374624 Events         20         20         0          0          0          0          0          0          0          0          0          0          16         -          16
-TrigSignatureMoniMT                                 INFO -- #2938374624 Features                             0          0          0          0          0          0          0          0          0          0          33         -
-TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subjesgscIS_059jvt_L1J15 #1593009344
-TrigSignatureMoniMT                                 INFO -- #1593009344 Events         20         20         0          0          0          0          0          0          0          0          0          0          16         -          16
-TrigSignatureMoniMT                                 INFO -- #1593009344 Features                             0          0          0          0          0          0          0          0          0          0          33         -
-TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subjesgscIS_L1J15 #3341539267
-TrigSignatureMoniMT                                 INFO -- #3341539267 Events         20         20         0          0          0          0          0          0          0          0          0          0          19         -          19
-TrigSignatureMoniMT                                 INFO -- #3341539267 Features                             0          0          0          0          0          0          0          0          0          0          50         -
-TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subjesgscIS_bmv2c1070_split_L1J20 #991419339
-TrigSignatureMoniMT                                 INFO -- #991419339 Events          19         19         0          0          0          0          0          0          0          0          0          0          19         10         10
-TrigSignatureMoniMT                                 INFO -- #991419339 Features                              0          0          0          0          0          0          0          0          0          0          49         21
-TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subjesgscIS_boffperf_split_L1J20 #1961149049
-TrigSignatureMoniMT                                 INFO -- #1961149049 Events         19         19         0          0          0          0          0          0          0          0          0          0          19         19         19
-TrigSignatureMoniMT                                 INFO -- #1961149049 Features                             0          0          0          0          0          0          0          0          0          0          49         49
-TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subjesgscIS_pf_L1J20 #761060030
-TrigSignatureMoniMT                                 INFO -- #761060030 Events          19         19         0          0          0          0          0          0          0          0          0          0          18         -          18
-TrigSignatureMoniMT                                 INFO -- #761060030 Features                              0          0          0          0          0          0          0          0          0          0          39         -
-TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subresjesgscIS_L1J15 #1509925407
-TrigSignatureMoniMT                                 INFO -- #1509925407 Events         20         20         0          0          0          0          0          0          0          0          0          0          19         -          19
-TrigSignatureMoniMT                                 INFO -- #1509925407 Features                             0          0          0          0          0          0          0          0          0          0          45         -
-TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subresjesgscIS_pf_L1J20 #4012311417
-TrigSignatureMoniMT                                 INFO -- #4012311417 Events         19         19         0          0          0          0          0          0          0          0          0          0          18         -          18
-TrigSignatureMoniMT                                 INFO -- #4012311417 Features                             0          0          0          0          0          0          0          0          0          0          39         -
+TrigSignatureMoniMT                                 INFO -- #868405538 Events          20         20         0          0          0          0          0          0          0          0          0          19         -          -          19
+TrigSignatureMoniMT                                 INFO -- #868405538 Features                              0          0          0          0          0          0          0          0          0          49         -          -
 TrigSignatureMoniMT                                 INFO HLT_j45_nojcalib_L1J20 #2042444294
-TrigSignatureMoniMT                                 INFO -- #2042444294 Events         19         19         0          0          0          0          0          0          0          0          0          0          17         -          17
-TrigSignatureMoniMT                                 INFO -- #2042444294 Features                             0          0          0          0          0          0          0          0          0          0          39         -
+TrigSignatureMoniMT                                 INFO -- #2042444294 Events         19         19         0          0          0          0          0          0          0          0          0          17         -          -          17
+TrigSignatureMoniMT                                 INFO -- #2042444294 Features                             0          0          0          0          0          0          0          0          0          39         -          -
+TrigSignatureMoniMT                                 INFO HLT_j45_pf_ftf_L1J20 #3679554988
+TrigSignatureMoniMT                                 INFO -- #3679554988 Events         19         19         0          0          0          0          0          0          0          0          0          18         -          -          18
+TrigSignatureMoniMT                                 INFO -- #3679554988 Features                             0          0          0          0          0          0          0          0          0          38         -          -
+TrigSignatureMoniMT                                 INFO HLT_j45_pf_nojcalib_ftf_L1J20 #4202219904
+TrigSignatureMoniMT                                 INFO -- #4202219904 Events         19         19         0          0          0          0          0          0          0          0          0          17         -          -          17
+TrigSignatureMoniMT                                 INFO -- #4202219904 Features                             0          0          0          0          0          0          0          0          0          37         -          -
+TrigSignatureMoniMT                                 INFO HLT_j45_pf_subjesgscIS_ftf_L1J20 #2187173741
+TrigSignatureMoniMT                                 INFO -- #2187173741 Events         19         19         0          0          0          0          0          0          0          0          0          18         -          -          18
+TrigSignatureMoniMT                                 INFO -- #2187173741 Features                             0          0          0          0          0          0          0          0          0          38         -          -
+TrigSignatureMoniMT                                 INFO HLT_j45_pf_subresjesgscIS_ftf_L1J20 #3567642453
+TrigSignatureMoniMT                                 INFO -- #3567642453 Events         19         19         0          0          0          0          0          0          0          0          0          18         -          -          18
+TrigSignatureMoniMT                                 INFO -- #3567642453 Features                             0          0          0          0          0          0          0          0          0          38         -          -
 TrigSignatureMoniMT                                 INFO HLT_j45_sktc_nojcalib_L1J20 #1542468090
-TrigSignatureMoniMT                                 INFO -- #1542468090 Events         19         19         0          0          0          0          0          0          0          0          0          0          15         -          15
-TrigSignatureMoniMT                                 INFO -- #1542468090 Features                             0          0          0          0          0          0          0          0          0          0          26         -
+TrigSignatureMoniMT                                 INFO -- #1542468090 Events         19         19         0          0          0          0          0          0          0          0          0          15         -          -          15
+TrigSignatureMoniMT                                 INFO -- #1542468090 Features                             0          0          0          0          0          0          0          0          0          26         -          -
+TrigSignatureMoniMT                                 INFO HLT_j45_subjesgscIS_ftf_011jvt_L1J15 #266323220
+TrigSignatureMoniMT                                 INFO -- #266323220 Events          20         20         0          0          0          0          0          0          0          0          0          15         -          -          15
+TrigSignatureMoniMT                                 INFO -- #266323220 Features                              0          0          0          0          0          0          0          0          0          32         -          -
+TrigSignatureMoniMT                                 INFO HLT_j45_subjesgscIS_ftf_015jvt_L1J15 #3102941497
+TrigSignatureMoniMT                                 INFO -- #3102941497 Events         20         20         0          0          0          0          0          0          0          0          0          15         -          -          15
+TrigSignatureMoniMT                                 INFO -- #3102941497 Features                             0          0          0          0          0          0          0          0          0          32         -          -
+TrigSignatureMoniMT                                 INFO HLT_j45_subjesgscIS_ftf_059jvt_L1J15 #2237035634
+TrigSignatureMoniMT                                 INFO -- #2237035634 Events         20         20         0          0          0          0          0          0          0          0          0          15         -          -          15
+TrigSignatureMoniMT                                 INFO -- #2237035634 Features                             0          0          0          0          0          0          0          0          0          32         -          -
+TrigSignatureMoniMT                                 INFO HLT_j45_subjesgscIS_ftf_L1J15 #1960278431
+TrigSignatureMoniMT                                 INFO -- #1960278431 Events         20         20         0          0          0          0          0          0          0          0          0          19         -          -          19
+TrigSignatureMoniMT                                 INFO -- #1960278431 Features                             0          0          0          0          0          0          0          0          0          50         -          -
+TrigSignatureMoniMT                                 INFO HLT_j45_subjesgscIS_ftf_bmv2c1070_split_L1J20 #980453000
+TrigSignatureMoniMT                                 INFO -- #980453000 Events          19         19         0          0          0          0          0          0          0          0          0          19         10         -          10
+TrigSignatureMoniMT                                 INFO -- #980453000 Features                              0          0          0          0          0          0          0          0          0          49         21         -
+TrigSignatureMoniMT                                 INFO HLT_j45_subjesgscIS_ftf_boffperf_split_L1J20 #3374916154
+TrigSignatureMoniMT                                 INFO -- #3374916154 Events         19         19         0          0          0          0          0          0          0          0          0          19         19         -          19
+TrigSignatureMoniMT                                 INFO -- #3374916154 Features                             0          0          0          0          0          0          0          0          0          49         49         -
+TrigSignatureMoniMT                                 INFO HLT_j45_subresjesgscIS_ftf_L1J15 #1213239619
+TrigSignatureMoniMT                                 INFO -- #1213239619 Events         20         20         0          0          0          0          0          0          0          0          0          19         -          -          19
+TrigSignatureMoniMT                                 INFO -- #1213239619 Features                             0          0          0          0          0          0          0          0          0          45         -          -
 TrigSignatureMoniMT                                 INFO HLT_j460_a10_lcw_subjes_L1J100 #3327656707
-TrigSignatureMoniMT                                 INFO -- #3327656707 Events         3          3          0          0          0          0          0          0          0          0          0          0          0          -          0
-TrigSignatureMoniMT                                 INFO -- #3327656707 Features                             0          0          0          0          0          0          0          0          0          0          0          -
+TrigSignatureMoniMT                                 INFO -- #3327656707 Events         3          3          0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #3327656707 Features                             0          0          0          0          0          0          0          0          0          0          -          -
 TrigSignatureMoniMT                                 INFO HLT_j460_a10_lcw_subjes_L1J20 #215408633
-TrigSignatureMoniMT                                 INFO -- #215408633 Events          19         19         0          0          0          0          0          0          0          0          0          0          0          -          0
-TrigSignatureMoniMT                                 INFO -- #215408633 Features                              0          0          0          0          0          0          0          0          0          0          0          -
+TrigSignatureMoniMT                                 INFO -- #215408633 Events          19         19         0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #215408633 Features                              0          0          0          0          0          0          0          0          0          0          -          -
 TrigSignatureMoniMT                                 INFO HLT_j460_a10r_L1J100 #1151767619
-TrigSignatureMoniMT                                 INFO -- #1151767619 Events         3          3          0          0          0          0          0          0          0          0          0          0          0          -          0
-TrigSignatureMoniMT                                 INFO -- #1151767619 Features                             0          0          0          0          0          0          0          0          0          0          0          -
+TrigSignatureMoniMT                                 INFO -- #1151767619 Events         3          3          0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #1151767619 Features                             0          0          0          0          0          0          0          0          0          0          -          -
 TrigSignatureMoniMT                                 INFO HLT_j460_a10r_L1J20 #3875082669
-TrigSignatureMoniMT                                 INFO -- #3875082669 Events         19         19         0          0          0          0          0          0          0          0          0          0          0          -          0
-TrigSignatureMoniMT                                 INFO -- #3875082669 Features                             0          0          0          0          0          0          0          0          0          0          0          -
+TrigSignatureMoniMT                                 INFO -- #3875082669 Events         19         19         0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #3875082669 Features                             0          0          0          0          0          0          0          0          0          0          -          -
+TrigSignatureMoniMT                                 INFO HLT_j460_a10sd_csskpf_jes_ftf_35smcINF_L1J100 #3781128663
+TrigSignatureMoniMT                                 INFO -- #3781128663 Events         3          3          0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #3781128663 Features                             0          0          0          0          0          0          0          0          0          0          -          -
+TrigSignatureMoniMT                                 INFO HLT_j460_a10sd_csskpf_jes_ftf_L1J100 #1509950051
+TrigSignatureMoniMT                                 INFO -- #1509950051 Events         3          3          0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #1509950051 Features                             0          0          0          0          0          0          0          0          0          0          -          -
+TrigSignatureMoniMT                                 INFO HLT_j460_a10sd_csskpf_nojcalib_ftf_35smcINF_L1J100 #249842682
+TrigSignatureMoniMT                                 INFO -- #249842682 Events          3          3          0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #249842682 Features                              0          0          0          0          0          0          0          0          0          0          -          -
+TrigSignatureMoniMT                                 INFO HLT_j460_a10sd_csskpf_nojcalib_ftf_L1J100 #3452032818
+TrigSignatureMoniMT                                 INFO -- #3452032818 Events         3          3          0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #3452032818 Features                             0          0          0          0          0          0          0          0          0          0          -          -
 TrigSignatureMoniMT                                 INFO HLT_j460_a10sd_lcw_nojcalib_L1J100 #3093997295
-TrigSignatureMoniMT                                 INFO -- #3093997295 Events         3          3          0          0          0          0          0          0          0          0          0          0          0          -          0
-TrigSignatureMoniMT                                 INFO -- #3093997295 Features                             0          0          0          0          0          0          0          0          0          0          0          -
+TrigSignatureMoniMT                                 INFO -- #3093997295 Events         3          3          0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #3093997295 Features                             0          0          0          0          0          0          0          0          0          0          -          -
+TrigSignatureMoniMT                                 INFO HLT_j460_a10sd_pf_nojcalib_ftf_L1J100 #2138269254
+TrigSignatureMoniMT                                 INFO -- #2138269254 Events         3          3          0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #2138269254 Features                             0          0          0          0          0          0          0          0          0          0          -          -
 TrigSignatureMoniMT                                 INFO HLT_j460_a10t_lcw_jes_30smcINF_L1J100 #2296827117
-TrigSignatureMoniMT                                 INFO -- #2296827117 Events         3          3          0          0          0          0          0          0          0          0          0          0          0          -          0
-TrigSignatureMoniMT                                 INFO -- #2296827117 Features                             0          0          0          0          0          0          0          0          0          0          0          -
+TrigSignatureMoniMT                                 INFO -- #2296827117 Events         3          3          0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #2296827117 Features                             0          0          0          0          0          0          0          0          0          0          -          -
 TrigSignatureMoniMT                                 INFO HLT_j460_a10t_lcw_jes_L1J100 #436385969
-TrigSignatureMoniMT                                 INFO -- #436385969 Events          3          3          0          0          0          0          0          0          0          0          0          0          0          -          0
-TrigSignatureMoniMT                                 INFO -- #436385969 Features                              0          0          0          0          0          0          0          0          0          0          0          -
+TrigSignatureMoniMT                                 INFO -- #436385969 Events          3          3          0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #436385969 Features                              0          0          0          0          0          0          0          0          0          0          -          -
+TrigSignatureMoniMT                                 INFO HLT_j460_a10t_lcw_nojcalib_35smcINF_L1J100 #3224465417
+TrigSignatureMoniMT                                 INFO -- #3224465417 Events         3          3          0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #3224465417 Features                             0          0          0          0          0          0          0          0          0          0          -          -
+TrigSignatureMoniMT                                 INFO HLT_j460_a10t_lcw_nojcalib_L1J100 #1966129844
+TrigSignatureMoniMT                                 INFO -- #1966129844 Events         3          3          0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #1966129844 Features                             0          0          0          0          0          0          0          0          0          0          -          -
 TrigSignatureMoniMT                                 INFO HLT_j80_0eta240_2j60_320eta490_j0_dijetSEP80j1etSEP0j1eta240SEP80j2etSEP0j2eta240SEP700djmass_L1J20 #3634067472
-TrigSignatureMoniMT                                 INFO -- #3634067472 Events         19         19         0          0          0          0          0          0          0          0          0          0          0          -          0
-TrigSignatureMoniMT                                 INFO -- #3634067472 Features                             0          0          0          0          0          0          0          0          0          0          0          -
+TrigSignatureMoniMT                                 INFO -- #3634067472 Events         19         19         0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #3634067472 Features                             0          0          0          0          0          0          0          0          0          0          -          -
 TrigSignatureMoniMT                                 INFO HLT_j80_L1J15 #2440872308
-TrigSignatureMoniMT                                 INFO -- #2440872308 Events         20         20         0          0          0          0          0          0          0          0          0          0          13         -          13
-TrigSignatureMoniMT                                 INFO -- #2440872308 Features                             0          0          0          0          0          0          0          0          0          0          23         -
+TrigSignatureMoniMT                                 INFO -- #2440872308 Events         20         20         0          0          0          0          0          0          0          0          0          13         -          -          13
+TrigSignatureMoniMT                                 INFO -- #2440872308 Features                             0          0          0          0          0          0          0          0          0          23         -          -
 TrigSignatureMoniMT                                 INFO HLT_j80_j60_L1J15 #582699527
-TrigSignatureMoniMT                                 INFO -- #582699527 Events          20         20         0          0          0          0          0          0          0          0          0          0          0          -          0
-TrigSignatureMoniMT                                 INFO -- #582699527 Features                              0          0          0          0          0          0          0          0          0          0          0          -
+TrigSignatureMoniMT                                 INFO -- #582699527 Events          20         20         0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #582699527 Features                              0          0          0          0          0          0          0          0          0          0          -          -
 TrigSignatureMoniMT                                 INFO HLT_j85_L1J20 #510475538
-TrigSignatureMoniMT                                 INFO -- #510475538 Events          19         19         0          0          0          0          0          0          0          0          0          0          13         -          13
-TrigSignatureMoniMT                                 INFO -- #510475538 Features                              0          0          0          0          0          0          0          0          0          0          21         -
+TrigSignatureMoniMT                                 INFO -- #510475538 Events          19         19         0          0          0          0          0          0          0          0          0          13         -          -          13
+TrigSignatureMoniMT                                 INFO -- #510475538 Features                              0          0          0          0          0          0          0          0          0          21         -          -
 TrigSignatureMoniMT                                 INFO HLT_j85_ftf_L1J20 #877042532
-TrigSignatureMoniMT                                 INFO -- #877042532 Events          19         19         0          0          0          0          0          0          0          0          0          0          13         -          13
-TrigSignatureMoniMT                                 INFO -- #877042532 Features                              0          0          0          0          0          0          0          0          0          0          21         -
-TrigSignatureMoniMT                                 INFO HLT_j85_ftf_pf_L1J20 #1538535401
-TrigSignatureMoniMT                                 INFO -- #1538535401 Events         19         19         0          0          0          0          0          0          0          0          0          0          11         -          11
-TrigSignatureMoniMT                                 INFO -- #1538535401 Features                             0          0          0          0          0          0          0          0          0          0          16         -
+TrigSignatureMoniMT                                 INFO -- #877042532 Events          19         19         0          0          0          0          0          0          0          0          0          13         -          -          13
+TrigSignatureMoniMT                                 INFO -- #877042532 Features                              0          0          0          0          0          0          0          0          0          21         -          -
+TrigSignatureMoniMT                                 INFO HLT_j85_pf_ftf_L1J20 #789444389
+TrigSignatureMoniMT                                 INFO -- #789444389 Events          19         19         0          0          0          0          0          0          0          0          0          10         -          -          10
+TrigSignatureMoniMT                                 INFO -- #789444389 Features                              0          0          0          0          0          0          0          0          0          14         -          -
 TrigSignatureMoniMT                                 INFO HLT_mb_sptrk_L1RD0_FILLED #4097312640
-TrigSignatureMoniMT                                 INFO -- #4097312640 Events         20         20         20         20         -          -          -          -          -          -          -          -          -          -          20
-TrigSignatureMoniMT                                 INFO -- #4097312640 Features                             20         20         -          -          -          -          -          -          -          -          -          -
+TrigSignatureMoniMT                                 INFO -- #4097312640 Events         20         0          0          0          -          -          -          -          -          -          -          -          -          -          0
+TrigSignatureMoniMT                                 INFO -- #4097312640 Features                             0          0          -          -          -          -          -          -          -          -          -          -
 TrigSignatureMoniMT                                 INFO HLT_mu0_muoncalib_L1MU20 #997163309
 TrigSignatureMoniMT                                 INFO -- #997163309 Events          8          8          0          0          0          0          0          -          -          -          -          -          -          -          0
 TrigSignatureMoniMT                                 INFO -- #997163309 Features                              0          0          0          0          0          -          -          -          -          -          -          -
@@ -407,20 +458,23 @@ TrigSignatureMoniMT                                 INFO HLT_mu14_L1MU10 #169690
 TrigSignatureMoniMT                                 INFO -- #1696906927 Events         10         10         0          0          0          0          10         7          7          7          -          -          -          -          7
 TrigSignatureMoniMT                                 INFO -- #1696906927 Features                             0          0          0          0          13         8          8          8          -          -          -          -
 TrigSignatureMoniMT                                 INFO HLT_mu20_2mu4noL1_L1MU20 #1029128679
-TrigSignatureMoniMT                                 INFO -- #1029128679 Events         8          8          0          0          0          0          8          5          5          5          1          1          -          -          1
-TrigSignatureMoniMT                                 INFO -- #1029128679 Features                             0          0          0          0          10         6          6          6          2          2          -          -
+TrigSignatureMoniMT                                 INFO -- #1029128679 Events         8          8          0          0          0          0          8          5          5          5          0          0          1          1          1
+TrigSignatureMoniMT                                 INFO -- #1029128679 Features                             0          0          0          0          10         6          6          6          0          0          2          2
 TrigSignatureMoniMT                                 INFO HLT_mu20_ivar_L1MU6 #2083734526
 TrigSignatureMoniMT                                 INFO -- #2083734526 Events         10         10         0          0          0          0          10         5          5          -          -          -          -          -          5
 TrigSignatureMoniMT                                 INFO -- #2083734526 Features                             0          0          0          0          14         6          5          -          -          -          -          -
+TrigSignatureMoniMT                                 INFO HLT_mu20_ivarmedium_mu8noL1_L1MU20 #3249386942
+TrigSignatureMoniMT                                 INFO -- #3249386942 Events         8          8          0          0          0          0          8          5          5          5          3          0          1          1          1
+TrigSignatureMoniMT                                 INFO -- #3249386942 Features                             0          0          0          0          10         6          6          6          3          0          1          1
 TrigSignatureMoniMT                                 INFO HLT_mu22_2mu4noL1_L1MU20 #3427670100
-TrigSignatureMoniMT                                 INFO -- #3427670100 Events         8          8          0          0          0          0          8          5          5          5          1          1          -          -          1
-TrigSignatureMoniMT                                 INFO -- #3427670100 Features                             0          0          0          0          10         6          6          6          2          2          -          -
+TrigSignatureMoniMT                                 INFO -- #3427670100 Events         8          8          0          0          0          0          8          5          5          5          0          0          1          1          1
+TrigSignatureMoniMT                                 INFO -- #3427670100 Features                             0          0          0          0          10         6          6          6          0          0          2          2
 TrigSignatureMoniMT                                 INFO HLT_mu22_mu8noL1_L1MU20 #3165652409
-TrigSignatureMoniMT                                 INFO -- #3165652409 Events         8          8          0          0          0          0          8          5          5          5          2          2          -          -          2
-TrigSignatureMoniMT                                 INFO -- #3165652409 Features                             0          0          0          0          10         6          6          6          3          3          -          -
+TrigSignatureMoniMT                                 INFO -- #3165652409 Events         8          8          0          0          0          0          8          5          5          5          0          0          2          2          2
+TrigSignatureMoniMT                                 INFO -- #3165652409 Features                             0          0          0          0          10         6          6          6          0          0          3          3
 TrigSignatureMoniMT                                 INFO HLT_mu24_2mu4noL1_L1MU20 #3233544630
-TrigSignatureMoniMT                                 INFO -- #3233544630 Events         8          8          0          0          0          0          8          5          5          5          1          1          -          -          1
-TrigSignatureMoniMT                                 INFO -- #3233544630 Features                             0          0          0          0          10         6          6          6          2          2          -          -
+TrigSignatureMoniMT                                 INFO -- #3233544630 Events         8          8          0          0          0          0          8          5          5          5          0          0          1          1          1
+TrigSignatureMoniMT                                 INFO -- #3233544630 Features                             0          0          0          0          10         6          6          6          0          0          2          2
 TrigSignatureMoniMT                                 INFO HLT_mu24_L1MU20 #417425162
 TrigSignatureMoniMT                                 INFO -- #417425162 Events          8          8          0          0          0          0          8          5          5          5          -          -          -          -          5
 TrigSignatureMoniMT                                 INFO -- #417425162 Features                              0          0          0          0          10         6          6          6          -          -          -          -
@@ -431,8 +485,8 @@ TrigSignatureMoniMT                                 INFO HLT_mu24_ivarmedium_L1M
 TrigSignatureMoniMT                                 INFO -- #737407430 Events          8          8          0          0          0          0          8          5          5          5          3          -          -          -          3
 TrigSignatureMoniMT                                 INFO -- #737407430 Features                              0          0          0          0          10         6          6          6          3          -          -          -
 TrigSignatureMoniMT                                 INFO HLT_mu24_mu10noL1_L1MU20 #2563354236
-TrigSignatureMoniMT                                 INFO -- #2563354236 Events         8          8          0          0          0          0          8          5          5          5          2          2          -          -          2
-TrigSignatureMoniMT                                 INFO -- #2563354236 Features                             0          0          0          0          10         6          6          6          3          3          -          -
+TrigSignatureMoniMT                                 INFO -- #2563354236 Events         8          8          0          0          0          0          8          5          5          5          0          0          2          2          2
+TrigSignatureMoniMT                                 INFO -- #2563354236 Features                             0          0          0          0          10         6          6          6          0          0          3          3
 TrigSignatureMoniMT                                 INFO HLT_mu26_L1MU20 #311138376
 TrigSignatureMoniMT                                 INFO -- #311138376 Events          8          8          0          0          0          0          8          5          4          3          -          -          -          -          3
 TrigSignatureMoniMT                                 INFO -- #311138376 Features                              0          0          0          0          10         6          5          4          -          -          -          -
@@ -440,17 +494,17 @@ TrigSignatureMoniMT                                 INFO HLT_mu26_ivarmedium_L1M
 TrigSignatureMoniMT                                 INFO -- #3411723090 Events         8          8          0          0          0          0          8          5          4          3          2          -          -          -          2
 TrigSignatureMoniMT                                 INFO -- #3411723090 Features                             0          0          0          0          10         6          5          4          2          -          -          -
 TrigSignatureMoniMT                                 INFO HLT_mu26_mu10noL1_L1MU20 #2318302287
-TrigSignatureMoniMT                                 INFO -- #2318302287 Events         8          8          0          0          0          0          8          5          4          3          1          1          -          -          1
-TrigSignatureMoniMT                                 INFO -- #2318302287 Features                             0          0          0          0          10         6          5          4          2          2          -          -
+TrigSignatureMoniMT                                 INFO -- #2318302287 Events         8          8          0          0          0          0          8          5          4          3          0          0          1          1          1
+TrigSignatureMoniMT                                 INFO -- #2318302287 Features                             0          0          0          0          10         6          5          4          0          0          2          2
 TrigSignatureMoniMT                                 INFO HLT_mu26_mu8noL1_L1MU20 #2233067926
-TrigSignatureMoniMT                                 INFO -- #2233067926 Events         8          8          0          0          0          0          8          5          4          3          1          1          -          -          1
-TrigSignatureMoniMT                                 INFO -- #2233067926 Features                             0          0          0          0          10         6          5          4          2          2          -          -
+TrigSignatureMoniMT                                 INFO -- #2233067926 Events         8          8          0          0          0          0          8          5          4          3          0          0          1          1          1
+TrigSignatureMoniMT                                 INFO -- #2233067926 Features                             0          0          0          0          10         6          5          4          0          0          2          2
 TrigSignatureMoniMT                                 INFO HLT_mu28_ivarmedium_L1MU20 #1963262787
 TrigSignatureMoniMT                                 INFO -- #1963262787 Events         8          8          0          0          0          0          8          5          4          3          2          -          -          -          2
 TrigSignatureMoniMT                                 INFO -- #1963262787 Features                             0          0          0          0          10         6          5          3          2          -          -          -
 TrigSignatureMoniMT                                 INFO HLT_mu28_mu8noL1_L1MU20 #86648125
-TrigSignatureMoniMT                                 INFO -- #86648125 Events           8          8          0          0          0          0          8          5          4          3          1          1          -          -          1
-TrigSignatureMoniMT                                 INFO -- #86648125 Features                               0          0          0          0          10         6          5          3          1          1          -          -
+TrigSignatureMoniMT                                 INFO -- #86648125 Events           8          8          0          0          0          0          8          5          4          3          0          0          1          1          1
+TrigSignatureMoniMT                                 INFO -- #86648125 Features                               0          0          0          0          10         6          5          3          0          0          1          1
 TrigSignatureMoniMT                                 INFO HLT_mu35_ivarmedium_L1MU20 #597064890
 TrigSignatureMoniMT                                 INFO -- #597064890 Events          8          8          0          0          0          0          8          5          3          2          1          -          -          -          1
 TrigSignatureMoniMT                                 INFO -- #597064890 Features                              0          0          0          0          10         6          4          2          1          -          -          -
@@ -485,17 +539,17 @@ TrigSignatureMoniMT                                 INFO HLT_mu6_mu4_L12MU4 #171
 TrigSignatureMoniMT                                 INFO -- #1713982776 Events         4          4          0          0          0          0          4          4          4          4          -          -          -          -          4
 TrigSignatureMoniMT                                 INFO -- #1713982776 Features                             0          0          0          0          8          8          12         10         -          -          -          -
 TrigSignatureMoniMT                                 INFO HLT_mu6_mu6noL1_L1MU6 #451489897
-TrigSignatureMoniMT                                 INFO -- #451489897 Events          10         10         0          0          0          0          10         10         10         10         5          4          -          -          5
-TrigSignatureMoniMT                                 INFO -- #451489897 Features                              0          0          0          0          14         13         16         15         8          7          -          -
+TrigSignatureMoniMT                                 INFO -- #451489897 Events          10         10         0          0          0          0          10         10         10         10         0          0          5          4          4
+TrigSignatureMoniMT                                 INFO -- #451489897 Features                              0          0          0          0          14         13         16         15         0          0          8          7
 TrigSignatureMoniMT                                 INFO HLT_mu6fast_L1MU6 #3518031697
 TrigSignatureMoniMT                                 INFO -- #3518031697 Events         10         10         0          0          0          0          10         -          -          -          -          -          -          -          10
 TrigSignatureMoniMT                                 INFO -- #3518031697 Features                             0          0          0          0          14         -          -          -          -          -          -          -
 TrigSignatureMoniMT                                 INFO HLT_mu6fast_j45_nojcalib_L1J20 #1776326110
-TrigSignatureMoniMT                                 INFO -- #1776326110 Events         19         19         0          0          0          0          0          0          0          0          0          0          0          -          0
-TrigSignatureMoniMT                                 INFO -- #1776326110 Features                             0          0          0          0          0          0          0          0          0          0          0          -
+TrigSignatureMoniMT                                 INFO -- #1776326110 Events         19         19         0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #1776326110 Features                             0          0          0          0          0          0          0          0          0          0          -          -
 TrigSignatureMoniMT                                 INFO HLT_mu6fast_xe30_mht_L1XE10 #1876869651
-TrigSignatureMoniMT                                 INFO -- #1876869651 Events         19         19         0          0          0          0          0          0          0          0          0          0          0          -          0
-TrigSignatureMoniMT                                 INFO -- #1876869651 Features                             0          0          0          0          0          0          0          0          0          0          0          -
+TrigSignatureMoniMT                                 INFO -- #1876869651 Events         19         19         0          0          0          0          0          0          0          0          0          0          -          -          0
+TrigSignatureMoniMT                                 INFO -- #1876869651 Features                             0          0          0          0          0          0          0          0          0          0          -          -
 TrigSignatureMoniMT                                 INFO HLT_mu80_L1MU20 #387900377
 TrigSignatureMoniMT                                 INFO -- #387900377 Events          8          8          0          0          0          0          8          5          0          0          -          -          -          -          0
 TrigSignatureMoniMT                                 INFO -- #387900377 Features                              0          0          0          0          10         6          0          0          -          -          -          -
@@ -791,68 +845,68 @@ TrigSignatureMoniMT                                 INFO HLT_tilecalib_laser_Til
 TrigSignatureMoniMT                                 INFO -- #1063154655 Events         0          0          0          -          -          -          -          -          -          -          -          -          -          -          0
 TrigSignatureMoniMT                                 INFO -- #1063154655 Features                             0          -          -          -          -          -          -          -          -          -          -          -
 TrigSignatureMoniMT                                 INFO HLT_timeburner_L1All #819160059
-TrigSignatureMoniMT                                 INFO -- #819160059 Events          20         20         0          -          -          -          -          -          -          -          -          -          -          -          0
+TrigSignatureMoniMT                                 INFO -- #819160059 Events          20         0          0          -          -          -          -          -          -          -          -          -          -          -          0
 TrigSignatureMoniMT                                 INFO -- #819160059 Features                              0          -          -          -          -          -          -          -          -          -          -          -
 TrigSignatureMoniMT                                 INFO HLT_xe100_mht_L1XE50 #532175988
-TrigSignatureMoniMT                                 INFO -- #532175988 Events          10         10         0          0          0          0          0          0          0          0          0          0          9          -          9
-TrigSignatureMoniMT                                 INFO -- #532175988 Features                              0          0          0          0          0          0          0          0          0          0          9          -
+TrigSignatureMoniMT                                 INFO -- #532175988 Events          10         10         0          0          0          0          0          0          0          0          0          9          -          -          9
+TrigSignatureMoniMT                                 INFO -- #532175988 Features                              0          0          0          0          0          0          0          0          0          9          -          -
 TrigSignatureMoniMT                                 INFO HLT_xe100_pfsum_L1XE50 #1890237897
-TrigSignatureMoniMT                                 INFO -- #1890237897 Events         10         10         0          0          0          0          0          0          0          0          0          0          4          -          4
-TrigSignatureMoniMT                                 INFO -- #1890237897 Features                             0          0          0          0          0          0          0          0          0          0          4          -
+TrigSignatureMoniMT                                 INFO -- #1890237897 Events         10         10         0          0          0          0          0          0          0          0          0          4          -          -          4
+TrigSignatureMoniMT                                 INFO -- #1890237897 Features                             0          0          0          0          0          0          0          0          0          4          -          -
 TrigSignatureMoniMT                                 INFO HLT_xe100_tcpufit_L1XE50 #2803198799
-TrigSignatureMoniMT                                 INFO -- #2803198799 Events         10         10         0          0          0          0          0          0          0          0          0          0          6          -          6
-TrigSignatureMoniMT                                 INFO -- #2803198799 Features                             0          0          0          0          0          0          0          0          0          0          6          -
+TrigSignatureMoniMT                                 INFO -- #2803198799 Events         10         10         0          0          0          0          0          0          0          0          0          6          -          -          6
+TrigSignatureMoniMT                                 INFO -- #2803198799 Features                             0          0          0          0          0          0          0          0          0          6          -          -
 TrigSignatureMoniMT                                 INFO HLT_xe100_trkmht_L1XE50 #1055916731
-TrigSignatureMoniMT                                 INFO -- #1055916731 Events         10         10         0          0          0          0          0          0          0          0          0          0          7          -          7
-TrigSignatureMoniMT                                 INFO -- #1055916731 Features                             0          0          0          0          0          0          0          0          0          0          7          -
+TrigSignatureMoniMT                                 INFO -- #1055916731 Events         10         10         0          0          0          0          0          0          0          0          0          7          -          -          7
+TrigSignatureMoniMT                                 INFO -- #1055916731 Features                             0          0          0          0          0          0          0          0          0          7          -          -
 TrigSignatureMoniMT                                 INFO HLT_xe100_trkmht_xe85_tcpufit_xe65_cell_L1XE50 #451622546
-TrigSignatureMoniMT                                 INFO -- #451622546 Events          10         10         0          0          0          0          0          0          0          0          0          0          6          -          6
-TrigSignatureMoniMT                                 INFO -- #451622546 Features                              0          0          0          0          0          0          0          0          0          0          6          -
+TrigSignatureMoniMT                                 INFO -- #451622546 Events          10         10         0          0          0          0          0          0          0          0          0          6          -          -          6
+TrigSignatureMoniMT                                 INFO -- #451622546 Features                              0          0          0          0          0          0          0          0          0          6          -          -
 TrigSignatureMoniMT                                 INFO HLT_xe110_mht_L1XE50 #3030733259
-TrigSignatureMoniMT                                 INFO -- #3030733259 Events         10         10         0          0          0          0          0          0          0          0          0          0          7          -          7
-TrigSignatureMoniMT                                 INFO -- #3030733259 Features                             0          0          0          0          0          0          0          0          0          0          7          -
+TrigSignatureMoniMT                                 INFO -- #3030733259 Events         10         10         0          0          0          0          0          0          0          0          0          7          -          -          7
+TrigSignatureMoniMT                                 INFO -- #3030733259 Features                             0          0          0          0          0          0          0          0          0          7          -          -
 TrigSignatureMoniMT                                 INFO HLT_xe110_tc_em_L1XE50 #607113828
-TrigSignatureMoniMT                                 INFO -- #607113828 Events          10         10         0          0          0          0          0          0          0          0          0          0          5          -          5
-TrigSignatureMoniMT                                 INFO -- #607113828 Features                              0          0          0          0          0          0          0          0          0          0          5          -
+TrigSignatureMoniMT                                 INFO -- #607113828 Events          10         10         0          0          0          0          0          0          0          0          0          5          -          -          5
+TrigSignatureMoniMT                                 INFO -- #607113828 Features                              0          0          0          0          0          0          0          0          0          5          -          -
 TrigSignatureMoniMT                                 INFO HLT_xe110_tcpufit_L1XE50 #892853397
-TrigSignatureMoniMT                                 INFO -- #892853397 Events          10         10         0          0          0          0          0          0          0          0          0          0          6          -          6
-TrigSignatureMoniMT                                 INFO -- #892853397 Features                              0          0          0          0          0          0          0          0          0          0          6          -
+TrigSignatureMoniMT                                 INFO -- #892853397 Events          10         10         0          0          0          0          0          0          0          0          0          6          -          -          6
+TrigSignatureMoniMT                                 INFO -- #892853397 Features                              0          0          0          0          0          0          0          0          0          6          -          -
 TrigSignatureMoniMT                                 INFO HLT_xe30_cell_L1XE10 #1649696554
-TrigSignatureMoniMT                                 INFO -- #1649696554 Events         19         19         0          0          0          0          0          0          0          0          0          0          17         -          17
-TrigSignatureMoniMT                                 INFO -- #1649696554 Features                             0          0          0          0          0          0          0          0          0          0          17         -
+TrigSignatureMoniMT                                 INFO -- #1649696554 Events         19         19         0          0          0          0          0          0          0          0          0          17         -          -          17
+TrigSignatureMoniMT                                 INFO -- #1649696554 Features                             0          0          0          0          0          0          0          0          0          17         -          -
 TrigSignatureMoniMT                                 INFO HLT_xe30_cell_xe30_tcpufit_L1XE10 #3768353779
-TrigSignatureMoniMT                                 INFO -- #3768353779 Events         19         19         0          0          0          0          0          0          0          0          0          0          14         -          14
-TrigSignatureMoniMT                                 INFO -- #3768353779 Features                             0          0          0          0          0          0          0          0          0          0          14         -
+TrigSignatureMoniMT                                 INFO -- #3768353779 Events         19         19         0          0          0          0          0          0          0          0          0          14         -          -          14
+TrigSignatureMoniMT                                 INFO -- #3768353779 Features                             0          0          0          0          0          0          0          0          0          14         -          -
 TrigSignatureMoniMT                                 INFO HLT_xe30_cvfpufit_L1XE10 #3860749499
-TrigSignatureMoniMT                                 INFO -- #3860749499 Events         19         19         0          0          0          0          0          0          0          0          0          0          14         -          14
-TrigSignatureMoniMT                                 INFO -- #3860749499 Features                             0          0          0          0          0          0          0          0          0          0          14         -
+TrigSignatureMoniMT                                 INFO -- #3860749499 Events         19         19         0          0          0          0          0          0          0          0          0          14         -          -          14
+TrigSignatureMoniMT                                 INFO -- #3860749499 Features                             0          0          0          0          0          0          0          0          0          14         -          -
 TrigSignatureMoniMT                                 INFO HLT_xe30_mht_L1XE10 #3626903018
-TrigSignatureMoniMT                                 INFO -- #3626903018 Events         19         19         0          0          0          0          0          0          0          0          0          0          19         -          19
-TrigSignatureMoniMT                                 INFO -- #3626903018 Features                             0          0          0          0          0          0          0          0          0          0          19         -
+TrigSignatureMoniMT                                 INFO -- #3626903018 Events         19         19         0          0          0          0          0          0          0          0          0          19         -          -          19
+TrigSignatureMoniMT                                 INFO -- #3626903018 Features                             0          0          0          0          0          0          0          0          0          19         -          -
 TrigSignatureMoniMT                                 INFO HLT_xe30_mhtpufit_em_subjesgscIS_L1XE10 #689201557
-TrigSignatureMoniMT                                 INFO -- #689201557 Events          19         19         0          0          0          0          0          0          0          0          0          0          15         -          15
-TrigSignatureMoniMT                                 INFO -- #689201557 Features                              0          0          0          0          0          0          0          0          0          0          15         -
+TrigSignatureMoniMT                                 INFO -- #689201557 Events          19         19         0          0          0          0          0          0          0          0          0          14         -          -          14
+TrigSignatureMoniMT                                 INFO -- #689201557 Features                              0          0          0          0          0          0          0          0          0          14         -          -
 TrigSignatureMoniMT                                 INFO HLT_xe30_mhtpufit_pf_subjesgscIS_L1XE10 #1886909707
-TrigSignatureMoniMT                                 INFO -- #1886909707 Events         19         19         0          0          0          0          0          0          0          0          0          0          14         -          14
-TrigSignatureMoniMT                                 INFO -- #1886909707 Features                             0          0          0          0          0          0          0          0          0          0          14         -
+TrigSignatureMoniMT                                 INFO -- #1886909707 Events         19         19         0          0          0          0          0          0          0          0          0          15         -          -          15
+TrigSignatureMoniMT                                 INFO -- #1886909707 Features                             0          0          0          0          0          0          0          0          0          15         -          -
 TrigSignatureMoniMT                                 INFO HLT_xe30_pfopufit_L1XE10 #2252641537
-TrigSignatureMoniMT                                 INFO -- #2252641537 Events         19         19         0          0          0          0          0          0          0          0          0          0          14         -          14
-TrigSignatureMoniMT                                 INFO -- #2252641537 Features                             0          0          0          0          0          0          0          0          0          0          14         -
+TrigSignatureMoniMT                                 INFO -- #2252641537 Events         19         19         0          0          0          0          0          0          0          0          0          14         -          -          14
+TrigSignatureMoniMT                                 INFO -- #2252641537 Features                             0          0          0          0          0          0          0          0          0          14         -          -
 TrigSignatureMoniMT                                 INFO HLT_xe30_pfsum_L1XE10 #998713382
-TrigSignatureMoniMT                                 INFO -- #998713382 Events          19         19         0          0          0          0          0          0          0          0          0          0          16         -          16
-TrigSignatureMoniMT                                 INFO -- #998713382 Features                              0          0          0          0          0          0          0          0          0          0          16         -
+TrigSignatureMoniMT                                 INFO -- #998713382 Events          19         19         0          0          0          0          0          0          0          0          0          16         -          -          16
+TrigSignatureMoniMT                                 INFO -- #998713382 Features                              0          0          0          0          0          0          0          0          0          16         -          -
 TrigSignatureMoniMT                                 INFO HLT_xe30_tcpufit_L1XE10 #1583719916
-TrigSignatureMoniMT                                 INFO -- #1583719916 Events         19         19         0          0          0          0          0          0          0          0          0          0          14         -          14
-TrigSignatureMoniMT                                 INFO -- #1583719916 Features                             0          0          0          0          0          0          0          0          0          0          14         -
+TrigSignatureMoniMT                                 INFO -- #1583719916 Events         19         19         0          0          0          0          0          0          0          0          0          14         -          -          14
+TrigSignatureMoniMT                                 INFO -- #1583719916 Features                             0          0          0          0          0          0          0          0          0          14         -          -
 TrigSignatureMoniMT                                 INFO HLT_xe30_trkmht_L1XE10 #2468872349
-TrigSignatureMoniMT                                 INFO -- #2468872349 Events         19         19         0          0          0          0          0          0          0          0          0          0          17         -          17
-TrigSignatureMoniMT                                 INFO -- #2468872349 Features                             0          0          0          0          0          0          0          0          0          0          17         -
+TrigSignatureMoniMT                                 INFO -- #2468872349 Events         19         19         0          0          0          0          0          0          0          0          0          17         -          -          17
+TrigSignatureMoniMT                                 INFO -- #2468872349 Features                             0          0          0          0          0          0          0          0          0          17         -          -
 TrigSignatureMoniMT                                 INFO HLT_xe65_cell_L1XE50 #531141817
-TrigSignatureMoniMT                                 INFO -- #531141817 Events          10         10         0          0          0          0          0          0          0          0          0          0          7          -          7
-TrigSignatureMoniMT                                 INFO -- #531141817 Features                              0          0          0          0          0          0          0          0          0          0          7          -
+TrigSignatureMoniMT                                 INFO -- #531141817 Events          10         10         0          0          0          0          0          0          0          0          0          7          -          -          7
+TrigSignatureMoniMT                                 INFO -- #531141817 Features                              0          0          0          0          0          0          0          0          0          7          -          -
 TrigSignatureMoniMT                                 INFO HLT_xe65_cell_xe110_tcpufit_L1XE50 #115518400
-TrigSignatureMoniMT                                 INFO -- #115518400 Events          10         10         0          0          0          0          0          0          0          0          0          0          5          -          5
-TrigSignatureMoniMT                                 INFO -- #115518400 Features                              0          0          0          0          0          0          0          0          0          0          5          -
+TrigSignatureMoniMT                                 INFO -- #115518400 Events          10         10         0          0          0          0          0          0          0          0          0          5          -          -          5
+TrigSignatureMoniMT                                 INFO -- #115518400 Features                              0          0          0          0          0          0          0          0          0          5          -          -
 TrigSignatureMoniMT                                 INFO HLT_xe95_trkmht_xe90_tcpufit_xe75_cell_L1XE50 #302256132
-TrigSignatureMoniMT                                 INFO -- #302256132 Events          10         10         0          0          0          0          0          0          0          0          0          0          4          -          4
-TrigSignatureMoniMT                                 INFO -- #302256132 Features                              0          0          0          0          0          0          0          0          0          0          4          -
+TrigSignatureMoniMT                                 INFO -- #302256132 Events          10         10         0          0          0          0          0          0          0          0          0          4          -          -          4
+TrigSignatureMoniMT                                 INFO -- #302256132 Features                              0          0          0          0          0          0          0          0          0          4          -          -
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_BStoBStoESDAOD_mt1_build.py b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_BStoBStoESDAOD_v1Dev_build.py
similarity index 98%
rename from Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_BStoBStoESDAOD_mt1_build.py
rename to Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_BStoBStoESDAOD_v1Dev_build.py
index 33a7943e29a2d32dc87c91ce353ebd53d3f55295..5a7c2cbbbfc5024d295f83d46bf852fd08437aac 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_BStoBStoESDAOD_mt1_build.py
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_BStoBStoESDAOD_v1Dev_build.py
@@ -11,7 +11,7 @@ def findFile(pattern):
     '''Bash inline file name finder'''
     return '`find . -name \'{:s}\' | tail -n 1`'.format(pattern)
 
-menu_name = 'LS2_v1'
+menu_name = 'LS2_v1_TriggerValidation_mc_prescale'
 
 # Run athena BS->BS job
 BStoBS = ExecStep.ExecStep("BStoBS")
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_HITtoRDOTrig_mt1_build.py b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_HITtoRDOTrig_v1Dev_build.py
similarity index 95%
rename from Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_HITtoRDOTrig_mt1_build.py
rename to Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_HITtoRDOTrig_v1Dev_build.py
index ac269b817e68a53870eee53d619c9b5583ead50f..43049cca423f76ef5a5b80acfe01d539ce344b4c 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_HITtoRDOTrig_mt1_build.py
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_HITtoRDOTrig_v1Dev_build.py
@@ -33,6 +33,7 @@ rdo2rdotrig.input = ''
 rdo2rdotrig.explicit_input = True
 rdo2rdotrig.threads = 1
 rdo2rdotrig.args = '--inputRDOFile=RDO.pool.root --outputRDO_TRIGFile=RDO_TRIG.pool.root'
+rdo2rdotrig.args += ' --preExec="setMenu=\'LS2_v1_TriggerValidation_mc_prescale\'"'
 
 test = Test.Test()
 test.art_type = 'build'
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_HITtoRDOTrig_mt1_grid.py b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_HITtoRDOTrig_v1Dev_grid.py
similarity index 96%
rename from Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_HITtoRDOTrig_mt1_grid.py
rename to Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_HITtoRDOTrig_v1Dev_grid.py
index fb2786c0b7bfb1baa0425d47b97ad166c52900bb..fa43f3d8a1b0c188cf8107b330cba02a4c45e7f5 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_HITtoRDOTrig_mt1_grid.py
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_HITtoRDOTrig_v1Dev_grid.py
@@ -49,6 +49,7 @@ rdo2rdotrig.input = ''
 rdo2rdotrig.explicit_input = True
 rdo2rdotrig.threads = 1
 rdo2rdotrig.args = '--inputRDOFile=RDO.pool.root --outputRDO_TRIGFile=RDO_TRIG.pool.root'
+rdo2rdotrig.args += ' --preExec="setMenu=\'LS2_v1_TriggerValidation_mc_prescale\'"'
 
 test = Test.Test()
 test.art_type = 'grid'
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_HITtoRDOTrig_build.py b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_HITtoRDOTrig_v7Primaries_build.py
similarity index 87%
rename from Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_HITtoRDOTrig_build.py
rename to Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_HITtoRDOTrig_v7Primaries_build.py
index f5a87ae590080ca29d82864026767066adf242e9..035a8c1dfd9b47328d11664795646d504be17223 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_HITtoRDOTrig_build.py
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_HITtoRDOTrig_v7Primaries_build.py
@@ -27,11 +27,18 @@ hit2rdo.args += ' --jobNumber="1"'
 hit2rdo.args += ' --preExec "HITtoRDO:userRunLumiOverride={\'run\':300000, \'startmu\':40.0, \'endmu\':70.0, \'stepmu\':1.0, \'startlb\':1, \'timestamp\': 1500000000};ScaleTaskLength=0.1"'
 hit2rdo.args += ' --preInclude "HITtoRDO:Digitization/ForceUseOfPileUpTools.py,SimulationJobOptions/preInlcude.PileUpBunchTrainsMC16c_2017_Config1.py,RunDependentSimData/configLumi_muRange.py"'
 
+preExec = ';'.join([
+  'from TriggerJobOpts.TriggerFlags import TriggerFlags',
+  'TriggerFlags.triggerMenuSetup=\'Physics_pp_v7_primaries\'',
+  'TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\")',
+])
+
 rdo2rdotrig = ExecStep.ExecStep('RDOtoRDOTrigger')
 rdo2rdotrig.type = 'Reco_tf'
 rdo2rdotrig.input = ''
 rdo2rdotrig.explicit_input = True
 rdo2rdotrig.args = '--inputRDOFile=RDO.pool.root --outputRDO_TRIGFile=RDO_TRIG.pool.root'
+rdo2rdotrig.args += ' --preExec="all:{:s};"'.format(preExec)
 
 test = Test.Test()
 test.art_type = 'build'
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_HITtoRDOTrig_grid.py b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_HITtoRDOTrig_v7Primaries_grid.py
similarity index 89%
rename from Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_HITtoRDOTrig_grid.py
rename to Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_HITtoRDOTrig_v7Primaries_grid.py
index 57293d8ce399da89b2e3ddbf2a71aef0f3af8c34..e431d5089f858f38e02c4e4e7754f10e56b53c54 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_HITtoRDOTrig_grid.py
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_HITtoRDOTrig_v7Primaries_grid.py
@@ -46,11 +46,18 @@ hit2rdo.args += ' --jobNumber="1"'
 hit2rdo.args += ' --preExec "HITtoRDO:userRunLumiOverride={\'run\':300000, \'startmu\':40.0, \'endmu\':70.0, \'stepmu\':1.0, \'startlb\':1, \'timestamp\': 1500000000};ScaleTaskLength=0.1"'
 hit2rdo.args += ' --preInclude "HITtoRDO:Digitization/ForceUseOfPileUpTools.py,SimulationJobOptions/preInlcude.PileUpBunchTrainsMC16c_2017_Config1.py,RunDependentSimData/configLumi_muRange.py"'
 
+preExec = ';'.join([
+  'from TriggerJobOpts.TriggerFlags import TriggerFlags',
+  'TriggerFlags.triggerMenuSetup=\'Physics_pp_v7_primaries\'',
+  'TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\")',
+])
+
 rdo2rdotrig = ExecStep.ExecStep('RDOtoRDOTrigger')
 rdo2rdotrig.type = 'Reco_tf'
 rdo2rdotrig.input = ''
 rdo2rdotrig.explicit_input = True
 rdo2rdotrig.args = '--inputRDOFile=RDO.pool.root --outputRDO_TRIGFile=RDO_TRIG.pool.root'
+rdo2rdotrig.args += ' --preExec="all:{:s};"'.format(preExec)
 
 test = Test.Test()
 test.art_type = 'grid'
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_PhysValWeb_mt1_compLegacy_grid.py b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_PhysValWeb_comp_v1v7_grid.py
similarity index 90%
rename from Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_PhysValWeb_mt1_compLegacy_grid.py
rename to Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_PhysValWeb_comp_v1v7_grid.py
index 2aa9c0cfd7c2311bb14ee76119c0f060acf45553..f23612e586853107097bfacb3d0911f9b99a01f2 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_PhysValWeb_mt1_compLegacy_grid.py
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_PhysValWeb_comp_v1v7_grid.py
@@ -26,10 +26,10 @@ from TrigValTools.TrigValSteering import Test, CheckSteps
 from TrigAnalysisTest.TrigAnalysisSteps import add_physvalweb_steps
 
 downloadLegacyTrig = CheckSteps.DownloadRefStep('DownloadLegacyTriggerNTUP')
-downloadLegacyTrig.artjobname = 'test_trigAna_PhysValWeb_grid.py'
+downloadLegacyTrig.artjobname = 'test_trigAna_RDOtoPhysval_v7Primaries_grid.py'
 
 downloadRun3Trig = CheckSteps.DownloadRefStep('DownloadRun3TriggerNTUP')
-downloadRun3Trig.artjobname = 'test_trigAna_PhysValWeb_mt1_grid.py'
+downloadRun3Trig.artjobname = 'test_trigAna_RDOtoPhysval_v1Dev_grid.py'
 downloadRun3Trig.args += ' --dst="."'
 
 test = Test.Test()
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_PhysValWeb_grid.py b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_PhysValWeb_grid.py
deleted file mode 100755
index 70d873a2f3456063ee91ff8e8a329719c1ea2c09..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_PhysValWeb_grid.py
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/usr/bin/env python
-
-# art-description: Test of transform RDO->RDO_TRIG->ESD->AOD->NTUP_PHYSVAL with serial athena (legacy trigger) and produce webdisplay
-# art-type: grid
-# art-include: master/Athena
-# 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: *.pmon.gz
-# art-output: *perfmon*
-# art-output: prmon*
-# art-output: *.check*
-# art-output: HLTconfig*.xml
-# art-output: L1Topoconfig*.xml
-# art-output: LVL1config*.xml
-# art-output: PHYSVAL_WEB
-# art-html: PHYSVAL_WEB
-
-from TrigValTools.TrigValSteering import Test, ExecStep, CheckSteps
-from TrigAnalysisTest.TrigAnalysisSteps import add_physvalweb_steps
-import os
-
-# To run single-process transform on MCORE sites
-if 'ATHENA_NPROC_NUM' in os.environ:
-    del os.environ['ATHENA_NPROC_NUM']
-
-rdo2aod = ExecStep.ExecStep('RDOtoAOD')
-rdo2aod.type = 'Reco_tf'
-rdo2aod.input = 'ttbar'
-rdo2aod.max_events = 500
-rdo2aod.args = '--outputAODFile=AOD.pool.root --steering="doRDO_TRIG" --valid=True'
-rdo2aod.args += ' --preExec="all:from TriggerJobOpts.TriggerFlags import TriggerFlags; TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\");"'
-
-physval = ExecStep.ExecStep('PhysVal')
-physval.type = 'Reco_tf'
-physval.input = ''
-physval.explicit_input = True
-physval.args = '--inputAODFile=AOD.pool.root --outputNTUP_PHYSVALFile=NTUP_PHYSVAL.pool.root --valid=True'
-
-validationFlags = 'doTrigEgamma,doTrigBphys,doTrigMET,doTrigJet,doTrigMuon,doTrigHLTResult,doTrigCalo,doTrigMinBias,doTrigTau,doTrigIDtrk,doTrigBjet'
-physval.args += ' --validationFlags="{:s}"'.format(validationFlags)
-
-test = Test.Test()
-test.art_type = 'grid'
-test.exec_steps = [rdo2aod,physval]
-test.check_steps = CheckSteps.default_check_steps(test)
-
-# Add web display steps
-slice_names = [
-    'JetMon', 'TauMon', 'MuonMon', 'IDMon',
-    'BphysMon', 'HLTCaloESD', 'ResultMon', 'BjetMon',
-    'METMon', 'MinBiasMon', 'Egamma']
-download = CheckSteps.DownloadRefStep()
-add_physvalweb_steps(test, slice_names, download)
-
-import sys
-sys.exit(test.run())
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_PhysValWeb_mt1_grid.py b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_PhysValWeb_mt1_grid.py
deleted file mode 100755
index 412ce230290ed8ad9c653765cf9135f6bf3ffefb..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_PhysValWeb_mt1_grid.py
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/usr/bin/env python
-
-# art-description: Test of transform RDO->RDO_TRIG->ESD->AOD with AthenaMT and AOD->NTUP_PHYSVAL with serial athena to produce webdisplay
-# art-type: grid
-# art-include: master/Athena
-# 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: *.pmon.gz
-# art-output: *perfmon*
-# art-output: prmon*
-# art-output: *.check*
-# art-output: HLTconfig*.xml
-# art-output: L1Topoconfig*.xml
-# art-output: LVL1config*.xml
-# art-output: PHYSVAL_WEB
-# art-html: PHYSVAL_WEB
-
-from TrigValTools.TrigValSteering import Test, ExecStep, CheckSteps
-from TrigAnalysisTest.TrigAnalysisSteps import add_physvalweb_steps
-import os
-
-# To run single-process transform on MCORE sites
-if 'ATHENA_NPROC_NUM' in os.environ:
-    del os.environ['ATHENA_NPROC_NUM']
-
-rdo2aod = ExecStep.ExecStep('RDOtoAOD')
-rdo2aod.type = 'Reco_tf'
-rdo2aod.input = 'ttbar'
-rdo2aod.threads = 1
-rdo2aod.max_events = 500
-rdo2aod.args = '--outputAODFile=AOD.pool.root --steering="doRDO_TRIG" --valid=True'
-rdo2aod.args += ' --preExec="all:from TriggerJobOpts.TriggerFlags import TriggerFlags; TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\");"'
-
-physval = ExecStep.ExecStep('PhysVal')
-physval.type = 'Reco_tf'
-physval.input = ''
-physval.explicit_input = True
-physval.args = '--inputAODFile=AOD.pool.root --outputNTUP_PHYSVALFile=NTUP_PHYSVAL.pool.root --valid=True'
-
-validationFlags = 'doTrigEgamma,doTrigBphys,doTrigMET,doTrigJet,doTrigMuon,doTrigHLTResult,doTrigCalo,doTrigMinBias,doTrigTau,doTrigIDtrk,doTrigBjet'
-physval.args += ' --validationFlags="{:s}"'.format(validationFlags)
-
-test = Test.Test()
-test.art_type = 'grid'
-test.exec_steps = [rdo2aod,physval]
-test.check_steps = CheckSteps.default_check_steps(test)
-
-# Add web display steps
-slice_names = [
-    'JetMon', 'TauMon', 'MuonMon', 'IDMon',
-    'BphysMon', 'HLTCaloESD', 'ResultMon', 'BjetMon',
-    'METMon', 'MinBiasMon', 'Egamma']
-download = CheckSteps.DownloadRefStep()
-add_physvalweb_steps(test, slice_names, download)
-
-import sys
-sys.exit(test.run())
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoAOD_mt1_build.py b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoAOD_v1Dev_build.py
similarity index 74%
rename from Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoAOD_mt1_build.py
rename to Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoAOD_v1Dev_build.py
index eebc78e513e50651f7be753211ccab981a69b5a2..eef1d2bd060c8bd5e2f156f2c7ec33656fbb5923 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoAOD_mt1_build.py
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoAOD_v1Dev_build.py
@@ -9,12 +9,18 @@
 from TrigValTools.TrigValSteering import Test, ExecStep, CheckSteps
 from TrigAnalysisTest.TrigAnalysisSteps import add_analysis_steps
 
+preExec = ';'.join([
+  'setMenu=\'LS2_v1_TriggerValidation_mc_prescale\'',
+  'from TriggerJobOpts.TriggerFlags import TriggerFlags',
+  'TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\")',
+])
+
 rdo2aod = ExecStep.ExecStep()
 rdo2aod.type = 'Reco_tf'
 rdo2aod.input = 'ttbar'
 rdo2aod.threads = 1
 rdo2aod.args = '--outputAODFile=AOD.pool.root --steering="doRDO_TRIG"'
-rdo2aod.args += ' --preExec="all:from TriggerJobOpts.TriggerFlags import TriggerFlags; TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\");"'
+rdo2aod.args += ' --preExec="all:{:s};"'.format(preExec)
 
 test = Test.Test()
 test.art_type = 'build'
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoAOD_mt1_grid.py b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoAOD_v1Dev_grid.py
similarity index 80%
rename from Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoAOD_mt1_grid.py
rename to Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoAOD_v1Dev_grid.py
index b664ceef626c00296d96c7db124158472aa582b2..6d2e343c59cc7b66582ecbc2994aadfa94c934c7 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoAOD_mt1_grid.py
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoAOD_v1Dev_grid.py
@@ -25,13 +25,19 @@ import os
 if 'ATHENA_NPROC_NUM' in os.environ:
     del os.environ['ATHENA_NPROC_NUM']
 
+preExec = ';'.join([
+  'setMenu=\'LS2_v1_TriggerValidation_mc_prescale\'',
+  'from TriggerJobOpts.TriggerFlags import TriggerFlags',
+  'TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\")',
+])
+
 rdo2aod = ExecStep.ExecStep()
 rdo2aod.type = 'Reco_tf'
 rdo2aod.input = 'ttbar'
 rdo2aod.max_events = 500
 rdo2aod.threads = 1
 rdo2aod.args = '--outputAODFile=AOD.pool.root --steering="doRDO_TRIG"'
-rdo2aod.args += ' --preExec="all:from TriggerJobOpts.TriggerFlags import TriggerFlags; TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\");"'
+rdo2aod.args += ' --preExec="all:{:s};"'.format(preExec)
 
 test = Test.Test()
 test.art_type = 'grid'
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoAOD_build.py b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoAOD_v7Primaries_build.py
similarity index 74%
rename from Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoAOD_build.py
rename to Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoAOD_v7Primaries_build.py
index b648c0dbee4d083aaf58fa27cbf8082fdc431995..635043ed1f61f2cad8aefeb77a05fe6bffa44ead 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoAOD_build.py
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoAOD_v7Primaries_build.py
@@ -9,11 +9,17 @@
 from TrigValTools.TrigValSteering import Test, ExecStep, CheckSteps
 from TrigAnalysisTest.TrigAnalysisSteps import add_analysis_steps
 
+preExec = ';'.join([
+  'from TriggerJobOpts.TriggerFlags import TriggerFlags',
+  'TriggerFlags.triggerMenuSetup=\'Physics_pp_v7_primaries\'',
+  'TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\")',
+])
+
 rdo2aod = ExecStep.ExecStep()
 rdo2aod.type = 'Reco_tf'
 rdo2aod.input = 'ttbar'
 rdo2aod.args = '--outputAODFile=AOD.pool.root --steering="doRDO_TRIG"'
-rdo2aod.args += ' --preExec="all:from TriggerJobOpts.TriggerFlags import TriggerFlags; TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\");"'
+rdo2aod.args += ' --preExec="all:{:s};"'.format(preExec)
 
 test = Test.Test()
 test.art_type = 'build'
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoAOD_grid.py b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoAOD_v7Primaries_grid.py
similarity index 81%
rename from Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoAOD_grid.py
rename to Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoAOD_v7Primaries_grid.py
index 9feb2ba0b7789ba0d1ba81f48da6b6390dbf00e6..3db85cbc4bee0d18a436ace4ca1bd2caeddb1345 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoAOD_grid.py
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoAOD_v7Primaries_grid.py
@@ -28,12 +28,18 @@ import os
 if 'ATHENA_NPROC_NUM' in os.environ:
     del os.environ['ATHENA_NPROC_NUM']
 
+preExec = ';'.join([
+  'from TriggerJobOpts.TriggerFlags import TriggerFlags',
+  'TriggerFlags.triggerMenuSetup=\'Physics_pp_v7_primaries\'',
+  'TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\")',
+])
+
 rdo2aod = ExecStep.ExecStep()
 rdo2aod.type = 'Reco_tf'
 rdo2aod.input = 'ttbar'
 rdo2aod.max_events = 500
 rdo2aod.args = '--outputAODFile=AOD.pool.root --steering="doRDO_TRIG"'
-rdo2aod.args += ' --preExec="all:from TriggerJobOpts.TriggerFlags import TriggerFlags; TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\");"'
+rdo2aod.args += ' --preExec="all:{:s};"'.format(preExec)
 
 test = Test.Test()
 test.art_type = 'grid'
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoPhysval_mt1_build.py b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoPhysval_v1Dev_build.py
similarity index 72%
rename from Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoPhysval_mt1_build.py
rename to Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoPhysval_v1Dev_build.py
index 6b78a0855d8e5f7936fd3fabd641b667d521bf34..b5dcaf75f9ff9d47741053ad91fc73ae24e18910 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoPhysval_mt1_build.py
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoPhysval_v1Dev_build.py
@@ -8,13 +8,18 @@
 
 from TrigValTools.TrigValSteering import Test, ExecStep, CheckSteps
 
+preExec = ';'.join([
+  'setMenu=\'LS2_v1_TriggerValidation_mc_prescale\'',
+  'from TriggerJobOpts.TriggerFlags import TriggerFlags',
+  'TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\")',
+])
+
 rdo2aod = ExecStep.ExecStep('RDOtoAOD')
 rdo2aod.type = 'Reco_tf'
 rdo2aod.input = 'ttbar'
 rdo2aod.threads = 1
 rdo2aod.args = '--outputAODFile=AOD.pool.root --steering="doRDO_TRIG" --valid=True'
-rdo2aod.args += ' --preExec="all:from TriggerJobOpts.TriggerFlags import TriggerFlags; TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\");"'
-rdo2aod.args += ' --postInclude="TriggerTest/disableChronoStatSvcPrintout.py"'
+rdo2aod.args += ' --preExec="all:{:s};"'.format(preExec)
 
 physval = ExecStep.ExecStep('PhysVal')
 physval.type = 'Reco_tf'
@@ -24,8 +29,8 @@ physval.args = '--inputAODFile=AOD.pool.root --outputNTUP_PHYSVALFile=NTUP_PHYSV
 physval.args += ' --postInclude="TriggerTest/disableChronoStatSvcPrintout.py"'
 
 validationFlags = 'doTrigEgamma,doTrigBphys,doTrigMET,doTrigJet,doTrigMuon,doTrigHLTResult,doTrigCalo,doTrigMinBias,doTrigTau,doTrigIDtrk,doTrigBjet'
-preExec = 'TriggerFlags.EDMDecodingVersion.set_Value_and_Lock(3); from TrigEDMConfig import ContainerRemapping_Run2Run3; ContainerRemapping_Run2Run3.remapHLTContainerNames();'
-physval.args += ' --validationFlags="{:s}" --preExec="{:s}"'.format(validationFlags, preExec)
+validationPreExec = 'TriggerFlags.EDMDecodingVersion.set_Value_and_Lock(3); from TrigEDMConfig import ContainerRemapping_Run2Run3; ContainerRemapping_Run2Run3.remapHLTContainerNames();'
+physval.args += ' --validationFlags="{:s}" --preExec="{:s}"'.format(validationFlags, validationPreExec)
 
 test = Test.Test()
 test.art_type = 'build'
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoPhysval_mt1_grid.py b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoPhysval_v1Dev_grid.py
similarity index 80%
rename from Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoPhysval_mt1_grid.py
rename to Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoPhysval_v1Dev_grid.py
index bea9664847baaf799c4ad93448bd558536d39dee..c1c2591cd0d6349176bbc1a16732f213c7eb45b9 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoPhysval_mt1_grid.py
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoPhysval_v1Dev_grid.py
@@ -30,13 +30,19 @@ import os
 if 'ATHENA_NPROC_NUM' in os.environ:
     del os.environ['ATHENA_NPROC_NUM']
 
+preExec = ';'.join([
+  'setMenu=\'LS2_v1_TriggerValidation_mc_prescale\'',
+  'from TriggerJobOpts.TriggerFlags import TriggerFlags',
+  'TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\")',
+])
+
 rdo2aod = ExecStep.ExecStep('RDOtoAOD')
 rdo2aod.type = 'Reco_tf'
 rdo2aod.input = 'ttbar'
 rdo2aod.max_events = 500
 rdo2aod.threads = 1
 rdo2aod.args = '--outputAODFile=AOD.pool.root --steering="doRDO_TRIG" --valid=True'
-rdo2aod.args += ' --preExec="all:from TriggerJobOpts.TriggerFlags import TriggerFlags; TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\");"'
+rdo2aod.args += ' --preExec="all:{:s};"'.format(preExec)
 
 physval = ExecStep.ExecStep('PhysVal')
 physval.type = 'Reco_tf'
@@ -45,8 +51,8 @@ physval.explicit_input = True
 physval.args = '--inputAODFile=AOD.pool.root --outputNTUP_PHYSVALFile=NTUP_PHYSVAL.pool.root --valid=True'
 
 validationFlags = 'doTrigEgamma,doTrigBphys,doTrigMET,doTrigJet,doTrigMuon,doTrigHLTResult,doTrigCalo,doTrigMinBias,doTrigTau,doTrigIDtrk,doTrigBjet'
-preExec = 'TriggerFlags.EDMDecodingVersion.set_Value_and_Lock(3); from TrigEDMConfig import ContainerRemapping_Run2Run3; ContainerRemapping_Run2Run3.remapHLTContainerNames();'
-physval.args += ' --validationFlags="{:s}" --preExec="{:s}"'.format(validationFlags, preExec)
+validationPreExec = 'TriggerFlags.EDMDecodingVersion.set_Value_and_Lock(3); from TrigEDMConfig import ContainerRemapping_Run2Run3; ContainerRemapping_Run2Run3.remapHLTContainerNames();'
+physval.args += ' --validationFlags="{:s}" --preExec="{:s}"'.format(validationFlags, validationPreExec)
 
 test = Test.Test()
 test.art_type = 'grid'
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoPhysval_build.py b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoPhysval_v7Primaries_build.py
similarity index 81%
rename from Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoPhysval_build.py
rename to Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoPhysval_v7Primaries_build.py
index 3b395a78f85b02bf3865fc4f968e180a936761e8..92589a1b2111883c8ff6f20a3bea5bf4f8143b59 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoPhysval_build.py
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoPhysval_v7Primaries_build.py
@@ -8,11 +8,17 @@
 
 from TrigValTools.TrigValSteering import Test, ExecStep, CheckSteps
 
+preExec = ';'.join([
+  'from TriggerJobOpts.TriggerFlags import TriggerFlags',
+  'TriggerFlags.triggerMenuSetup=\'Physics_pp_v7_primaries\'',
+  'TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\")',
+])
+
 rdo2aod = ExecStep.ExecStep('RDOtoAOD')
 rdo2aod.type = 'Reco_tf'
 rdo2aod.input = 'ttbar'
 rdo2aod.args = '--outputAODFile=AOD.pool.root --steering="doRDO_TRIG" --valid=True'
-rdo2aod.args += ' --preExec="all:from TriggerJobOpts.TriggerFlags import TriggerFlags; TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\");"'
+rdo2aod.args += ' --preExec="all:{:s};"'.format(preExec)
 
 physval = ExecStep.ExecStep('PhysVal')
 physval.type = 'Reco_tf'
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoPhysval_grid.py b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoPhysval_v7Primaries_grid.py
similarity index 88%
rename from Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoPhysval_grid.py
rename to Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoPhysval_v7Primaries_grid.py
index 903577ca19f9e2013db92704444c98810a533c54..4991416463dd8cd39ddd7ace50a9d1a8d48b6195 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoPhysval_grid.py
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoPhysval_v7Primaries_grid.py
@@ -30,12 +30,18 @@ import os
 if 'ATHENA_NPROC_NUM' in os.environ:
     del os.environ['ATHENA_NPROC_NUM']
 
+preExec = ';'.join([
+  'from TriggerJobOpts.TriggerFlags import TriggerFlags',
+  'TriggerFlags.triggerMenuSetup=\'Physics_pp_v7_primaries\'',
+  'TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\")',
+])
+
 rdo2aod = ExecStep.ExecStep('RDOtoAOD')
 rdo2aod.type = 'Reco_tf'
 rdo2aod.input = 'ttbar'
 rdo2aod.max_events = 500
 rdo2aod.args = '--outputAODFile=AOD.pool.root --steering="doRDO_TRIG" --valid=True'
-rdo2aod.args += ' --preExec="all:from TriggerJobOpts.TriggerFlags import TriggerFlags; TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\");"'
+rdo2aod.args += ' --preExec="all:{:s};"'.format(preExec)
 
 physval = ExecStep.ExecStep('PhysVal')
 physval.type = 'Reco_tf'
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoRDOTrig_mt1_build.py b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoRDOTrig_mt1_build.py
index 36ff6edd29ffe1b593412b08e3b889a79023c56a..9d4a70250294581a4551003525d0c2b87c7d12e3 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoRDOTrig_mt1_build.py
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoRDOTrig_mt1_build.py
@@ -1,32 +1,6 @@
-#!/usr/bin/env python
-
-# art-description: Test of the RDOtoRDOTrigger transform with threads=1
-# 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.
-
-from TrigValTools.TrigValSteering import Test, ExecStep, CheckSteps
-
-ex = ExecStep.ExecStep()
-ex.type = 'Reco_tf'
-ex.input = 'ttbar'
-ex.threads = 1
-ex.args = '--outputRDO_TRIGFile=RDO_TRIG.pool.root'
-ex.args += ' --preExec="all:from TriggerJobOpts.TriggerFlags import TriggerFlags; TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\");"'
-
-test = Test.Test()
-test.art_type = 'build'
-test.exec_steps = [ex]
-test.check_steps = CheckSteps.default_check_steps(test)
-
-# Add a step comparing counts in the log against reference
-refcomp = CheckSteps.RegTestStep("CountRefComp")
-refcomp.input_base_name = 'athena.merged'
-refcomp.regex = r'TrigSignatureMoniMT\s*INFO\sHLT_.*|TrigSignatureMoniMT\s*INFO\s-- #[0-9]+ (Events|Features).*'
-refcomp.reference = 'TrigAnalysisTest/ref_RDOtoRDOTrig_mt1_build.ref'
-refcomp.required = True # Final exit code depends on this step
-CheckSteps.add_step_after_type(test.check_steps, CheckSteps.LogMergeStep, refcomp)
-
-import sys
-sys.exit(test.run())
+#!/bin/sh
+# flake8: noqa
+# This is just a hacky link to a renamed test script, which is needed until the test name in CI configuration is updated
+test_trigAna_RDOtoRDOTrig_v1Dev_build.py
+exit_code=$?
+exit ${exit_code}
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoRDOTrig_v1Dev_build.py b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoRDOTrig_v1Dev_build.py
new file mode 100755
index 0000000000000000000000000000000000000000..9c99e46102b206023250734fd96b0bcb3fd3c0e4
--- /dev/null
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoRDOTrig_v1Dev_build.py
@@ -0,0 +1,38 @@
+#!/usr/bin/env python
+
+# art-description: Test of the RDOtoRDOTrigger transform with threads=1
+# 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.
+
+from TrigValTools.TrigValSteering import Test, ExecStep, CheckSteps
+
+preExec = ';'.join([
+  'setMenu=\'LS2_v1_TriggerValidation_mc_prescale\'',
+  'from TriggerJobOpts.TriggerFlags import TriggerFlags',
+  'TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\")',
+])
+
+ex = ExecStep.ExecStep()
+ex.type = 'Reco_tf'
+ex.input = 'ttbar'
+ex.threads = 1
+ex.args = '--outputRDO_TRIGFile=RDO_TRIG.pool.root'
+ex.args += ' --preExec="all:{:s};"'.format(preExec)
+
+test = Test.Test()
+test.art_type = 'build'
+test.exec_steps = [ex]
+test.check_steps = CheckSteps.default_check_steps(test)
+
+# Add a step comparing counts in the log against reference
+refcomp = CheckSteps.RegTestStep("CountRefComp")
+refcomp.input_base_name = 'athena.merged'
+refcomp.regex = r'TrigSignatureMoniMT\s*INFO\sHLT_.*|TrigSignatureMoniMT\s*INFO\s-- #[0-9]+ (Events|Features).*'
+refcomp.reference = 'TrigAnalysisTest/ref_RDOtoRDOTrig_v1Dev_build.ref'
+refcomp.required = True # Final exit code depends on this step
+CheckSteps.add_step_after_type(test.check_steps, CheckSteps.LogMergeStep, refcomp)
+
+import sys
+sys.exit(test.run())
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoRDOTrig_mt1_grid.py b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoRDOTrig_v1Dev_grid.py
similarity index 80%
rename from Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoRDOTrig_mt1_grid.py
rename to Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoRDOTrig_v1Dev_grid.py
index da9410f010f98d287d51dae0a3daeedaaedf4544..5b3917f2750bf3dd2c4b5a28aee4c2488c23b336 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoRDOTrig_mt1_grid.py
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoRDOTrig_v1Dev_grid.py
@@ -25,12 +25,18 @@ import os
 if 'ATHENA_NPROC_NUM' in os.environ:
     del os.environ['ATHENA_NPROC_NUM']
 
+preExec = ';'.join([
+  'setMenu=\'LS2_v1_TriggerValidation_mc_prescale\'',
+  'from TriggerJobOpts.TriggerFlags import TriggerFlags',
+  'TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\")',
+])
+
 ex = ExecStep.ExecStep()
 ex.type = 'Reco_tf'
 ex.input = 'ttbar'
 ex.threads = 1
 ex.args = '--outputRDO_TRIGFile=RDO_TRIG.pool.root'
-ex.args += ' --preExec="all:from TriggerJobOpts.TriggerFlags import TriggerFlags; TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\");"'
+ex.args += ' --preExec="all:{:s};"'.format(preExec)
 
 test = Test.Test()
 test.art_type = 'grid'
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoRDOTrig_build.py b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoRDOTrig_v7Primaries_build.py
similarity index 74%
rename from Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoRDOTrig_build.py
rename to Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoRDOTrig_v7Primaries_build.py
index a81c81307761520b845ef14f3df89bbf628025c3..d76ab9aaa67ebd40e5b07d0ee89987f1747399d8 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoRDOTrig_build.py
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoRDOTrig_v7Primaries_build.py
@@ -9,11 +9,17 @@
 from TrigValTools.TrigValSteering import Test, ExecStep, CheckSteps
 from TrigAnalysisTest.TrigAnalysisSteps import add_analysis_steps
 
+preExec = ';'.join([
+  'from TriggerJobOpts.TriggerFlags import TriggerFlags',
+  'TriggerFlags.triggerMenuSetup=\'Physics_pp_v7_primaries\'',
+  'TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\")',
+])
+
 ex = ExecStep.ExecStep()
 ex.type = 'Reco_tf'
 ex.input = 'ttbar'
 ex.args = '--outputRDO_TRIGFile=RDO_TRIG.pool.root'
-ex.args += ' --preExec="all:from TriggerJobOpts.TriggerFlags import TriggerFlags; TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\");"'
+ex.args += ' --preExec="all:{:s};"'.format(preExec)
 
 test = Test.Test()
 test.art_type = 'build'
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoRDOTrig_grid.py b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoRDOTrig_v7Primaries_grid.py
similarity index 81%
rename from Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoRDOTrig_grid.py
rename to Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoRDOTrig_v7Primaries_grid.py
index cec6e80d6bf4a1abd23eb71fb098ce6a5915f615..beb3016bd90e103d87e333b9e2a7652f220ae449 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoRDOTrig_grid.py
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoRDOTrig_v7Primaries_grid.py
@@ -28,12 +28,18 @@ import os
 if 'ATHENA_NPROC_NUM' in os.environ:
     del os.environ['ATHENA_NPROC_NUM']
 
+preExec = ';'.join([
+  'from TriggerJobOpts.TriggerFlags import TriggerFlags',
+  'TriggerFlags.triggerMenuSetup=\'Physics_pp_v7_primaries\'',
+  'TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\")',
+])
+
 ex = ExecStep.ExecStep()
 ex.type = 'Reco_tf'
 ex.input = 'ttbar'
 ex.max_events = 500
 ex.args = '--outputRDO_TRIGFile=RDO_TRIG.pool.root'
-ex.args += ' --preExec="all:from TriggerJobOpts.TriggerFlags import TriggerFlags; TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\");"'
+ex.args += ' --preExec="all:{:s};"'.format(preExec)
 
 test = Test.Test()
 test.art_type = 'grid'
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoT0Mon_mt1_build.py b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoT0Mon_v1Dev_build.py
similarity index 82%
rename from Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoT0Mon_mt1_build.py
rename to Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoT0Mon_v1Dev_build.py
index 3b4872d7576584ee8cde7b301a64b1cba6fe61ef..507ca598f30eca891f248d565a268a5328476b85 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoT0Mon_mt1_build.py
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoT0Mon_v1Dev_build.py
@@ -8,13 +8,18 @@
 
 from TrigValTools.TrigValSteering import Test, ExecStep, CheckSteps
 
+preExec = ';'.join([
+  'setMenu=\'LS2_v1_TriggerValidation_mc_prescale\'',
+  'from TriggerJobOpts.TriggerFlags import TriggerFlags',
+  'TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\")',
+])
+
 rdo2aod = ExecStep.ExecStep('RDOtoAOD')
 rdo2aod.type = 'Reco_tf'
 rdo2aod.input = 'ttbar'
 rdo2aod.threads = 1
 rdo2aod.args = '--outputAODFile=AOD.pool.root --steering="doRDO_TRIG" --valid=True'
-rdo2aod.args += ' --preExec="all:from TriggerJobOpts.TriggerFlags import TriggerFlags; TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\");"'
-rdo2aod.args += ' --postInclude="TriggerTest/disableChronoStatSvcPrintout.py"'
+rdo2aod.args += ' --preExec="all:{:s};"'.format(preExec)
 
 tzmon = ExecStep.ExecStep('Tier0Mon')
 tzmon.type = 'other'
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoT0Mon_mt1_grid.py b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoT0Mon_v1Dev_grid.py
similarity index 85%
rename from Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoT0Mon_mt1_grid.py
rename to Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoT0Mon_v1Dev_grid.py
index 88578c234423c04554b131125de764d6a7504941..bbb8900ed9946f7d82896c957b3a9af2364214e0 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoT0Mon_mt1_grid.py
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoT0Mon_v1Dev_grid.py
@@ -24,14 +24,19 @@ import os
 if 'ATHENA_NPROC_NUM' in os.environ:
     del os.environ['ATHENA_NPROC_NUM']
 
+preExec = ';'.join([
+  'setMenu=\'LS2_v1_TriggerValidation_mc_prescale\'',
+  'from TriggerJobOpts.TriggerFlags import TriggerFlags',
+  'TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\")',
+])
+
 rdo2aod = ExecStep.ExecStep('RDOtoAOD')
 rdo2aod.type = 'Reco_tf'
 rdo2aod.input = 'ttbar'
 rdo2aod.max_events = 500
 rdo2aod.threads = 1
 rdo2aod.args = '--outputAODFile=AOD.pool.root --steering="doRDO_TRIG" --valid=True'
-rdo2aod.args += ' --preExec="all:from TriggerJobOpts.TriggerFlags import TriggerFlags; TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\");"'
-rdo2aod.args += ' --postInclude="TriggerTest/disableChronoStatSvcPrintout.py"'
+rdo2aod.args += ' --preExec="all:{:s};"'.format(preExec)
 
 tzmon = ExecStep.ExecStep('Tier0Mon')
 tzmon.type = 'other'
diff --git a/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py b/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py
index 6de0b967eea2b329337a11d3ab9d303ad1a5e13c..a2729962d6a8f9b8c2a0651365dc217d8759c280 100644
--- a/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py
@@ -22,7 +22,7 @@ from AthenaCommon.Utils.unixtools import FindFile
 
 class TrigInDetReco(ExecStep):
 
-    def __init__(self, name='TrigInDetReco'):
+    def __init__(self, name='TrigInDetReco', postexec_file='' ):
         ExecStep.__init__(self, name)
 ##        super(TrigInDetReco, self).__init__(name)
         self.type = 'Reco_tf'
@@ -57,6 +57,12 @@ class TrigInDetReco(ExecStep):
             'TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\")',
         ])
         self.postexec_trig = "from AthenaCommon.AppMgr import ServiceMgr; ServiceMgr.AthenaPoolCnvSvc.MaxFileSizes=['tmp.RDO_TRIG=100000000000']"
+
+        if postexec_file!='' : 
+            pe_file = open( postexec_file )
+            self.postexec_trig += ";"+pe_file.read()            
+            print( "postexec_trig: ", self.postexec_trig )
+
         self.postexec_reco = "from AthenaCommon.AppMgr import ServiceMgr; ServiceMgr.AthenaPoolCnvSvc.MaxFileSizes=['tmp.ESD=100000000000']"
         self.args = '--outputAODFile=AOD.pool.root --steering="doRDO_TRIG" '
 
@@ -140,6 +146,7 @@ class TrigInDetdictStep(Step):
         os.system( 'get_files -data TIDAdata_cuts.dat' )
         os.system( 'get_files -data TIDAdata-run3-offline.dat' )
         os.system( 'get_files -data TIDAdata_cuts-offline.dat' )
+        os.system( 'get_files -jo   TIDAml_extensions.py' ) 
         super(TrigInDetdictStep, self).configure(test)
 
 
diff --git a/Trigger/TrigValidation/TrigInDetValidation/share/TIDAml_extensions.py b/Trigger/TrigValidation/TrigInDetValidation/share/TIDAml_extensions.py
new file mode 100644
index 0000000000000000000000000000000000000000..7cc870252a8e940b1ede3170727b668f5d907073
--- /dev/null
+++ b/Trigger/TrigValidation/TrigInDetValidation/share/TIDAml_extensions.py
@@ -0,0 +1,7 @@
+ftf = findAlgorithm(topSequence, "TrigFastTrackFinder_JetFS")
+ftf.doSeedRedundancyCheck = True
+ftf.UseTrigSeedML  = 1 #can be 0, 1, 2, or 3, 0 means the
+# ML-based seed filtering is off
+ftf.TrigSeedML_LUT = 'trigseed_ML_medium.lut' 
+ftf.OutputLevel=DEBUG 
+
diff --git a/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_Base.py b/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_Base.py
index eb8bbd1512b46167411c9b3df1eb63c15dfa1eb5..010a4e1cf97bf7a4ca5f61c0531cac78b2617496 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_Base.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_Base.py
@@ -34,6 +34,7 @@ local    = False
 exclude  = False
 postproc = False
 
+
 for opt,arg in opts:
     if opt in ("-l", "--local"):
         local=True
@@ -44,8 +45,10 @@ for opt,arg in opts:
     if opt=="-n":
         LEvents=arg
 
-
-rdo2aod = TrigInDetReco()
+if 'postexec' in dir() :
+    rdo2aod = TrigInDetReco( postexec_file=postexec )
+else :
+    rdo2aod = TrigInDetReco()
 
 # test specific variables ...
 
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu40.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu40.py
index 1e81a1f8047bb1231fb7eea8b44d298a228f7793..e63df8970ebe98734a95e1e2bba760174a649233 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu40.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu40.py
@@ -73,7 +73,7 @@ if (not exclude):
 # Run Tidardict
 if ((not exclude) or postproc ):
     rdict = TrigInDetdictStep()
-    rdict.args='TIDAdata-run3.dat -r Offline -f data-hists.root -b Test_bin.dat '
+    rdict.args='TIDAdata-run3-offline.dat -r Offline -f data-hists.root -b Test_bin.dat '
     test.check_steps.append(rdict)
 
  
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu40_mt.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu40_mt.py
index 1a109d69602acffe9819799693251de394fa7256..dab5f4d764a8b67de0365349c77539a590853199 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu40_mt.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu40_mt.py
@@ -73,7 +73,7 @@ if (not exclude):
 # Run Tidardict
 if ((not exclude) or postproc ):
     rdict = TrigInDetdictStep()
-    rdict.args='TIDAdata-run3.dat -r Offline -f data-hists.root -b Test_bin.dat '
+    rdict.args='TIDAdata-run3-offline.dat -r Offline -f data-hists.root -b Test_bin.dat '
     test.check_steps.append(rdict)
 
  
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 7bcc7ded921fda77e35ccf4be737a9f8b42c1f79..b4059b9915c3350abad3207750d2e23b3af2608e 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80.py
@@ -73,7 +73,7 @@ if (not exclude):
 # Run Tidardict
 if ((not exclude) or postproc ):
     rdict = TrigInDetdictStep()
-    rdict.args='TIDAdata-run3.dat -r Offline -f data-hists.root -b Test_bin.dat '
+    rdict.args='TIDAdata-run3-offline.dat -r Offline -f data-hists.root -b Test_bin.dat '
     test.check_steps.append(rdict)
 
  
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 40340a0c3a250ea705778583bb399f6df019e901..378b33fe83296344319c5088d87e8b9f9dd75303 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
@@ -73,7 +73,7 @@ if (not exclude):
 # Run Tidardict
 if ((not exclude) or postproc ):
     rdict = TrigInDetdictStep()
-    rdict.args='TIDAdata-run3.dat -r Offline -f data-hists.root -b Test_bin.dat '
+    rdict.args='TIDAdata-run3-offline.dat -r Offline -f data-hists.root -b Test_bin.dat '
     test.check_steps.append(rdict)
 
  
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
index 6ba9a89522f8c55eb1f1d0c44d3649436844b0d9..7ef225f72347a76ccc36e5ea971f1aebf563490e 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80_mt2.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80_mt2.py
@@ -73,7 +73,7 @@ if (not exclude):
 # Run Tidardict
 if ((not exclude) or postproc ):
     rdict = TrigInDetdictStep()
-    rdict.args='TIDAdata-run3.dat -r Offline -f data-hists.root -b Test_bin.dat '
+    rdict.args='TIDAdata-run3-offline.dat -r Offline -f data-hists.root -b Test_bin.dat '
     test.check_steps.append(rdict)
 
  
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80_mt3.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80_mt3.py
index 1bdf788263d16d2d8cedb88b40dafc12e9570578..9ff4e7edcc96e7defeaed0cf00b19db58c68016e 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80_mt3.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80_mt3.py
@@ -72,7 +72,7 @@ if (not exclude):
 # Run Tidardict
 if ((not exclude) or postproc ):
     rdict = TrigInDetdictStep()
-    rdict.args='TIDAdata-run3.dat -r Offline -f data-hists.root -b Test_bin.dat '
+    rdict.args='TIDAdata-run3-offline.dat -r Offline -f data-hists.root -b Test_bin.dat '
     test.check_steps.append(rdict)
 
  
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_jpsiee_pu40_mt.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_jpsiee_pu40_mt.py
index 46112b85709b83a1392e01d55288414e424d516c..69ec8f6584f9dbb0b7907c622849d5ada238aa36 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_jpsiee_pu40_mt.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_jpsiee_pu40_mt.py
@@ -81,7 +81,7 @@ if ((not exclude) or postproc ):
     rdict.args='TIDAdata-run3.dat -f data-hists.root -p 11 -b Test_bin.dat '
     test.check_steps.append(rdict)
     rdict2 = TrigInDetdictStep('TrigInDetDict2')
-    rdict2.args='TIDAdata-run3.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
+    rdict2.args='TIDAdata-run3-offline.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
     test.check_steps.append(rdict2)
 
  
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
index ff53bba222a46a59bcadee577f494950fcb05ec9..4cd643a07d049c3c85193aade6f0f8563de7d8ec 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80.py
@@ -81,7 +81,7 @@ if ((not exclude) or postproc ):
     rdict.args='TIDAdata-run3.dat -f data-hists.root -p 11 -b Test_bin.dat '
     test.check_steps.append(rdict)
     rdict2 = TrigInDetdictStep('TrigInDetDict2')
-    rdict2.args='TIDAdata-run3.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
+    rdict2.args='TIDAdata-run3-offline.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
     test.check_steps.append(rdict2)
 
  
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
index 5c77e74e43592298a56473f87269ac1f61feeaf8..1c43c8664a8b4b3eb1a3d6cea2800620bf0960a3 100755
--- 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
@@ -81,7 +81,7 @@ if ((not exclude) or postproc ):
     rdict.args='TIDAdata-run3.dat -f data-hists.root -p 11 -b Test_bin.dat '
     test.check_steps.append(rdict)
     rdict2 = TrigInDetdictStep('TrigInDetDict2')
-    rdict2.args='TIDAdata-run3.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
+    rdict2.args='TIDAdata-run3-offline.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
     test.check_steps.append(rdict2)
 
  
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_larged0_mt.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_larged0_mt.py
index 0803e57c112974937648e68843e8f26a339a9add..c7f1fa50f7b4571c85fefcfaf4376d9574e55d6c 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_larged0_mt.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_larged0_mt.py
@@ -81,7 +81,7 @@ if ((not exclude) or postproc ):
     rdict.args='TIDAdata-run3.dat -f data-hists.root -p 11 -b Test_bin.dat '
     test.check_steps.append(rdict)
     rdict2 = TrigInDetdictStep('TrigInDetDict2')
-    rdict2.args='TIDAdata-run3.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
+    rdict2.args='TIDAdata-run3-offline.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
     test.check_steps.append(rdict2)
 
  
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_larged0_pu_mt.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_larged0_pu_mt.py
index 19119606eae579e276d1258096f9fc2b839936bf..07649383b63317da7bad7a3dcd935158535bc903 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_larged0_pu_mt.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_larged0_pu_mt.py
@@ -81,7 +81,7 @@ if ((not exclude) or postproc ):
     rdict.args='TIDAdata-run3.dat -f data-hists.root -p 11 -b Test_bin.dat '
     test.check_steps.append(rdict)
     rdict2 = TrigInDetdictStep('TrigInDetDict2')
-    rdict2.args='TIDAdata-run3.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
+    rdict2.args='TIDAdata-run3-offline.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
     test.check_steps.append(rdict2)
 
  
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
index efe7ed36cc10a95390a46f95700b01a393b47a6a..092c2a68e3ba2161f95769536d4b2a32ff1dd7e3 100755
--- 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
@@ -81,7 +81,7 @@ if ((not exclude) or postproc ):
     rdict.args='TIDAdata-run3.dat -f data-hists.root -p 11 -b Test_bin.dat '
     test.check_steps.append(rdict)
     rdict2 = TrigInDetdictStep('TrigInDetDict2')
-    rdict2.args='TIDAdata-run3.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
+    rdict2.args='TIDAdata-run3-offline.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
     test.check_steps.append(rdict2)
 
  
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_pu40_mt.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_pu40_mt.py
index 2beb57eff13e02d9419e549acd36d984386c5adb..3576f7f167d536532602f17000a47637b386904f 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_pu40_mt.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_pu40_mt.py
@@ -81,7 +81,7 @@ if ((not exclude) or postproc ):
     rdict.args='TIDAdata-run3.dat -f data-hists.root -p 11 -b Test_bin.dat '
     test.check_steps.append(rdict)
     rdict2 = TrigInDetdictStep('TrigInDetDict2')
-    rdict2.args='TIDAdata-run3.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
+    rdict2.args='TIDAdata-run3-offline.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
     test.check_steps.append(rdict2)
 
  
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_zee_pu40.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_zee_pu40.py
index c84d08fd35eab96d36113e61f4ef75e5c17459be..34b754fab8bf24cb74b8b5d47bfc5f76ee4a47a4 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_zee_pu40.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_zee_pu40.py
@@ -81,7 +81,7 @@ if ((not exclude) or postproc ):
     rdict.args='TIDAdata-run3.dat -f data-hists.root -p 11 -b Test_bin.dat '
     test.check_steps.append(rdict)
     rdict2 = TrigInDetdictStep('TrigInDetDict2')
-    rdict2.args='TIDAdata-run3.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
+    rdict2.args='TIDAdata-run3-offline.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
     test.check_steps.append(rdict2)
 
  
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_zee_pu40_mt.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_zee_pu40_mt.py
index 4cf057e3f605b48f5e015a045e65225fc379a01b..bbc1c4c283ba919e962322a2edf940133f87bc02 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_zee_pu40_mt.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_zee_pu40_mt.py
@@ -81,7 +81,7 @@ if ((not exclude) or postproc ):
     rdict.args='TIDAdata-run3.dat -f data-hists.root -p 11 -b Test_bin.dat '
     test.check_steps.append(rdict)
     rdict2 = TrigInDetdictStep('TrigInDetDict2')
-    rdict2.args='TIDAdata-run3.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
+    rdict2.args='TIDAdata-run3-offline.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
     test.check_steps.append(rdict2)
 
  
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_fsjet_ml_pu40.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_fsjet_ml_pu40.py
new file mode 100755
index 0000000000000000000000000000000000000000..6fe968139ba3126c5c29b632752db2807d396d8f
--- /dev/null
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_fsjet_ml_pu40.py
@@ -0,0 +1,47 @@
+#!/usr/bin/env python
+
+# art-description: art job for fsjet_ml_pu40
+# art-type: grid
+# art-include: master/Athena
+# art-input: valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.merge.RDO.e4993_s3214_r11315
+# art-input-nfiles: 3
+# art-athena-mt: 4
+# art-memory: 4096
+# art-html: https://idtrigger-val.web.cern.ch/idtrigger-val/TIDAWeb/TIDAart/?jobdir=
+# 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 
+
+
+Slices  = ['fsjet']
+RunEF   = False
+Events  = 2000 
+Threads = 1 
+Slots   = 1 # what about the mt: 4 art directive ? nfiles: 3 ?
+Input   = 'ttbar'    # defined in TrigValTools/share/TrigValInputs.json  
+
+# post exec doesn't quite work yet
+# postexec_file = 'TIDAml_extensions.py'
+
+TrackReference = [ 'Truth', 'Offline' ]
+
+
+from AthenaCommon.Include import include 
+include("TrigInDetValidation/TrigInDetValidation_Base.py")
+
+
+ 
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_fsjet_pu40.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_fsjet_pu40.py
index 1ae91bacce43836497c084fb114abbd1a94a21dc..7215b315d0af0c394b1234bb9871922edd3d9390 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_fsjet_pu40.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_fsjet_pu40.py
@@ -3,6 +3,7 @@
 # art-description: art job for fsjet_pu40
 # art-type: grid
 # art-include: master/Athena
+# art-input: valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.merge.RDO.e4993_s3214_r11315
 # art-input-nfiles: 3
 # art-athena-mt: 4
 # art-memory: 4096
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_fsjet_pu40_mt.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_fsjet_pu40_mt.py
index 4360e666a676720dadb833219ae1fb5d097cad5e..8ffa41345cf08531a60a1c4268645437abd7e917 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_fsjet_pu40_mt.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_fsjet_pu40_mt.py
@@ -3,6 +3,7 @@
 # art-description: art job for fsjet_pu40_mt
 # art-type: grid
 # art-include: master/Athena
+# art-input: valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.merge.RDO.e4993_s3214_r11315
 # art-input-nfiles: 3
 # art-athena-mt: 4
 # art-memory: 4096
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_minbias.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_minbias.py
index 9ea8361af669cfe89a85e208919a01dad4bea15b..66b7477c5d5a9b267fd0cc578c0af5f2269d5319 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_minbias.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_minbias.py
@@ -5,6 +5,7 @@
 # art-type: grid
 # art-include: master/Athena
 # art-html: https://idtrigger-val.web.cern.ch/idtrigger-val/TIDAWeb/TIDAart/?jobdir=
+# art-input: mc15_13TeV.361203.Pythia8_A2_MSTW2008LO_ND_minbias.recon.RDO.e3639_s2606_s2174_r7661_tid07858100_00
 # art-athena-mt: 4
 # art-memory: 4096
 # art-output: *.txt
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_minbias_mt.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_minbias_mt.py
index d3e2b1525602df437ddf17e34f77d19ad90af797..99fed652af5e273f99d116bf40a255c550733675 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_minbias_mt.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_minbias_mt.py
@@ -5,6 +5,8 @@
 # art-type: grid
 # art-include: master/Athena
 # art-html: https://idtrigger-val.web.cern.ch/idtrigger-val/TIDAWeb/TIDAart/?jobdir=
+# art-input: mc15_13TeV.361203.Pythia8_A2_MSTW2008LO_ND_minbias.recon.RDO.e3639_s2606_s2174_r7661_tid07858100_00
+# art-athena-nfiles: 4
 # art-athena-mt: 4
 # art-memory: 4096
 # art-output: *.txt
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_bphys.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_bphys.py
index 4992954e7dc8e7a93bd863464527c1d04f61d68b..5fdbf2ce1b077a3014efab075b31f64b7dcd56a6 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_bphys.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_bphys.py
@@ -74,7 +74,7 @@ if ((not exclude) or postproc ):
     rdict.args='TIDAdata-run3.dat -f data-hists.root -p 13 -b Test_bin.dat '
     test.check_steps.append(rdict)
     rdict2 = TrigInDetdictStep('TrigInDetDict2')
-    rdict2.args='TIDAdata-run3.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
+    rdict2.args='TIDAdata-run3-offline.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
     test.check_steps.append(rdict2)
 
  
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_bphys_mt.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_bphys_mt.py
index 452c86cd0948ff32786a846ac39220e80bc63252..899cff53906cfedd6f975e8439f92101caf323aa 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_bphys_mt.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_bphys_mt.py
@@ -74,7 +74,7 @@ if ((not exclude) or postproc ):
     rdict.args='TIDAdata-run3.dat -f data-hists.root -p 13 -b Test_bin.dat '
     test.check_steps.append(rdict)
     rdict2 = TrigInDetdictStep('TrigInDetDict2')
-    rdict2.args='TIDAdata-run3.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
+    rdict2.args='TIDAdata-run3-offline.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
     test.check_steps.append(rdict2)
 
  
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0.py
index 02befe2d3ef0bd317131ab193fe24454598c6abb..f88401a4f6f90b9b3eb0629e48d31d56d4d0c39e 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0.py
@@ -81,7 +81,7 @@ if ((not exclude) or postproc ):
     rdict.args='TIDAdata-run3.dat -f data-hists.root -p 13 -b Test_bin.dat '
     test.check_steps.append(rdict)
     rdict2 = TrigInDetdictStep('TrigInDetDict2')
-    rdict2.args='TIDAdata-run3.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
+    rdict2.args='TIDAdata-run3-offline.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
     test.check_steps.append(rdict2)
 
  
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0_mt.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0_mt.py
index 33a704cb5aac1072d1edf3d1aad58ef28dc84d80..ff730d9aa732f5b44d728456c3051315a4f2bc51 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0_mt.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0_mt.py
@@ -81,7 +81,7 @@ if ((not exclude) or postproc ):
     rdict.args='TIDAdata-run3.dat -f data-hists.root -p 13 -b Test_bin.dat '
     test.check_steps.append(rdict)
     rdict2 = TrigInDetdictStep('TrigInDetDict2')
-    rdict2.args='TIDAdata-run3.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
+    rdict2.args='TIDAdata-run3-offline.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
     test.check_steps.append(rdict2)
 
  
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
index 9a64a0be59e26a94c3d5f7457a1436813f23dc08..e9b5f086437ade4d571281558db930a61f3b5f79 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0_pu.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0_pu.py
@@ -81,7 +81,7 @@ if ((not exclude) or postproc ):
     rdict.args='TIDAdata-run3.dat -f data-hists.root -p 13 -b Test_bin.dat '
     test.check_steps.append(rdict)
     rdict2 = TrigInDetdictStep('TrigInDetDict2')
-    rdict2.args='TIDAdata-run3.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
+    rdict2.args='TIDAdata-run3-offline.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
     test.check_steps.append(rdict2)
 
  
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0_pu_mt.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0_pu_mt.py
index 4c8958edb38f184407da0acea064b07baa7363dc..bd05f49197d38b0861d6f6bc53992268447c807c 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0_pu_mt.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0_pu_mt.py
@@ -81,7 +81,7 @@ if ((not exclude) or postproc ):
     rdict.args='TIDAdata-run3.dat -f data-hists.root -p 13 -b Test_bin.dat '
     test.check_steps.append(rdict)
     rdict2 = TrigInDetdictStep('TrigInDetDict2')
-    rdict2.args='TIDAdata-run3.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
+    rdict2.args='TIDAdata-run3-offline.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
     test.check_steps.append(rdict2)
 
  
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 5c253a98bd12a98cf1f1dc5ac7bf5c9d53a8103a..202d49a31921ce55acebc89c5f5e5ef59aded857 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_zmumu_pu40.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_zmumu_pu40.py
@@ -81,7 +81,7 @@ if ((not exclude) or postproc ):
     rdict.args='TIDAdata-run3.dat -f data-hists.root -p 13 -b Test_bin.dat '
     test.check_steps.append(rdict)
     rdict2 = TrigInDetdictStep('TrigInDetDict2')
-    rdict2.args='TIDAdata-run3.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
+    rdict2.args='TIDAdata-run3-offline.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
     test.check_steps.append(rdict2)
 
  
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_zmumu_pu40_mt.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_zmumu_pu40_mt.py
index bf5914208cee1236c5cdb717623cfc3f0bec7b70..b3886bb083bbde1f243756823b8950b0002e6f5c 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_zmumu_pu40_mt.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_zmumu_pu40_mt.py
@@ -81,7 +81,7 @@ if ((not exclude) or postproc ):
     rdict.args='TIDAdata-run3.dat -f data-hists.root -p 13 -b Test_bin.dat '
     test.check_steps.append(rdict)
     rdict2 = TrigInDetdictStep('TrigInDetDict2')
-    rdict2.args='TIDAdata-run3.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
+    rdict2.args='TIDAdata-run3-offline.dat -r Offline  -f data-hists-offline.root -b Test_bin.dat '
     test.check_steps.append(rdict2)
 
  
diff --git a/Trigger/TrigValidation/TrigValTools/bin/check_log.py b/Trigger/TrigValidation/TrigValTools/bin/check_log.py
index 75e21bf84d8bbbe2ced1d34782396805173a55e5..7d720c44e5a88ee0a3b527e7098309b3c64ea5f2 100755
--- a/Trigger/TrigValidation/TrigValTools/bin/check_log.py
+++ b/Trigger/TrigValidation/TrigValTools/bin/check_log.py
@@ -6,7 +6,6 @@ import re
 import argparse
 import sys
 import os
-import six
 
 desc = 'Tool to check for error messages in a log file. By default ERROR, FATAL \
   and CRITICAL messages are considered. The config file may be used to \
@@ -131,8 +130,7 @@ def scanLogfile():
     msgLevels = re.compile('|'.join(pattern))
     igLevels = re.compile('|'.join(ignorePattern))
     logFileAddress = args.logfile
-    encargs = {} if six.PY2 else {'encoding' : 'utf-8'}
-    with open(logFileAddress,'r',**encargs) as logFile:
+    with open(logFileAddress,'r', encoding='utf-8') as logFile:
         tracing = False
         for line in logFile:
             #Tracing only makes sense for errors
diff --git a/Trigger/TrigValidation/TrigValTools/bin/messageCounter.py b/Trigger/TrigValidation/TrigValTools/bin/messageCounter.py
index 44148ce9c9ce665e281d299c014c2df1892bc808..69a28999024bcb9ce2c4889bd0eafd97f2d001cf 100755
--- a/Trigger/TrigValidation/TrigValTools/bin/messageCounter.py
+++ b/Trigger/TrigValidation/TrigValTools/bin/messageCounter.py
@@ -16,7 +16,6 @@ import logging
 import argparse
 import json
 from collections import OrderedDict
-import six
 
 
 default_ignore_patterns = [
@@ -106,11 +105,11 @@ def make_summary(result):
 
 def print_result(summary, full_result, print_messages=False):
     summary_str = 'Found the following number of messages:\n'
-    for p, n in six.iteritems(summary):
+    for p, n in summary.items():
         summary_str += '{:8d} {:s} messages\n'.format(n, p)
     logging.info(summary_str)
     if print_messages:
-        for p, lines in six.iteritems(full_result):
+        for p, lines in full_result.items():
             logging.info('##### The following %s messages were found #####', p)
             for line in lines:
                 print(line, end='')  # noqa: ATL901
@@ -144,8 +143,7 @@ def main():
             logging.error('Cannot open file %s, skipping', fname)
             continue
         logging.info('Analysing file %s', fname)
-        encargs = {} if six.PY2 else {'encoding' : 'utf-8'}
-        with open(fname, **encargs) as f:
+        with open(fname, encoding='utf-8') as f:
             messages = extract_messages(f, start, end, ignore)
         summary = make_summary(messages)
         print_result(summary, messages, args.printMessages)
diff --git a/Trigger/TrigValidation/TrigValTools/bin/runTrigART.py b/Trigger/TrigValidation/TrigValTools/bin/runTrigART.py
index 69b6d38dfc0ddacc169cb07ce6924a675eef4cad..fccc693b67e13d76dc5610c3f6b24ea91da60233 100755
--- a/Trigger/TrigValidation/TrigValTools/bin/runTrigART.py
+++ b/Trigger/TrigValidation/TrigValTools/bin/runTrigART.py
@@ -10,14 +10,13 @@ import argparse
 import shutil
 import subprocess
 import json
-import six
 from TrigValTools.TrigARTUtils import package_prefix, find_scripts, remember_cwd
 
 
 def minimal_pattern(package):
     dict = {'TriggerTest':      '(test_trig_data_v1Dev_build|test_trig_data_newJO_build)',
             'TrigP1Test':       'test_trigP1_v1Dev_build',
-            'TrigAnalysisTest': 'test_trigAna_RDOtoRDOTrig_mt1_build'}
+            'TrigAnalysisTest': 'test_trigAna_RDOtoRDOTrig_v1Dev_build'}
     if package == 'ALL':
         return '({})'.format('|'.join([v for v in dict.values() if v]))
     elif package in dict and dict[package] is not None:
@@ -121,7 +120,7 @@ def analyse_results(all_test_results):
     max_len_col1 = len(max(table.keys(), key=len))
     max_len_col2 = len(max(table.values(), key=len))
     logging.info('-'*(max_len_col1+max_len_col2+7))
-    for k, v in six.iteritems(table):
+    for k, v in table.items():
         logging.info('| {col1:<{width1}} | {col2:<{width2}} |'.format(
             col1=k, width1=max_len_col1,
             col2=v, width2=max_len_col2))
diff --git a/Trigger/TrigValidation/TrigValTools/bin/runTrigCI.py b/Trigger/TrigValidation/TrigValTools/bin/runTrigCI.py
index ddb93bbcdbb2b3019d5ff6928e561bd0280b8b9a..fb8ac6167d20df45fcd419abe76ac9fe8120f04c 100755
--- a/Trigger/TrigValidation/TrigValTools/bin/runTrigCI.py
+++ b/Trigger/TrigValidation/TrigValTools/bin/runTrigCI.py
@@ -11,7 +11,6 @@ import logging
 import argparse
 import subprocess
 import errno
-from six import iteritems
 from collections import OrderedDict
 from TrigValTools.TrigARTUtils import find_scripts, remember_cwd
 
@@ -117,7 +116,7 @@ def main():
     logging.info('RESULTS SUMMARY:')
     logging.info('='*(max_name_len+11))
     final_code = 0
-    for script, result in iteritems(results):
+    for script, result in results.items():
         logging.info('| %s : %4d |', '{:{width}s}'.format(script, width=max_name_len), result)
         if abs(result) > final_code:
             final_code = abs(result)
diff --git a/Trigger/TrigValidation/TrigValTools/bin/trig-test-json.py b/Trigger/TrigValidation/TrigValTools/bin/trig-test-json.py
index ec1b3e6a85313113f6f696db573deac1a496b1f5..75d2d79cd4d01efacde122a59727ddf76d19e0fe 100755
--- a/Trigger/TrigValidation/TrigValTools/bin/trig-test-json.py
+++ b/Trigger/TrigValidation/TrigValTools/bin/trig-test-json.py
@@ -12,7 +12,6 @@ import re
 import sys
 import logging
 import os
-import six
 from collections import OrderedDict
 from TrigValTools.TrigARTUtils import first_existing_file, newest_file
 
@@ -84,7 +83,7 @@ def convert_to_megabytes(number, unit):
         "GB": 1024,
         'TB': 1024**2
     }
-    for unit_name, mult in six.iteritems(multipliers):
+    for unit_name, mult in multipliers.items():
         if unit_name == unit:
             return float(number)*mult
     logging.error("Unit conversion failed from {} to MB".format(unit))
diff --git a/Trigger/TrigValidation/TrigValTools/python/TrigValSteering/CheckSteps.py b/Trigger/TrigValidation/TrigValTools/python/TrigValSteering/CheckSteps.py
index 4b7b19a736ec2ec48eee83706294181cede99f10..02b2a8137303e2300a5933fc0e1a72854abb3a60 100644
--- a/Trigger/TrigValidation/TrigValTools/python/TrigValSteering/CheckSteps.py
+++ b/Trigger/TrigValidation/TrigValTools/python/TrigValSteering/CheckSteps.py
@@ -10,7 +10,6 @@ import os
 import re
 import subprocess
 import json
-import six
 import glob
 
 from TrigValTools.TrigValSteering.Step import Step, get_step_from_list
@@ -147,9 +146,8 @@ class LogMergeStep(Step):
                 self.log_files.append(f)
 
     def merge_logs(self):
-        encargs = {} if six.PY2 else {'encoding' : 'utf-8'}
         try:
-            with open(self.merged_name, 'w', **encargs) as merged_file:
+            with open(self.merged_name, 'w', encoding='utf-8') as merged_file:
                 for log_name in self.log_files:
                     if not os.path.isfile(log_name):
                         if self.warn_if_missing:
@@ -157,7 +155,7 @@ class LogMergeStep(Step):
                             merged_file.write(
                                 '### WARNING Missing {} ###\n'.format(log_name))
                         continue
-                    with open(log_name, **encargs) as log_file:
+                    with open(log_name, encoding='utf-8') as log_file:
                         merged_file.write('### {} ###\n'.format(log_name))
                         for line in log_file:
                             merged_file.write(line)
@@ -305,11 +303,10 @@ class RegTestStep(RefComparisonStep):
         if not os.path.isfile(log_file):
             self.log.error('%s input file %s is missing', self.name, log_file)
             return False
-        encargs = {} if six.PY2 else {'encoding' : 'utf-8'}
-        with open(log_file, **encargs) as f_in:
+        with open(log_file, encoding='utf-8') as f_in:
             matches = re.findall('({}.*).*$'.format(self.regex),
                                  f_in.read(), re.MULTILINE)
-            with open(self.input_file, 'w', **encargs) as f_out:
+            with open(self.input_file, 'w', encoding='utf-8') as f_out:
                 for line in matches:
                     linestr = str(line[0]) if type(line) is tuple else line
                     f_out.write(linestr+'\n')
@@ -563,8 +560,7 @@ class ZeroCountsStep(Step):
                 self.name, input_file)
             return -1
         lines_checked = 0
-        encargs = {} if six.PY2 else {'encoding' : 'utf-8'}
-        with open(input_file, **encargs) as f_in:
+        with open(input_file, encoding='utf-8') as f_in:
             for line in f_in.readlines():
                 split_line = line.split()
                 lines_checked += 1
@@ -648,7 +644,7 @@ class MessageCountStep(Step):
                 self.log.warning('%s cannot open file %s', self.name, json_file)
             with open(json_file) as f:
                 summary = json.load(f)
-                for level, threshold in six.iteritems(self.thresholds):
+                for level, threshold in self.thresholds.items():
                     if summary[level] > threshold:
                         self.result += 1
                         self.log.info(
diff --git a/Trigger/TrigValidation/TrigValTools/python/TrigValSteering/Step.py b/Trigger/TrigValidation/TrigValTools/python/TrigValSteering/Step.py
index 58bcaf906843d30d39bef4365ec1a50ee7984bb9..bdb5bf6a2f78a960fb8e9079ea2a154447dce482 100644
--- a/Trigger/TrigValidation/TrigValTools/python/TrigValSteering/Step.py
+++ b/Trigger/TrigValidation/TrigValTools/python/TrigValSteering/Step.py
@@ -12,6 +12,7 @@ import signal
 import subprocess
 import time
 import re
+import psutil
 from enum import Enum
 from threading import Timer
 from TrigValTools.TrigValSteering.Common import get_logger, art_result, running_in_CI
@@ -86,24 +87,24 @@ class Step(object):
         where the first is filled with the backtrace by this function
         (it has to be a list to be mutable).
         '''
-        # Produce backtrace for the parent and all children
-
         try:
-            import psutil
+            # Produce backtrace for the parent and all children
             parent = psutil.Process(pid)
             backtrace = ''
             for proc in [parent] + parent.children(recursive=True):
                 backtrace += '\nTraceback for {} PID {}:\n'.format(proc.name(), proc.pid)
                 backtrace += subprocess.check_output('$ROOTSYS/etc/gdb-backtrace.sh {}'.format(proc.pid),
-                                                     stderr=subprocess.STDOUT, shell=True)
-        except ImportError:
-            # psutil is missing in LCG_96 python3
-            backtrace = 'psutil not available; no backtrace generated'
+                                                        stderr=subprocess.STDOUT, shell=True).decode('utf-8')
+            backtrace_list[0] = backtrace
 
-        backtrace_list[0] = backtrace
+            # Kill the process
+            os.killpg(pid, signal)
 
-        # Kill the process
-        os.killpg(pid, signal)
+        except Exception as e:
+            # This may happen e.g. if one of the processes finishes before we generate backtrace
+            msg = 'Caught exception while generating backtrace: ' + str(e)
+            backtrace_list[0] = msg
+            self.log.error(msg)
 
     def __execute_with_timeout(self, cmd, timeout_sec):
         '''
diff --git a/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref b/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref
index 0b92e9e37a2251423ca76fd46df831e5eaa5e6cb..6047fbdf7596761b5d0a124fe3282a0508a31f0a 100644
--- a/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref
+++ b/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref
@@ -1,3 +1,6 @@
+TrigSignatureMoniMT                                 INFO HLT_2e12_lhloose_mu10_L12EM8VH_MU10 #2518246928
+TrigSignatureMoniMT                                 INFO -- #2518246928 Events         20         20         0          0          0          0          0          0          0          0          -          -          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #2518246928 Features                             0          0          0          0          0          0          0          0          -          -          -          -          
 TrigSignatureMoniMT                                 INFO HLT_2e17_etcut_L12EM15VH #3136730292
 TrigSignatureMoniMT                                 INFO -- #3136730292 Events         20         20         0          0          0          -          -          -          -          -          -          -          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #3136730292 Features                             0          0          0          -          -          -          -          -          -          -          -          -          
@@ -13,6 +16,9 @@ TrigSignatureMoniMT                                 INFO -- #1796849979 Features
 TrigSignatureMoniMT                                 INFO HLT_2e3_etcut_L12EM3 #2613484113
 TrigSignatureMoniMT                                 INFO -- #2613484113 Events         20         20         13         13         13         -          -          -          -          -          -          -          -          -          13         
 TrigSignatureMoniMT                                 INFO -- #2613484113 Features                             92         324        178        -          -          -          -          -          -          -          -          -          
+TrigSignatureMoniMT                                 INFO HLT_2g10_loose_mu20_L1MU20 #3765708828
+TrigSignatureMoniMT                                 INFO -- #3765708828 Events         20         20         0          0          0          0          0          0          0          0          -          -          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #3765708828 Features                             0          0          0          0          0          0          0          0          -          -          -          -          
 TrigSignatureMoniMT                                 INFO HLT_2g20_tight_L12EM15VH #3837353071
 TrigSignatureMoniMT                                 INFO -- #3837353071 Events         20         20         0          0          0          0          -          -          -          -          -          -          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #3837353071 Features                             0          0          0          0          -          -          -          -          -          -          -          -          
@@ -31,12 +37,21 @@ TrigSignatureMoniMT                                 INFO -- #3965466087 Features
 TrigSignatureMoniMT                                 INFO HLT_2g50_loose_L12EM20VH #3590373854
 TrigSignatureMoniMT                                 INFO -- #3590373854 Events         20         20         0          0          0          0          -          -          -          -          -          -          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #3590373854 Features                             0          0          0          0          -          -          -          -          -          -          -          -          
+TrigSignatureMoniMT                                 INFO HLT_2j330_a10sd_csskpf_jes_ftf_35smcINF_L1J100 #3495282139
+TrigSignatureMoniMT                                 INFO -- #3495282139 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #3495282139 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
+TrigSignatureMoniMT                                 INFO HLT_2j330_a10sd_csskpf_nojcalib_ftf_35smcINF_L1J100 #2680976232
+TrigSignatureMoniMT                                 INFO -- #2680976232 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #2680976232 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_2j330_a10t_lcw_jes_35smcINF_L1J100 #1295975955
-TrigSignatureMoniMT                                 INFO -- #1295975955 Events         20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #1295975955 Features                             0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO -- #1295975955 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #1295975955 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
+TrigSignatureMoniMT                                 INFO HLT_2j330_a10t_lcw_nojcalib_35smcINF_L1J100 #891415013
+TrigSignatureMoniMT                                 INFO -- #891415013 Events          20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #891415013 Features                              0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_2j60_L1J15 #927735533
-TrigSignatureMoniMT                                 INFO -- #927735533 Events          20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #927735533 Features                              0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO -- #927735533 Events          20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #927735533 Features                              0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_2mu10_bJpsimumu_L12MU10 #3498558358
 TrigSignatureMoniMT                                 INFO -- #3498558358 Events         20         20         0          0          0          0          0          0          0          0          -          -          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #3498558358 Features                             0          0          0          0          0          0          0          0          -          -          -          -          
@@ -80,11 +95,11 @@ TrigSignatureMoniMT                                 INFO HLT_2mu6_muonqual_L12MU
 TrigSignatureMoniMT                                 INFO -- #2398136098 Events         20         20         0          0          0          0          0          0          0          0          -          -          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #2398136098 Features                             0          0          0          0          0          0          0          0          -          -          -          -          
 TrigSignatureMoniMT                                 INFO HLT_3j200_L1J100 #2199422919
-TrigSignatureMoniMT                                 INFO -- #2199422919 Events         20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #2199422919 Features                             0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO -- #2199422919 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #2199422919 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_3j200_L1J20 #493765146
-TrigSignatureMoniMT                                 INFO -- #493765146 Events          20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #493765146 Features                              0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO -- #493765146 Events          20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #493765146 Features                              0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_3mu6_L13MU6 #1832399408
 TrigSignatureMoniMT                                 INFO -- #1832399408 Events         20         20         0          0          0          0          0          0          0          0          -          -          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #1832399408 Features                             0          0          0          0          0          0          0          0          -          -          -          -          
@@ -98,8 +113,11 @@ TrigSignatureMoniMT                                 INFO HLT_4mu4_L14MU4 #183438
 TrigSignatureMoniMT                                 INFO -- #1834383636 Events         20         20         0          0          0          0          0          0          0          0          -          -          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #1834383636 Features                             0          0          0          0          0          0          0          0          -          -          -          -          
 TrigSignatureMoniMT                                 INFO HLT_5j70_0eta240_L14J20 #1175391812
-TrigSignatureMoniMT                                 INFO -- #1175391812 Events         20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #1175391812 Features                             0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO -- #1175391812 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #1175391812 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
+TrigSignatureMoniMT                                 INFO HLT_alfacalib_AlfaPEB_L1ALFA_ANY #4094852824
+TrigSignatureMoniMT                                 INFO -- #4094852824 Events         20         20         20         -          -          -          -          -          -          -          -          -          -          -          20         
+TrigSignatureMoniMT                                 INFO -- #4094852824 Features                             20         -          -          -          -          -          -          -          -          -          -          -          
 TrigSignatureMoniMT                                 INFO HLT_beamspot_allTE_trkfast_BeamSpotPEB_L1J15 #3989372080
 TrigSignatureMoniMT                                 INFO -- #3989372080 Events         20         20         20         20         -          -          -          -          -          -          -          -          -          -          20         
 TrigSignatureMoniMT                                 INFO -- #3989372080 Features                             20         20         -          -          -          -          -          -          -          -          -          -          
@@ -112,6 +130,9 @@ TrigSignatureMoniMT                                 INFO -- #843341480 Features
 TrigSignatureMoniMT                                 INFO HLT_cscmon_L1All #1000936179
 TrigSignatureMoniMT                                 INFO -- #1000936179 Events         20         20         -          -          -          -          -          -          -          -          -          -          -          -          20         
 TrigSignatureMoniMT                                 INFO -- #1000936179 Features                             -          -          -          -          -          -          -          -          -          -          -          -          
+TrigSignatureMoniMT                                 INFO HLT_e12_lhloose_2mu10_L12MU10 #4167710884
+TrigSignatureMoniMT                                 INFO -- #4167710884 Events         20         20         0          0          0          0          0          0          0          0          -          -          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #4167710884 Features                             0          0          0          0          0          0          0          0          -          -          -          -          
 TrigSignatureMoniMT                                 INFO HLT_e140_lhloose_L1EM22VHI #3471067710
 TrigSignatureMoniMT                                 INFO -- #3471067710 Events         20         20         0          0          0          0          -          -          -          -          -          -          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #3471067710 Features                             0          0          0          0          -          -          -          -          -          -          -          -          
@@ -127,6 +148,12 @@ TrigSignatureMoniMT                                 INFO -- #140779220 Features
 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_e24_lhmedium_2g12_loose_L1EM20VH_3EM10VH #2668628593
+TrigSignatureMoniMT                                 INFO -- #2668628593 Events         20         20         0          0          0          0          -          -          -          -          -          -          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #2668628593 Features                             0          0          0          0          -          -          -          -          -          -          -          -          
+TrigSignatureMoniMT                                 INFO HLT_e24_lhmedium_g25_medium_L12EM20VH #2785977835
+TrigSignatureMoniMT                                 INFO -- #2785977835 Events         20         20         0          0          0          0          -          -          -          -          -          -          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #2785977835 Features                             0          0          0          0          -          -          -          -          -          -          -          -          
 TrigSignatureMoniMT                                 INFO HLT_e24_lhvloose_2e12_lhvloose_L1EM20VH_3EM10VH #9348946
 TrigSignatureMoniMT                                 INFO -- #9348946 Events            20         20         0          0          0          0          -          -          -          -          -          -          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #9348946 Features                                0          0          0          0          -          -          -          -          -          -          -          -          
@@ -220,6 +247,9 @@ TrigSignatureMoniMT                                 INFO -- #3370790749 Features
 TrigSignatureMoniMT                                 INFO HLT_g300_etcut_L1EM22VHI #310189774
 TrigSignatureMoniMT                                 INFO -- #310189774 Events          20         20         0          0          0          -          -          -          -          -          -          -          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #310189774 Features                              0          0          0          -          -          -          -          -          -          -          -          -          
+TrigSignatureMoniMT                                 INFO HLT_g35_loose_mu18_L1EM24VHI #3939387897
+TrigSignatureMoniMT                                 INFO -- #3939387897 Events         20         20         0          0          0          0          0          0          0          0          -          -          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #3939387897 Features                             0          0          0          0          0          0          0          0          -          -          -          -          
 TrigSignatureMoniMT                                 INFO HLT_g35_medium_g25_medium_L12EM20VH #1158879722
 TrigSignatureMoniMT                                 INFO -- #1158879722 Events         20         20         0          0          0          0          -          -          -          -          -          -          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #1158879722 Features                             0          0          0          0          -          -          -          -          -          -          -          -          
@@ -239,131 +269,152 @@ TrigSignatureMoniMT                                 INFO HLT_g5_tight_L1EM3 #328
 TrigSignatureMoniMT                                 INFO -- #3280865118 Events         20         20         9          9          9          1          -          -          -          -          -          -          -          -          1          
 TrigSignatureMoniMT                                 INFO -- #3280865118 Features                             13         13         30         1          -          -          -          -          -          -          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j0_perf_L1J12_EMPTY #1341875780
-TrigSignatureMoniMT                                 INFO -- #1341875780 Events         20         20         0          0          0          0          0          0          0          0          0          0          8          -          8          
-TrigSignatureMoniMT                                 INFO -- #1341875780 Features                             0          0          0          0          0          0          0          0          0          0          117        -          
+TrigSignatureMoniMT                                 INFO -- #1341875780 Events         20         20         0          0          0          0          0          0          0          0          0          8          -          -          8          
+TrigSignatureMoniMT                                 INFO -- #1341875780 Features                             0          0          0          0          0          0          0          0          0          117        -          -          
 TrigSignatureMoniMT                                 INFO HLT_j0_vbenfSEP30etSEP34mass35SEP50fbet_L1J20 #4034799151
-TrigSignatureMoniMT                                 INFO -- #4034799151 Events         20         20         0          0          0          0          0          0          0          0          0          0          2          -          2          
-TrigSignatureMoniMT                                 INFO -- #4034799151 Features                             0          0          0          0          0          0          0          0          0          0          24         -          
-TrigSignatureMoniMT                                 INFO HLT_j225_ftf_subjesgscIS_bmv2c1040_split_L1J100 #3992507557
-TrigSignatureMoniMT                                 INFO -- #3992507557 Events         20         20         0          0          0          0          0          0          0          0          0          0          0          0          0          
-TrigSignatureMoniMT                                 INFO -- #3992507557 Features                             0          0          0          0          0          0          0          0          0          0          0          0          
+TrigSignatureMoniMT                                 INFO -- #4034799151 Events         20         20         0          0          0          0          0          0          0          0          0          2          -          -          2          
+TrigSignatureMoniMT                                 INFO -- #4034799151 Features                             0          0          0          0          0          0          0          0          0          24         -          -          
+TrigSignatureMoniMT                                 INFO HLT_j225_subjesgscIS_ftf_bmv2c1040_split_L1J100 #219711753
+TrigSignatureMoniMT                                 INFO -- #219711753 Events          20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
+TrigSignatureMoniMT                                 INFO -- #219711753 Features                              0          0          0          0          0          0          0          0          0          0          0          -          
 TrigSignatureMoniMT                                 INFO HLT_j260_320eta490_L1J20 #3084792704
-TrigSignatureMoniMT                                 INFO -- #3084792704 Events         20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #3084792704 Features                             0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO -- #3084792704 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #3084792704 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j260_320eta490_L1J75_31ETA49 #3769257182
-TrigSignatureMoniMT                                 INFO -- #3769257182 Events         20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #3769257182 Features                             0          0          0          0          0          0          0          0          0          0          0          -          
-TrigSignatureMoniMT                                 INFO HLT_j275_ftf_subjesgscIS_bmv2c1060_split_L1J100 #1211559599
-TrigSignatureMoniMT                                 INFO -- #1211559599 Events         20         20         0          0          0          0          0          0          0          0          0          0          0          0          0          
-TrigSignatureMoniMT                                 INFO -- #1211559599 Features                             0          0          0          0          0          0          0          0          0          0          0          0          
-TrigSignatureMoniMT                                 INFO HLT_j275_ftf_subjesgscIS_boffperf_split_L1J100 #588317894
-TrigSignatureMoniMT                                 INFO -- #588317894 Events          20         20         0          0          0          0          0          0          0          0          0          0          0          0          0          
-TrigSignatureMoniMT                                 INFO -- #588317894 Features                              0          0          0          0          0          0          0          0          0          0          0          0          
-TrigSignatureMoniMT                                 INFO HLT_j300_ftf_subjesgscIS_bmv2c1070_split_L1J100 #3706723666
-TrigSignatureMoniMT                                 INFO -- #3706723666 Events         20         20         0          0          0          0          0          0          0          0          0          0          0          0          0          
-TrigSignatureMoniMT                                 INFO -- #3706723666 Features                             0          0          0          0          0          0          0          0          0          0          0          0          
-TrigSignatureMoniMT                                 INFO HLT_j360_ftf_subjesgscIS_bmv2c1077_split_L1J100 #1837565816
-TrigSignatureMoniMT                                 INFO -- #1837565816 Events         20         20         0          0          0          0          0          0          0          0          0          0          0          0          0          
-TrigSignatureMoniMT                                 INFO -- #1837565816 Features                             0          0          0          0          0          0          0          0          0          0          0          0          
+TrigSignatureMoniMT                                 INFO -- #3769257182 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #3769257182 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
+TrigSignatureMoniMT                                 INFO HLT_j275_subjesgscIS_ftf_bmv2c1060_split_L1J100 #710546402
+TrigSignatureMoniMT                                 INFO -- #710546402 Events          20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
+TrigSignatureMoniMT                                 INFO -- #710546402 Features                              0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO HLT_j275_subjesgscIS_ftf_boffperf_split_L1J100 #540369970
+TrigSignatureMoniMT                                 INFO -- #540369970 Events          20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
+TrigSignatureMoniMT                                 INFO -- #540369970 Features                              0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO HLT_j300_subjesgscIS_ftf_bmv2c1070_split_L1J100 #2074989613
+TrigSignatureMoniMT                                 INFO -- #2074989613 Events         20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
+TrigSignatureMoniMT                                 INFO -- #2074989613 Features                             0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO HLT_j360_subjesgscIS_ftf_bmv2c1077_split_L1J100 #4176355792
+TrigSignatureMoniMT                                 INFO -- #4176355792 Events         20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
+TrigSignatureMoniMT                                 INFO -- #4176355792 Features                             0          0          0          0          0          0          0          0          0          0          0          -          
 TrigSignatureMoniMT                                 INFO HLT_j420_L1J100 #2659902019
-TrigSignatureMoniMT                                 INFO -- #2659902019 Events         20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #2659902019 Features                             0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO -- #2659902019 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #2659902019 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j420_L1J20 #2205518067
-TrigSignatureMoniMT                                 INFO -- #2205518067 Events         20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #2205518067 Features                             0          0          0          0          0          0          0          0          0          0          0          -          
-TrigSignatureMoniMT                                 INFO HLT_j420_ftf_subjesgscIS_L1J20 #4179085188
-TrigSignatureMoniMT                                 INFO -- #4179085188 Events         20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #4179085188 Features                             0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO -- #2205518067 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #2205518067 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
+TrigSignatureMoniMT                                 INFO HLT_j420_subjesgscIS_ftf_L1J20 #2116995085
+TrigSignatureMoniMT                                 INFO -- #2116995085 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #2116995085 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j45_L1J15 #1364976160
-TrigSignatureMoniMT                                 INFO -- #1364976160 Events         20         20         0          0          0          0          0          0          0          0          0          0          6          -          6          
-TrigSignatureMoniMT                                 INFO -- #1364976160 Features                             0          0          0          0          0          0          0          0          0          0          6          -          
+TrigSignatureMoniMT                                 INFO -- #1364976160 Events         20         20         0          0          0          0          0          0          0          0          0          6          -          -          6          
+TrigSignatureMoniMT                                 INFO -- #1364976160 Features                             0          0          0          0          0          0          0          0          0          6          -          -          
+TrigSignatureMoniMT                                 INFO HLT_j45_csskpf_nojcalib_ftf_L1J20 #2528888897
+TrigSignatureMoniMT                                 INFO -- #2528888897 Events         20         20         0          0          0          0          0          0          0          0          0          3          -          -          3          
+TrigSignatureMoniMT                                 INFO -- #2528888897 Features                             0          0          0          0          0          0          0          0          0          3          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j45_cssktc_nojcalib_L1J20 #3295122398
-TrigSignatureMoniMT                                 INFO -- #3295122398 Events         20         20         0          0          0          0          0          0          0          0          0          0          3          -          3          
-TrigSignatureMoniMT                                 INFO -- #3295122398 Features                             0          0          0          0          0          0          0          0          0          0          3          -          
+TrigSignatureMoniMT                                 INFO -- #3295122398 Events         20         20         0          0          0          0          0          0          0          0          0          3          -          -          3          
+TrigSignatureMoniMT                                 INFO -- #3295122398 Features                             0          0          0          0          0          0          0          0          0          3          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j45_ftf_L1J15 #868405538
-TrigSignatureMoniMT                                 INFO -- #868405538 Events          20         20         0          0          0          0          0          0          0          0          0          0          6          -          6          
-TrigSignatureMoniMT                                 INFO -- #868405538 Features                              0          0          0          0          0          0          0          0          0          0          6          -          
-TrigSignatureMoniMT                                 INFO HLT_j45_ftf_csskpf_nojcalib_L1J20 #3533281867
-TrigSignatureMoniMT                                 INFO -- #3533281867 Events         20         20         0          0          0          0          0          0          0          0          0          0          3          -          3          
-TrigSignatureMoniMT                                 INFO -- #3533281867 Features                             0          0          0          0          0          0          0          0          0          0          3          -          
-TrigSignatureMoniMT                                 INFO HLT_j45_ftf_pf_L1J20 #1335156103
-TrigSignatureMoniMT                                 INFO -- #1335156103 Events         20         20         0          0          0          0          0          0          0          0          0          0          3          -          3          
-TrigSignatureMoniMT                                 INFO -- #1335156103 Features                             0          0          0          0          0          0          0          0          0          0          3          -          
-TrigSignatureMoniMT                                 INFO HLT_j45_ftf_pf_nojcalib_L1J20 #3658890913
-TrigSignatureMoniMT                                 INFO -- #3658890913 Events         20         20         0          0          0          0          0          0          0          0          0          0          3          -          3          
-TrigSignatureMoniMT                                 INFO -- #3658890913 Features                             0          0          0          0          0          0          0          0          0          0          3          -          
-TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subjesgscIS_011jvt_L1J15 #2857031468
-TrigSignatureMoniMT                                 INFO -- #2857031468 Events         20         20         0          0          0          0          0          0          0          0          0          0          3          -          3          
-TrigSignatureMoniMT                                 INFO -- #2857031468 Features                             0          0          0          0          0          0          0          0          0          0          3          -          
-TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subjesgscIS_015jvt_L1J15 #2938374624
-TrigSignatureMoniMT                                 INFO -- #2938374624 Events         20         20         0          0          0          0          0          0          0          0          0          0          3          -          3          
-TrigSignatureMoniMT                                 INFO -- #2938374624 Features                             0          0          0          0          0          0          0          0          0          0          3          -          
-TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subjesgscIS_059jvt_L1J15 #1593009344
-TrigSignatureMoniMT                                 INFO -- #1593009344 Events         20         20         0          0          0          0          0          0          0          0          0          0          3          -          3          
-TrigSignatureMoniMT                                 INFO -- #1593009344 Features                             0          0          0          0          0          0          0          0          0          0          3          -          
-TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subjesgscIS_L1J15 #3341539267
-TrigSignatureMoniMT                                 INFO -- #3341539267 Events         20         20         0          0          0          0          0          0          0          0          0          0          7          -          7          
-TrigSignatureMoniMT                                 INFO -- #3341539267 Features                             0          0          0          0          0          0          0          0          0          0          7          -          
-TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subjesgscIS_bmv2c1070_split_L1J20 #991419339
-TrigSignatureMoniMT                                 INFO -- #991419339 Events          20         20         0          0          0          0          0          0          0          0          0          0          5          1          1          
-TrigSignatureMoniMT                                 INFO -- #991419339 Features                              0          0          0          0          0          0          0          0          0          0          5          1          
-TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subjesgscIS_boffperf_split_L1J20 #1961149049
-TrigSignatureMoniMT                                 INFO -- #1961149049 Events         20         20         0          0          0          0          0          0          0          0          0          0          5          5          5          
-TrigSignatureMoniMT                                 INFO -- #1961149049 Features                             0          0          0          0          0          0          0          0          0          0          5          5          
-TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subjesgscIS_pf_L1J20 #761060030
-TrigSignatureMoniMT                                 INFO -- #761060030 Events          20         20         0          0          0          0          0          0          0          0          0          0          3          -          3          
-TrigSignatureMoniMT                                 INFO -- #761060030 Features                              0          0          0          0          0          0          0          0          0          0          3          -          
-TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subresjesgscIS_L1J15 #1509925407
-TrigSignatureMoniMT                                 INFO -- #1509925407 Events         20         20         0          0          0          0          0          0          0          0          0          0          7          -          7          
-TrigSignatureMoniMT                                 INFO -- #1509925407 Features                             0          0          0          0          0          0          0          0          0          0          7          -          
-TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subresjesgscIS_pf_L1J20 #4012311417
-TrigSignatureMoniMT                                 INFO -- #4012311417 Events         20         20         0          0          0          0          0          0          0          0          0          0          3          -          3          
-TrigSignatureMoniMT                                 INFO -- #4012311417 Features                             0          0          0          0          0          0          0          0          0          0          3          -          
+TrigSignatureMoniMT                                 INFO -- #868405538 Events          20         20         0          0          0          0          0          0          0          0          0          6          -          -          6          
+TrigSignatureMoniMT                                 INFO -- #868405538 Features                              0          0          0          0          0          0          0          0          0          6          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j45_nojcalib_L1J20 #2042444294
-TrigSignatureMoniMT                                 INFO -- #2042444294 Events         20         20         0          0          0          0          0          0          0          0          0          0          3          -          3          
-TrigSignatureMoniMT                                 INFO -- #2042444294 Features                             0          0          0          0          0          0          0          0          0          0          3          -          
+TrigSignatureMoniMT                                 INFO -- #2042444294 Events         20         20         0          0          0          0          0          0          0          0          0          3          -          -          3          
+TrigSignatureMoniMT                                 INFO -- #2042444294 Features                             0          0          0          0          0          0          0          0          0          3          -          -          
+TrigSignatureMoniMT                                 INFO HLT_j45_pf_ftf_L1J20 #3679554988
+TrigSignatureMoniMT                                 INFO -- #3679554988 Events         20         20         0          0          0          0          0          0          0          0          0          3          -          -          3          
+TrigSignatureMoniMT                                 INFO -- #3679554988 Features                             0          0          0          0          0          0          0          0          0          3          -          -          
+TrigSignatureMoniMT                                 INFO HLT_j45_pf_nojcalib_ftf_L1J20 #4202219904
+TrigSignatureMoniMT                                 INFO -- #4202219904 Events         20         20         0          0          0          0          0          0          0          0          0          3          -          -          3          
+TrigSignatureMoniMT                                 INFO -- #4202219904 Features                             0          0          0          0          0          0          0          0          0          3          -          -          
+TrigSignatureMoniMT                                 INFO HLT_j45_pf_subjesgscIS_ftf_L1J20 #2187173741
+TrigSignatureMoniMT                                 INFO -- #2187173741 Events         20         20         0          0          0          0          0          0          0          0          0          3          -          -          3          
+TrigSignatureMoniMT                                 INFO -- #2187173741 Features                             0          0          0          0          0          0          0          0          0          3          -          -          
+TrigSignatureMoniMT                                 INFO HLT_j45_pf_subresjesgscIS_ftf_L1J20 #3567642453
+TrigSignatureMoniMT                                 INFO -- #3567642453 Events         20         20         0          0          0          0          0          0          0          0          0          3          -          -          3          
+TrigSignatureMoniMT                                 INFO -- #3567642453 Features                             0          0          0          0          0          0          0          0          0          3          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j45_sktc_nojcalib_L1J20 #1542468090
-TrigSignatureMoniMT                                 INFO -- #1542468090 Events         20         20         0          0          0          0          0          0          0          0          0          0          3          -          3          
-TrigSignatureMoniMT                                 INFO -- #1542468090 Features                             0          0          0          0          0          0          0          0          0          0          3          -          
+TrigSignatureMoniMT                                 INFO -- #1542468090 Events         20         20         0          0          0          0          0          0          0          0          0          3          -          -          3          
+TrigSignatureMoniMT                                 INFO -- #1542468090 Features                             0          0          0          0          0          0          0          0          0          3          -          -          
+TrigSignatureMoniMT                                 INFO HLT_j45_subjesgscIS_ftf_011jvt_L1J15 #266323220
+TrigSignatureMoniMT                                 INFO -- #266323220 Events          20         20         0          0          0          0          0          0          0          0          0          3          -          -          3          
+TrigSignatureMoniMT                                 INFO -- #266323220 Features                              0          0          0          0          0          0          0          0          0          3          -          -          
+TrigSignatureMoniMT                                 INFO HLT_j45_subjesgscIS_ftf_015jvt_L1J15 #3102941497
+TrigSignatureMoniMT                                 INFO -- #3102941497 Events         20         20         0          0          0          0          0          0          0          0          0          3          -          -          3          
+TrigSignatureMoniMT                                 INFO -- #3102941497 Features                             0          0          0          0          0          0          0          0          0          3          -          -          
+TrigSignatureMoniMT                                 INFO HLT_j45_subjesgscIS_ftf_059jvt_L1J15 #2237035634
+TrigSignatureMoniMT                                 INFO -- #2237035634 Events         20         20         0          0          0          0          0          0          0          0          0          3          -          -          3          
+TrigSignatureMoniMT                                 INFO -- #2237035634 Features                             0          0          0          0          0          0          0          0          0          3          -          -          
+TrigSignatureMoniMT                                 INFO HLT_j45_subjesgscIS_ftf_L1J15 #1960278431
+TrigSignatureMoniMT                                 INFO -- #1960278431 Events         20         20         0          0          0          0          0          0          0          0          0          7          -          -          7          
+TrigSignatureMoniMT                                 INFO -- #1960278431 Features                             0          0          0          0          0          0          0          0          0          7          -          -          
+TrigSignatureMoniMT                                 INFO HLT_j45_subjesgscIS_ftf_bmv2c1070_split_L1J20 #980453000
+TrigSignatureMoniMT                                 INFO -- #980453000 Events          20         20         0          0          0          0          0          0          0          0          0          5          1          -          1          
+TrigSignatureMoniMT                                 INFO -- #980453000 Features                              0          0          0          0          0          0          0          0          0          5          1          -          
+TrigSignatureMoniMT                                 INFO HLT_j45_subjesgscIS_ftf_boffperf_split_L1J20 #3374916154
+TrigSignatureMoniMT                                 INFO -- #3374916154 Events         20         20         0          0          0          0          0          0          0          0          0          5          5          -          5          
+TrigSignatureMoniMT                                 INFO -- #3374916154 Features                             0          0          0          0          0          0          0          0          0          5          5          -          
+TrigSignatureMoniMT                                 INFO HLT_j45_subresjesgscIS_ftf_L1J15 #1213239619
+TrigSignatureMoniMT                                 INFO -- #1213239619 Events         20         20         0          0          0          0          0          0          0          0          0          7          -          -          7          
+TrigSignatureMoniMT                                 INFO -- #1213239619 Features                             0          0          0          0          0          0          0          0          0          7          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j460_a10_lcw_subjes_L1J100 #3327656707
-TrigSignatureMoniMT                                 INFO -- #3327656707 Events         20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #3327656707 Features                             0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO -- #3327656707 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #3327656707 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j460_a10_lcw_subjes_L1J20 #215408633
-TrigSignatureMoniMT                                 INFO -- #215408633 Events          20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #215408633 Features                              0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO -- #215408633 Events          20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #215408633 Features                              0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j460_a10r_L1J100 #1151767619
-TrigSignatureMoniMT                                 INFO -- #1151767619 Events         20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #1151767619 Features                             0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO -- #1151767619 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #1151767619 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j460_a10r_L1J20 #3875082669
-TrigSignatureMoniMT                                 INFO -- #3875082669 Events         20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #3875082669 Features                             0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO -- #3875082669 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #3875082669 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
+TrigSignatureMoniMT                                 INFO HLT_j460_a10sd_csskpf_jes_ftf_35smcINF_L1J100 #3781128663
+TrigSignatureMoniMT                                 INFO -- #3781128663 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #3781128663 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
+TrigSignatureMoniMT                                 INFO HLT_j460_a10sd_csskpf_jes_ftf_L1J100 #1509950051
+TrigSignatureMoniMT                                 INFO -- #1509950051 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #1509950051 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
+TrigSignatureMoniMT                                 INFO HLT_j460_a10sd_csskpf_nojcalib_ftf_35smcINF_L1J100 #249842682
+TrigSignatureMoniMT                                 INFO -- #249842682 Events          20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #249842682 Features                              0          0          0          0          0          0          0          0          0          0          -          -          
+TrigSignatureMoniMT                                 INFO HLT_j460_a10sd_csskpf_nojcalib_ftf_L1J100 #3452032818
+TrigSignatureMoniMT                                 INFO -- #3452032818 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #3452032818 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j460_a10sd_lcw_nojcalib_L1J100 #3093997295
-TrigSignatureMoniMT                                 INFO -- #3093997295 Events         20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #3093997295 Features                             0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO -- #3093997295 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #3093997295 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
+TrigSignatureMoniMT                                 INFO HLT_j460_a10sd_pf_nojcalib_ftf_L1J100 #2138269254
+TrigSignatureMoniMT                                 INFO -- #2138269254 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #2138269254 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j460_a10t_lcw_jes_30smcINF_L1J100 #2296827117
-TrigSignatureMoniMT                                 INFO -- #2296827117 Events         20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #2296827117 Features                             0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO -- #2296827117 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #2296827117 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j460_a10t_lcw_jes_L1J100 #436385969
-TrigSignatureMoniMT                                 INFO -- #436385969 Events          20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #436385969 Features                              0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO -- #436385969 Events          20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #436385969 Features                              0          0          0          0          0          0          0          0          0          0          -          -          
+TrigSignatureMoniMT                                 INFO HLT_j460_a10t_lcw_nojcalib_35smcINF_L1J100 #3224465417
+TrigSignatureMoniMT                                 INFO -- #3224465417 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #3224465417 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
+TrigSignatureMoniMT                                 INFO HLT_j460_a10t_lcw_nojcalib_L1J100 #1966129844
+TrigSignatureMoniMT                                 INFO -- #1966129844 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #1966129844 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j80_0eta240_2j60_320eta490_j0_dijetSEP80j1etSEP0j1eta240SEP80j2etSEP0j2eta240SEP700djmass_L1J20 #3634067472
-TrigSignatureMoniMT                                 INFO -- #3634067472 Events         20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #3634067472 Features                             0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO -- #3634067472 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #3634067472 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j80_L1J15 #2440872308
-TrigSignatureMoniMT                                 INFO -- #2440872308 Events         20         20         0          0          0          0          0          0          0          0          0          0          3          -          3          
-TrigSignatureMoniMT                                 INFO -- #2440872308 Features                             0          0          0          0          0          0          0          0          0          0          3          -          
+TrigSignatureMoniMT                                 INFO -- #2440872308 Events         20         20         0          0          0          0          0          0          0          0          0          3          -          -          3          
+TrigSignatureMoniMT                                 INFO -- #2440872308 Features                             0          0          0          0          0          0          0          0          0          3          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j80_j60_L1J15 #582699527
-TrigSignatureMoniMT                                 INFO -- #582699527 Events          20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #582699527 Features                              0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO -- #582699527 Events          20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #582699527 Features                              0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j85_L1J20 #510475538
-TrigSignatureMoniMT                                 INFO -- #510475538 Events          20         20         0          0          0          0          0          0          0          0          0          0          3          -          3          
-TrigSignatureMoniMT                                 INFO -- #510475538 Features                              0          0          0          0          0          0          0          0          0          0          3          -          
+TrigSignatureMoniMT                                 INFO -- #510475538 Events          20         20         0          0          0          0          0          0          0          0          0          3          -          -          3          
+TrigSignatureMoniMT                                 INFO -- #510475538 Features                              0          0          0          0          0          0          0          0          0          3          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j85_ftf_L1J20 #877042532
-TrigSignatureMoniMT                                 INFO -- #877042532 Events          20         20         0          0          0          0          0          0          0          0          0          0          3          -          3          
-TrigSignatureMoniMT                                 INFO -- #877042532 Features                              0          0          0          0          0          0          0          0          0          0          3          -          
-TrigSignatureMoniMT                                 INFO HLT_j85_ftf_pf_L1J20 #1538535401
-TrigSignatureMoniMT                                 INFO -- #1538535401 Events         20         20         0          0          0          0          0          0          0          0          0          0          2          -          2          
-TrigSignatureMoniMT                                 INFO -- #1538535401 Features                             0          0          0          0          0          0          0          0          0          0          2          -          
+TrigSignatureMoniMT                                 INFO -- #877042532 Events          20         20         0          0          0          0          0          0          0          0          0          3          -          -          3          
+TrigSignatureMoniMT                                 INFO -- #877042532 Features                              0          0          0          0          0          0          0          0          0          3          -          -          
+TrigSignatureMoniMT                                 INFO HLT_j85_pf_ftf_L1J20 #789444389
+TrigSignatureMoniMT                                 INFO -- #789444389 Events          20         20         0          0          0          0          0          0          0          0          0          2          -          -          2          
+TrigSignatureMoniMT                                 INFO -- #789444389 Features                              0          0          0          0          0          0          0          0          0          2          -          -          
 TrigSignatureMoniMT                                 INFO HLT_mb_sptrk_L1RD0_FILLED #4097312640
 TrigSignatureMoniMT                                 INFO -- #4097312640 Events         20         20         20         19         -          -          -          -          -          -          -          -          -          -          19         
 TrigSignatureMoniMT                                 INFO -- #4097312640 Features                             20         19         -          -          -          -          -          -          -          -          -          -          
@@ -407,20 +458,23 @@ TrigSignatureMoniMT                                 INFO HLT_mu14_L1MU10 #169690
 TrigSignatureMoniMT                                 INFO -- #1696906927 Events         20         20         0          0          0          0          1          1          0          0          -          -          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #1696906927 Features                             0          0          0          0          1          1          0          0          -          -          -          -          
 TrigSignatureMoniMT                                 INFO HLT_mu20_2mu4noL1_L1MU20 #1029128679
-TrigSignatureMoniMT                                 INFO -- #1029128679 Events         20         20         0          0          0          0          1          1          0          0          0          0          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #1029128679 Features                             0          0          0          0          1          1          0          0          0          0          -          -          
+TrigSignatureMoniMT                                 INFO -- #1029128679 Events         20         20         0          0          0          0          1          1          0          0          0          0          0          0          0          
+TrigSignatureMoniMT                                 INFO -- #1029128679 Features                             0          0          0          0          1          1          0          0          0          0          0          0          
 TrigSignatureMoniMT                                 INFO HLT_mu20_ivar_L1MU6 #2083734526
 TrigSignatureMoniMT                                 INFO -- #2083734526 Events         20         20         0          0          0          0          1          1          1          -          -          -          -          -          1          
 TrigSignatureMoniMT                                 INFO -- #2083734526 Features                             0          0          0          0          1          1          1          -          -          -          -          -          
+TrigSignatureMoniMT                                 INFO HLT_mu20_ivarmedium_mu8noL1_L1MU20 #3249386942
+TrigSignatureMoniMT                                 INFO -- #3249386942 Events         20         20         0          0          0          0          1          1          0          0          0          0          0          0          0          
+TrigSignatureMoniMT                                 INFO -- #3249386942 Features                             0          0          0          0          1          1          0          0          0          0          0          0          
 TrigSignatureMoniMT                                 INFO HLT_mu22_2mu4noL1_L1MU20 #3427670100
-TrigSignatureMoniMT                                 INFO -- #3427670100 Events         20         20         0          0          0          0          1          1          0          0          0          0          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #3427670100 Features                             0          0          0          0          1          1          0          0          0          0          -          -          
+TrigSignatureMoniMT                                 INFO -- #3427670100 Events         20         20         0          0          0          0          1          1          0          0          0          0          0          0          0          
+TrigSignatureMoniMT                                 INFO -- #3427670100 Features                             0          0          0          0          1          1          0          0          0          0          0          0          
 TrigSignatureMoniMT                                 INFO HLT_mu22_mu8noL1_L1MU20 #3165652409
-TrigSignatureMoniMT                                 INFO -- #3165652409 Events         20         20         0          0          0          0          1          1          0          0          0          0          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #3165652409 Features                             0          0          0          0          1          1          0          0          0          0          -          -          
+TrigSignatureMoniMT                                 INFO -- #3165652409 Events         20         20         0          0          0          0          1          1          0          0          0          0          0          0          0          
+TrigSignatureMoniMT                                 INFO -- #3165652409 Features                             0          0          0          0          1          1          0          0          0          0          0          0          
 TrigSignatureMoniMT                                 INFO HLT_mu24_2mu4noL1_L1MU20 #3233544630
-TrigSignatureMoniMT                                 INFO -- #3233544630 Events         20         20         0          0          0          0          1          1          0          0          0          0          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #3233544630 Features                             0          0          0          0          1          1          0          0          0          0          -          -          
+TrigSignatureMoniMT                                 INFO -- #3233544630 Events         20         20         0          0          0          0          1          1          0          0          0          0          0          0          0          
+TrigSignatureMoniMT                                 INFO -- #3233544630 Features                             0          0          0          0          1          1          0          0          0          0          0          0          
 TrigSignatureMoniMT                                 INFO HLT_mu24_L1MU20 #417425162
 TrigSignatureMoniMT                                 INFO -- #417425162 Events          20         20         0          0          0          0          1          1          0          0          -          -          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #417425162 Features                              0          0          0          0          1          1          0          0          -          -          -          -          
@@ -431,8 +485,8 @@ TrigSignatureMoniMT                                 INFO HLT_mu24_ivarmedium_L1M
 TrigSignatureMoniMT                                 INFO -- #737407430 Events          20         20         0          0          0          0          1          1          0          0          0          -          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #737407430 Features                              0          0          0          0          1          1          0          0          0          -          -          -          
 TrigSignatureMoniMT                                 INFO HLT_mu24_mu10noL1_L1MU20 #2563354236
-TrigSignatureMoniMT                                 INFO -- #2563354236 Events         20         20         0          0          0          0          1          1          0          0          0          0          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #2563354236 Features                             0          0          0          0          1          1          0          0          0          0          -          -          
+TrigSignatureMoniMT                                 INFO -- #2563354236 Events         20         20         0          0          0          0          1          1          0          0          0          0          0          0          0          
+TrigSignatureMoniMT                                 INFO -- #2563354236 Features                             0          0          0          0          1          1          0          0          0          0          0          0          
 TrigSignatureMoniMT                                 INFO HLT_mu26_L1MU20 #311138376
 TrigSignatureMoniMT                                 INFO -- #311138376 Events          20         20         0          0          0          0          1          1          0          0          -          -          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #311138376 Features                              0          0          0          0          1          1          0          0          -          -          -          -          
@@ -440,17 +494,17 @@ TrigSignatureMoniMT                                 INFO HLT_mu26_ivarmedium_L1M
 TrigSignatureMoniMT                                 INFO -- #3411723090 Events         20         20         0          0          0          0          1          1          0          0          0          -          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #3411723090 Features                             0          0          0          0          1          1          0          0          0          -          -          -          
 TrigSignatureMoniMT                                 INFO HLT_mu26_mu10noL1_L1MU20 #2318302287
-TrigSignatureMoniMT                                 INFO -- #2318302287 Events         20         20         0          0          0          0          1          1          0          0          0          0          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #2318302287 Features                             0          0          0          0          1          1          0          0          0          0          -          -          
+TrigSignatureMoniMT                                 INFO -- #2318302287 Events         20         20         0          0          0          0          1          1          0          0          0          0          0          0          0          
+TrigSignatureMoniMT                                 INFO -- #2318302287 Features                             0          0          0          0          1          1          0          0          0          0          0          0          
 TrigSignatureMoniMT                                 INFO HLT_mu26_mu8noL1_L1MU20 #2233067926
-TrigSignatureMoniMT                                 INFO -- #2233067926 Events         20         20         0          0          0          0          1          1          0          0          0          0          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #2233067926 Features                             0          0          0          0          1          1          0          0          0          0          -          -          
+TrigSignatureMoniMT                                 INFO -- #2233067926 Events         20         20         0          0          0          0          1          1          0          0          0          0          0          0          0          
+TrigSignatureMoniMT                                 INFO -- #2233067926 Features                             0          0          0          0          1          1          0          0          0          0          0          0          
 TrigSignatureMoniMT                                 INFO HLT_mu28_ivarmedium_L1MU20 #1963262787
 TrigSignatureMoniMT                                 INFO -- #1963262787 Events         20         20         0          0          0          0          1          1          0          0          0          -          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #1963262787 Features                             0          0          0          0          1          1          0          0          0          -          -          -          
 TrigSignatureMoniMT                                 INFO HLT_mu28_mu8noL1_L1MU20 #86648125
-TrigSignatureMoniMT                                 INFO -- #86648125 Events           20         20         0          0          0          0          1          1          0          0          0          0          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #86648125 Features                               0          0          0          0          1          1          0          0          0          0          -          -          
+TrigSignatureMoniMT                                 INFO -- #86648125 Events           20         20         0          0          0          0          1          1          0          0          0          0          0          0          0          
+TrigSignatureMoniMT                                 INFO -- #86648125 Features                               0          0          0          0          1          1          0          0          0          0          0          0          
 TrigSignatureMoniMT                                 INFO HLT_mu35_ivarmedium_L1MU20 #597064890
 TrigSignatureMoniMT                                 INFO -- #597064890 Events          20         20         0          0          0          0          1          1          0          0          0          -          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #597064890 Features                              0          0          0          0          1          1          0          0          0          -          -          -          
@@ -485,17 +539,17 @@ TrigSignatureMoniMT                                 INFO HLT_mu6_mu4_L12MU4 #171
 TrigSignatureMoniMT                                 INFO -- #1713982776 Events         20         20         0          0          0          0          1          0          0          0          -          -          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #1713982776 Features                             0          0          0          0          2          0          0          0          -          -          -          -          
 TrigSignatureMoniMT                                 INFO HLT_mu6_mu6noL1_L1MU6 #451489897
-TrigSignatureMoniMT                                 INFO -- #451489897 Events          20         20         0          0          0          0          1          1          0          0          0          0          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #451489897 Features                              0          0          0          0          1          1          0          0          0          0          -          -          
+TrigSignatureMoniMT                                 INFO -- #451489897 Events          20         20         0          0          0          0          1          1          0          0          0          0          0          0          0          
+TrigSignatureMoniMT                                 INFO -- #451489897 Features                              0          0          0          0          1          1          0          0          0          0          0          0          
 TrigSignatureMoniMT                                 INFO HLT_mu6fast_L1MU6 #3518031697
 TrigSignatureMoniMT                                 INFO -- #3518031697 Events         20         20         0          0          0          0          1          -          -          -          -          -          -          -          1          
 TrigSignatureMoniMT                                 INFO -- #3518031697 Features                             0          0          0          0          1          -          -          -          -          -          -          -          
 TrigSignatureMoniMT                                 INFO HLT_mu6fast_j45_nojcalib_L1J20 #1776326110
-TrigSignatureMoniMT                                 INFO -- #1776326110 Events         20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #1776326110 Features                             0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO -- #1776326110 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #1776326110 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_mu6fast_xe30_mht_L1XE10 #1876869651
-TrigSignatureMoniMT                                 INFO -- #1876869651 Events         20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #1876869651 Features                             0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO -- #1876869651 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #1876869651 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_mu80_L1MU20 #387900377
 TrigSignatureMoniMT                                 INFO -- #387900377 Events          20         20         0          0          0          0          1          1          0          0          -          -          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #387900377 Features                              0          0          0          0          1          1          0          0          -          -          -          -          
@@ -794,65 +848,65 @@ TrigSignatureMoniMT                                 INFO HLT_timeburner_L1All #8
 TrigSignatureMoniMT                                 INFO -- #819160059 Events          20         20         0          -          -          -          -          -          -          -          -          -          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #819160059 Features                              0          -          -          -          -          -          -          -          -          -          -          -          
 TrigSignatureMoniMT                                 INFO HLT_xe100_mht_L1XE50 #532175988
-TrigSignatureMoniMT                                 INFO -- #532175988 Events          20         20         0          0          0          0          0          0          0          0          0          0          1          -          1          
-TrigSignatureMoniMT                                 INFO -- #532175988 Features                              0          0          0          0          0          0          0          0          0          0          1          -          
+TrigSignatureMoniMT                                 INFO -- #532175988 Events          20         20         0          0          0          0          0          0          0          0          0          1          -          -          1          
+TrigSignatureMoniMT                                 INFO -- #532175988 Features                              0          0          0          0          0          0          0          0          0          1          -          -          
 TrigSignatureMoniMT                                 INFO HLT_xe100_pfsum_L1XE50 #1890237897
-TrigSignatureMoniMT                                 INFO -- #1890237897 Events         20         20         0          0          0          0          0          0          0          0          0          0          1          -          1          
-TrigSignatureMoniMT                                 INFO -- #1890237897 Features                             0          0          0          0          0          0          0          0          0          0          1          -          
+TrigSignatureMoniMT                                 INFO -- #1890237897 Events         20         20         0          0          0          0          0          0          0          0          0          1          -          -          1          
+TrigSignatureMoniMT                                 INFO -- #1890237897 Features                             0          0          0          0          0          0          0          0          0          1          -          -          
 TrigSignatureMoniMT                                 INFO HLT_xe100_tcpufit_L1XE50 #2803198799
-TrigSignatureMoniMT                                 INFO -- #2803198799 Events         20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #2803198799 Features                             0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO -- #2803198799 Events         20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #2803198799 Features                             0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_xe100_trkmht_L1XE50 #1055916731
-TrigSignatureMoniMT                                 INFO -- #1055916731 Events         20         20         0          0          0          0          0          0          0          0          0          0          1          -          1          
-TrigSignatureMoniMT                                 INFO -- #1055916731 Features                             0          0          0          0          0          0          0          0          0          0          1          -          
+TrigSignatureMoniMT                                 INFO -- #1055916731 Events         20         20         0          0          0          0          0          0          0          0          0          1          -          -          1          
+TrigSignatureMoniMT                                 INFO -- #1055916731 Features                             0          0          0          0          0          0          0          0          0          1          -          -          
 TrigSignatureMoniMT                                 INFO HLT_xe100_trkmht_xe85_tcpufit_xe65_cell_L1XE50 #451622546
-TrigSignatureMoniMT                                 INFO -- #451622546 Events          20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #451622546 Features                              0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO -- #451622546 Events          20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #451622546 Features                              0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_xe110_mht_L1XE50 #3030733259
-TrigSignatureMoniMT                                 INFO -- #3030733259 Events         20         20         0          0          0          0          0          0          0          0          0          0          1          -          1          
-TrigSignatureMoniMT                                 INFO -- #3030733259 Features                             0          0          0          0          0          0          0          0          0          0          1          -          
+TrigSignatureMoniMT                                 INFO -- #3030733259 Events         20         20         0          0          0          0          0          0          0          0          0          1          -          -          1          
+TrigSignatureMoniMT                                 INFO -- #3030733259 Features                             0          0          0          0          0          0          0          0          0          1          -          -          
 TrigSignatureMoniMT                                 INFO HLT_xe110_tc_em_L1XE50 #607113828
-TrigSignatureMoniMT                                 INFO -- #607113828 Events          20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #607113828 Features                              0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO -- #607113828 Events          20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #607113828 Features                              0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_xe110_tcpufit_L1XE50 #892853397
-TrigSignatureMoniMT                                 INFO -- #892853397 Events          20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #892853397 Features                              0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO -- #892853397 Events          20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #892853397 Features                              0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_xe30_cell_L1XE10 #1649696554
-TrigSignatureMoniMT                                 INFO -- #1649696554 Events         20         20         0          0          0          0          0          0          0          0          0          0          3          -          3          
-TrigSignatureMoniMT                                 INFO -- #1649696554 Features                             0          0          0          0          0          0          0          0          0          0          3          -          
+TrigSignatureMoniMT                                 INFO -- #1649696554 Events         20         20         0          0          0          0          0          0          0          0          0          3          -          -          3          
+TrigSignatureMoniMT                                 INFO -- #1649696554 Features                             0          0          0          0          0          0          0          0          0          3          -          -          
 TrigSignatureMoniMT                                 INFO HLT_xe30_cell_xe30_tcpufit_L1XE10 #3768353779
-TrigSignatureMoniMT                                 INFO -- #3768353779 Events         20         20         0          0          0          0          0          0          0          0          0          0          3          -          3          
-TrigSignatureMoniMT                                 INFO -- #3768353779 Features                             0          0          0          0          0          0          0          0          0          0          3          -          
+TrigSignatureMoniMT                                 INFO -- #3768353779 Events         20         20         0          0          0          0          0          0          0          0          0          3          -          -          3          
+TrigSignatureMoniMT                                 INFO -- #3768353779 Features                             0          0          0          0          0          0          0          0          0          3          -          -          
 TrigSignatureMoniMT                                 INFO HLT_xe30_cvfpufit_L1XE10 #3860749499
-TrigSignatureMoniMT                                 INFO -- #3860749499 Events         20         20         0          0          0          0          0          0          0          0          0          0          6          -          6          
-TrigSignatureMoniMT                                 INFO -- #3860749499 Features                             0          0          0          0          0          0          0          0          0          0          6          -          
+TrigSignatureMoniMT                                 INFO -- #3860749499 Events         20         20         0          0          0          0          0          0          0          0          0          6          -          -          6          
+TrigSignatureMoniMT                                 INFO -- #3860749499 Features                             0          0          0          0          0          0          0          0          0          6          -          -          
 TrigSignatureMoniMT                                 INFO HLT_xe30_mht_L1XE10 #3626903018
-TrigSignatureMoniMT                                 INFO -- #3626903018 Events         20         20         0          0          0          0          0          0          0          0          0          0          14         -          14         
-TrigSignatureMoniMT                                 INFO -- #3626903018 Features                             0          0          0          0          0          0          0          0          0          0          14         -          
+TrigSignatureMoniMT                                 INFO -- #3626903018 Events         20         20         0          0          0          0          0          0          0          0          0          14         -          -          14         
+TrigSignatureMoniMT                                 INFO -- #3626903018 Features                             0          0          0          0          0          0          0          0          0          14         -          -          
 TrigSignatureMoniMT                                 INFO HLT_xe30_mhtpufit_em_subjesgscIS_L1XE10 #689201557
-TrigSignatureMoniMT                                 INFO -- #689201557 Events          20         20         0          0          0          0          0          0          0          0          0          0          5          -          5          
-TrigSignatureMoniMT                                 INFO -- #689201557 Features                              0          0          0          0          0          0          0          0          0          0          5          -          
+TrigSignatureMoniMT                                 INFO -- #689201557 Events          20         20         0          0          0          0          0          0          0          0          0          5          -          -          5          
+TrigSignatureMoniMT                                 INFO -- #689201557 Features                              0          0          0          0          0          0          0          0          0          5          -          -          
 TrigSignatureMoniMT                                 INFO HLT_xe30_mhtpufit_pf_subjesgscIS_L1XE10 #1886909707
-TrigSignatureMoniMT                                 INFO -- #1886909707 Events         20         20         0          0          0          0          0          0          0          0          0          0          4          -          4          
-TrigSignatureMoniMT                                 INFO -- #1886909707 Features                             0          0          0          0          0          0          0          0          0          0          4          -          
+TrigSignatureMoniMT                                 INFO -- #1886909707 Events         20         20         0          0          0          0          0          0          0          0          0          4          -          -          4          
+TrigSignatureMoniMT                                 INFO -- #1886909707 Features                             0          0          0          0          0          0          0          0          0          4          -          -          
 TrigSignatureMoniMT                                 INFO HLT_xe30_pfopufit_L1XE10 #2252641537
-TrigSignatureMoniMT                                 INFO -- #2252641537 Events         20         20         0          0          0          0          0          0          0          0          0          0          4          -          4          
-TrigSignatureMoniMT                                 INFO -- #2252641537 Features                             0          0          0          0          0          0          0          0          0          0          4          -          
+TrigSignatureMoniMT                                 INFO -- #2252641537 Events         20         20         0          0          0          0          0          0          0          0          0          4          -          -          4          
+TrigSignatureMoniMT                                 INFO -- #2252641537 Features                             0          0          0          0          0          0          0          0          0          4          -          -          
 TrigSignatureMoniMT                                 INFO HLT_xe30_pfsum_L1XE10 #998713382
-TrigSignatureMoniMT                                 INFO -- #998713382 Events          20         20         0          0          0          0          0          0          0          0          0          0          5          -          5          
-TrigSignatureMoniMT                                 INFO -- #998713382 Features                              0          0          0          0          0          0          0          0          0          0          5          -          
+TrigSignatureMoniMT                                 INFO -- #998713382 Events          20         20         0          0          0          0          0          0          0          0          0          5          -          -          5          
+TrigSignatureMoniMT                                 INFO -- #998713382 Features                              0          0          0          0          0          0          0          0          0          5          -          -          
 TrigSignatureMoniMT                                 INFO HLT_xe30_tcpufit_L1XE10 #1583719916
-TrigSignatureMoniMT                                 INFO -- #1583719916 Events         20         20         0          0          0          0          0          0          0          0          0          0          6          -          6          
-TrigSignatureMoniMT                                 INFO -- #1583719916 Features                             0          0          0          0          0          0          0          0          0          0          6          -          
+TrigSignatureMoniMT                                 INFO -- #1583719916 Events         20         20         0          0          0          0          0          0          0          0          0          6          -          -          6          
+TrigSignatureMoniMT                                 INFO -- #1583719916 Features                             0          0          0          0          0          0          0          0          0          6          -          -          
 TrigSignatureMoniMT                                 INFO HLT_xe30_trkmht_L1XE10 #2468872349
-TrigSignatureMoniMT                                 INFO -- #2468872349 Events         20         20         0          0          0          0          0          0          0          0          0          0          4          -          4          
-TrigSignatureMoniMT                                 INFO -- #2468872349 Features                             0          0          0          0          0          0          0          0          0          0          4          -          
+TrigSignatureMoniMT                                 INFO -- #2468872349 Events         20         20         0          0          0          0          0          0          0          0          0          4          -          -          4          
+TrigSignatureMoniMT                                 INFO -- #2468872349 Features                             0          0          0          0          0          0          0          0          0          4          -          -          
 TrigSignatureMoniMT                                 INFO HLT_xe65_cell_L1XE50 #531141817
-TrigSignatureMoniMT                                 INFO -- #531141817 Events          20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #531141817 Features                              0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO -- #531141817 Events          20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #531141817 Features                              0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_xe65_cell_xe110_tcpufit_L1XE50 #115518400
-TrigSignatureMoniMT                                 INFO -- #115518400 Events          20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #115518400 Features                              0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO -- #115518400 Events          20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #115518400 Features                              0          0          0          0          0          0          0          0          0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_xe95_trkmht_xe90_tcpufit_xe75_cell_L1XE50 #302256132
-TrigSignatureMoniMT                                 INFO -- #302256132 Events          20         20         0          0          0          0          0          0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #302256132 Features                              0          0          0          0          0          0          0          0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO -- #302256132 Events          20         20         0          0          0          0          0          0          0          0          0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #302256132 Features                              0          0          0          0          0          0          0          0          0          0          -          -          
diff --git a/Trigger/TrigValidation/TriggerTest/share/testCommonSliceAthenaTrigRDO.py b/Trigger/TrigValidation/TriggerTest/share/testCommonSliceAthenaTrigRDO.py
index a679fdd0085f06d52ec906b30641b550359654c1..64f9d5b8d504dcd022568e490e092b341a3ef607 100644
--- a/Trigger/TrigValidation/TriggerTest/share/testCommonSliceAthenaTrigRDO.py
+++ b/Trigger/TrigValidation/TriggerTest/share/testCommonSliceAthenaTrigRDO.py
@@ -17,15 +17,6 @@ if ('enableCostMonitoring' in dir() and bool(enableCostMonitoring) == True):
 else: 
     enableCostMonitoring = False
 
-#RTT runs with costMonitoring on - test whether it is available in a given release
-#test whether a package is useable in this release
-import imp
-try:
-    imp.find_module('TrigCostD3PDMaker')
-except:
-    printfunc ('CostMonitoring packages not available, setting  enableCostMonitoring=False')
-    enableCostMonitoring=False
-
 # flags for RecExCommon
 doTrigger=True
 rec.doWriteAOD=False
@@ -183,7 +174,6 @@ if 'enableCostMonitoring' in dir() and bool(enableCostMonitoring) == True:
     import TriggerJobOpts.Modifiers
     getattr(TriggerJobOpts.Modifiers,'enableCostMonitoring')().postSetup()
     getattr(TriggerJobOpts.Modifiers,'enableCostForCAF')().postSetup()
-    getattr(TriggerJobOpts.Modifiers,'enableCostD3PD')().postSetup()
     # Check if we are debugging the cost mon output - false by default
     if 'enableCostDebug' in dir() and bool(enableCostDebug) == True:
         getattr(TriggerJobOpts.Modifiers,'enableCostDebug')().postSetup()
diff --git a/Trigger/TrigValidation/TriggerTest/share/testCommonSliceAthenaTrigRDOtoAOD.py b/Trigger/TrigValidation/TriggerTest/share/testCommonSliceAthenaTrigRDOtoAOD.py
index ee15054237ea320d5a6ab242a5ae19d438a21bed..8dc63e0d4a18b48b9b1de6839f4f28af9356c6f7 100644
--- a/Trigger/TrigValidation/TriggerTest/share/testCommonSliceAthenaTrigRDOtoAOD.py
+++ b/Trigger/TrigValidation/TriggerTest/share/testCommonSliceAthenaTrigRDOtoAOD.py
@@ -22,15 +22,6 @@ if ('enableCostMonitoring' in dir()):
 else: 
     enableCostMonitoring = False
 
-#RTT runs with costMonitoring on - test whether it is available in a given release
-#test whether a package is useable in this release
-import imp
-try:
-    imp.find_module('TrigCostD3PDMaker')
-except:
-    printfunc ('CostMonitoring packages not available, setting  enableCostMonitoring=False')
-    enableCostMonitoring=False
-
 # flags for RecExCommon
 #thanks to Olya for the "magic" AOD combination - see: https://its.cern.ch/jira/browse/ATR-11211
 doTrigger=True
@@ -208,7 +199,6 @@ if 'enableCostMonitoring' in dir() and bool(enableCostMonitoring) == True:
     import TriggerJobOpts.Modifiers
     getattr(TriggerJobOpts.Modifiers,'enableCostMonitoring')().postSetup()
     getattr(TriggerJobOpts.Modifiers,'enableCostForCAF')().postSetup()
-    getattr(TriggerJobOpts.Modifiers,'enableCostD3PD')().postSetup()
     # Check if we are debugging the cost mon output - false by default
     if 'enableCostDebug' in dir() and bool(enableCostDebug) == True:
         getattr(TriggerJobOpts.Modifiers,'enableCostDebug')().postSetup()
diff --git a/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py b/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py
index 01d892be7d64e7ca07e2eb85246ccfcbdd58ebfa..23ee6373926c3cfa24067de40060c48ea888c57d 100644
--- a/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py
+++ b/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py
@@ -308,9 +308,27 @@ TriggerHLTListRun3 = [
     ('xAOD::JetContainer#HLT_AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets_jes',                'BS ESD AODFULL AODSLIM AODVERYSLIM', 'Jet'),
     ('xAOD::JetAuxContainer#HLT_AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets_jesAux.'+JetVars, 'BS ESD AODFULL AODSLIM AODVERYSLIM', 'Jet'),
 
+    ('xAOD::JetContainer#HLT_AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets_nojcalib',                'BS ESD AODFULL AODSLIM AODVERYSLIM', 'Jet'),
+    ('xAOD::JetAuxContainer#HLT_AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets_nojcalibAux.'+JetVars, 'BS ESD AODFULL AODSLIM AODVERYSLIM', 'Jet'),
+
     ('xAOD::JetContainer#HLT_AntiKt10LCTopoSoftDropBeta100Zcut10Jets_nojcalib',                'BS ESD AODFULL', 'Jet'),
     ('xAOD::JetAuxContainer#HLT_AntiKt10LCTopoSoftDropBeta100Zcut10Jets_nojcalibAux.'+JetVars, 'BS ESD AODFULL', 'Jet'),
 
+    ('xAOD::JetContainer#HLT_AntiKt10EMPFlowJets_nojcalib_ftf',                       'BS ESD AODFULL', 'Jet'),
+    ('xAOD::JetAuxContainer#HLT_AntiKt10EMPFlowJets_nojcalib_ftfAux.'+JetVars,        'BS ESD AODFULL', 'Jet'),
+
+    ('xAOD::JetContainer#HLT_AntiKt10EMPFlowSoftDropBeta100Zcut10Jets_nojcalib_ftf',                'BS ESD AODFULL', 'Jet'),
+    ('xAOD::JetAuxContainer#HLT_AntiKt10EMPFlowSoftDropBeta100Zcut10Jets_nojcalib_ftfAux.'+JetVars, 'BS ESD AODFULL', 'Jet'),
+
+    ('xAOD::JetContainer#HLT_AntiKt10EMPFlowCSSKJets_nojcalib_ftf',                       'BS ESD AODFULL', 'Jet'),
+    ('xAOD::JetAuxContainer#HLT_AntiKt10EMPFlowCSSKJets_nojcalib_ftfAux.'+JetVars,        'BS ESD AODFULL', 'Jet'),
+
+    ('xAOD::JetContainer#HLT_AntiKt10EMPFlowCSSKSoftDropBeta100Zcut10Jets_nojcalib_ftf',                'BS ESD AODFULL', 'Jet'),
+    ('xAOD::JetAuxContainer#HLT_AntiKt10EMPFlowCSSKSoftDropBeta100Zcut10Jets_nojcalib_ftfAux.'+JetVars, 'BS ESD AODFULL', 'Jet'),
+
+    ('xAOD::JetContainer#HLT_AntiKt10EMPFlowCSSKSoftDropBeta100Zcut10Jets_jes_ftf',                'BS ESD AODFULL', 'Jet'),
+    ('xAOD::JetAuxContainer#HLT_AntiKt10EMPFlowCSSKSoftDropBeta100Zcut10Jets_jes_ftfAux.'+JetVars, 'BS ESD AODFULL', 'Jet'),
+
     ('xAOD::JetContainer#HLT_AntiKt4EMPFlowJets_subjesIS_ftf',                'BS ESD AODFULL', 'Jet'),
     ('xAOD::JetAuxContainer#HLT_AntiKt4EMPFlowJets_subjesIS_ftfAux.'+JetVars, 'BS ESD AODFULL', 'Jet'),
 
@@ -387,7 +405,7 @@ TriggerHLTListRun3 = [
     #('xAOD::TauJetAuxContainer#HLT_TrigTauRecMerged_CaloOnlyMVAAux.',                  'BS ESD AODFULL AODSLIM AODVERYSLIM', 'Tau'),
 
     ('xAOD::TauJetContainer#HLT_TrigTauRecMerged_MVA',                     'BS ESD AODFULL AODSLIM AODVERYSLIM', 'Tau', 'inViews:TAUFTFIsoViews,TAUEFViews'),
-    ('xAOD::TauJetAuxContainer#HLT_TrigTauRecMerged_MVAAux.jetLink',              'BS ESD AODFULL AODSLIM AODVERYSLIM', 'Tau'),
+    ('xAOD::TauJetAuxContainer#HLT_TrigTauRecMerged_MVAAux.',              'BS ESD AODFULL AODSLIM AODVERYSLIM', 'Tau'),
 
     ('xAOD::TauJetContainer#HLT_TrigTauRecMerged_Precision',                     'BS ESD AODFULL AODSLIM AODVERYSLIM', 'Tau', 'inViews:TAUFTFIdViews,TAUFTFTrackViews,TAUFTFTrackTwoViews'),
     ('xAOD::TauJetAuxContainer#HLT_TrigTauRecMerged_PrecisionAux.',              'BS ESD AODFULL AODSLIM AODVERYSLIM', 'Tau'),
@@ -462,6 +480,8 @@ TriggerHLTListRun3 = [
     ('xAOD::TrigCompositeAuxContainer#HLT_TrackCountAux.ntrks.pTcuts.z0cuts.counts',            'BS ESD AODFULL AODSLIM', 'MinBias'),
 ]
 
+# HLTNav_* object list is built dynamically during job configuration, here we only define its output targets
+HLTNavEDMTargets = 'BS CostMonDS ESD AODFULL AODSLIM'
 
 #-------------------------------------------------------------------------------
 # EDM details list to store the transient-persistent version
@@ -502,3 +522,21 @@ def tpMap():
             continue
         l[tr] = persistent(tr)
     return l
+
+
+def addHLTNavigationToEDMList(edmList, allDecisions, hypoDecisions):
+    """
+    Extend TriggerHLTListRun3 with HLT Navigation objects
+    """
+    for decisionCollection in allDecisions:
+        dynamic = '.-' # Exclude dynamic
+        if decisionCollection in hypoDecisions:
+            # Include dynamic
+            dynamic = '.remap_linkColIndices.remap_linkColKeys'
+            if 'PEBInfoWriter' in decisionCollection:
+                dynamic += '.PEBROBList.PEBSubDetList'
+        typeName = 'xAOD::TrigCompositeContainer#{:s}'.format(decisionCollection)
+        typeNameAux = 'xAOD::TrigCompositeAuxContainer#{:s}Aux{:s}'.format(decisionCollection, dynamic)
+        edmList.extend([
+            (typeName,    HLTNavEDMTargets, 'Steer'),
+            (typeNameAux, HLTNavEDMTargets, 'Steer')])
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/Modifiers.py b/Trigger/TriggerCommon/TriggerJobOpts/python/Modifiers.py
index 634c3b2c8cdbbb9537e4dea19e346c4cb847d904..1d20e1eb6f905367ad2fddbed3423183f1830631 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/python/Modifiers.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/python/Modifiers.py
@@ -589,27 +589,6 @@ class forceMuonDataPrep(_modifier):
     def preSetup(self):
         pass  # the actual modifier is implemented in share/Trigger_topOptions_standalone.py
 
-class FakeLVL1(_modifier):
-    """
-    setup fake LVL1 RoIs
-    """
-    def postSetup(self):
-        from TrigFake.TrigFakeConf import FakeLvl1RoIatFixedEtaPhi
-        fake = FakeLvl1RoIatFixedEtaPhi()
-        fake.FakeMuonRoiPhi=TriggerFlags.CosmicSlice.FakeLVL1ROIPhi()
-        fake.FakeMuonRoiEta=TriggerFlags.CosmicSlice.FakeLVL1ROIEta()
-        #fake.FakeMuonRoiEta=0.5
-        fake.FakeMuonRoiLabel=TriggerFlags.CosmicSlice.FakeLVL1Threshold()
-        from AthenaCommon.AlgSequence import AlgSequence
-        topSequence = AlgSequence()
-        if hasattr(topSequence,"TrigSteer_HLT"):
-            topSequence.TrigSteer_HLT.LvlConverterTool =  fake
-            if (TriggerFlags.CosmicSlice.forceLVL2Accept()):
-                svcMgr.HltEventLoopMgr.ForceLvl2Accept =  True
-            if (TriggerFlags.CosmicSlice.filterEmptyROB()):
-                svcMgr.ROBDataProviderSvc.filterEmptyROB=True
-
-
 class rerunLVL1(_modifier):
     """
     Reruns the L1 simulation on real data
@@ -1288,37 +1267,6 @@ class autoConditionsTag(_modifier):
         from RecExConfig.AutoConfiguration import ConfigureConditionsTag
         ConfigureConditionsTag()
 
-
-class enableCostD3PD(_modifier):
-    """
-    Enables creation of Cost D3PD during trigger execution
-    Should be used in conjunction with enableCostMonitoring
-    D3PDMaker packages must be in the release or compiled manually
-    """
-    def postSetup(self):
-        import imp
-        try:
-            imp.find_module('TrigCostD3PDMaker')
-            from AthenaCommon.Include import include, IncludeError
-            include("TrigCostD3PDMaker/TrigCostD3PDMaker_prodJobOFragment.py")
-        except IncludeError:
-            log.error('TrigCostD3PDMaker packages not available, will not produce CostMonitoring D3PD.')
-
-class enableRateD3PD(_modifier):
-    """
-    Enables creation of Rate D3PD during trigger execution
-    Should be used in conjunction with enableCostMonitoring
-    D3PDMaker packages must be in the release or compiled manually
-    """
-    def postSetup(self):
-        import imp
-        try:
-            imp.find_module('TrigCostD3PDMaker')
-            from AthenaCommon.Include import include, IncludeError
-            include("TrigCostD3PDMaker/TrigRateD3PDMaker_prodJobOFragment.py")
-        except IncludeError:
-            log.warning('TrigCostD3PDMaker packages not available, will not produce RateMonitoring D3PD.')
-
 class enableCostDebug(_modifier):
     """
     Enables cost debugging options
@@ -1375,14 +1323,6 @@ class doEnhancedBiasWeights(_modifier):
             costConfig.postSetupEBWeighting()
         except AttributeError:
             log.warning('TrigCostMonitor has no EnhancedBias postSetup option...')
-        # Try to put this in D3PD (will only work offline), still goes in the BS anyway
-        import imp
-        try:
-            imp.find_module('TrigCostD3PDMaker')
-            from AthenaCommon.Include import include, ImportError
-            include("TrigCostD3PDMaker/TrigEBWeightD3PDMaker_prodJobOFragment.py")
-        except ImportError:
-            log.warning('TrigCostD3PDMaker packages not available, will not produce Enhanced Bias weighting D3PD.')
 
 class BeamspotFromSqlite(_modifier):
     """
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfig.py b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfig.py
index 05bf7f0d3c65dbc7489767eec8458d8cf4b3bb1e..982ba3d80f4857ffd18173903d2869a0ee28c67c 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfig.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfig.py
@@ -109,7 +109,7 @@ def collectL1DecoderDecisionObjects(l1decoder):
 
 def collectHypoDecisionObjects(hypos, inputs = True, outputs = True):
     decisionObjects = set()
-    for step, stepHypos in six.iteritems (hypos):
+    for step, stepHypos in sorted(six.iteritems (hypos)):
         for hypoAlg in stepHypos:
             __log.debug( "Hypo %s with input %s and output %s ",
                          hypoAlg.getName(), hypoAlg.HypoInputDecisions, hypoAlg.HypoOutputDecisions )
@@ -173,13 +173,14 @@ def triggerSummaryCfg(flags, hypos):
     allChains = OrderedDict()
 
     
-    for stepName, stepHypos in sorted( hypos.items() ):
+    # lambda sort because we have strings Step1 Step2 ... Step10 Step11 and python sorts that
+    # to Step10 Step11 Step1 Step2
+    for stepName, stepHypos in sorted( hypos.items(), key=lambda x : int(x[0].split('_')[0][4:]) ):
         # order hypos so that ComboHypos are last ones
         orderedStepHypos = sorted(stepHypos, key=lambda hypo: __isCombo(hypo))  
         for hypo in orderedStepHypos:
             hypoChains,hypoOutputKey = __decisionsFromHypo( hypo )
             allChains.update( OrderedDict.fromkeys( hypoChains, hypoOutputKey ) )
-
     from TriggerMenuMT.HLTMenuConfig.Menu.TriggerConfigHLT import TriggerConfigHLT
     from L1Decoder.L1DecoderConfig import mapThresholdToL1DecisionCollection
     if len(TriggerConfigHLT.dicts()) == 0:
@@ -243,7 +244,7 @@ def triggerMonitoringCfg(flags, hypos, filters, l1Decoder):
 
 
 
-def triggerOutputCfg(flags, decObj, decObjHypoOut, summaryAlg):
+def triggerOutputCfg(flags, summaryAlg):
     # Following cases are considered:
     # 1) Running in partition or athenaHLT - configure BS output written by the HLT framework
     # 2) Running offline athena and writing BS - configure BS output written by OutputStream alg
@@ -282,7 +283,7 @@ def triggerOutputCfg(flags, decObj, decObjHypoOut, summaryAlg):
     # Create the configuration
     if onlineWriteBS:
         __log.info("Configuring online ByteStream HLT output")
-        acc = triggerBSOutputCfg(flags, decObj, decObjHypoOut, summaryAlg)
+        acc = triggerBSOutputCfg(flags, summaryAlg)
         # Configure the online HLT result maker to use the above tools
         # For now use old svcMgr interface as this service is not available from acc.getService()
         from AthenaCommon.AppMgr import ServiceMgr as svcMgr
@@ -295,10 +296,10 @@ def triggerOutputCfg(flags, decObj, decObjHypoOut, summaryAlg):
                 hltEventLoopMgr.ResultMaker.MakerTools += [ conf2toConfigurable(tool) ]
     elif offlineWriteBS:
         __log.info("Configuring offline ByteStream HLT output")
-        acc = triggerBSOutputCfg(flags, decObj, decObjHypoOut, summaryAlg, offline=True)
+        acc = triggerBSOutputCfg(flags, summaryAlg, offline=True)
     elif writePOOL:
         __log.info("Configuring POOL HLT output")
-        acc = triggerPOOLOutputCfg(flags, decObj, decObjHypoOut, edmSet)
+        acc = triggerPOOLOutputCfg(flags, edmSet)
     else:
         __log.info("No HLT output writing is configured")
         acc = ComponentAccumulator()
@@ -306,7 +307,7 @@ def triggerOutputCfg(flags, decObj, decObjHypoOut, summaryAlg):
     return acc, edmSet
 
 
-def triggerBSOutputCfg(flags, decObj, decObjHypoOut, summaryAlg, offline=False):
+def triggerBSOutputCfg(flags, summaryAlg, offline=False):
     """
     Returns CA with algorithms and/or tools required to do the serialisation
 
@@ -319,28 +320,17 @@ def triggerBSOutputCfg(flags, decObj, decObjHypoOut, summaryAlg, offline=False):
     from TrigEDMConfig import DataScoutingInfo
     from TrigEDMConfig.TriggerEDM import getRun3BSList
 
-    # handle the collectiosn defined in the EDM config
-    collectionsToBS = getRun3BSList( ["BS"]+ DataScoutingInfo.getAllDataScoutingIdentifiers() )
+    # Get list of all output collections for ByteStream (including DataScouting)
+    collectionsToBS = getRun3BSList( ["BS"] + DataScoutingInfo.getAllDataScoutingIdentifiers() )
 
+    # Build an output dictionary with key = collection type#name, value = list of ROBFragment module IDs
     ItemModuleDict = OrderedDict()
     for typekey, bsfragments in collectionsToBS:
-        # translate readable frament names like BS, CostMonDS names to ROB fragment IDs 0 - for the BS, 1,...- for DS fragments
+        # Translate readable fragment names like BS, CostMonDS to ROB fragment IDs 0 (full result), 1, ... (DS results)
         moduleIDs = [ DataScoutingInfo.getFullHLTResultID() if f == 'BS' else DataScoutingInfo.getDataScoutingResultID(f)
                       for f in bsfragments ]
         ItemModuleDict[typekey] = moduleIDs
 
-    # Add decision containers (navigation)
-    for item in decObj:
-        dynamic = '.-' # Exclude dynamic
-        if item in decObjHypoOut:
-            dynamic = '.' # Include dynamic
-        typeName = 'xAOD::TrigCompositeContainer#{:s}'.format(item)
-        typeNameAux = 'xAOD::TrigCompositeAuxContainer#{:s}Aux{:s}'.format(item, dynamic)
-        if typeName not in list(ItemModuleDict.keys()):
-            ItemModuleDict[typeName] = [DataScoutingInfo.getFullHLTResultID(), DataScoutingInfo.getDataScoutingResultID('CostMonDS')]
-        if typeNameAux not in list(ItemModuleDict.keys()):
-            ItemModuleDict[typeNameAux] = [DataScoutingInfo.getFullHLTResultID(), DataScoutingInfo.getDataScoutingResultID('CostMonDS')]
-
     from TrigOutputHandling.TrigOutputHandlingConfig import TriggerEDMSerialiserToolCfg, StreamTagMakerToolCfg, TriggerBitsMakerToolCfg
 
     # Tool serialising EDM objects to fill the HLT result
@@ -384,7 +374,7 @@ def triggerBSOutputCfg(flags, decObj, decObjHypoOut, summaryAlg, offline=False):
     return acc
 
 
-def triggerPOOLOutputCfg(flags, decObj, decObjHypoOut, edmSet):
+def triggerPOOLOutputCfg(flags, edmSet):
     # Get the list of output collections from TriggerEDM
     from TrigEDMConfig.TriggerEDM import getTriggerEDMList
     edmList = getTriggerEDMList(edmSet, flags.Trigger.EDMDecodingVersion)
@@ -394,14 +384,6 @@ def triggerPOOLOutputCfg(flags, decObj, decObjHypoOut, edmSet):
     for edmType, edmKeys in six.iteritems (edmList):
         itemsToRecord.extend([edmType+'#'+collKey for collKey in edmKeys])
 
-    # Add decision containers (navigation)
-    for item in decObj:
-        dynamic = '.-' # Exclude dynamic
-        if item in decObjHypoOut:
-            dynamic = '.' # Include dynamic
-        itemsToRecord.append('xAOD::TrigCompositeContainer#{:s}'.format(item))
-        itemsToRecord.append('xAOD::TrigCompositeAuxContainer#{:s}Aux{:s}'.format(item, dynamic))
-
     # Add EventInfo
     itemsToRecord.append('xAOD::EventInfo#EventInfo')
     itemsToRecord.append('xAOD::EventAuxInfo#EventInfoAux.')
@@ -590,12 +572,15 @@ def triggerRunCfg( flags, seqName = None, menu=None ):
     __log.info( "Of which, %d are the outputs of hypos", len( decObjHypoOut ) )
     __log.info( str( decObj ) )
 
-
-
     # configure components need to normalise output before writing out
     viewMakers = collectViewMakers( HLTSteps )
 
-    outputAcc, edmSet = triggerOutputCfg( flags, decObj, decObjHypoOut, summaryAlg )
+    # Add HLT Navigation to EDM list
+    from TrigEDMConfig import TriggerEDMRun3
+    TriggerEDMRun3.addHLTNavigationToEDMList(TriggerEDMRun3.TriggerHLTListRun3, decObj, decObjHypoOut)
+
+    # Configure output writing
+    outputAcc, edmSet = triggerOutputCfg( flags, summaryAlg )
     acc.merge( outputAcc )
 
     if edmSet:
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerFlags.py b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerFlags.py
index dc2a5217125fd6158593a5eb475a5afb7e62826b..764f7f1e0ab96afbb69165c15bc080e1de8749a3 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerFlags.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerFlags.py
@@ -494,7 +494,9 @@ class readL1TopoConfigFromXML(JobProperty):
 
     def _do_action(self):
         """ setup some consistency """
-        if self.get_Value() is False:
+        if self.get_Value():
+            TriggerFlags.inputL1TopoConfigFile = "TriggerMenuXML/L1Topoconfig_"+TriggerFlags.triggerMenuSetup()+"_" + TriggerFlags.menuVersion() + ".xml"
+        else:
             TriggerFlags.inputL1TopoConfigFile = TriggerFlags.outputL1TopoConfigFile()
 
 _flags.append(readL1TopoConfigFromXML)
@@ -521,6 +523,8 @@ class readLVL1configFromXML(JobProperty):
             TriggerFlags.inputLVL1configFile = TriggerFlags.outputLVL1configFile()
             TriggerFlags.Lvl1.items.set_On()
         else:
+            menuXMLPackage = "TriggerMenuMT" if TriggerFlags.doMT() else "TriggerMenuXML"
+            TriggerFlags.inputLVL1configFile = menuXMLPackage + "/LVL1config_"+_getMenuBaseName(TriggerFlags.triggerMenuSetup())+"_" + TriggerFlags.menuVersion() + ".xml"
             xmlFile=TriggerFlags.inputLVL1configFile()
             from TrigConfigSvc.TrigConfigSvcConfig import findFileInXMLPATH
             if xmlFile!='NONE' and not os.path.exists(findFileInXMLPATH(xmlFile)):
@@ -560,12 +564,11 @@ class readHLTconfigFromXML(JobProperty):
         else:
             if TriggerFlags.inputHLTconfigFile != 'NONE':
                 
-                TriggerFlags.inputHLTconfigFile = "HLTconfig_"+TriggerFlags.triggerMenuSetup()+"_" + TriggerFlags.menuVersion() + ".xml"
+                TriggerFlags.inputHLTconfigFile = "TriggerMenuXML/HLTconfig_"+TriggerFlags.triggerMenuSetup()+"_" + TriggerFlags.menuVersion() + ".xml"
                 nightlyPaths=os.environ['XMLPATH'].split(':')
 
                 for p in nightlyPaths:
-                    #print p+"/TriggerMenuXML/HLTconfig_"+TriggerFlags.triggerMenuSetup()+"_" + TriggerFlags.menuVersion() + ".xml"
-                    full_path_name = p+"/TriggerMenuXML/"+TriggerFlags.inputHLTconfigFile()
+                    full_path_name = p+"/"+TriggerFlags.inputHLTconfigFile()
                     if os.path.exists(full_path_name) is True:
                         log.info("The HLT xml file is: "+full_path_name)
                         success = True
@@ -614,12 +617,7 @@ class outputL1TopoConfigFile(JobProperty):
             # cases, e.g. MC_pp_v5_tight_mc_prescale. Prescaling is
             # not available for L1Topo, therefore that part is being
             # removed.
-            import re
-            menuSetup = TriggerFlags.triggerMenuSetup()
-            m = re.match(r'(.*v\d(?:_primaries)?).*', menuSetup)
-            if m:
-                menuSetup = m.groups()[0]
-            return "L1Topoconfig_" + menuSetup + "_" + TriggerFlags.menuVersion() + ".xml"
+            return "L1Topoconfig_" + _getMenuBaseName(TriggerFlags.triggerMenuSetup()) + "_" + TriggerFlags.menuVersion() + ".xml"
         else:
             return self.get_Value()
         
@@ -672,7 +670,7 @@ class inputL1TopoConfigFile(JobProperty):
     If TriggerFlags.readL1TopoConfigFromXML()==True, then this file is
     used for L1TopoConfiguration.
     
-    Defaults to L1TopoConfig_<triggerMenuSetup>_<menuVersion>.xml
+    Defaults to L1Topoconfig_<triggerMenuSetup>_<menuVersion>.xml
     """
     statusOn=True
     allowedType=['str']
@@ -680,7 +678,7 @@ class inputL1TopoConfigFile(JobProperty):
 
     def __call__(self):
         if self.get_Value() == "":
-            return "L1TopoConfig_"+TriggerFlags.triggerMenuSetup()+"_" + TriggerFlags.menuVersion() + ".xml"
+            return "L1Topoconfig_"+TriggerFlags.triggerMenuSetup()+"_" + TriggerFlags.menuVersion() + ".xml"
         else:
             return self.get_Value()
         
@@ -707,14 +705,11 @@ class inputLVL1configFile(JobProperty):
 _flags.append(inputLVL1configFile)
 
 # remove prescale suffixes
-def _getMenuBaseName( menuName):
-    log = logging.getLogger('TrigConfigSvcCfg')
-    pattern = re.compile(r'_v\d+|DC14')
-    patternPos = pattern.search(menuName)
-    if patternPos:
-        menuName=menuName[:patternPos.end()]
-    else:
-        log.info('Can\'t find pattern to shorten menu name, either non-existent in name or not implemented.')
+def _getMenuBaseName(menuName):
+    log = logging.getLogger(__name__)
+    m = re.match(r'(.*v\d(?:_primaries)?).*', menuName)
+    if m:
+        menuName = m.groups()[0]
     return menuName
 
 
@@ -861,7 +856,7 @@ class triggerMenuSetup(JobProperty):
         elif self.get_Value() == 'InitialBeam_default':
             self.set_Value(self._default_InitialBeam_menu)
             self._log.info("%s - trigger menu 'InitialBeam_default' changed to '%s'", self.__class__.__name__, self.get_Value())
-            
+
         # filenames for LVL1 and HLT
         if TriggerFlags.readLVL1configFromXML() is True:
             TriggerFlags.inputLVL1configFile = "LVL1config_"+_getMenuBaseName(TriggerFlags.triggerMenuSetup())+"_" + TriggerFlags.menuVersion() + ".xml"
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
index 84ec1543d4cc4037d5c211f26f2889ea38c09e50..2a9b7361c5a8f3d487307cb496d8149bcd5a35a5 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
@@ -30,7 +30,6 @@ class opt:
     doMuon           = True           # ConfigFlags.Trigger.doMuon
     doDBConfig       = None           # dump trigger configuration
     trigBase         = None           # file name for trigger config dump
-    enableCostD3PD   = False          # enable cost monitoring
     doWriteRDOTrigger = False         # Write out RDOTrigger?
     doWriteBS        = True           # Write out BS?
     doL1Unpacking    = True           # decode L1 data in input file if True, else setup emulation
@@ -44,6 +43,10 @@ class opt:
     enableL1Phase1   = False          # Enable Run-3 LVL1 simulation and/or decoding
     enableL1CaloLegacy = True         # Enable Run-2 L1Calo simulation and/or decoding (possible even if enablePhase1 is True)
 #Individual slice flags
+    doCalibSlice        = True
+    doTestSlice         = True
+    doHeavyIonSlice     = True
+    doEnhancedBiasSlice = True
     doEgammaSlice     = True
     doMuonSlice       = True
     doMinBiasSlice    = True
@@ -585,7 +588,13 @@ if opt.doWriteBS or opt.doWriteRDOTrigger:
         log.error("Failed to find L1Decoder or DecisionSummaryMakerAlg, cannot determine Decision names for output configuration")
         decObj = []
         decObjHypoOut = []
-    CAtoGlobalWrapper( triggerOutputCfg, ConfigFlags, decObj=decObj, decObjHypoOut=decObjHypoOut, summaryAlg=summaryMakerAlg)
+
+    # Add HLT Navigation to EDM list
+    from TrigEDMConfig import TriggerEDMRun3
+    TriggerEDMRun3.addHLTNavigationToEDMList(TriggerEDMRun3.TriggerHLTListRun3, decObj, decObjHypoOut)
+
+    # Configure output writing
+    CAtoGlobalWrapper( triggerOutputCfg, ConfigFlags, summaryAlg=summaryMakerAlg)
 
 #-------------------------------------------------------------
 # Non-ComponentAccumulator Cost Monitoring
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone_newJO.py b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone_newJO.py
index 09e71a0b531fbc4ba5d7aee9328ec263fd21115e..65e1efbcaf6772afc9e23a033b0b8062b0e4a89f 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone_newJO.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone_newJO.py
@@ -9,9 +9,18 @@ from AthenaConfiguration.AllConfigFlags import ConfigFlags as flags
 from AthenaCommon.Configurable import Configurable
 Configurable.configurableRun3Behavior=1
 
+
+
+flags.Detector.GeometryPixel = True
+flags.Detector.GeometrySCT   = True
+flags.Detector.GeometryTRT   = True
+flags.Detector.GeometryID    = True
+flags.Detector.GeometryBpipe = True
+flags.Detector.GeometryCavern = False
 flags.Detector.GeometryPixel = True
 flags.Detector.GeometrySCT   = True
 flags.Detector.GeometryTRT   = True
+
 flags.Detector.GeometryLAr   = True
 flags.Detector.GeometryTile  = True
 flags.Detector.GeometryMDT   = True
@@ -19,13 +28,21 @@ flags.Detector.GeometryTGC   = True
 flags.Detector.GeometryCSC   = True
 flags.Detector.GeometryRPC   = True
 
+
+flags.Detector.RecoPixel = True
+flags.Detector.RecoSCT   = True
+
+
 # Output configuration - currently testing offline workflow
 flags.Trigger.writeBS = False
 flags.Output.doWriteRDO = True
 flags.Output.RDOFileName = 'RDO_TRIG.pool.root'
 
 flags.Trigger.CostMonitoring.doCostMonitoring = True
-
+flags.Scheduler.CheckDependencies = True
+flags.Scheduler.ShowDataDeps = True
+flags.Scheduler.ShowDataFlow = True
+flags.Scheduler.ShowControlFlow = True
 
 import importlib
 setupMenuPath = "TriggerMenuMT.HLTMenuConfig.Menu."+flags.Trigger.triggerMenuSetup+"_newJO"
@@ -47,7 +64,8 @@ flags.InDet.usePixelDCS=False
 
 flags.lock()
 
-from AthenaCommon.Constants import DEBUG,WARNING
+
+from AthenaCommon.Constants import INFO,DEBUG,WARNING
 acc = MainServicesCfg( flags )
 acc.getService('AvalancheSchedulerSvc').VerboseSubSlots = True
 
@@ -71,9 +89,6 @@ from RegionSelector.RegSelConfig import regSelCfg
 acc.merge( regSelCfg( flags ) )
 
 
-from TrigInDetConfig.TrigInDetConfig import TrigInDetCondConfig
-acc.merge( TrigInDetCondConfig( flags ) )
-
 acc.getEventAlgo( "TrigSignatureMoniMT" ).OutputLevel=DEBUG
 acc.getEventAlgo( "L1Decoder" ).ctpUnpacker.UseTBPBits=True # test setup
 
@@ -84,12 +99,15 @@ logging.getLogger('forcomps').setLevel(DEBUG)
 acc.foreach_component("*/L1Decoder").OutputLevel = DEBUG
 acc.foreach_component("*/L1Decoder/*Tool").OutputLevel = DEBUG # tools
 acc.foreach_component("*HLTTop/*Hypo*").OutputLevel = DEBUG # hypo algs
-acc.foreach_component("*HLTTop/*Hypo*/*Tool*").OutputLevel = DEBUG # hypo tools
-acc.foreach_component("*HLTTop/RoRSeqFilter/*").OutputLevel = DEBUG # filters
+acc.foreach_component("*HLTTop/*Hypo*/*Tool*").OutputLevel = INFO # hypo tools
+acc.foreach_component("*HLTTop/RoRSeqFilter/*").OutputLevel = INFO# filters
 acc.foreach_component("*HLTTop/*Input*").OutputLevel = DEBUG # input makers
-acc.foreach_component("*HLTTop/*HLTEDMCreator*").OutputLevel = DEBUG # messaging from the EDM creators
+acc.foreach_component("*HLTTop/*HLTEDMCreator*").OutputLevel = WARNING # messaging from the EDM creators
 acc.foreach_component("*HLTTop/*GenericMonitoringTool*").OutputLevel = WARNING # silcence mon tools (addressing by type)
-acc.foreach_component("*/L1Decoder").OutputLevel = DEBUG
+
+
+acc.printConfig(withDetails=False, summariseProps=True, printDefaults=True)
+
 
 fname = "runHLT_standalone_newJO.pkl"
 print( "Storing config in the file {}".format( fname ) )
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/CalibChainConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/CalibChainConfiguration.py
new file mode 100644
index 0000000000000000000000000000000000000000..3a9ea2d4fb545cd950674244e6e012b3383d7268
--- /dev/null
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/CalibChainConfiguration.py
@@ -0,0 +1,25 @@
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+
+from AthenaCommon.Logging import logging
+logging.getLogger().info("Importing %s",__name__)
+log = logging.getLogger("TriggerMenuMT.HLTMenuConfig.CalibCosmicMon.CalibChainConfiguration")
+
+from TriggerMenuMT.HLTMenuConfig.Menu.ChainConfigurationBase import ChainConfigurationBase
+
+#----------------------------------------------------------------
+class CalibChainConfiguration(ChainConfigurationBase):
+
+    def __init__(self, chainDict):
+        ChainConfigurationBase.__init__(self,chainDict)
+        
+    # ----------------------
+    # Assemble the chain depending on information from chainName
+    # ----------------------
+    def assembleChain(self):       
+                         
+        chainSteps = []
+        log.debug("Assembling chain for " + self.chainName)
+        myChain = self.buildChain(chainSteps)
+        return myChain
+
+
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/GenerateCalibChainDefs.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/GenerateCalibChainDefs.py
new file mode 100644
index 0000000000000000000000000000000000000000..7db53d3b1c51b38e6180e4a61140eddaafe96e22
--- /dev/null
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/GenerateCalibChainDefs.py
@@ -0,0 +1,38 @@
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+
+from TriggerMenuMT.HLTMenuConfig.Menu.ChainDictTools import splitChainDict
+from TriggerMenuMT.HLTMenuConfig.CalibCosmicMon.CalibChainConfiguration import CalibChainConfiguration as CalibChainConfiguration
+from TriggerMenuMT.HLTMenuConfig.Menu.ChainMerging import mergeChainDefs
+
+
+from AthenaCommon.Logging import logging
+log = logging.getLogger( 'TriggerMenuMT.HLTMenuConfig.CalibCosmicMon.generateChainConfigs' )
+log.info("Importing %s",__name__)
+
+
+
+def generateChainConfigs( chainDict ):
+
+    listOfChainDicts = splitChainDict(chainDict)
+    log.debug("Will generate Config for streamer: %s", chainDict['chainName'])
+
+    listOfChainDefs = []
+        
+    #streamers will never have more than one chainPart but this is still
+    #needed to move to the correct format [{}]->{}
+    for subChainDict in listOfChainDicts:
+        
+        Calib = CalibChainConfiguration(subChainDict).assembleChain() 
+
+        listOfChainDefs += [Calib]
+        log.debug('length of chaindefs %s', len(listOfChainDefs) )
+
+    if len(listOfChainDefs)>1:
+        log.warning("This is a streamer with more than one chainPart, is this really intended?")
+        theChainDef = mergeChainDefs(listOfChainDefs, chainDict)
+    else:
+        theChainDef = listOfChainDefs[0]
+
+    log.debug("theChainDef %s" , theChainDef)
+
+    return theChainDef
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/ElectronSequenceSetup.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/ElectronSequenceSetup.py
index 5c05433350f4a8a1202d877939474eb7391ccc9a..4ac4fbc205233ffd7967e8523b72fdda31af1f9c 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/ElectronSequenceSetup.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/ElectronSequenceSetup.py
@@ -28,12 +28,6 @@ def fastElectronSequence(ConfigFlags):
     viewVerify.DataObjects += [( 'xAOD::TrigEMClusterContainer' , 'StoreGateSvc+' + CaloMenuDefs.L2CaloClusters ),
                                ( 'TrigRoiDescriptorCollection' , 'StoreGateSvc+'+RoIs )]
 
-    from IOVDbSvc.CondDB import conddb
-    if not conddb.folderRequested( "/PIXEL/DCS/FSMSTATUS"):
-      viewVerify.DataObjects += [( 'CondAttrListCollection' , 'ConditionStore+/PIXEL/DCS/FSMSTATUS' )]
-    if not conddb.folderRequested( "/PIXEL/DCS/FSMSTATE"):
-      viewVerify.DataObjects += [( 'CondAttrListCollection' , 'ConditionStore+/PIXEL/DCS/FSMSTATE' )]
-    
     TrackParticlesName = ""
     for viewAlg in viewAlgs:
         if "InDetTrigTrackParticleCreatorAlg" in viewAlg.name():
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/generateElectron.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/generateElectron.py
index 0a1f385d957f050eaa29ebb0c5d8305398f34db1..a3f965858011033e9557c4f9ba6a9e226c75e469 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/generateElectron.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/generateElectron.py
@@ -34,7 +34,6 @@ def generateChains( flags,  chainDict ):
     l2CaloHypo =  l2CaloHypoCfg( flags, name = 'L2ElectronCaloHypo',
                                  CaloClusters = recordable('HLT_FastCaloEMClusters'))
 
-
     accCalo.addEventAlgo(l2CaloHypo, sequenceName=stepView.getName())
 
     fastCaloSequence = CAMenuSequence( Sequence    = l2CaloReco.sequence(),
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetChainConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetChainConfiguration.py
index 6808b79af94dcc8004fd5c6930fbae5bd2ea1d27..3ffa4b5744a51516a5591385eabaf5c1e94cba61 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetChainConfiguration.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetChainConfiguration.py
@@ -82,7 +82,8 @@ class JetChainConfiguration(ChainConfigurationBase):
         jetDefStr = jetRecoDictToString(self.recoDict)
 
         stepName = "Step1_jet_"+jetDefStr
-        jetSeq1 = RecoFragmentsPool.retrieve( jetMenuSequence, None, **self.recoDict ) # the None will be used for flags in future
+        from AthenaConfiguration.AllConfigFlags import ConfigFlags
+        jetSeq1 = RecoFragmentsPool.retrieve( jetMenuSequence, ConfigFlags, **self.recoDict ) # the None will be used for flags in future
 
         return ChainStep(stepName, [jetSeq1], multiplicity=[1], chainDicts=[self.dict])
 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetMenuSequences.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetMenuSequences.py
index f33061578354be8073d9aa7937ab067556594515..b32595769aa9a22c4d273973e4ce96839b5d7c80 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetMenuSequences.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetMenuSequences.py
@@ -4,15 +4,15 @@
 from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import RecoFragmentsPool, MenuSequence
 from TriggerMenuMT.HLTMenuConfig.Jet.JetRecoSequences import jetAthSequence, jetRecoDictToString
     
-def jetCFSequence(dummyFlags,**recoDict):
+def jetCFSequence(configFlags,**recoDict):
     """ Function to create the jet Menu Sequence"""
     
     #reco sequence
-    (JetAthSequence, InputMakerAlg, sequenceOut) = RecoFragmentsPool.retrieve(jetAthSequence,None,**recoDict)
+    (JetAthSequence, InputMakerAlg, sequenceOut) = RecoFragmentsPool.retrieve(jetAthSequence,configFlags,**recoDict)
     return (JetAthSequence, InputMakerAlg, sequenceOut) 
 
-def jetMenuSequence(dummyFlags,**recoDict):
-    (JetAthSequence, InputMakerAlg, sequenceOut)= jetCFSequence(dummyFlags,**recoDict)    
+def jetMenuSequence(configFlags,**recoDict):
+    (JetAthSequence, InputMakerAlg, sequenceOut)= jetCFSequence(configFlags,**recoDict)    
     #hypo
     from TrigHLTJetHypo.TrigHLTJetHypoConf import TrigJetHypoAlgMT
     from TrigHLTJetHypo.TrigJetHypoToolConfig import trigJetHypoToolFromDict
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetRecoConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetRecoConfiguration.py
index 6c2472e4a42dd0e8cdbb0bc1215e6a16ad3d83ee..7e871e53d9525af1cfeecb9210dad69f88fbf8e0 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetRecoConfiguration.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetRecoConfiguration.py
@@ -71,19 +71,23 @@ def defineJetConstit(jetRecoDict,clustersKey=None,pfoPrefix=None):
             jetConstit.inputname = clustersKey
     return jetConstit
 
+    
+def interpretRecoAlg(recoAlg):
+    import re
+    jetalg, jetradius, jetextra = re.split(r'(\d+)',recoAlg)    
+    return jetalg, int(jetradius), jetextra
+
 # Arbitrary min pt for fastjet, set to be low enough for MHT(?)
 # Could/should adjust higher for large-R
 def defineJets(jetRecoDict,clustersKey=None,pfoPrefix=None):
     minpt = {
-        "a4":  7000,
-        "a10": 50000,
-        "a10r": 50000,
-        "a10t": 50000,
-        "a10sd": 50000,
+        4:  7000,
+        10: 50000,
     }
-    radius = float(jetRecoDict["recoAlg"].lstrip("a").rstrip("trsd"))/10
+    jetalg, jetradius, jetextra = interpretRecoAlg(jetRecoDict["recoAlg"])
+    actualradius = float(jetradius)/10
     jetConstit = defineJetConstit(jetRecoDict,clustersKey,pfoPrefix)
-    jetDef = JetDefinition( "AntiKt", radius, jetConstit, ptmin=minpt[jetRecoDict["recoAlg"]])
+    jetDef = JetDefinition( "AntiKt", actualradius, jetConstit, ptmin=minpt[jetradius])
     return jetDef
 
 def defineReclusteredJets(jetRecoDict):
@@ -120,6 +124,7 @@ def defineTrackMods(trkopt):
 # Translate calib specification into something understood by
 # the calibration config helper
 def defineCalibFilterMods(jetRecoDict,dataSource,rhoKey="auto"):
+
     # Minimum modifier set for calibration w/o track GSC
     # Should eventually build in more mods, depend on track info etc
     jetalg = jetRecoDict["recoAlg"]
@@ -132,12 +137,12 @@ def defineCalibFilterMods(jetRecoDict,dataSource,rhoKey="auto"):
         if jetRecoDict["trkopt"]=="notrk" and "subres" in jetRecoDict["jetCalib"]:
             raise ValueError("Pileup residual calibration requested but no track source provided!")
 
-        if jetRecoDict["dataType"]=="tc":
+        if jetRecoDict["dataType"].endswith("tc"):
             calibContext,calibSeq = {
                 ("a4","subjes"):   ("TrigRun2","JetArea_EtaJES_GSC"),        # Calo GSC only
-                ("a4","subjesIS"): ("TrigRun2","JetArea_EtaJES_GSC_Insitu"), # Calo GSC only
-                ("a4","subjesgscIS"): ("TrigRun2GSC","JetArea_EtaJES_GSC_Insitu"), # Calo+Trk GSC
-                ("a4","subresjesgscIS"): ("TrigRun2GSC","JetArea_Residual_EtaJES_GSC_Insitu"), # pu residual + calo+trk GSC
+                ("a4","subjesIS"): ("TrigRun2","JetArea_EtaJES_GSC"), # Calo GSC only
+                ("a4","subjesgscIS"): ("TrigRun2GSC","JetArea_EtaJES_GSC"), # Calo+Trk GSC
+                ("a4","subresjesgscIS"): ("TrigRun2GSC","JetArea_Residual_EtaJES_GSC"), # pu residual + calo+trk GSC
                 ("a10","subjes"):  ("TrigUngroomed","JetArea_EtaJES"),
                 ("a10t","jes"):    ("TrigTrimmed","EtaJES_JMS"),
                 }[(jetRecoDict["recoAlg"],jetRecoDict["jetCalib"])]
@@ -148,14 +153,19 @@ def defineCalibFilterMods(jetRecoDict,dataSource,rhoKey="auto"):
                 gscDepth = "trackWIDTH"
                 pvname = "HLT_IDVertex_FS"
 
-        elif jetRecoDict["dataType"]=="pf":
+        elif jetRecoDict["dataType"].endswith("pf"):
             gscDepth = "auto"
-            calibContext = "TrigLS2"
-            calibSeq = "JetArea_Residual_EtaJES_GSC"
-            if jetRecoDict["jetCalib"].endswith("IS"):
-                calibSeq += "_Insitu"
+            if 'sd' in jetRecoDict["recoAlg"]:
+                calibContext = "TrigSoftDrop"
+                calibSeq = "EtaJES_JMS"
+            else:
+                calibContext = "TrigLS2"
+                calibSeq = "JetArea_Residual_EtaJES_GSC"
             pvname = "HLT_IDVertex_FS"
 
+        if jetRecoDict["jetCalib"].endswith("IS") and (dataSource=="data"):
+            calibSeq += "_Insitu"
+
         calibSpec = ":".join( [calibContext, dataSource, calibSeq, rhoKey, pvname, gscDepth] )
         from .TriggerJetMods import ConstitFourMom_copy
         if jetalg=="a4":
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetRecoSequences.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetRecoSequences.py
index 915086c5693d185c7bb4d832895bfcd9f5affb11..54d1b7d8202a5e9084bc37e0621723a40eafc9f5 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetRecoSequences.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetRecoSequences.py
@@ -6,7 +6,8 @@ from AthenaCommon.CFElements import parOR, seqAND
 from TriggerMenuMT.HLTMenuConfig.Menu.ChainConfigurationBase import RecoFragmentsPool
 from AthenaConfiguration.ComponentAccumulator import conf2toConfigurable
 from TriggerMenuMT.HLTMenuConfig.Jet import JetRecoConfiguration
-
+from JetRecConfig.JetRecConfig import getConstitPJGAlg, getJetAlgorithm
+from TrigEDMConfig.TriggerEDMRun3 import recordable
 
 # Translate the reco dict to a string for suffixing etc
 def jetRecoDictToString(jetRecoDict):
@@ -17,200 +18,209 @@ def jetRecoDictToString(jetRecoDict):
 
 # Configure reco from a dict of options
 # Start from a FullScan inputs maker
-def jetAthSequence(dummyFlags, **jetRecoDict):
+def jetAthSequence(configFlags, **jetRecoDict):
     from TrigT2CaloCommon.CaloDef import clusterFSInputMaker
     InputMakerAlg= conf2toConfigurable(clusterFSInputMaker())
 
-    # Does nothing now, but may need to use this to toggle Insitu calib step
-    # in which case it should be deduced from input flags
-    dataSource = "data" # or mc
-
-    (recoSequence, sequenceOut) = RecoFragmentsPool.retrieve( jetRecoSequence, None, dataSource=dataSource, **jetRecoDict )
+    (recoSequence, sequenceOut, jetDef) = RecoFragmentsPool.retrieve( jetRecoSequence, configFlags, **jetRecoDict )
 
     jetDefString = jetRecoDictToString(jetRecoDict)
     JetAthSequence =  seqAND("jetAthSequence_"+jetDefString,[InputMakerAlg, recoSequence ])
     return (JetAthSequence, InputMakerAlg, sequenceOut)
 
+jetNamePrefix = "HLT_"
+
 # Dummy flag arg needed so that each reco sequence is held separately
 # in the RecoFragmentsPool -- only the kwargs are used to distinguish
 # different sequences. New convention is just to pass "None" for flags
-def jetRecoSequence( dummyFlags, dataSource, RoIs = 'HLT_FSJETRoI', **jetRecoDict):
+def jetRecoSequence( configFlags, RoIs = 'HLT_FSJETRoI', **jetRecoDict ):
+
+    jetalg, jetradius, extra = JetRecoConfiguration.interpretRecoAlg(jetRecoDict["recoAlg"])
+    doGrooming = extra in ["t","sd"]
+    doRecluster = extra == "r"
+    dataSource = "mc" if configFlags.Input.isMC else "data"
 
+    if doRecluster:
+        return RecoFragmentsPool.retrieve( reclusteredJetRecoSequence, configFlags, dataSource=dataSource, RoIs=RoIs, **jetRecoDict)
+    elif doGrooming:
+        return RecoFragmentsPool.retrieve( groomedJetRecoSequence, configFlags, dataSource=dataSource, RoIs=RoIs, **jetRecoDict)
+    else:
+        return RecoFragmentsPool.retrieve( standardJetRecoSequence, configFlags, dataSource=dataSource, RoIs=RoIs, **jetRecoDict)
+
+# Normal jet reconstruction, no reclustering or grooming
+def standardJetRecoSequence( configFlags, dataSource, RoIs, **jetRecoDict ):
     jetDefString = jetRecoDictToString(jetRecoDict)
     recoSeq = parOR( "JetRecSeq_"+jetDefString, [])
 
-    recoAlg = jetRecoDict["recoAlg"]
-    doGrooming = recoAlg.endswith("t") or recoAlg.endswith("sd") # trimming or soft drop
-    doRecluster = recoAlg.endswith("r")
-    jetNamePrefix = "HLT_"
+    # Start by adding the topocluster reco sequence
+    from TriggerMenuMT.HLTMenuConfig.CommonSequences.CaloSequenceSetup import (
+            caloClusterRecoSequence, LCCaloClusterRecoSequence)
+    if jetRecoDict["calib"] == "em":
+        topoClusterSequence, clustersKey = RecoFragmentsPool.retrieve(
+                caloClusterRecoSequence, flags=None, RoIs=RoIs)
+    elif jetRecoDict["calib"] == "lcw":
+        topoClusterSequence, clustersKey = RecoFragmentsPool.retrieve(
+                LCCaloClusterRecoSequence, flags=None, RoIs=RoIs)
+    else:
+        raise ValueError("Invalid value for calib: '{}'".format(jetRecoDict["calib"]))
+    recoSeq += topoClusterSequence
 
-    from TrigEDMConfig.TriggerEDMRun3 import recordable
-    from JetRecConfig import ConfigurableCompatibility
-    ConfigurableCompatibility.Convert2Configurable = True
-    from JetRecConfig.JetRecConfig import getConstitPJGAlg, getJetAlgorithm
-    if doRecluster:
-        # Reclustering -- recursively call the basic jet reco and add this to the sequence,
-        # then add another jet algorithm to run the reclustering step
-        basicJetRecoDict = dict(jetRecoDict)
-        basicJetRecoDict["recoAlg"] = "a4" # Standard size for reclustered
-        (basicJetRecoSequence,basicJetsName) = RecoFragmentsPool.retrieve(jetRecoSequence,None,dataSource=dataSource, **basicJetRecoDict)
-        recoSeq += basicJetRecoSequence
-
-        rcJetPtMin = 15e3 # 15 GeV minimum pt for jets to be reclustered
-        from JetRec.JetRecConf import JetViewAlg
-        filteredJetsName = basicJetsName+"_pt15"
-        recoSeq += JetViewAlg("jetview_"+filteredJetsName,
-                              InputContainer=basicJetsName,
-                              OutputContainer=filteredJetsName,
-                              PtMin=rcJetPtMin)
-    
-        rcJetDef = JetRecoConfiguration.defineReclusteredJets(jetRecoDict)
-        rcJetDef.inputdef.inputname = filteredJetsName
-        rcJetsFullName = jetNamePrefix+rcJetDef.basename+"RCJets_"+jetRecoDict["jetCalib"]
-        rcModList = [] # Could set substructure mods
-        rcJetDef.modifiers = rcModList
-
-        rcConstitPJAlg = getConstitPJGAlg( rcJetDef.inputdef )
-        rcConstitPJKey = rcConstitPJAlg.OutputContainer
-        recoSeq += conf2toConfigurable( rcConstitPJAlg )
-
-        # Get online monitoring tool
-        from JetRec import JetOnlineMon
-        monTool = JetOnlineMon.getMonTool_TrigJetAlgorithm("HLTJets/"+rcJetsFullName+"/")
-
-        rcPJs = [rcConstitPJKey]
-        rcJetRecAlg = getJetAlgorithm(rcJetsFullName, rcJetDef, rcPJs, rcModList, monTool)
-
-        recoSeq += conf2toConfigurable( rcJetRecAlg )
-
-        sequenceOut = recordable(rcJetsFullName)
+    # Set up tracking sequence -- may need to reorganise or relocate
+    # depending on how we want to handle HLT preselection
+    trkcolls = None
+    if jetRecoDict["trkopt"] != "notrk":
+        from .JetTrackingConfig import JetTrackingSequence
+        (jettrkseq, trkcolls) = RecoFragmentsPool.retrieve( JetTrackingSequence, configFlags, trkopt=jetRecoDict["trkopt"], RoIs=RoIs)
+        recoSeq += jettrkseq
+
+    # Potentially add particle flow reconstruction
+    # Work in progress
+    if "pf" in jetRecoDict["dataType"]:
+        if jetRecoDict["trkopt"] == "notrk":
+            raise RuntimeError("PFlow jet chain requested with no tracking option!")
+        from eflowRec.PFHLTSequence import PFHLTSequence
+        (pfseq, pfoPrefix) = RecoFragmentsPool.retrieve(PFHLTSequence, configFlags, clustersin=clustersKey, tracktype=jetRecoDict["trkopt"])
+        recoSeq += pfseq
+        jetDef = JetRecoConfiguration.defineJets(jetRecoDict,pfoPrefix=pfoPrefix)
+    else:
+        jetDef = JetRecoConfiguration.defineJets(jetRecoDict,clustersKey=clustersKey)
+    useConstitMods = ["sktc","cssktc", "pf", "csskpf"]
+    doConstitMods = jetRecoDict["dataType"] in useConstitMods
 
-    elif doGrooming:
-        # Grooming needs to be set up similarly to reclustering
-        # --> build ungroomed jets, then add a grooming alg
-        ungroomedJetRecoDict = dict(jetRecoDict)
-        ungroomedJetRecoDict["recoAlg"] = ungroomedJetRecoDict["recoAlg"].rstrip("tsd") # Drop grooming spec
-        ungroomedJetRecoDict["jetCalib"] = "nojcalib" # No need to calibrate
-        ungroomedDef = JetRecoConfiguration.defineJets(ungroomedJetRecoDict)
+    # chosen jet collection
+    jetsFullName = jetNamePrefix+jetDef.basename+"Jets_"+jetRecoDict["jetCalib"]
+    if jetRecoDict["trkopt"] != "notrk":
+        jetsFullName += "_{}".format(jetRecoDict["trkopt"])
+    sequenceOut = recordable(jetsFullName)
 
-        (ungroomedJetRecoSequence,ungroomedJetsName) = RecoFragmentsPool.retrieve(jetRecoSequence,None,dataSource=dataSource, **ungroomedJetRecoDict)
-        recoSeq += conf2toConfigurable( ungroomedJetRecoSequence )
-        # Need to forward the pseudojets of the parents to the groomer
-        parentpjs = getattr(ungroomedJetRecoSequence,"jetalg_{}".format(ungroomedJetsName)).Tools[0].InputPseudoJets
+    if doConstitMods:
+        # Get online monitoring jet rec tool
+        from JetRecTools import OnlineMon                                                  
+        monJetRecTool = OnlineMon.getMonTool_Algorithm("HLTJets/"+jetsFullName+"/")
 
-        groomDef = JetRecoConfiguration.defineGroomedJets(jetRecoDict,ungroomedDef,ungroomedJetsName)
-        groomedJetsFullName = jetNamePrefix+groomDef.basename+"Jets_"+jetRecoDict["jetCalib"]
+        from JetRecConfig.ConstModHelpers import getConstitModAlg
+        if jetRecoDict["trkopt"] == "notrk":
+            recoSeq += getConstitModAlg(jetDef.inputdef,suffix="HLT",tvaKey="JetTrackVtxAssoc",vtxKey="PrimaryVertices",monTool=monJetRecTool)
+        else:
+            recoSeq += getConstitModAlg(jetDef.inputdef,suffix="HLT",tvaKey=trkcolls["TVA"],vtxKey=trkcolls["Vertices"],monTool=monJetRecTool)
+
+    # Add the PseudoJetGetter alg to the sequence
+    constitPJAlg = getConstitPJGAlg( jetDef.inputdef )
+    constitPJKey = constitPJAlg.OutputContainer
+    recoSeq += conf2toConfigurable( constitPJAlg )
+    # Basic list of PseudoJets is just the constituents
+    # Append ghosts (tracks) if desired
+    pjs = [constitPJKey]
+    if trkcolls:
+        pjs.append(trkcolls["GhostTracks"])
+
+    from JetRecConfig import JetRecConfig
+    jetModList = []
+    if jetRecoDict["trkopt"] != "notrk":
+        trkMods = JetRecoConfiguration.defineTrackMods(jetRecoDict["trkopt"])
+        jetModList += trkMods
+
+    rhoKey = "auto"
+    if "sub" in jetRecoDict["jetCalib"]:
+        # Add the event shape alg if needed for area subtraction
+        eventShapeAlg = JetRecConfig.getEventShapeAlg( jetDef.inputdef, constitPJKey, "HLT_" )
+        recoSeq += conf2toConfigurable(eventShapeAlg)
+        # Not currently written because impossible to merge
+        # across event views, which is maybe a concern in
+        # the case of regional PFlow
+        rhoKey = eventShapeAlg.EventDensityTool.OutputContainer
+
+    # Import the standard jet modifiers as defined for offline
+    # We can add/configure these differently if desired. In particular,
+    # we could define a TriggerJetMods module if settings need to
+    # diverge substantially e.g. track/vertex collections
+    calibMods = JetRecoConfiguration.defineCalibFilterMods(jetRecoDict,dataSource, rhoKey)
+    jetModList += calibMods
+
+    # Get online monitoring tool
+    from JetRec import JetOnlineMon
+    monTool = JetOnlineMon.getMonTool_TrigJetAlgorithm("HLTJets/"+jetsFullName+"/")
+
+    # Generate a JetAlgorithm to run the jet finding and modifiers
+    # (via a JetRecTool instance).
+    jetRecAlg = JetRecConfig.getJetAlgorithm(jetsFullName, jetDef, pjs, jetModList, monTool)
+    recoSeq += conf2toConfigurable( jetRecAlg )
+    # End of basic jet reco
+    return recoSeq, sequenceOut, jetDef
+
+# Grooming needs the ungroomed jets to be built first,
+# so call the basic jet reco seq, then add a grooming alg
+def groomedJetRecoSequence( configFlags, dataSource, RoIs, **jetRecoDict ):
+    jetDefString = jetRecoDictToString(jetRecoDict)
+    recoSeq = parOR( "JetGroomSeq_"+jetDefString, [])
+    ungroomedJetRecoDict = dict(jetRecoDict)
+    ungroomedJetRecoDict["recoAlg"] = ungroomedJetRecoDict["recoAlg"].rstrip("tsd") # Drop grooming spec
+    ungroomedJetRecoDict["jetCalib"] = "nojcalib" # No need to calibrate
 
-        groomedModList = JetRecoConfiguration.defineCalibFilterMods(jetRecoDict,dataSource)
-        # Can add substructure mods here
+    (ungroomedJetRecoSequence,ungroomedJetsName, ungroomedDef) = RecoFragmentsPool.retrieve(standardJetRecoSequence,configFlags,dataSource=dataSource,RoIs=RoIs,**ungroomedJetRecoDict)
+    recoSeq += conf2toConfigurable( ungroomedJetRecoSequence )
+    # Need to forward the pseudojets of the parents to the groomer
+    parentpjs = getattr(ungroomedJetRecoSequence,"jetalg_{}".format(ungroomedJetsName)).Tools[0].InputPseudoJets
 
-        # Get online monitoring tool
-        from JetRec import JetOnlineMon
-        monTool = JetOnlineMon.getMonTool_TrigJetAlgorithm("HLTJets/"+groomedJetsFullName+"/")
+    groomDef = JetRecoConfiguration.defineGroomedJets(jetRecoDict,ungroomedDef,ungroomedJetsName)
+    groomedJetsFullName = jetNamePrefix+groomDef.basename+"Jets_"+jetRecoDict["jetCalib"]
+    if jetRecoDict["trkopt"]!="notrk":
+        groomedJetsFullName += "_"+jetRecoDict["trkopt"]
 
-        from JetRecConfig.JetGroomConfig import getJetGroomAlg
-        groomalg = getJetGroomAlg(groomedJetsFullName,groomDef,parentpjs,groomedModList,monTool)
-        recoSeq += conf2toConfigurable( groomalg )
+    groomedModList = JetRecoConfiguration.defineCalibFilterMods(jetRecoDict,dataSource)
+    # Can add substructure mods here
 
-        sequenceOut = recordable(groomedJetsFullName)
-    else:
-        # Normal jet reconstruction, no reclustering or grooming
-
-        # Start by adding the topocluster reco sequence
-        # This makes EM clusters!
-        from TriggerMenuMT.HLTMenuConfig.CommonSequences.CaloSequenceSetup import (
-                caloClusterRecoSequence, LCCaloClusterRecoSequence)
-        if jetRecoDict["calib"] == "em":
-            topoClusterSequence, clustersKey = RecoFragmentsPool.retrieve(
-                    caloClusterRecoSequence, flags=None, RoIs=RoIs)
-        elif jetRecoDict["calib"] == "lcw":
-            topoClusterSequence, clustersKey = RecoFragmentsPool.retrieve(
-                    LCCaloClusterRecoSequence, flags=None, RoIs=RoIs)
-        else:
-            raise ValueError("Invalid value for calib: '{}'".format(jetRecoDict["calib"]))
-        recoSeq += topoClusterSequence
-
-        # Set up tracking sequence -- may need to reorganise or relocate
-        # depending on how we want to handle HLT preselection
-        trkcolls = None
-        if jetRecoDict["trkopt"] != "notrk":
-            from .JetTrackingConfig import JetTrackingSequence
-            (jettrkseq, trkcolls) = RecoFragmentsPool.retrieve( JetTrackingSequence, None, trkopt=jetRecoDict["trkopt"], RoIs=RoIs)
-            recoSeq += jettrkseq
-
-        # Potentially add particle flow reconstruction
-        # Work in progress
-        if "pf" in jetRecoDict["dataType"]:
-            if jetRecoDict["trkopt"] == "notrk":
-                raise RuntimeError("PFlow jet chain requested with no tracking option!")
-            from eflowRec.PFHLTSequence import PFHLTSequence
-            (pfseq, pfoPrefix) = RecoFragmentsPool.retrieve(PFHLTSequence, None, clustersin=clustersKey, tracktype=jetRecoDict["trkopt"])
-            recoSeq += pfseq
-            jetDef = JetRecoConfiguration.defineJets(jetRecoDict,pfoPrefix=pfoPrefix)
-        else:
-            jetDef = JetRecoConfiguration.defineJets(jetRecoDict,clustersKey=clustersKey)
-        useConstitMods = ["sktc","cssktc", "pf", "csskpf"]
-        doConstitMods = jetRecoDict["dataType"] in useConstitMods
-
-        # chosen jet collection
-        jetsFullName = jetNamePrefix+jetDef.basename+"Jets_"+jetRecoDict["jetCalib"]
-        if jetRecoDict["trkopt"] != "notrk":
-            jetsFullName += "_{}".format(jetRecoDict["trkopt"])
-        sequenceOut = recordable(jetsFullName)
-
-        if doConstitMods:
-            # Get online monitoring jet rec tool
-            from JetRecTools import OnlineMon                                                  
-            monJetRecTool = OnlineMon.getMonTool_Algorithm("HLTJets/"+jetsFullName+"/")
-
-            from JetRecConfig.ConstModHelpers import getConstitModAlg
-            if jetRecoDict["trkopt"] == "notrk":
-                recoSeq += getConstitModAlg(jetDef.inputdef,suffix="HLT",tvaKey="JetTrackVtxAssoc",vtxKey="PrimaryVertices",monTool=monJetRecTool)
-            else:
-                recoSeq += getConstitModAlg(jetDef.inputdef,suffix="HLT",tvaKey=trkcolls["TVA"],vtxKey=trkcolls["Vertices"],monTool=monJetRecTool)
-
-        # Add the PseudoJetGetter alg to the sequence
-        constitPJAlg = getConstitPJGAlg( jetDef.inputdef )
-        constitPJKey = constitPJAlg.OutputContainer
-        recoSeq += conf2toConfigurable( constitPJAlg )
-        # Basic list of PseudoJets is just the constituents
-        # Append ghosts (tracks) if desired
-        pjs = [constitPJKey]
-        if trkcolls:
-            pjs.append(trkcolls["GhostTracks"])
-
-        from JetRecConfig import JetRecConfig
-        jetModList = []
-        if jetRecoDict["trkopt"] != "notrk":
-            trkMods = JetRecoConfiguration.defineTrackMods(jetRecoDict["trkopt"])
-            jetModList += trkMods
-
-        rhoKey = "auto"
-        if "sub" in jetRecoDict["jetCalib"]:
-            # Add the event shape alg if needed for area subtraction
-            eventShapeAlg = JetRecConfig.getEventShapeAlg( jetDef.inputdef, constitPJKey, "HLT_" )
-            recoSeq += conf2toConfigurable(eventShapeAlg)
-            # Not currently written because impossible to merge
-            # across event views, which is maybe a concern in
-            # the case of regional PFlow
-            rhoKey = eventShapeAlg.EventDensityTool.OutputContainer
-
-        # Import the standard jet modifiers as defined for offline
-        # We can add/configure these differently if desired. In particular,
-        # we could define a TriggerJetMods module if settings need to
-        # diverge substantially e.g. track/vertex collections
-        calibMods = JetRecoConfiguration.defineCalibFilterMods(jetRecoDict,dataSource, rhoKey)
-        jetModList += calibMods
-
-        # Get online monitoring tool
-        from JetRec import JetOnlineMon
-        monTool = JetOnlineMon.getMonTool_TrigJetAlgorithm("HLTJets/"+jetsFullName+"/")
-
-        # Generate a JetAlgorithm to run the jet finding and modifiers
-        # (via a JetRecTool instance).
-        jetRecAlg = JetRecConfig.getJetAlgorithm(jetsFullName, jetDef, pjs, jetModList, monTool)
-        recoSeq += conf2toConfigurable( jetRecAlg )
-        # End of basic jet reco
-        pass
-
-    return (recoSeq,sequenceOut)
+    # Get online monitoring tool
+    from JetRec import JetOnlineMon
+    monTool = JetOnlineMon.getMonTool_TrigJetAlgorithm("HLTJets/"+groomedJetsFullName+"/")
+
+    from JetRecConfig.JetGroomConfig import getJetGroomAlg
+    groomalg = getJetGroomAlg(groomedJetsFullName,groomDef,parentpjs,groomedModList,monTool)
+    recoSeq += conf2toConfigurable( groomalg )
+
+    sequenceOut = recordable(groomedJetsFullName)
+    jetDef = groomDef
+    return recoSeq, sequenceOut, jetDef
+
+
+# Reclustering -- call the basic jet reco and add this to the sequence,
+# then add another jet algorithm to run the reclustering step
+def reclusteredJetRecoSequence( configFlags, dataSource, RoIs, **jetRecoDict ):
+    jetDefString = jetRecoDictToString(jetRecoDict)
+    recoSeq = parOR( "JetReclusterSeq_"+jetDefString, [])
+
+    basicJetRecoDict = dict(jetRecoDict)
+    basicJetRecoDict["recoAlg"] = "a4" # Standard size for reclustered
+    (basicJetRecoSequence,basicJetsName, basicJetDef) = RecoFragmentsPool.retrieve(standardJetRecoSequence,configFlags,dataSource=dataSource,RoIs=RoIs,**basicJetRecoDict)
+    recoSeq += basicJetRecoSequence
+
+    rcJetPtMin = 15e3 # 15 GeV minimum pt for jets to be reclustered
+    from JetRec.JetRecConf import JetViewAlg
+    filteredJetsName = basicJetsName+"_pt15"
+    recoSeq += JetViewAlg("jetview_"+filteredJetsName,
+                          InputContainer=basicJetsName,
+                          OutputContainer=filteredJetsName,
+                          PtMin=rcJetPtMin)
+
+    rcJetDef = JetRecoConfiguration.defineReclusteredJets(jetRecoDict)
+    rcJetDef.inputdef.inputname = filteredJetsName
+    rcJetsFullName = jetNamePrefix+rcJetDef.basename+"RCJets_"+jetRecoDict["jetCalib"]
+    rcModList = [] # Could set substructure mods
+    rcJetDef.modifiers = rcModList
+
+    rcConstitPJAlg = getConstitPJGAlg( rcJetDef.inputdef )
+    rcConstitPJKey = rcConstitPJAlg.OutputContainer
+    recoSeq += conf2toConfigurable( rcConstitPJAlg )
+
+    # Get online monitoring tool
+    from JetRec import JetOnlineMon
+    monTool = JetOnlineMon.getMonTool_TrigJetAlgorithm("HLTJets/"+rcJetsFullName+"/")
+
+    rcPJs = [rcConstitPJKey]
+    rcJetRecAlg = getJetAlgorithm(rcJetsFullName, rcJetDef, rcPJs, rcModList, monTool)
+
+    recoSeq += conf2toConfigurable( rcJetRecAlg )
+
+    sequenceOut = recordable(rcJetsFullName)
+    jetDef = rcJetDef
+    return recoSeq, sequenceOut, jetDef
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MET/AlgConfigs.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MET/AlgConfigs.py
index 7a4936428fde58f0227a1147080ba78bce370c64..0d8ee40c27af82dab0051e271acaf1be136c5bc1 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MET/AlgConfigs.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MET/AlgConfigs.py
@@ -8,6 +8,8 @@ from ..Menu.SignatureDicts import METChainParts
 import GaudiKernel.SystemOfUnits as Units
 import TrigEFMissingET.PUClassification as PUClassification
 
+from AthenaConfiguration.AllConfigFlags import ConfigFlags
+
 from AthenaCommon.Logging import logging
 
 log = logging.getLogger(__name__)
@@ -121,8 +123,8 @@ class MHTConfig(AlgConfig):
         # TODO - right now jet calibration is hardcoded to EM
         jetRecoDict["calib"] = "em"
         jetRecoDict["jetCalib"] = "subjes"
-        jetSeq, jetName = RecoFragmentsPool.retrieve(
-            jetRecoSequence, None, dataSource="data", **jetRecoDict
+        jetSeq, jetName, jetDef = RecoFragmentsPool.retrieve(
+            jetRecoSequence, ConfigFlags, **jetRecoDict
         )
 
         self.inputs = [jetSeq]
@@ -142,8 +144,8 @@ class TrkMHTConfig(AlgConfig):
         jetRecoDict = jetRecoDictForMET(trkopt="ftf", **recoDict)
         # TODO - right now jet calibration is hardcoded to EM
         jetRecoDict["calib"] = "em"
-        jetSeq, jetName = RecoFragmentsPool.retrieve(
-            jetRecoSequence, None, dataSource="data", **jetRecoDict
+        jetSeq, jetName, jetDef = RecoFragmentsPool.retrieve(
+            jetRecoSequence, ConfigFlags, **jetRecoDict
         )
 
         # These are the names set by the upstream algorithms. Unfortunately
@@ -281,8 +283,8 @@ class MHTPufitConfig(AlgConfig):
         # If this is PFlow then set the calib type to "em"
         if recoDict["jetDataType"] == "pf":
             jetRecoDict["calib"] = "em"
-        jetSeq, jetName = RecoFragmentsPool.retrieve(
-            jetRecoSequence, flags=None, dataSource="data", **jetRecoDict
+        jetSeq, jetName, jetDef = RecoFragmentsPool.retrieve(
+            jetRecoSequence, flags=ConfigFlags, **jetRecoDict
         )
 
         # We need to get the input name that the jet sequence used
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainConfigurationBase.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainConfigurationBase.py
index b40874b46402d62d2b21fe91bfac1a2333a00b62..c3553ff78002a65c4f259830d39a4a5b0a64f2e7 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainConfigurationBase.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainConfigurationBase.py
@@ -59,9 +59,32 @@ class ChainConfigurationBase(object):
         return ChainStep(stepName, Sequences=[], multiplicity=[] ,chainDicts=[self.dict])
  
     def buildChain(self, chainSteps):
+    
+        alignmentGroups = []
+        if isinstance(self.chainPart, dict):
+            alignmentGroups = [self.chainPart['alignmentGroup']]
+        elif isinstance(self.chainPart, list):
+            
+            alignmentGroups = [cp['alignmentGroup'] for cp in self.chainPart]
+            testAlignGrps = list(set(alignmentGroups))
+            if not(len(testAlignGrps) == 1 and testAlignGrps[0] == 'JetMET'):
+                log.error("ChainConfigurationBase.buildChain(): number of chainParts does not correspond chainSteps")    
+                log.error('ChainConfigurationBase.buildChain() chainPart: %s',self.chainPart)
+                log.error("ChainConfigurationBase.buildChain() alignmentGroups: %s", alignmentGroups)
+                log.error("ChainConfigurationBase.buildChain() chainName: %s", self.chainName)
+                log.error("ChainConfigurationBase.buildChain() chainSteps: %s", chainSteps)               
+            else:
+                alignmentGroups = testAlignGrps            
+   
+        else:
+            log.error("ChainConfigurationBase.buildChain(): chainPart is not a list or dict, not sure what to do here! %s	", self.chainPart)
+              
         myChain = Chain(name = self.chainName,
                         ChainSteps = chainSteps,
-                        L1Thresholds = [self.L1Threshold] )
+                        L1Thresholds = [self.L1Threshold],
+                        nSteps = [len(chainSteps)], # not true for combined chains
+                        alignmentGroups = alignmentGroups
+                         )
 
         return myChain
 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainDictTools.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainDictTools.py
index e2752a8dcdfeba96e95041d573d167496a34cd65..3bedb167003137d9673ad61ae5ca8ee32ad8f27c 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainDictTools.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainDictTools.py
@@ -65,7 +65,7 @@ def splitInterSignatureChainDict(chainDict):
                     
     #log.info("ListOfSplitChainDicts", chainPart['chainPartName'])
     
-    #oder the splitted dicts
+    #order the splitted dicts
     orderedListOfSplitChainDicts = []
     if "mergingOrder" not in chainDict:
         log.debug("No merging order given for chain %s.", chainDict['chainName'])
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainMerging.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainMerging.py
index 0ae26774ca477cd791bdee383f7838b4a873b72a..6bdde51d52cfdac5accb3ada741aaa3db120e86d 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainMerging.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainMerging.py
@@ -10,6 +10,9 @@ import re
 
 def mergeChainDefs(listOfChainDefs, chainDict):
 
+    #chainDefList is a list of Chain() objects
+    #one for each part in the chain
+
     strategy = chainDict["mergingStrategy"]
     offset = chainDict["mergingOffset"]
     log.info("%s: Combine by using %s merging", chainDict['chainName'], strategy)
@@ -33,18 +36,23 @@ def mergeParallel(chainDefList, offset):
     nSteps = []
     chainName = ''
     l1Thresholds = []
-
+    alignmentGroups = []
 
     for cConfig in chainDefList:
         if chainName == '':
             chainName = cConfig.name
         elif chainName != cConfig.name:
             log.error("Something is wrong with the combined chain name: cConfig.name = %s while chainName = %s", cConfig.name, chainName)
-            
+        
         allSteps.append(cConfig.steps)
         nSteps.append(len(cConfig.steps))
         l1Thresholds.extend(cConfig.vseeds)
-
+        if len(cConfig.alignmentGroups) > 1:
+            log.error("Merging an already merged chain? This is odd! %s",cConfig.alignmentGroups)
+        elif len(cConfig.alignmentGroups) == 1:
+            alignmentGroups.append(cConfig.alignmentGroups[0])
+        else: 
+            log.info("Alignment groups are empty for this combined chain - if this is not _newJO, this is not ok!")
     import itertools
     if 'zip_longest' in dir(itertools):
         from itertools import zip_longest
@@ -61,7 +69,8 @@ def mergeParallel(chainDefList, offset):
         combStep = makeCombinedStep(mySteps, step_index+1, chainDefList)
         combChainSteps.append(combStep)
                                   
-    combinedChainDef = Chain(chainName, ChainSteps=combChainSteps, L1Thresholds=l1Thresholds)
+    combinedChainDef = Chain(chainName, ChainSteps=combChainSteps, L1Thresholds=l1Thresholds, 
+                                nSteps = nSteps, alignmentGroups = alignmentGroups)
 
     log.debug("Parallel merged chain %s with these steps:", chainName)
     for step in combinedChainDef.steps:
@@ -113,7 +122,7 @@ def mergeSerial(chainDefList):
     nSteps = []
     chainName = ''
     l1Thresholds = []
-
+    alignmentGroups = []
     log.debug('Merge chainDefList:')
     log.debug(chainDefList)
 
@@ -126,6 +135,9 @@ def mergeSerial(chainDefList):
         allSteps.append(cConfig.steps)
         nSteps.append(len(cConfig.steps))
         l1Thresholds.extend(cConfig.vseeds)
+        if len(cConfig.alignmentGroups) > 1:
+            log.error("Merging an already merged chain? This is odd! %s",cConfig.alignmentGroups)
+        alignmentGroups.append(cConfig.alignmentGroups[0])
 
     serialSteps = serial_zip(allSteps, chainName)
     mySerialSteps = deepcopy(serialSteps)
@@ -142,7 +154,8 @@ def mergeSerial(chainDefList):
     else:
         log.info("Have to deal with uneven number of chain steps, there might be none's appearing in sequence list => to be fixed")
                                   
-    combinedChainDef = Chain(chainName, ChainSteps=combChainSteps, L1Thresholds=l1Thresholds)
+    combinedChainDef = Chain(chainName, ChainSteps=combChainSteps, L1Thresholds=l1Thresholds,
+                               nSteps = nSteps, alignmentGroups = alignmentGroups)
 
     log.debug("Serial merged chain %s with these steps:", chainName)
     for step in combinedChainDef.steps:
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/DictFromChainName.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/DictFromChainName.py
index ba67d57d90669fb183d037cf33d8cf3796b5266f..43c8626b8c53888335abf2fec51b8454c0dc5f05 100755
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/DictFromChainName.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/DictFromChainName.py
@@ -221,7 +221,9 @@ def analyseChainName(chainName, L1thresholds, L1item):
     # ---- obtain dictionary parts for signature defining patterns ----
     from .SignatureDicts import getSignatureNameFromToken, AllowedCosmicChainIdentifiers, \
         AllowedCalibChainIdentifiers, AllowedMonitorChainIdentifiers, AllowedBeamspotChainIdentifiers
-
+    
+    from .MenuAlignmentTools import getAlignmentGroupFromPattern
+    
     def buildDict(signature, sigToken ):
         groupdict = {'signature': signature, 'threshold': '', 'multiplicity': '',
                      'trigType': sigToken, 'extra': ''}
@@ -256,7 +258,10 @@ def analyseChainName(chainName, L1thresholds, L1item):
             log.debug("multichainindex: %s", multichainindex)
 
             sName = getSignatureNameFromToken(cpart)
+            
             groupdict['signature'] = sName
+            groupdict['alignmentGroup'] = getAlignmentGroupFromPattern(sName, groupdict['extra'])
+            
             log.debug('groupdictionary groupdict: %s', groupdict)
             mdicts.append(groupdict)
 
@@ -268,7 +273,7 @@ def analyseChainName(chainName, L1thresholds, L1item):
             for chainCategory in [(['mb'], 'MinBias', 'mb'),
                                   (['hi'], 'HeavyIon', 'mb'),
                                   (AllowedCosmicChainIdentifiers, 'Cosmic', 'cosmic'),
-                                  (AllowedCalibChainIdentifiers, 'Calibration', 'calib'),
+                                  (AllowedCalibChainIdentifiers, 'Calib', 'calib'),
                                   (AllowedMonitorChainIdentifiers, 'Monitor', 'calib'),
                                   (AllowedBeamspotChainIdentifiers, 'Beamspot', 'beamspot'),
                                   (['eb'], 'EnhancedBias', 'eb') ]:
@@ -338,6 +343,7 @@ def analyseChainName(chainName, L1thresholds, L1item):
         chainProperties['multiplicity'] = multiplicity
         chainProperties['threshold']=mdicts[chainindex]['threshold']
         chainProperties['signature']=mdicts[chainindex]['signature']
+        chainProperties['alignmentGroup'] = getAlignmentGroupFromPattern(mdicts[chainindex]['signature'], mdicts[chainindex]['extra'])
 
         # if we have a L1 topo in a multi-chain then we want to remove it from the chain name
         # but only if it's the same as the L1item_main; otherwise it belongs to chain part and we q
@@ -351,18 +357,20 @@ def analyseChainName(chainName, L1thresholds, L1item):
 
         log.debug('Chainparts: %s', chainparts)
         if (chainProperties['signature'] != 'Cosmic') \
-                & (chainProperties['signature'] != 'Calibration')\
+                & (chainProperties['signature'] != 'Calib')\
                 & (chainProperties['signature'] != 'Streaming') \
                 & (chainProperties['signature'] != 'Beamspot') \
                 & (chainProperties['signature'] != 'Monitor') :
             parts.pop(0)
 
 
-        #---- Check if topo is a bphsyics topo -> change signature ----
+        #---- Check if topo is a bphysics topo -> change signature ----
         from .SignatureDicts import AllowedTopos_Bphysics
         for t in genchainDict['topo']:
             if (t in AllowedTopos_Bphysics):
                 chainProperties['signature'] = 'Bphysics'
+                chainProperties['alignmentGroup'] = getAlignmentGroupFromPattern('Bphysics', mdicts[chainindex]['extra'])
+
 
 
         # ---- import the relevant dictionaries for each part of the chain ----
@@ -432,8 +440,8 @@ def analyseChainName(chainName, L1thresholds, L1item):
 
         # ---- remove properties that aren't allowed in the chain properties for a given siganture ----
         forbiddenProperties = set(chainProperties.keys()) - set(allowedSignaturePropertiesAndValues.keys())
-        log.debug('chainPropertie:s %s', set(chainProperties.keys()))
-        log.debug('allowedSignaturePropertiesAndValues: %s', set(allowedSignaturePropertiesAndValues.keys()))
+        log.debug('chainProperties: %s', sorted(set(chainProperties.keys())))
+        log.debug('allowedSignaturePropertiesAndValues: %s', sorted(set(allowedSignaturePropertiesAndValues.keys())))
         for fb in forbiddenProperties:
             forbiddenValue = chainProperties.pop(fb)
             assert forbiddenValue == '', "Property {} not allowed for signature '{}', but specified '{}'".format (fb, chainProperties['signature'], forbiddenValue)
@@ -448,7 +456,9 @@ def analyseChainName(chainName, L1thresholds, L1item):
     for cPart in allChainProperties:
         if cPart['signature'] == 'Jet' and cPart['bTag'] != '':
             cPart['signature'] = 'Bjet'
+            cPart['alignmentGroup'] = getAlignmentGroupFromPattern('Bjet', cPart['extra'])
         genchainDict['signatures'] += [cPart['signature']]
+        genchainDict['alignmentGroups'] += [cPart['alignmentGroup']]
 
     #genchainDict['signature'] = allChainProperties[0]['signature']
 
@@ -480,7 +490,8 @@ def dictFromChainName(chainInfo):
         mergingOrder    = []
         topoStartFrom   = ''
 
-    elif 'ChainProp' in str(type(chainInfo)):
+    elif 'ChainProp' in str(type(chainInfo)):	
+        #this is how we define chains in the menu - the normal behaviour of this function
         chainName       = chainInfo.name
         l1Thresholds    = chainInfo.l1SeedThresholds
         stream          = chainInfo.stream
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py
index fd6cedfbc4a87b37f260bd87b975ce8747e2e052..139b8e871d87f2a9faa5eea11c9ae40af521edff 100755
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py
@@ -16,7 +16,7 @@ from TriggerMenuMT.HLTMenuConfig.Menu.DictFromChainName import dictFromChainName
 from TriggerMenuMT.HLTMenuConfig.Menu.ChainDictTools import splitInterSignatureChainDict
 from TriggerMenuMT.HLTMenuConfig.Menu.MenuPrescaleConfig import MenuPrescaleConfig, applyHLTPrescale
 from TriggerMenuMT.HLTMenuConfig.Menu.ChainMerging import mergeChainDefs
-from TriggerMenuMT.HLTMenuConfig.Menu.MenuAlignmentTools import analyseCombinations, groupSignatures, setChainSignatures
+from TriggerMenuMT.HLTMenuConfig.Menu.MenuAlignmentTools import analyseCombinations
 from TriggerMenuMT.HLTMenuConfig.CommonSequences import EventBuildingSequenceSetup
 
 from AthenaCommon.Logging import logging
@@ -67,7 +67,7 @@ class GenerateMenuMT(object):
         self.allSignatures = ['Egamma', 'Muon', 'Jet', 'Bjet', 'Bphysics', 'MET', 'Tau',
                               'HeavyIon', 'Beamspot', 'Cosmic', 'EnhancedBias',
                               'Monitor', 'Calib', 'Streaming', 'Combined', 'MinBias', 'Test'] #, AFP
-        self.calibCosmicMonSigs = ['Streaming','Monitor','Beamspot','Cosmic'] #others not implemented yet ['Beamspot', 'Cosmic', 'EnhancedBias', 'Monitor', 'Calib', 'Streaming']
+        self.calibCosmicMonSigs = ['Streaming','Monitor','Beamspot','Cosmic', 'Calib'] #others not implemented yet ['Beamspot', 'Cosmic', 'EnhancedBias', 'Monitor', 'Calib', 'Streaming']
 
         # flags
         self.doEgammaChains         = True
@@ -81,7 +81,7 @@ class GenerateMenuMT(object):
         self.doMinBiasChains        = True
         self.doHeavyIonChains       = True
         self.doCosmicChains         = True
-        self.doCalibrationChains    = True
+        self.doCalibChains    = True
         self.doStreamingChains      = True
         self.doMonitorChains        = True
         self.doBeamspotChains       = True
@@ -168,7 +168,7 @@ class GenerateMenuMT(object):
 
         all_chains = []
         combinations_in_menu = []
-        signatures_to_align = set()
+        alignmentGroups_to_align = set()
         length_of_configs = {}
         for chain in chainsInMenu:
             log.debug("Now processing chain: %s ", chain) 
@@ -185,46 +185,33 @@ class GenerateMenuMT(object):
             
             all_chains += [(chainDict,chainConfig,lengthOfChainConfigs)]
             
-            #update the signature length dictionary if we have a longer number of steps
+            #update the alignment group length dictionary if we have a longer number of steps
             #or the signature isn't registered in the dictionary yet
-            for config_length, config_sig in lengthOfChainConfigs:
-                if config_sig in length_of_configs:
-                    if config_length > length_of_configs[config_sig]:
-                        length_of_configs[config_sig] = config_length
+            for config_length, config_grp in lengthOfChainConfigs:
+                if config_grp in length_of_configs:
+                    if config_length > length_of_configs[config_grp]:
+                        length_of_configs[config_grp] = config_length
                 else:
-                    length_of_configs[config_sig] = config_length
-
-            # find the chains that contain more than one signature - what combinations do we need to deal with?
-            # using sets here so we don't end up with duplicates - though in the future this may have to be revisited
-            # if we split signatures into multiple types of algorithm
-            if len(set(chainDict['signatures'])) > 1:  
-                combinations_in_menu += [list(set(chainDict['signatures']))]
-                for sig in list(set(chainDict['signatures'])):
-                    signatures_to_align.update([sig])
+                    length_of_configs[config_grp] = config_length
+
+            # find the chains that contain more than one alignment group, to keep track
+            # of what combinations do we need to deal with.
+            # we're using sets here so we don't end up with duplicates
+            if len(set(chainDict['alignmentGroups'])) > 1:  
+                combinations_in_menu += [list(set(chainDict['alignmentGroups']))]
+                for align_group in list(set(chainDict['alignmentGroups'])):
+                    alignmentGroups_to_align.update([align_group])
         
         # align event building sequences
         EventBuildingSequenceSetup.alignEventBuildingSteps(all_chains)
 
-        #will likely always be true, but the grouping could be redefined
-        groupPeskySignatures = True
-        
-        if groupPeskySignatures:    
-            # do some replacing of Electron --> Egamma, Photon --> Egamma
-            # Jet/MET/b-jet --> JetMET
-            # B-physics chains are hard-coded as muon chains, since they run muons
-            #    --> any B-->ee chains would need to be set as egamma!
-        
-            # these modified signatures are only used for the aligning! We don't overwrite 
-            # any of the signatures the chains are in.
-            combinations_in_menu,signatures_to_align,length_of_configs = groupSignatures(combinations_in_menu, signatures_to_align,length_of_configs)
-
-
         #dict of signature: set it belongs to
         #e.g. {'Electron': ['Electron','Muon','Photon']}        
-        signature_sets_to_align = analyseCombinations(combinations_in_menu, signatures_to_align, doGroupSignatures = groupPeskySignatures)
-        
-        log.debug('Aligning the following signatures with sets: %s',signature_sets_to_align)
+        alignmentGroup_sets_to_align = analyseCombinations(combinations_in_menu, alignmentGroups_to_align)
         
+        log.debug('Aligning the following signatures with sets: %s',sorted(alignmentGroup_sets_to_align))
+        log.debug('Length of each of the alignment groups: %s',length_of_configs)
+
         for chainDict,chainConfig,lengthOfChainConfigs in all_chains:
         
               # start by ordering electron, photon, muon by having e+mu, g+mu, e+g chains
@@ -236,50 +223,47 @@ class GenerateMenuMT(object):
               # is greater than the number of electron steps combined chain. Assume that the max length of an electron chain occurs 
               # in a combined chain.
               
-              signatures = chainDict['signatures']
-              
-              if groupPeskySignatures:
-                signatures, lengthOfChainConfigs = setChainSignatures(signatures, lengthOfChainConfigs)
-    
+              alignmentGroups = chainDict['alignmentGroups']
+            
               #parallel-merged single-signature chains or single signature chains. Anything that needs no splitting!
-              if len(set(signatures)) == 1: 
-                  if signatures[0] not in signature_sets_to_align or len(signature_sets_to_align[signatures[0]]) == 1:
-                      # no need to align lonely signatures
-                      # the latter condition should never happen, because we only put in signatures that are 
+              if len(set(alignmentGroups)) == 1: 
+                  if alignmentGroups[0] not in alignmentGroup_sets_to_align or len(alignmentGroup_sets_to_align[alignmentGroups[0]]) == 1:
+                      # no need to align lonely alignment groups
+                      # the latter condition should never happen, because we only put in alignment groups that are 
                       # in combined chains, and thus will need *some* aligning. but good to check in any case.
-                      log.debug("Finished with retrieving chain configuration for chain %s", chain.name)
+                      log.debug("Finished with retrieving chain configuration for chain %s", chainDict['chainName'])
                       chainConfig.numberAllSteps()
                       TriggerConfigHLT.registerChain( chainDict, chainConfig )
                       continue
-                  elif signatures[0] == signature_sets_to_align[signatures[0]][0]:
+                  elif alignmentGroups[0] == alignmentGroup_sets_to_align[alignmentGroups[0]][0]:
                       # if it's the first chain in the set to be aligned, again - nothing to do here.
-                      log.debug("Finished with retrieving chain configuration for chain %s", chain.name) 
+                      log.debug("Finished with retrieving chain configuration for chain %s", chainDict['chainName']) 
                       chainConfig.numberAllSteps()
                       TriggerConfigHLT.registerChain( chainDict, chainConfig )
                       continue                       
                   else:
                       # now we know that empty steps are necessary before this chain. we can loop through and add accordingly
                       # but we want to do this in reverse
-                      the_align_sigs = signature_sets_to_align[signatures[0]][:signature_sets_to_align[signatures[0]].index(signatures[0])]
+                      the_align_sigs = alignmentGroup_sets_to_align[alignmentGroups[0]][:alignmentGroup_sets_to_align[alignmentGroups[0]].index(alignmentGroups[0])]
                       the_align_sigs.reverse()
                       
                       for align_sig in the_align_sigs:
                           chainConfig.insertEmptySteps(chainDict,'Empty'+align_sig+'Align',length_of_configs[align_sig],0)         
 
-                      log.debug("Finished with retrieving chain configuration for chain %s", chain.name)
+                      log.debug("Finished with retrieving chain configuration for chain %s", chainDict['chainName'])
                       chainConfig.numberAllSteps()
                       TriggerConfigHLT.registerChain( chainDict, chainConfig )
                           
-              elif len(signatures) == 2:
+              elif len(alignmentGroups) == 2:
                   #check for a few bad conditions first:
-                  if(signatures[0] not in signature_sets_to_align or signatures[1] not in signature_sets_to_align):
-                      log.error(" one of the signatures in %s is not available in the sets to align dictionary!", signatures)
-                  elif signature_sets_to_align[signatures[0]] != signature_sets_to_align[signatures[1]]:
-                      log.error(" the two signatures %s point to different sets in the sets to align dictionary. Set1: %s, set2: %s!", 
-                                signatures, signature_sets_to_align[signatures[0]],signature_sets_to_align[signatures[1]])
+                  if(alignmentGroups[0] not in alignmentGroup_sets_to_align or alignmentGroups[1] not in alignmentGroup_sets_to_align):
+                      log.error(" one of the alignmentGroups in %s is not available in the sets to align dictionary!", alignmentGroups)
+                  elif alignmentGroup_sets_to_align[alignmentGroups[0]] != alignmentGroup_sets_to_align[alignmentGroups[1]]:
+                      log.error(" the two alignmentGroups %s point to different sets in the sets to align dictionary. Set1: %s, set2: %s!", 
+                                alignmentGroups, alignmentGroup_sets_to_align[alignmentGroups[0]],alignmentGroup_sets_to_align[alignmentGroups[1]])
                 
-                  if len(signature_sets_to_align[signatures[0]]) == 2:
-                      
+                  if len(alignmentGroup_sets_to_align[alignmentGroups[0]]) == 2:
+
                       # if the pair is on its own, then we just make sure the first signature's number
                       # of steps is equal to the max in that signature (so the next signature starts at the right step)
                       
@@ -287,63 +271,74 @@ class GenerateMenuMT(object):
                       # overwrite duplicates yet. 
                       # probably, at some point, will need to divide this beyond signature but instead as unique sequence within a signature. 
                       # munoL1 is already one case...
-                      length_firstsig = 0
-                      max_length_firstsig = length_of_configs[signature_sets_to_align[signatures[0]][0]]
-                      for config_length,config_sig in lengthOfChainConfigs:
-                          if config_sig == signature_sets_to_align[signatures[0]][0]:
-                              length_firstsig = config_length
-                      if length_firstsig < max_length_firstsig:
-                          #too short! gotta add padding steps between two signatures...
-                          needed_steps = max_length_firstsig - length_firstsig
-                          chainConfig.insertEmptySteps(chainDict,'Empty'+signature_sets_to_align[signatures[0]][0]+'Align',needed_steps,length_firstsig) 
+                      length_firstgrp = 0
+                      max_length_firstgrp = length_of_configs[alignmentGroup_sets_to_align[alignmentGroups[0]][0]]
+                      for config_length,config_grp in lengthOfChainConfigs:
+                          if config_grp == alignmentGroup_sets_to_align[alignmentGroups[0]][0]:
+                              length_firstgrp = config_length
+                      if length_firstgrp < max_length_firstgrp:
+                          #too short! need to add padding steps between two alignment groups...
+                          needed_steps = max_length_firstgrp - length_firstgrp
+                          chainConfig.insertEmptySteps(chainDict,'Empty'+alignmentGroup_sets_to_align[alignmentGroups[0]][0]+'Align',needed_steps,length_firstgrp) 
                       
-                      elif length_firstsig > max_length_firstsig:
-                          log.error("%s first signature length %d is greater than the max calculated, %d",chainDict.name,length_firstsig, max_length_firstsig)     
+                      elif length_firstgrp > max_length_firstgrp:
+                          log.error("%s first signature length %d is greater than the max calculated, %d",chainDict.name,length_firstgrp, max_length_firstgrp)     
                   
-                      log.debug("Finished with retrieving chain configuration for chain %s", chain.name)
+                      log.debug("Finished with retrieving chain configuration for chain %s", chainDict['chainName'])
                       chainConfig.numberAllSteps()
                       TriggerConfigHLT.registerChain( chainDict, chainConfig )
   
 
                   #this should probably work for signatures > 2, but might be a few gotchas (and errors need updating)
-                  if len(signature_sets_to_align[signatures[0]]) > 2:
-                      if(signatures[0] not in signature_sets_to_align or signatures[1] not in signature_sets_to_align):
-                          log.error(" one of the signatures in %s is not available in the sets to align dictionary!", signatures)
-                      elif signature_sets_to_align[signatures[0]] != signature_sets_to_align[signatures[1]]:
-                          log.error(" the two signatures %s point to different sets in the sets to align dictionary. Set1: %s, set2: %s!", 
-                                     signatures, signature_sets_to_align[signatures[0]], signature_sets_to_align[signatures[1]])
+                  elif len(alignmentGroup_sets_to_align[alignmentGroups[0]]) > 2:
+                      if(alignmentGroups[0] not in alignmentGroup_sets_to_align or alignmentGroups[1] not in alignmentGroup_sets_to_align):
+                          log.error(" one of the alignmentGroups in %s is not available in the sets to align dictionary!", alignmentGroups)
+                      elif alignmentGroup_sets_to_align[alignmentGroups[0]] != alignmentGroup_sets_to_align[alignmentGroups[1]]:
+                          log.error(" the two alignmentGroups %s point to different sets in the sets to align dictionary. Set1: %s, set2: %s!", 
+                                     alignmentGroups, alignmentGroup_sets_to_align[alignmentGroups[0]], alignmentGroup_sets_to_align[alignmentGroups[1]])
                       
-                      # we need to know which signatures are in the chain in which order. Assume this is always stored correctly.
+                      # we need to know which alignmentGroups are in the chain in which order. Assume this is always stored correctly.
                       # (this should be true)
                       
                       # never need to align the last chain - it can end a different length, no problem.
                       # ignore any signatures after the end of those in this chain
 
-                      the_align_sigs = signature_sets_to_align[signatures[1]][:signature_sets_to_align[signatures[1]].index(signatures[1])]
-                      the_align_sigs.reverse()
-                      
-                      for align_sig in the_align_sigs:
-                          max_length_sig = length_of_configs[align_sig]
-                          if align_sig in signatures:
-                              length_sig = 0
-                              for config_length,config_sig in lengthOfChainConfigs:
-                                  if config_sig == align_sig:
-                                      length_sig = config_length
-                              if length_sig < max_length_sig:
-                                  #too short! gotta add padding steps between two signatures...
-                                  needed_steps = max_length_sig - length_sig
-                                  chainConfig.insertEmptySteps(chainDict,'Empty'+align_sig+'Align',needed_steps,length_sig) 
+                      alignGroups_set = alignmentGroup_sets_to_align[alignmentGroups[1]][:alignmentGroup_sets_to_align[alignmentGroups[1]].index(alignmentGroups[1])]
+                      alignGroups_set.reverse()
+                      grp_masks = [x in alignmentGroups for x in alignGroups_set]
+                      grp_lengths = []
+                      for align_grp,grp_in_chain in zip(alignGroups_set,grp_masks):
+                          if grp_in_chain:
+                              for config_length,config_grp in lengthOfChainConfigs:
+                                if config_grp == align_grp: 
+                                    grp_lengths += [config_length]
+                          else:
+                              grp_lengths += [0]
+                          
+                      for istep,(align_grp,grp_in_chain,length_in_chain) in enumerate(zip(alignGroups_set,grp_masks,grp_lengths)):
+                          # We're working our way backwards through the chain 
+                          # need to know how many steps are already before us!
+                          nSteps_before_grp = 0
+                          if istep < len(grp_lengths)-1: 
+                              nSteps_before_grp = sum(grp_lengths[istep+1:])
+                          max_length_grp = length_of_configs[align_grp]
+                          if grp_in_chain:
+                              if length_in_chain < max_length_grp:
+                                  #too short! gotta add padding steps between two alignmentGroups...
+                                  needed_steps = max_length_grp - length_in_chain
+                                  start_step = nSteps_before_grp + length_in_chain
+                                  chainConfig.insertEmptySteps(chainDict,'Empty'+align_grp+'Align',needed_steps,start_step) 
                           else:
                               # this sig isn't in the chain, but we still will need empty steps for it
                               # always add them to the start, because we're running in reverse order
-                              chainConfig.insertEmptySteps(chainDict,'Empty'+align_sig+'Align',length_of_configs[align_sig],0) 
+                              chainConfig.insertEmptySteps(chainDict,'Empty'+align_grp+'Align',length_of_configs[align_grp],nSteps_before_grp) 
                     
-                      log.debug("Finished with retrieving chain configuration for chain %s", chain.name) 
+                      log.debug("Finished with retrieving chain configuration for chain %s", chainDict['chainName']) 
                       chainConfig.numberAllSteps()
                       TriggerConfigHLT.registerChain( chainDict, chainConfig )               
               
               else: 
-                  log.error("Menu can't deal with combined chains with more than two signatures at the moment. oops...")
+                  log.error("Menu can't deal with combined chains with more than two alignmentGroups at the moment. oops...")
 
               if not TriggerConfigHLT.isChainRegistered(chainDict['chainName']):
                 log.error("Chain %s has not been registered in the menu!", chainDict['chainName'])
@@ -403,7 +398,11 @@ class GenerateMenuMT(object):
         # Assembles the chain configuration and returns a chain object with (name, L1see and list of ChainSteps)
         """
         # check if all the signature files can be imported files can be imported
+        log.debug("[__generateChainConfig] signaturesToGenerate: %s",  self.signaturesToGenerate)
+
         for sig in self.signaturesToGenerate:
+            log.debug("[__generateChainConfig] sig: %s", sig)
+            
             try:
                 if eval('self.do' + sig + 'Chains'):
                     if sig == 'Egamma':
@@ -445,13 +444,17 @@ class GenerateMenuMT(object):
 
         # Loop over all chainDicts and send them off to their respective assembly code
         listOfChainConfigs = []
-        lengthOfChainConfigs = []
-
-        for chainDict in chainDicts:
-            chainConfigs = None
-            currentSig = chainDict['signature']
-            chainName = chainDict['chainName']
-            log.debug('Checking chainDict for chain %s in signature %s' , chainName, currentSig)
+        tmp_lengthOfChainConfigs = []
+
+        for chainPartDict in chainDicts:
+            chainPartConfig = None
+            currentSig = chainPartDict['signature']
+            currentAlignGroup = None
+            if len(chainPartDict['chainParts']) == 1:
+                currentAlignGroup = chainPartDict['chainParts'][0]['alignmentGroup']
+            
+            chainName = chainPartDict['chainName']
+            log.debug('Checking chainDict for chain %s in signature %s, alignment group %s' , chainName, currentSig, currentAlignGroup)
 
             sigFolder = ''
             if currentSig == 'Electron' or currentSig == 'Photon':
@@ -464,16 +467,28 @@ class GenerateMenuMT(object):
             if currentSig in self.availableSignatures and currentSig != 'Combined':
                 try:                    
                     log.debug("Trying to get chain config for %s in folder %s", currentSig, sigFolder)
-                    functionToCall ='TriggerMenuMT.HLTMenuConfig.' + sigFolder + '.Generate' + currentSig + 'ChainDefs.generateChainConfigs(chainDict)' 
-                    chainConfigs = eval(functionToCall)
+                    functionToCall ='TriggerMenuMT.HLTMenuConfig.' + sigFolder + '.Generate' + currentSig + 'ChainDefs.generateChainConfigs(chainPartDict)' 
+                    chainPartConfig = eval(functionToCall)
                 except RuntimeError:
                     log.exception( 'Problems creating ChainDef for chain\n %s ', chainName)
                     continue
             else:
-                log.error('Chain %s ignored - Signature not available', chainDict['chainName'])
-            listOfChainConfigs.append(chainConfigs)
-            lengthOfChainConfigs.append((len(chainConfigs.steps),currentSig))
-
+                log.error('Chain %s ignored - Signature not available', chainPartDict['chainName'])
+            log.debug("Chain %s chain configs: %s",chainPartDict['chainName'],chainPartConfig)
+            listOfChainConfigs.append(chainPartConfig)
+            tmp_lengthOfChainConfigs.append((chainPartConfig.nSteps,chainPartConfig.alignmentGroups))
+
+        # this will be a list of lists for inter-sig combined chains and a list with one 
+        # multi-element list for intra-sig combined chains
+        # here, we flatten it accordingly (works for both cases!)
+        lengthOfChainConfigs = []
+        for nSteps, aGrps in tmp_lengthOfChainConfigs:
+            if len(nSteps) != len(aGrps):
+                log.error("Chain part has %s steps and %s alignment groups - these don't match!",nSteps,aGrps)
+            else:
+                for a,b in zip(nSteps,aGrps):
+                    lengthOfChainConfigs.append((a,b))         
+            
         ## if log.isEnabledFor(logging.DEBUG):
         ##     import pprint
         ##     pp = pprint.PrettyPrinter(indent=4, depth=8)
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py
index 5181bf3b5fa5bd8f13f98629c4eb57cdd93d20f7..b4a112df0a0bbee00903a67ac53e5b90b5fc3b74 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py
@@ -105,7 +105,7 @@ def createCFTree(CFseq):
     recoSeqSet=set()
     hypoSet=set()
     for menuseq in CFseq.step.sequences:
-        menuseq.addToSequencer(recoSeqSet, hypoSet)
+        menuseq.addToSequencer(recoSeqSet,hypoSet)
   
     #list(dict.fromkeys()) is guaranteed to respect ordering from python 3.7 onwards
     stepReco += list(dict.fromkeys([recoseq for recoseq in recoSeqSet]))
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
index 8dc4c0338f8c6a5ea9e49e6da9d85782dec2e950..e1e98bf77cbdc47a7d4edc6ce5d6d0e91a071cb4 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
@@ -13,7 +13,7 @@ from TriggerMenuMT.HLTMenuConfig.Menu.ChainDefInMenu import ChainProp
 import TriggerMenuMT.HLTMenuConfig.Menu.MC_pp_run3_v1 as mc_menu
 import TriggerMenuMT.HLTMenuConfig.Menu.PhysicsP1_pp_run3_v1 as p1_menu
 
-from TriggerMenuMT.HLTMenuConfig.Menu.Physics_pp_run3_v1 import PhysicsStream,SingleMuonGroup,MultiMuonGroup,SingleElectronGroup,MultiElectronGroup,SinglePhotonGroup,MultiPhotonGroup,SingleMETGroup,MultiMETGroup,SingleJetGroup,MultiJetGroup,SingleBjetGroup,SingleTauGroup,MultiTauGroup,BphysicsGroup,MinBiasGroup,ZeroBiasGroup
+from TriggerMenuMT.HLTMenuConfig.Menu.Physics_pp_run3_v1 import PhysicsStream,SingleMuonGroup,MultiMuonGroup,SingleElectronGroup,MultiElectronGroup,SinglePhotonGroup,MultiPhotonGroup,SingleMETGroup,MultiMETGroup,SingleJetGroup,MultiJetGroup,SingleBjetGroup,SingleTauGroup,MultiTauGroup,BphysicsGroup,MinBiasGroup
 
 def setupMenu():
 
@@ -34,6 +34,7 @@ def setupMenu():
         ChainProp(name='HLT_mu6_idperf_L1MU6', groups=SingleMuonGroup),
         ChainProp(name='HLT_mu24_idperf_L1MU20', groups=SingleMuonGroup),
         ChainProp(name='HLT_mu6_mu6noL1_L1MU6', l1SeedThresholds=['MU6','FSNOSEED'], mergingStrategy='serial', groups=MultiMuonGroup),
+        ChainProp(name='HLT_mu20_ivarmedium_mu8noL1_L1MU20', l1SeedThresholds=['MU20','FSNOSEED'], mergingStrategy='serial', groups=MultiMuonGroup),
     
         #test chains
         ChainProp(name='HLT_mu6fast_L1MU6', groups=SingleMuonGroup),
@@ -190,33 +191,43 @@ def setupMenu():
         ChainProp(name='HLT_j85_L1J20', groups=SingleJetGroup),
         ChainProp(name='HLT_j45_L1J15', groups=SingleJetGroup),
         ChainProp(name='HLT_j420_L1J20', groups=SingleJetGroup),
-        ChainProp(name='HLT_j45_ftf_subjesgscIS_L1J15', groups=SingleJetGroup),
-        ChainProp(name='HLT_j45_ftf_subresjesgscIS_L1J15', groups=SingleJetGroup),
-        ChainProp(name='HLT_j45_ftf_subjesgscIS_011jvt_L1J15', groups=SingleJetGroup),
-        ChainProp(name='HLT_j45_ftf_subjesgscIS_015jvt_L1J15', groups=SingleJetGroup),
-        ChainProp(name='HLT_j45_ftf_subjesgscIS_059jvt_L1J15', groups=SingleJetGroup),
+        ChainProp(name='HLT_j45_subjesgscIS_ftf_L1J15', groups=SingleJetGroup),
+        ChainProp(name='HLT_j45_subresjesgscIS_ftf_L1J15', groups=SingleJetGroup),
+        ChainProp(name='HLT_j45_subjesgscIS_ftf_011jvt_L1J15', groups=SingleJetGroup),
+        ChainProp(name='HLT_j45_subjesgscIS_ftf_015jvt_L1J15', groups=SingleJetGroup),
+        ChainProp(name='HLT_j45_subjesgscIS_ftf_059jvt_L1J15', groups=SingleJetGroup),
         ChainProp(name='HLT_j45_ftf_L1J15', groups=SingleJetGroup),
         ChainProp(name='HLT_j85_ftf_L1J20', groups=SingleJetGroup),
 
 
-        ChainProp(name='HLT_j45_ftf_pf_L1J20', groups=SingleJetGroup),
-        ChainProp(name='HLT_j45_ftf_subjesgscIS_pf_L1J20', groups=SingleJetGroup),
-        ChainProp(name='HLT_j45_ftf_subresjesgscIS_pf_L1J20', groups=SingleJetGroup),
-        ChainProp(name='HLT_j85_ftf_pf_L1J20', groups=SingleJetGroup),
+        ChainProp(name='HLT_j45_pf_ftf_L1J20', groups=SingleJetGroup),
+        ChainProp(name='HLT_j45_pf_subjesgscIS_ftf_L1J20', groups=SingleJetGroup),
+        ChainProp(name='HLT_j45_pf_subresjesgscIS_ftf_L1J20', groups=SingleJetGroup),
+        ChainProp(name='HLT_j85_pf_ftf_L1J20', groups=SingleJetGroup),
 
-        ChainProp(name='HLT_j420_ftf_subjesgscIS_L1J20', groups=SingleJetGroup),
+        ChainProp(name='HLT_j420_subjesgscIS_ftf_L1J20', groups=SingleJetGroup),
 
         ChainProp(name='HLT_j45_nojcalib_L1J20', groups=SingleJetGroup),
         ChainProp(name='HLT_j45_sktc_nojcalib_L1J20', groups=SingleJetGroup),
         ChainProp(name='HLT_j45_cssktc_nojcalib_L1J20', groups=SingleJetGroup),
-        ChainProp(name='HLT_j45_ftf_pf_nojcalib_L1J20', groups=SingleJetGroup),
-        ChainProp(name='HLT_j45_ftf_csskpf_nojcalib_L1J20', groups=SingleJetGroup),
+        ChainProp(name='HLT_j45_pf_nojcalib_ftf_L1J20', groups=SingleJetGroup),
+        ChainProp(name='HLT_j45_csskpf_nojcalib_ftf_L1J20', groups=SingleJetGroup),
 
         ChainProp(name='HLT_j260_320eta490_L1J20', groups=SingleJetGroup),
 
         ChainProp(name='HLT_j460_a10_lcw_subjes_L1J20', groups=SingleJetGroup),
         ChainProp(name='HLT_j460_a10r_L1J20', groups=SingleJetGroup),
+        ChainProp(name='HLT_j460_a10t_lcw_nojcalib_L1J100', groups=SingleJetGroup),
+        ChainProp(name='HLT_j460_a10t_lcw_nojcalib_35smcINF_L1J100', groups=SingleJetGroup),
+        ChainProp(name='HLT_2j330_a10t_lcw_nojcalib_35smcINF_L1J100', groups=SingleJetGroup),
         ChainProp(name='HLT_j460_a10sd_lcw_nojcalib_L1J100', groups=SingleJetGroup),
+        ChainProp(name='HLT_j460_a10sd_pf_nojcalib_ftf_L1J100', groups=SingleJetGroup),
+        ChainProp(name='HLT_j460_a10sd_csskpf_nojcalib_ftf_L1J100', groups=SingleJetGroup),
+        ChainProp(name='HLT_j460_a10sd_csskpf_nojcalib_ftf_35smcINF_L1J100', groups=SingleJetGroup),
+        ChainProp(name='HLT_2j330_a10sd_csskpf_nojcalib_ftf_35smcINF_L1J100', groups=SingleJetGroup),
+        ChainProp(name='HLT_j460_a10sd_csskpf_jes_ftf_L1J100', groups=SingleJetGroup),
+        ChainProp(name='HLT_j460_a10sd_csskpf_jes_ftf_35smcINF_L1J100', groups=SingleJetGroup),
+        ChainProp(name='HLT_2j330_a10sd_csskpf_jes_ftf_35smcINF_L1J100', groups=SingleJetGroup),
 
         ChainProp(name='HLT_3j200_L1J20', groups=MultiJetGroup),
         ChainProp(name='HLT_j0_vbenfSEP30etSEP34mass35SEP50fbet_L1J20', groups=SingleJetGroup),
@@ -226,9 +237,9 @@ def setupMenu():
     ]
 
     TriggerFlags.BjetSlice.signatures = TriggerFlags.BjetSlice.signatures() + [
-        ChainProp(name="HLT_j45_ftf_subjesgscIS_boffperf_split_L1J20", groups=SingleBjetGroup),
-        ChainProp(name="HLT_j275_ftf_subjesgscIS_boffperf_split_L1J100", groups=SingleBjetGroup),
-        ChainProp(name="HLT_j45_ftf_subjesgscIS_bmv2c1070_split_L1J20", groups=SingleBjetGroup),
+        ChainProp(name="HLT_j45_subjesgscIS_ftf_boffperf_split_L1J20", groups=SingleBjetGroup),
+        ChainProp(name="HLT_j275_subjesgscIS_ftf_boffperf_split_L1J100", groups=SingleBjetGroup),
+        ChainProp(name="HLT_j45_subjesgscIS_ftf_bmv2c1070_split_L1J20", groups=SingleBjetGroup),
     ]
 
     TriggerFlags.TauSlice.signatures = TriggerFlags.TauSlice.signatures() + [
@@ -286,16 +297,24 @@ def setupMenu():
         # 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),
-        # Test photon-muon chain (isolation is there to have different number of steps)
+        ChainProp(name='HLT_e12_lhloose_2mu10_L12MU10', l1SeedThresholds=['EM8VH','MU10'], mergingStrategy='serial', stream=[PhysicsStream], groups=MultiElectronGroup),
+        ChainProp(name='HLT_2e12_lhloose_mu10_L12EM8VH_MU10', l1SeedThresholds=['EM8VH','MU10'], mergingStrategy='serial', stream=[PhysicsStream], groups=MultiElectronGroup),
+
+        # Primary g-mu chains
         ChainProp(name='HLT_g25_medium_mu24_ivarmedium_L1MU20',l1SeedThresholds=['EM15VH','MU20'], mergingStrategy='serial', stream=[PhysicsStream], groups=MultiElectronGroup),
-    
-        # electron + photon stay in the same step - these need to be parallel merged!
+        ChainProp(name='HLT_g35_loose_mu18_L1EM24VHI', l1SeedThresholds=['EM24VHI','MU10'], mergingStrategy='serial', stream=[PhysicsStream], groups=MultiElectronGroup),
+        ChainProp(name='HLT_2g10_loose_mu20_L1MU20', l1SeedThresholds=['EM7','MU20'], mergingStrategy='serial', stream=[PhysicsStream], groups=MultiElectronGroup), # unsure what EM seed should be    
+
+        # Primary e-g chains: electron + photon stay in the same step - these need to be parallel merged!
+        # test
         ChainProp(name='HLT_e3_etcut1step_g5_etcut_L12EM3',l1SeedThresholds=['EM3','EM3'], mergingStrategy='parallel', stream=[PhysicsStream], groups=MultiElectronGroup),
-  
+        # primaries
+        ChainProp(name='HLT_e24_lhmedium_g25_medium_L12EM20VH', l1SeedThresholds=['EM20VH','EM20VH'], mergingStrategy='parallel', stream=[PhysicsStream], groups=MultiElectronGroup),
+        ChainProp(name='HLT_e24_lhmedium_2g12_loose_L1EM20VH_3EM10VH', l1SeedThresholds=['EM20VH','EM10VH'], mergingStrategy='parallel', stream=[PhysicsStream], groups=MultiElectronGroup), # unsure about l1SeedThresholds
+
         # Test chains for muon + jet/MET merging/aligning
         ChainProp(name='HLT_mu6fast_xe30_mht_L1XE10', l1SeedThresholds=['MU6','XE10'], mergingStrategy='serial', stream=[PhysicsStream], groups=SingleMETGroup),
-        ChainProp(name='HLT_mu6fast_j45_nojcalib_L1J20', l1SeedThresholds=['MU6','J20'], mergingStrategy='serial', stream=[PhysicsStream], groups=SingleMETGroup),
-    
+        ChainProp(name='HLT_mu6fast_j45_nojcalib_L1J20', l1SeedThresholds=['MU6','J20'], mergingStrategy='serial', stream=[PhysicsStream], groups=SingleMETGroup),    
     
     ]
     TriggerFlags.HeavyIonSlice.signatures  = TriggerFlags.HeavyIonSlice.signatures() + []
@@ -313,8 +332,8 @@ def setupMenu():
     ]
 
     TriggerFlags.StreamingSlice.signatures = TriggerFlags.StreamingSlice.signatures() + [
-        ChainProp(name='HLT_noalg_mb_L1RD2_EMPTY', l1SeedThresholds=['FSNOSEED'], stream=['MinBias'], groups=MinBiasGroup),
-        ChainProp(name='HLT_noalg_zb_L1ZB', l1SeedThresholds=['FSNOSEED'], stream=['ZeroBias'], groups=ZeroBiasGroup),
+        #ChainProp(name='HLT_noalg_mb_L1RD2_EMPTY', l1SeedThresholds=['FSNOSEED'], stream=['MinBias'], groups=MinBiasGroup),
+        #ChainProp(name='HLT_noalg_zb_L1ZB', l1SeedThresholds=['FSNOSEED'], stream=['ZeroBias'], groups=ZeroBiasGroup),
         ChainProp(name='HLT_noalg_L1MBTS_2_EMPTY', l1SeedThresholds=['FSNOSEED'], stream=['MinBias'], groups=MinBiasGroup), #ATR-21999
         ChainProp(name='HLT_noalg_L1MBTS_1_1_EMPTY', l1SeedThresholds=['FSNOSEED'], stream=['MinBias'], groups=MinBiasGroup), #ATR-21999
     ]
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuAlignmentTools.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuAlignmentTools.py
index 42273176c43f246d61bc3387c791679822f1ee61..55a0690d61884ba351aff35323161257f3b7d95b 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuAlignmentTools.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuAlignmentTools.py
@@ -20,28 +20,39 @@ the_signature_grouping = OrderedDict([
     ('Jet','JetMET'),
     ('MET','JetMET'),
     ('Bjet','JetMET'),
+    ('MuonnoL1', 'MuonnoL1')
     ])
 
+def getAlignmentGroupFromPattern(sName, extra):
+    signature_for_alignment = sName + extra
+    
+    if signature_for_alignment in the_signature_grouping.keys():
+        return the_signature_grouping[signature_for_alignment]
+    elif sName in  the_signature_grouping.keys():
+        return the_signature_grouping[sName]
+    else:
+        log.info("No alignment grouping for signature %s (%s)",sName,extra)
+        return sName
+
 # Here, we use a list of all the signature combinations in the menu and the signature
 # groupings/orderings we've defined in the_signature_grouping to calculate which signatures
 # need to be ordered compared to which others.
 # The function returns a dictionary of an ordered list of signatures each signature belongs to
 #    e.g. 'Muon' : ['Egamma','Muon']    
-def analyseCombinations(combinations_in_menu, signatures_in_combinations, doGroupSignatures = True):
+def analyseCombinations(combinations_in_menu, alignmentGroups_in_combinations):
     
-        # need to find out of if a signature, or anything in combination with that signature, 
-        # is in combination with any other signature
-        # 1 electron, 2 photon, 3 muon, 4 tau, 5 jet, 6 met, 7 b-jet, 8 B-physics
-        # but some of these share input makers and algorithms, so they need to be grouped!
-        # alternatively, the IMs/signatures/etc. could have their names unique for each signature
-        sig_dict = {"Electron":0,"Photon":1,"Muon":2,"Tau":3,"Jet":4,"MET":5,"Bjet":6,"Bphysics":7}
+        # need to find out of if an alignment group, or anything in combination with that
+        # aligment group, is in combination with any other alignment group.
+        
+        # first we make a dictionary of the ordering, based on the_signature_grouping 
+        # e.g. 1 electron+photon, 2 muon, 3 tau, 4 jet/met/b-jet, 5 noL1 muons
+        sig_dict = {}
+        igrp = 0
+        for _,v in the_signature_grouping.items():
+            if v not in sig_dict:
+                sig_dict[v] = igrp
+                igrp += 1
         
-        # Egamma = Electron+Photon, JetMET = Jet/MET/Bjet shared for now, because they share an input maker!
-        # HT chain are (will be) part of the jet signature.
-        if doGroupSignatures:
-            seen = set()
-            sig_dict = dict((x,len(seen)-1) for x in the_signature_grouping.values() if not (x in seen or seen.add(x)))
-            log.debug('Grouping of signatures to align: %s',sig_dict)
         inv_sig_dict = {v: k for k, v in sig_dict.items()}
         
         the_matrix = np.eye((len(sig_dict)))
@@ -87,45 +98,12 @@ def analyseCombinations(combinations_in_menu, signatures_in_combinations, doGrou
         unique_by_sig = [[ inv_sig_dict[sig_int] for sig_int in setlist ] for setlist in unique_sets]
 
         sig_to_set = {}
-        for sig in signatures_in_combinations:
+        for sig in alignmentGroups_in_combinations:
             for aset in unique_by_sig:
                 if sig in aset:
                     sig_to_set[sig] = aset
          
         return sig_to_set
-        
-# redefine the various signature lists/dicts to use the grouped signatures (e.g. not
-# electron, photon but instead egamma)
-def groupSignatures(combinations_in_menu, signatures_to_align, length_of_configs):
-    for icomb,comb in enumerate(combinations_in_menu):
-        if any([acomb in the_signature_grouping for acomb in comb]):
-            tmpcomb = []
-            for asig in comb:
-                if asig in the_signature_grouping:
-                    tmpcomb += [the_signature_grouping[asig]]
-                else:
-                    # not sure this could come up - but if we have something random like minbias + muon chains? 
-                    tmpcomb += [asig]
-
-        combinations_in_menu[icomb] = tmpcomb
-        
-    signatures_to_align = list(signatures_to_align) #was a set, make a list!
-    for isig, asig in enumerate(signatures_to_align):
-        if asig in the_signature_grouping:
-            signatures_to_align[isig] = the_signature_grouping[asig]
-                                        
-    signatures_to_align = list(set(signatures_to_align)) #get rid of duplicates
-          
-    log.debug('Signatures that are going to be aligned: %s',signatures_to_align)
-    log.debug('Signature combinations that are in the menu: %s',combinations_in_menu)
-
-    for newsig in set(the_signature_grouping.values()):
-        if newsig not in length_of_configs:
-            # get all the signatures in the new sig:
-            corresponding_sig_lengths = [length_of_configs.get(oldsig,0) for oldsig in the_signature_grouping if the_signature_grouping[oldsig] == newsig]
-            length_of_configs[newsig] = max(corresponding_sig_lengths)
-
-    return combinations_in_menu, signatures_to_align, length_of_configs
 
 # takes the list of signatures in a chain and changes it to be the post-grouping signatures
 # e.g. ['Electron','Muon'] ==> ['Egamma','Muon] 
@@ -143,4 +121,5 @@ def setChainSignatures(signatures, lengthOfChainConfigs):
         # else it'll be a signature that doesn't need aligning, like beamspot or something.
         # maybe they should all be added to the_signature_grouping, even if they never
         # need to be merged together
-    return signatures, lengthOfChainConfigs
\ No newline at end of file
+    return signatures, lengthOfChainConfigs
+
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuComponents.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuComponents.py
index 6d5a84fe862136d593b12873ffff7eb784158ed6..180a86b256a033b3386fcbac3b55f12d0434efb9 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuComponents.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuComponents.py
@@ -517,15 +517,16 @@ class CAMenuSequence(MenuSequence):
 
 class Chain(object):
     """Basic class to define the trigger menu """
-    __slots__='name','steps','vseeds','L1decisions'
-    def __init__(self, name, ChainSteps, L1Thresholds):
+    __slots__ ='name','steps','nSteps','alignmentGroups','vseeds','L1decisions'
+    def __init__(self, name, ChainSteps, L1Thresholds, nSteps = [], alignmentGroups = []):
         """
         Construct the Chain from the steps
         Out of all arguments the ChainSteps & L1Thresholds are most relevant, the chain name is used in debug messages
         """
         self.name = name
         self.steps=ChainSteps
-
+        self.nSteps = nSteps
+        self.alignmentGroups = alignmentGroups
         self.vseeds=L1Thresholds
 
         from L1Decoder.L1DecoderConfig import mapThresholdToL1DecisionCollection
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuPrescaleConfig.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuPrescaleConfig.py
index 5df365ff4afbe64d3da74327e83fe098be2c0262..ca403b3980e93eeb69ae5500c510d4d9f4d0eb62 100755
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuPrescaleConfig.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuPrescaleConfig.py
@@ -28,11 +28,7 @@ def MenuPrescaleConfig(triggerConfigHLT):
         log.info('LS2_v1 menu setup')
         from TriggerMenuMT.HLTMenuConfig.Menu.LS2_v1 import setupMenu
         setupMenu()
-        if 'cosmics_prescale' in menu_name:
-            addSliceChainsToPrescales(TriggerFlags, Prescales.HLTPrescales_cosmics)
-            L1Prescales = Prescales.L1Prescales_cosmics
-            HLTPrescales = Prescales.HLTPrescales_cosmics
-        elif 'tight_mc_prescale' in menu_name:
+        if 'tight_mc_prescale' in menu_name:
             L1Prescales = Prescales.L1Prescales_tight_mc_prescale
             HLTPrescales = Prescales.HLTPrescales_tight_mc_prescale
         elif 'TriggerValidation_mc_prescale' in menu_name:
@@ -47,10 +43,7 @@ def MenuPrescaleConfig(triggerConfigHLT):
         log.info('Physics_pp_run3_v1 menu setup')
         from TriggerMenuMT.HLTMenuConfig.Menu.Physics_pp_run3_v1 import setupMenu
         setupMenu()
-        if 'cosmics_prescale' in menu_name:
-            L1Prescales = Prescales.L1Prescales_cosmics
-            HLTPrescales = Prescales.HLTPrescales_cosmics
-        elif 'tight_mc_prescale' in menu_name:
+        if 'tight_mc_prescale' in menu_name:
             L1Prescales = Prescales.L1Prescales_tight_mc_prescale
             HLTPrescales = Prescales.HLTPrescales_tight_mc_prescale
         else:
@@ -61,10 +54,7 @@ def MenuPrescaleConfig(triggerConfigHLT):
         log.info('PhysicsP1_pp_run3_v1 menu setup')
         from TriggerMenuMT.HLTMenuConfig.Menu.PhysicsP1_pp_run3_v1 import setupMenu
         setupMenu()
-        if 'cosmics_prescale' in menu_name:
-            L1Prescales = Prescales.L1Prescales_cosmics
-            HLTPrescales = Prescales.HLTPrescales_cosmics
-        elif 'tight_mc_prescale' in menu_name:
+        if 'tight_mc_prescale' in menu_name:
             L1Prescales = Prescales.L1Prescales_tight_mc_prescale
             HLTPrescales = Prescales.HLTPrescales_tight_mc_prescale
         else:
@@ -75,10 +65,7 @@ def MenuPrescaleConfig(triggerConfigHLT):
         log.info('MC_pp_run3_v1 menu setup')
         from TriggerMenuMT.HLTMenuConfig.Menu.MC_pp_run3_v1 import setupMenu
         setupMenu()
-        if 'cosmics_prescale' in menu_name:
-            L1Prescales = Prescales.L1Prescales_cosmics
-            HLTPrescales = Prescales.HLTPrescales_cosmics
-        elif 'tight_mc_prescale' in menu_name:
+        if 'tight_mc_prescale' in menu_name:
             L1Prescales = Prescales.L1Prescales_tight_mc_prescale
             HLTPrescales = Prescales.HLTPrescales_tight_mc_prescale
         else:
@@ -89,10 +76,7 @@ def MenuPrescaleConfig(triggerConfigHLT):
         log.info('PhysicsP1_HI_run3_v1 menu setup')
         from TriggerMenuMT.HLTMenuConfig.Menu.PhysicsP1_HI_run3_v1 import setupMenu
         setupMenu()
-        if 'cosmics_prescale' in menu_name:
-            L1Prescales = Prescales.L1Prescales_cosmics
-            HLTPrescales = Prescales.HLTPrescales_cosmics
-        elif 'tight_mc_prescale' in menu_name:
+        if 'tight_mc_prescale' in menu_name:
             L1Prescales = Prescales.L1Prescales_tight_mc_prescale
             HLTPrescales = Prescales.HLTPrescales_tight_mc_prescale
         else:
@@ -103,10 +87,7 @@ def MenuPrescaleConfig(triggerConfigHLT):
         log.info('Dev_HI_run3_v1 menu setup')
         from TriggerMenuMT.HLTMenuConfig.Menu.Dev_HI_run3_v1 import setupMenu
         setupMenu()
-        if 'cosmics_prescale' in menu_name:
-            L1Prescales = Prescales.L1Prescales_cosmics
-            HLTPrescales = Prescales.HLTPrescales_cosmics
-        elif 'tight_mc_prescale' in menu_name:
+        if 'tight_mc_prescale' in menu_name:
             L1Prescales = Prescales.L1Prescales_tight_mc_prescale
             HLTPrescales = Prescales.HLTPrescales_tight_mc_prescale
         else:
@@ -117,10 +98,7 @@ def MenuPrescaleConfig(triggerConfigHLT):
         log.info('LS2_v1 menu setup')
         from TriggerMenuMT.HLTMenuConfig.Menu.LS2_v1 import setupMenu
         setupMenu()
-        if 'cosmics_prescale' in menu_name:
-            L1Prescales = Prescales.L1Prescales_cosmics
-            HLTPrescales = Prescales.HLTPrescales_cosmics
-        elif 'tight_mc_prescale' in menu_name:
+        if 'tight_mc_prescale' in menu_name:
             L1Prescales = Prescales.L1Prescales_tight_mc_prescale
             HLTPrescales = Prescales.HLTPrescales_tight_mc_prescale
         else:
@@ -131,12 +109,8 @@ def MenuPrescaleConfig(triggerConfigHLT):
         log.info('Cosmic_run3_v1 menu setup')
         from TriggerMenuMT.HLTMenuConfig.Menu.Cosmic_run3_v1 import setupMenu
         setupMenu()
-        if 'cosmics_prescale' in menu_name:
-            L1Prescales = Prescales.L1Prescales_cosmics
-            HLTPrescales = Prescales.HLTPrescales_cosmics
-        else:
-            L1Prescales = Prescales.L1Prescales
-            HLTPrescales = Prescales.HLTPrescales
+        L1Prescales = Prescales.L1Prescales
+        HLTPrescales = Prescales.HLTPrescales
             
     else:
         log.fatal ('Menu with name %s is not known in this version of TriggerMenu! ', menu_name)
@@ -144,22 +118,6 @@ def MenuPrescaleConfig(triggerConfigHLT):
 
     return (L1Prescales, HLTPrescales)
 
-def addSliceChainsToPrescales(flags, cosmic_prescales):
-    signatures = []
-    slice_props = [prop for prop in dir(flags) if prop.endswith("Slice")]
-    for slice_prop in slice_props:
-        slice = getattr(flags, slice_prop)
-        if slice.signatures():
-            signatures.extend(slice.signatures())
-        else:
-            log.debug('SKIPPING ' + str(slice_prop))
-
-    chains = [s.name for s in signatures]
-    combined = {chain: [-1, 0, 0] for chain in chains}
-    combined.update(cosmic_prescales)
-    from copy import deepcopy
-    cosmic_prescales = deepcopy(combined)
-
 def disableChains(flags, trigvalid_prescales, type_group):
     signatures = []
     slice_props = [prop for prop in dir(flags) if prop.endswith("Slice")]
@@ -214,9 +172,6 @@ class PrescaleClass(object):
     HLTPrescales = {
         }
 
-    L1Prescales_cosmics  = {}
-    HLTPrescales_cosmics = {}
-
     L1Prescales_trigvalid_mc_prescale  = {}
     HLTPrescales_trigvalid_mc_prescale = {}
 
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 e5c42f7c2991b5e829178f83b732b37f8b86cc57..b6fc381fd0b436d746de4ab465ef86dd99b176f0 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
@@ -13,7 +13,7 @@ from TriggerMenuMT.HLTMenuConfig.Menu.ChainDefInMenu import ChainProp
 
 import TriggerMenuMT.HLTMenuConfig.Menu.Physics_pp_run3_v1 as physics_menu 
 
-from TriggerMenuMT.HLTMenuConfig.Menu.Physics_pp_run3_v1 import PhysicsStream,SingleMuonGroup,SinglePhotonGroup,EgammaStreamersGroup,TauStreamersGroup,JetStreamersGroup,METStreamersGroup,MinBiasGroup
+from TriggerMenuMT.HLTMenuConfig.Menu.Physics_pp_run3_v1 import PhysicsStream,SingleMuonGroup,SinglePhotonGroup,EgammaStreamersGroup,TauStreamersGroup,JetStreamersGroup,METStreamersGroup,MinBiasGroup,ZeroBiasGroup
 
 
 def addP1Signatures():
@@ -134,6 +134,8 @@ def addP1Signatures():
 
         # MBTS
         ChainProp(name='HLT_noalg_L1MBTS_1_EMPTY', l1SeedThresholds=['FSNOSEED'], stream=['MinBias'], groups=MinBiasGroup), #ATR-21740
+        ChainProp(name='HLT_noalg_mb_L1RD2_EMPTY', l1SeedThresholds=['FSNOSEED'], stream=['MinBias'], groups=MinBiasGroup), # ATR-21367
+        ChainProp(name='HLT_noalg_zb_L1ZB',        l1SeedThresholds=['FSNOSEED'], stream=['ZeroBias'],groups=ZeroBiasGroup),# ATR-21367
     ]
     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 f084522a0b36a9c7485a17b84d4d8fd9e43e0688..f00186c181c169bdee7aaf4bc32113d601619ff8 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
@@ -106,10 +106,10 @@ def setupMenu():
     ]
 
     TriggerFlags.BjetSlice.signatures = [
-        ChainProp(name="HLT_j225_ftf_subjesgscIS_bmv2c1040_split_L1J100", groups=SingleBjetGroup),
-        ChainProp(name="HLT_j275_ftf_subjesgscIS_bmv2c1060_split_L1J100", groups=SingleBjetGroup),
-        ChainProp(name="HLT_j300_ftf_subjesgscIS_bmv2c1070_split_L1J100", groups=SingleBjetGroup),
-        ChainProp(name="HLT_j360_ftf_subjesgscIS_bmv2c1077_split_L1J100", groups=SingleBjetGroup),
+        ChainProp(name="HLT_j225_subjesgscIS_ftf_bmv2c1040_split_L1J100", groups=SingleBjetGroup),
+        ChainProp(name="HLT_j275_subjesgscIS_ftf_bmv2c1060_split_L1J100", groups=SingleBjetGroup),
+        ChainProp(name="HLT_j300_subjesgscIS_ftf_bmv2c1070_split_L1J100", groups=SingleBjetGroup),
+        ChainProp(name="HLT_j360_subjesgscIS_ftf_bmv2c1077_split_L1J100", groups=SingleBjetGroup),
     ]
 
     TriggerFlags.TauSlice.signatures = [
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
index 70355d32ec9430c960f957ea363fa46e48012dd7..fdb5c516cc0ba39b57d939a12d69c3d0a5a1d718 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
@@ -22,7 +22,8 @@ SliceIDDict = {
     'MinBias' : 'mb',
     'HeavyIon' : 'hi',
     'Cosmic'  : 'cosmic',
-    'Calibration'   : 'calib',
+    'Calib'   : 'calib',
+    #'Calib'   : 'calib',
     'Streaming'     : 'streamer',
     'Monitor'    : 'mon',
     'Beamspot'      : 'beamspot',
@@ -50,6 +51,7 @@ ChainDictTemplate = {
     'L1item'        : '',
     'topo'          : '',
     'signatures'    : [],
+    'alignmentGroups' : [],
     'stream'        : '',
     'groups'        : [],
     'EBstep'        : '',
@@ -64,6 +66,7 @@ ChainDictTemplate = {
 TestChainParts = {
     'L1threshold'    : '',
     'signature'      : ['Test'],
+    'alignmentGroup' : ['Test'],
     'chainPartName'  : '',
     'multiplicity'   : '',
     'extra'          : ['muv1', 'muv1step', 'muv2', 'ev1', 'ev2', 'ev3', 'gv1', 'muEmpty1', 'muEmpty2', 'ev1dr', 'muv1dr'],
@@ -75,6 +78,7 @@ TestChainParts = {
 # ---- Test Dictionary of default Values ----
 TestChainParts_Default = {
     'signature'      : ['Test'],
+    'alignmentGroup' : ['Test'],
     'L1threshold'    : '',
     'multiplicity'   : '',
     'trigType'       : '',
@@ -88,13 +92,14 @@ TestChainParts_Default = {
 AllowedTopos_jet = []
 # ---- Jet Dictinary of all allowed Values ----
 JetChainParts = {
-    'signature'    : ['Jet'],
-    'L1threshold'  : '',
-    'chainPartName': '',
-    'threshold'    : '',
-    'multiplicity' : '',
-    'etaRange'     : ['0eta320', '320eta490', '0eta240', '0eta290'],
-    'jvt'          : ['011jvt', '015jvt', '059jvt'],
+    'signature'     : ['Jet'],
+    'alignmentGroup': ['Jet','JetMET'],
+    'L1threshold'   : '',
+    'chainPartName' : '',
+    'threshold'     : '',
+    'multiplicity'  : '',
+    'etaRange'      : ['0eta320', '320eta490', '0eta240', '0eta290'],
+    'jvt'           : ['011jvt', '015jvt', '059jvt'],
     # May need to reinstate in the event that preselection is
     # needed before running tracking
     #'gscThreshold' : ['gsc'],
@@ -132,31 +137,32 @@ JetChainParts = {
 
 # ---- Jet Dictinary of default Values ----
 JetChainParts_Default = {
-    'signature'    : ['Jet'],
-    'L1threshold'  : '',
-    'threshold'    : '',
-    'multiplicity' : '',
-    'etaRange'     : '0eta320',
-    'jvt'          : '',
-    'trigType'     :'j',
-    'extra'        : '',
-    'cleaning'     : 'noCleaning',
-    'recoAlg'      :'a4',
-    'dataType'     :'tc',
-    'calib'        :'em',
-    'jetCalib'     :'subjesIS',
-    'scan'         :'FS',
-    'addInfo'      : [],
-    'TLA'          : '',
-    'topo'         : [],
-    'bTag'         : '',
-    'bTracking'    : '',
-    'bConfig'      : [],
-    'bMatching'    : [],
-    'dataScouting' : '',
-    'trkopt'       : 'notrk',
-    'hypoScenario' : 'simple',
-    'smc'          : 'nosmc',
+    'signature'     : ['Jet'],
+    'alignmentGroup': ['Jet'],
+    'L1threshold'   : '',
+    'threshold'     : '',
+    'multiplicity'  : '',
+    'etaRange'      : '0eta320',
+    'jvt'           : '',
+    'trigType'      :'j',
+    'extra'         : '',
+    'cleaning'      : 'noCleaning',
+    'recoAlg'       :'a4',
+    'dataType'      :'tc',
+    'calib'         :'em',
+    'jetCalib'      :'subjesIS',
+    'scan'          :'FS',
+    'addInfo'       : [],
+    'TLA'           : '',
+    'topo'          : [],
+    'bTag'          : '',
+    'bTracking'     : '',
+    'bConfig'       : [],
+    'bMatching'     : [],
+    'dataScouting'  : '',
+    'trkopt'        : 'notrk',
+    'hypoScenario'  : 'simple',
+    'smc'           : 'nosmc',
 }
 
 # ---- bJet Dictionary of default Values that are different to the ones for normal jet chains ----
@@ -187,6 +193,7 @@ AllowedTopos_mu = []
 # ---- Muon Dictinary of all allowed Values ----
 MuonChainParts = {
     'signature'      : ['Muon'],
+    'alignmentGroup' : ['Muon','MuonnoL1'],
     'L1threshold'    : '',
     'chainPartName'  : [],
     'multiplicity'   : '',
@@ -204,6 +211,7 @@ MuonChainParts = {
 # ---- MuonDictinary of default Values ----
 MuonChainParts_Default = {
     'signature'      : ['Muon'],
+    'alignmentGroup' : ['Muon'],
     'L1threshold'    : '',
     'multiplicity'   : '',
     'trigType'       : ['mu'],
@@ -240,36 +248,38 @@ AllowedTopos_tau = []
 
 # ---- Tau Dictionary of all allowed Values ----
 TauChainParts = {
-    'signature'    : ['Tau'],
-    'L1threshold'  : '',
-    'chainPartName': '',
-    'threshold'    : '',
-    'preselection' : ['track', 'tracktwo', 'tracktwoEF', 'tracktwoMVA', 'tracktwoEFmvaTES', 'ptonly', ],
-    'selection'    : ['medium1', 'verylooseRNN', 'looseRNN', 'mediumRNN', 'tightRNN', 'perf', 'idperf'],
-    'multiplicity' : '',
-    'trigType'     : ['tau'],
-    'trkInfo'      : '',
-    'extra'        : '',
-    'recoAlg'      : '',
-    'calib'        : '',
-    'addInfo'      : ['IdTest'],
-    'topo'         : AllowedTopos_tau,
+    'signature'     : ['Tau'],
+    'alignmentGroup': ['Tau'],
+    'L1threshold'   : '',
+    'chainPartName' : '',
+    'threshold'     : '',
+    'preselection'  : ['track', 'tracktwo', 'tracktwoEF', 'tracktwoMVA', 'tracktwoEFmvaTES', 'ptonly', ],
+    'selection'     : ['medium1', 'verylooseRNN', 'looseRNN', 'mediumRNN', 'tightRNN', 'perf', 'idperf'],
+    'multiplicity'  : '',
+    'trigType'      : ['tau'],
+    'trkInfo'       : '',
+    'extra'         : '',
+    'recoAlg'       : '',
+    'calib'         : '',
+    'addInfo'       : ['IdTest'],
+    'topo'          : AllowedTopos_tau,
 }
 TauChainParts_Default = {
-    'signature'    : ['Tau'],
-    'L1threshold'  : '',
-    'chainPartName': '',
-    'threshold'    : '20',
-    'preselection' : 'tracktwo',
-    'selection'    : 'medium1',
-    'multiplicity' : '',
-    'trigType'     : ['tau'],
-    'trkInfo'      : [],
-    'extra'        : '',
-    'recoAlg'      : '',
-    'calib'        : '',
-    'addInfo'      : '',
-    'topo'         : [],
+    'signature'     : ['Tau'],
+    'alignmentGroup': ['Tau'],
+    'L1threshold'   : '',
+    'chainPartName' : '',
+    'threshold'     : '20',
+    'preselection'  : 'tracktwo',
+    'selection'     : 'medium1',
+    'multiplicity'  :  '',
+    'trigType'      : ['tau'],
+    'trkInfo'       : [],
+    'extra'         : '',
+    'recoAlg'       : '',
+    'calib'         : '',
+    'addInfo'       :  '',
+    'topo'          : [],
 }
 
 #==========================================================
@@ -278,26 +288,28 @@ TauChainParts_Default = {
 AllowedTopos_xe = []
 # ---- Met Dictinary of all allowed Values ----
 METChainParts = {
-    'signature'    : ['MET'],
-    'L1threshold'  : '',
-    'chainPartName': '',
-    'threshold'    : '',
-    'multiplicity' : '',
-    'topo'         : AllowedTopos_xe,
-    'trigType'     : ['xe'],
-    'extra'        : ['noL1'],
-    'calib'        : ['lcw','em'],
-    'jetCalib'     : JetChainParts['jetCalib'],
-    'L2recoAlg'    : [],
-    'EFrecoAlg'    : ['cell', 'tc', 'tcpufit', 'mht', 'trkmht', 'pfsum', 'cvfpufit', 'pfopufit', 'mhtpufit'],
-    'jetDataType'  : JetChainParts['dataType'],
-    'L2muonCorr'   : [],
-    'EFmuonCorr'   : [],
-    'addInfo'      : ['FStracks'],
+    'signature'      : ['MET'],
+    'alignmentGroup' : ['MET','JetMET'],
+    'L1threshold'    : '',
+    'chainPartName'  : '',
+    'threshold'      : '',
+    'multiplicity'   : '',
+    'topo'           : AllowedTopos_xe,
+    'trigType'       : ['xe'],
+    'extra'          : ['noL1'],
+    'calib'          : ['lcw','em'],
+    'jetCalib'       : JetChainParts['jetCalib'],
+    'L2recoAlg'      : [],
+    'EFrecoAlg'      : ['cell', 'tc', 'tcpufit', 'mht', 'trkmht', 'pfsum', 'cvfpufit', 'pfopufit', 'mhtpufit'],
+    'jetDataType'    : JetChainParts['dataType'],
+    'L2muonCorr'     : [],
+    'EFmuonCorr'     : [],
+    'addInfo'        : ['FStracks'],
 }
 # ---- MetDictinary of default Values ----
 METChainParts_Default = {
     'signature'      : ['MET'],
+    'alignmentGroup' : ['MET'],
     'L1threshold'    : '',
     'trigType'       : ['xe'],
     'threshold'      : '',
@@ -345,6 +357,7 @@ AllowedTopos_e = ["Jpsiee","Zeg","Zee"]
 # ---- Electron Dictinary of all allowed Values ----
 ElectronChainParts = {
     'signature'      : ['Electron'],
+    'alignmentGroup' : ['Electron','Egamma'],
     'chainPartName'  : '',
     'L1threshold'    : '',
     'extra'          : '',
@@ -363,6 +376,7 @@ ElectronChainParts = {
 # ---- Egamma Dictinary of default Values ----
 ElectronChainParts_Default = {
     'signature'      : ['Electron'],
+    'alignmentGroup' : ['Electron'],
     'multiplicity'   : '',
     'L1threshold'         : '',
     'trigType'       : '',
@@ -390,6 +404,7 @@ ElectronChainParts_Default = {
 PhotonChainParts = {
     'L1threshold'    : '',
     'signature'      : ['Photon'],
+    'alignmentGroup' : ['Photon','Egamma'],
     'chainPartName'  : '',
     'multiplicity'   : '',    
     'trigType'       : ['g'],
@@ -409,6 +424,7 @@ PhotonChainParts = {
 # ---- Photon Dictinary of default Values ----
 PhotonChainParts_Default = {
     'signature'      : ['Photon'],
+    'alignmentGroup' : ['Photon'],
     'L1threshold'    : '',
     'multiplicity'   : '',    
     'trigType'       : '',
@@ -431,6 +447,7 @@ PhotonChainParts_Default = {
 # ---- MinBias Dictionary of all allowed Values ----
 MinBiasChainParts = {
     'signature'      : ['MinBias'],
+    'alignmentGroup' : ['MinBias'],
     'L1threshold'    : '',
     'chainPartName'  : '',
     'multiplicity'   : '',    
@@ -456,6 +473,7 @@ MinBiasChainParts = {
 # ---- MinBiasDictinary of default Values ----
 MinBiasChainParts_Default = {
     'signature'      : ['MinBias'],
+    'alignmentGroup' : ['MinBias'],
     'L1threshold'    : '',
     'chainPartName'  : '',
     'multiplicity'   : '',    
@@ -479,6 +497,7 @@ MinBiasChainParts_Default = {
 # ---- HeavyIon Dictionary of all allowed Values ----
 HeavyIonChainParts = {
     'signature'      : ['HeavyIon'],
+    'alignmentGroup' : ['HeavyIon'],
     'L1threshold'    : '',
     'chainPartName'  : '',
     'multiplicity'   : '',
@@ -501,6 +520,7 @@ HeavyIonChainParts = {
 # ---- HeavyIonDictinary of default Values ----
 HeavyIonChainParts_Default = { 
     'signature'      : ['HeavyIon'],
+    'alignmentGroup' : ['HeavyIon'],
     'L1threshold'    : '',
     'chainPartName'  : '',
     'multiplicity'   : '',
@@ -530,6 +550,7 @@ AllowedCosmicChainIdentifiers = ['larps','larhec',
 # ---- Cosmic Chain Dictinary of all allowed Values ----
 CosmicChainParts = {
     'signature'      : ['Cosmic'],
+    'alignmentGroup' : ['Cosmic'],
     'chainPartName'  : '',
     'L1threshold'    : '',
     'purpose'        : AllowedCosmicChainIdentifiers,
@@ -545,6 +566,7 @@ CosmicChainParts = {
 # ---- Cosmic Chain Default Dictinary of all allowed Values ----
 CosmicChainParts_Default = {
     'signature'      : ['Cosmic'],
+    'alignmentGroup' : ['Cosmic'],
     'chainPartName'  : '',
     'L1threshold'    : '',
     'purpose'        : [],
@@ -566,6 +588,7 @@ AllowedStreamingChainIdentifiers = ['noalg']
 # ---- Streaming Chain Dictinary of all allowed Values ----
 StreamingChainParts = {
     'signature'      : ['Streaming'],
+    'alignmentGroup' : ['Streaming'],
     'chainPartName'  : '',
     'L1threshold'    : '',
     'threshold'      : '',
@@ -583,6 +606,7 @@ StreamingChainParts = {
 # ---- Cosmic Chain Default Dictinary of all allowed Values ----
 StreamingChainParts_Default = {
     'signature'      : ['Streaming'],
+    'alignmentGroup' : ['Streaming'],
     'chainPartName'  : '',
     'L1threshold'    : '',
     'threshold'      : '',
@@ -609,7 +633,8 @@ AllowedCalibChainIdentifiers = ['csccalib',     'larcalib',
 ##stramingInfo not use in ChainConfiguration, only to distinguish streaming
 
 CalibChainParts = {
-    'signature'      : ['Calibration'],
+    'signature'      : ['Calib'],
+    'alignmentGroup' : ['Calib'],
     'chainPartName'  : '',
     'L1threshold'    : '',
     'purpose'        : AllowedCalibChainIdentifiers,
@@ -625,13 +650,14 @@ CalibChainParts = {
 
 # ---- Calib Chain Default Dictinary of all allowed Values ----
 CalibChainParts_Default = {
-    'signature'      : ['Calibration'],
+    'signature'      : ['Calib'],
+    'alignmentGroup' : ['Calib'],
     'chainPartName'  : '',
     'L1threshold'    : '',
     'purpose'        : [],
     'addInfo'        : [],
     'hypo'           : '',
-    'hits'           : [],
+    # 'hits'           : [],
     'streamingInfo'  : [],
     'threshold'      : '',
     'multiplicity'   : '',
@@ -653,6 +679,7 @@ AllowedMonitorChainIdentifiers = ['robrequest', 'timeburner',  'costmonitor',
 # ---- Monitor Chain Dictinary of all allowed Values ----
 MonitorChainParts = {
     'signature'      : ['Monitor'],
+    'alignmentGroup' : ['Monitor'],
     'chainPartName'  : '',
     'L1threshold'    : '',
     'monType'        : AllowedMonitorChainIdentifiers,
@@ -666,6 +693,7 @@ MonitorChainParts = {
 # ---- Monitor Chain Default Dictinary of all allowed Values ----
 MonitorChainParts_Default = {
     'signature'      : ['Monitor'],
+    'alignmentGroup' : ['Monitor'],
     'chainPartName'  : '',
     'L1threshold'    : '',
     'monType'        : [],
@@ -685,6 +713,7 @@ AllowedEBChainIdentifiers = ['eb']
 # ---- Enhanced Bias Chain Dictinary of all allowed Values ----
 EnhancedBiasChainParts = {
     'signature'      : ['EnhancedBias'],
+    'alignmentGroup' : ['EnhancedBias'],
     'chainPartName'  : '',
     'L1threshold'    : '',
     'algType'        : ['high','firstempty','empty','unpairediso','unpairednoniso', 'low'],
@@ -697,6 +726,7 @@ EnhancedBiasChainParts = {
 # ---- EnhancedBias Chain Default Dictinary of all allowed Values ----
 EnhancedBiasChainParts_Default = {
     'signature'      : ['EnhancedBias'],
+    'alignmentGroup' : ['EnhancedBias'],
     'chainPartName'  : '',
     'L1threshold'    : '',
     'algType'        : 'physics',
@@ -712,6 +742,7 @@ EnhancedBiasChainParts_Default = {
 AllowedBeamspotChainIdentifiers = ['beamspot',]
 BeamspotChainParts = {
     'signature'      : ['Beamspot'],
+    'alignmentGroup' : ['Beamspot'],
     'chainPartName'  : '',
     'L1threshold'    : '',
     'monType'        : AllowedBeamspotChainIdentifiers,
@@ -728,6 +759,7 @@ BeamspotChainParts = {
 # ---- Beamspot Chain Default Dictinary of all allowed Values ----
 BeamspotChainParts_Default = {
     'signature'      : ['Beamspot'],
+    'alignmentGroup' : ['Beamspot'],
     'chainPartName'  : '',
     'L1threshold'    : '',
     'monType'        : [],
@@ -818,7 +850,7 @@ def getSignatureInformation(signature):
         return [HeavyIonChainParts_Default, HeavyIonChainParts]
     if signature == "Cosmic":
         return [CosmicChainParts_Default, CosmicChainParts]
-    if signature == "Calibration":
+    if signature == "Calib":
         return [CalibChainParts_Default, CalibChainParts]
     if signature == "Streaming":
         return [StreamingChainParts_Default, StreamingChainParts]
@@ -831,7 +863,7 @@ def getSignatureInformation(signature):
     if signature == "Test":
         return [TestChainParts_Default, TestChainParts]
     else:
-        raise RuntimeError("ERROR Cannot find corresponding dictionary")
+        raise RuntimeError("ERROR Cannot find corresponding dictionary for signature", signature)
 
 #==========================================================
 # Analysis the base pattern: <mult><signatureType><threshold><extraInfo>
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MinBias/MinBiasChainConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MinBias/MinBiasChainConfiguration.py
index bb92b344c250a61dd3cf1333961e563c861d4b63..be042ccaf556fcabdfc5c31ad41f1992b616aff7 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MinBias/MinBiasChainConfiguration.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MinBias/MinBiasChainConfiguration.py
@@ -65,12 +65,6 @@ class MinBiasChainConfig(ChainConfigurationBase):
                                            ( 'PixelID' , 'DetectorStore+PixelID' ),
                                            ( 'TagInfo' , 'DetectorStore+ProcessingTags' )]
 
-        from IOVDbSvc.CondDB import conddb
-        if not conddb.folderRequested( '/PIXEL/DCS/FSMSTATE' ):
-          verifier.DataObjects += [( 'CondAttrListCollection' , 'ConditionStore+/PIXEL/DCS/FSMSTATE' )]
-        if not conddb.folderRequested( '/PIXEL/DCS/FSMSTATUS' ):
-          verifier.DataObjects += [( 'CondAttrListCollection' , 'ConditionStore+/PIXEL/DCS/FSMSTATUS' )]
-
         SpList = idAlgs[:-2]
 
         SpCount=TrigCountSpacePointsMT()
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/GenerateMuonChainDefs.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/GenerateMuonChainDefs.py
index 69b1ae0d476cc75df2db9b06e33fadc5f1f1ae40..29c246a4ebe206322e857e446160f0549af1e2b1 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/GenerateMuonChainDefs.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/GenerateMuonChainDefs.py
@@ -33,19 +33,3 @@ def generateChainConfigs(chainDict):
     return theChainDef
 
 
-# this is obsolete: can we remove ? FP
-def mergeSerial(listOfChainDefs):
-
-    chaindef = listOfChainDefs[0]
-    listOfChainDefs.pop(0)
-    steps = chaindef.steps
-
-    for cdef in listOfChainDefs:
-        csteps = cdef.steps 
-        for step in csteps:
-            steps.append(step)
-
-    return chaindef
-
-
-
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSequenceSetup.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSequenceSetup.py
index b2def1d49154c3016ed6f6115f5ec0e83a933b0e..793fc334af33ea66490f28b06944d349b3aa7f8c 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSequenceSetup.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSequenceSetup.py
@@ -136,11 +136,6 @@ def muCombAlgSequence(ConfigFlags):
     muCombFilterSequence = seqAND("l2muCombFilterSequence", [muonChainFilter, muCombRecoSequence])
 
     extraLoads = []
-    from IOVDbSvc.CondDB import conddb
-    if not conddb.folderRequested( '/PIXEL/DCS/FSMSTATUS' ):
-      extraLoads += [( 'CondAttrListCollection' , 'ConditionStore+/PIXEL/DCS/FSMSTATUS' )]
-    if not conddb.folderRequested( '/PIXEL/DCS/FSMSTATE' ):
-      extraLoads += [( 'CondAttrListCollection' , 'ConditionStore+/PIXEL/DCS/FSMSTATE' )]
 
     for decision in muonChainFilter.InputDecisions:
       extraLoads += [( 'xAOD::TrigCompositeContainer' , 'StoreGateSvc+'+decision )]
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSetup.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSetup.py
index d609f824ce09d9a766596d1cad718bd68f037d07..a53f477d265cd6494c07bcd61d73639d9b233865 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSetup.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSetup.py
@@ -552,9 +552,6 @@ def muCombRecoSequence( RoIs, name ):
   ViewVerify = CfgMgr.AthViews__ViewDataVerifier("muFastViewDataVerifier")
   ViewVerify.DataObjects = [('xAOD::L2StandAloneMuonContainer','StoreGateSvc+'+muNames.L2SAName)]
 
-  from IOVDbSvc.CondDB import conddb
-  if not conddb.folderRequested( '/TDAQ/Resources/ATLAS/PIXEL/Modules' ):
-    ViewVerify.DataObjects += [( 'CondAttrListCollection', 'ConditionStore+/TDAQ/Resources/ATLAS/PIXEL/Modules' )]
   muCombRecoSequence+=ViewVerify
 
   ### please read out TrigmuCombMTConfig file ###
@@ -621,25 +618,6 @@ def muEFSARecoSequence( RoIs, name ):
                                         ( 'TrigRoiDescriptorCollection' , 'StoreGateSvc+'+RoIs )]
   efAlgs.append( EFMuonViewDataVerifier )
 
-  # Only load these objects if they aren't available in conddb
-  from IOVDbSvc.CondDB import conddb
-  if not conddb.folderRequested( "/MDT/DQMF/DEAD_ELEMENT" ):
-    EFMuonViewDataVerifier.DataObjects += [( 'CondAttrListCollection' , 'ConditionStore+/MDT/DQMF/DEAD_ELEMENT' )]
-  if not conddb.folderRequested( "/MDT/TUBE_STATUS/DEAD_TUBE" ):
-    EFMuonViewDataVerifier.DataObjects += [( 'CondAttrListCollection' , 'ConditionStore+/MDT/TUBE_STATUS/DEAD_TUBE' )]
-
-  if name != 'FS':
-    # we now try to share the data preparation algorithms with L2, so we tell the view that it should expect the MDT, TGC, CSC and RPC PRDs to be available
-    EFMuonViewDataVerifier.DataObjects += [( 'Muon::MdtPrepDataContainer' , 'StoreGateSvc+MDT_DriftCircles' ),
-                                           ( 'Muon::TgcPrepDataContainer' , 'StoreGateSvc+TGC_Measurements' ),
-                                           ( 'Muon::RpcPrepDataContainer' , 'StoreGateSvc+RPC_Measurements' )]
-    if MuonGeometryFlags.hasCSC():
-      EFMuonViewDataVerifier.DataObjects += [( 'Muon::CscStripPrepDataContainer' , 'StoreGateSvc+CSC_Measurements' ),
-                                             ( 'Muon::CscPrepDataContainer' , 'StoreGateSvc+CSC_Clusters' )]
-    if (MuonGeometryFlags.hasSTGC() and MuonGeometryFlags.hasMM()): 
-      EFMuonViewDataVerifier.DataObjects += [( 'Muon::MMPrepDataContainer'       , 'StoreGateSvc+MM_Measurements'),
-                                             ( 'Muon::sTgcPrepDataContainer'     , 'StoreGateSvc+STGC_Measurements')]
-
   #need MdtCondDbAlg for the MuonStationIntersectSvc (required by segment and track finding)
   from AthenaCommon.AlgSequence import AthSequencer
   from MuonCondAlg.MuonTopCondAlgConfigRUN2 import MdtCondDbAlg
@@ -748,12 +726,8 @@ def muEFCBRecoSequence( RoIs, name ):
 
   muEFCBRecoSequence += ViewVerifyMS
 
-  # Add conditions data if not already available
-  from IOVDbSvc.CondDB import conddb
   from AthenaCommon.AlgSequence import AlgSequence
   topSequence = AlgSequence()
-  if not conddb.folderRequested( "/PIXEL/PixdEdx" ):
-    ViewVerifyMS.DataObjects += [( 'AthenaAttributeList' , 'ConditionStore+/PIXEL/PixdEdx' )]
 
   if not globalflags.InputFormat.is_bytestream():
     topSequence.SGInputLoader.Load += [( 'TRT_RDO_Container' , 'StoreGateSvc+TRT_RDOs' )]
@@ -1002,9 +976,9 @@ def efmuisoRecoSequence( RoIs, Muons ):
                              ( 'xAOD::MuonContainer' , 'StoreGateSvc+IsoViewMuons' )]
 
   # Make sure required objects are still available at whole-event level
-  from AthenaCommon.AlgSequence import AlgSequence
-  topSequence = AlgSequence()
   if not globalflags.InputFormat.is_bytestream():
+    from AthenaCommon.AlgSequence import AlgSequence
+    topSequence = AlgSequence()
     viewVerify.DataObjects += [( 'TRT_RDO_Container' , 'StoreGateSvc+TRT_RDOs' )]
     topSequence.SGInputLoader.Load += [( 'TRT_RDO_Container' , 'StoreGateSvc+TRT_RDOs' )]
 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Photon/generatePhoton.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Photon/generatePhoton.py
index c5bd2be446053dd7c3c6aa2d82cc337187a6e5d9..074285b1c74dbd86f8959c9e030178f095e86311 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Photon/generatePhoton.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Photon/generatePhoton.py
@@ -8,7 +8,6 @@ from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
 
 from TrigEgammaHypo.TrigEgammaFastCaloHypoTool import TrigEgammaFastCaloHypoToolFromDict
 from TrigEgammaHypo.TrigEgammaFastPhotonHypoTool import TrigEgammaFastPhotonHypoToolFromDict
-from TrigEDMConfig.TriggerEDMRun3 import recordable
 
 import pprint
 from AthenaCommon.Logging import logging
@@ -31,7 +30,7 @@ def generateChains(flags, chainDict):
 
     l2CaloHypo = l2CaloHypoCfg( flags,
                                 name = 'L2PhotonCaloHypo',
-                                CaloClusters = recordable('HLT_FastCaloEMClusters') )
+                                CaloClusters = 'HLT_FastCaloEMClusters' )
 
     accCalo.addEventAlgo(l2CaloHypo, sequenceName=stepView.getName())
 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Tau/TauRecoSequences.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Tau/TauRecoSequences.py
index a09d7e2fec799c2c0b10f24d4f11cf15c9fc73d3..edc78390432053308668e60fe228aace804e3ade 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Tau/TauRecoSequences.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Tau/TauRecoSequences.py
@@ -142,7 +142,6 @@ def tauCaloSequence(ConfigFlags):
     tauCaloRecoVDV = CfgMgr.AthViews__ViewDataVerifier( "tauCaloRecoVDV" )
     tauCaloRecoVDV.DataObjects = [( 'TrigRoiDescriptorCollection' , 'StoreGateSvc+TAUCaloRoIs' ),
                                   ( 'CaloBCIDAverage' , 'StoreGateSvc+CaloBCIDAverage' ),
-                                  ( 'ILArHVScaleCorr' , 'ConditionStore+LArHVScaleCorrRecomputed' ),
                                   ( 'xAOD::EventInfo' , 'StoreGateSvc+EventInfo' ),
                                   ( 'SG::AuxElement' , 'StoreGateSvc+EventInfo.ActIntPerXDecor' ),
                                   ( 'SG::AuxElement' , 'StoreGateSvc+EventInfo.AveIntPerXDecor' )]
@@ -169,7 +168,6 @@ def tauCaloMVASequence(ConfigFlags):
     tauCaloMVARecoVDV = CfgMgr.AthViews__ViewDataVerifier( "tauCaloMVARecoVDV" )
     tauCaloMVARecoVDV.DataObjects = [( 'TrigRoiDescriptorCollection' , 'StoreGateSvc+TAUCaloRoIs' ),
                                      ( 'CaloBCIDAverage' , 'StoreGateSvc+CaloBCIDAverage' ),
-                                     ( 'ILArHVScaleCorr' , 'ConditionStore+LArHVScaleCorrRecomputed' ),
                                      ( 'xAOD::EventInfo' , 'StoreGateSvc+EventInfo' ),
                                      ( 'SG::AuxElement' , 'StoreGateSvc+EventInfo.ActIntPerXDecor' ),
                                      ( 'SG::AuxElement' , 'StoreGateSvc+EventInfo.AveIntPerXDecor' )]
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8.py
index 98149e1c2615fb67ea8f3cb5908881bfd954651c..d4c6cc4797fc6e927ffaa30e3065d0760c354e75 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8.py
@@ -1,3 +1,4 @@
+
 # Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 #
 # Run this file in order to print out the empty slots
@@ -387,6 +388,7 @@ def defineMenu():
         'L1_CEP-CJ50' ,
         'L1_CEP-CJ50.ETA21',
 
+        #ATR-21371
         'L1_ALFA_ANY',
         'L1_ALFA_ELAST15', 'L1_ALFA_ELAST18',
         '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_Calib
@@ -814,7 +816,7 @@ def defineMenu():
         'L1_eEM15VHI_2eTAU12IM_gXERHO35' : 477,
         'L1_eEM15VH_MU10' : 478,
         'L1_eEM18VHI_3jJ20' : 489,
-        'L1_eEM20VHI_eTAU20IM_2eTAU20_jJ25_3jJ20' :  490,
+        'L1_ALFA_ANY' : 490,
         'L1_eEM20VH_3eEM10VH' : 491,
         'L1_eEM22VHI' : 492,
         'L1_eEM20VHI' : 493, 
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 de27d8d0907060465f65e0f3feb42d90625a98db..392cee0fe415902dda6796f308f41b41a57dd818 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/Menu_LS2_v1.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/Menu_LS2_v1.py
@@ -626,6 +626,9 @@ def defineMenu():
         ##     'L1_CALREQ0_P1', 'L1_CALREQ1_P1', 'L1_CALREQ2_P1',
 
         #ALFA
+        'L1_ALFA_ANY',
+        '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_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',
@@ -994,7 +997,14 @@ def defineMenu():
         'L1_MBTS_1_1_EMPTY' : 168,
         'L1_BPH-8M15-2MU4-BO' : 165,
         'L1_CALREQ2' : 511,
-
+        'L1_ALFA_B7L1U' : 489,
+        'L1_ALFA_ANY'   : 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,
 }