diff --git a/Calorimeter/CaloExample/CaloRecEx/share/CaloRecOutputItemList_jobOptions.py b/Calorimeter/CaloExample/CaloRecEx/share/CaloRecOutputItemList_jobOptions.py
index d9e10e05a6cb253076b69baabd33abe06bc1768b..7f143f2ac818e6c606c55dff9ac5a75a5cff6176 100644
--- a/Calorimeter/CaloExample/CaloRecEx/share/CaloRecOutputItemList_jobOptions.py
+++ b/Calorimeter/CaloExample/CaloRecEx/share/CaloRecOutputItemList_jobOptions.py
@@ -110,7 +110,8 @@ AODMoments=[#"LATERAL"
             ,"EM_PROBABILITY"
             #,"PTD"
             ,"BadChannelList"
-            ,#"LATERAL"
+            #,"LATERAL"
+            ,"SECOND_TIME"
             ]
 
 if jobproperties.CaloRecFlags.doExtendedClusterMoments.get_Value():
@@ -215,8 +216,6 @@ if jobproperties.CaloRecFlags.doCaloFwdTopoTower.get_Value():
          AuxListItem+="."+moment
     CaloClusterItemList+=[AuxListItem]
 
-
-
 CaloAODList+=CaloClusterItemList
 
 # E4' cells
diff --git a/Calorimeter/CaloLocalHadCalib/share/GetH6LCSinglePionsPerf_cbt.py b/Calorimeter/CaloLocalHadCalib/share/GetH6LCSinglePionsPerf_cbt.py
index 8c4e725d132a86ac773257f7b1862283be8c41d7..82263629bc3982e25e6b0c42ed5f5a9bb2d30391 100644
--- a/Calorimeter/CaloLocalHadCalib/share/GetH6LCSinglePionsPerf_cbt.py
+++ b/Calorimeter/CaloLocalHadCalib/share/GetH6LCSinglePionsPerf_cbt.py
@@ -126,17 +126,6 @@ if doTopoClusterAgain:
                                                              "TileExt0", "TileExt1", "TileExt2",
                                                              "TileGap1", "TileGap2", "TileGap3",
                                                              "FCAL0", "FCAL1"] 
-  # simple noise tool
-  SimpleNoiseFile = "sigmas_all.dat"
-  from CaloTools.CaloToolsConf import SimpleNoiseToolFromTextFile
-  SimpleNoiseTool = SimpleNoiseToolFromTextFile("SimpleNoiseTool")
-  SimpleNoiseTool.CellNoiseFileName = SimpleNoiseFile
-  ToolSvc += SimpleNoiseTool
-
-  topSequence.CaloTopoCluster.TopoMaker.CaloNoiseTool           = SimpleNoiseTool
-  topSequence.CaloTopoCluster.LocalCalib.LCWeight.CaloNoiseTool = SimpleNoiseTool
-  topSequence.CaloTopoCluster.DMCalib.LCDeadMaterial.CaloNoiseTool = SimpleNoiseTool
-
   # remove annoying BadChannel tool
   tlist=[]
   for x in topSequence.CaloTopoCluster.ClusterCorrectionTools:
diff --git a/Calorimeter/CaloLocalHadCalib/share/cl_w_ooc_H6.py b/Calorimeter/CaloLocalHadCalib/share/cl_w_ooc_H6.py
index d0559bb8aeb9106e68b86bd0dd48be89c8460614..8102bdb397bebf6cde9de282225e3ef31e16babb 100644
--- a/Calorimeter/CaloLocalHadCalib/share/cl_w_ooc_H6.py
+++ b/Calorimeter/CaloLocalHadCalib/share/cl_w_ooc_H6.py
@@ -142,16 +142,6 @@ if doTopoClusterAgain:
                                                              "TileExt0", "TileExt1", "TileExt2",
                                                              "TileGap1", "TileGap2", "TileGap3",
                                                              "FCAL0", "FCAL1"] 
-  # simple noise tool
-  SimpleNoiseFile = "sigmas_ave.dat"
-  from CaloTools.CaloToolsConf import SimpleNoiseToolFromTextFile
-  SimpleNoiseTool = SimpleNoiseToolFromTextFile("SimpleNoiseTool")
-  SimpleNoiseTool.CellNoiseFileName = SimpleNoiseFile
-  ToolSvc += SimpleNoiseTool
-
-  topSequence.CaloTopoCluster.TopoMaker.CaloNoiseTool           = SimpleNoiseTool
-  topSequence.CaloTopoCluster.LocalCalib.LCWeight.CaloNoiseTool = SimpleNoiseTool
-  topSequence.CaloTopoCluster.DMCalib.LCDeadMaterial.CaloNoiseTool = SimpleNoiseTool
 
   # remove annoying BadChannel tool
   tlist=[]
diff --git a/Calorimeter/CaloLocalHadCalib/share/deadmaterialtree_ctb.py b/Calorimeter/CaloLocalHadCalib/share/deadmaterialtree_ctb.py
index 22ec5d145ca5cba291cd9988690306395c42998d..923413a389b63ac4b3f57c974c0f88fbd6cd3e35 100644
--- a/Calorimeter/CaloLocalHadCalib/share/deadmaterialtree_ctb.py
+++ b/Calorimeter/CaloLocalHadCalib/share/deadmaterialtree_ctb.py
@@ -137,16 +137,6 @@ if doTopoClusterAgain:
                                                              "TileExt0", "TileExt1", "TileExt2",
                                                              "TileGap1", "TileGap2", "TileGap3",
                                                              "FCAL0", "FCAL1"] 
-  # simple noise tool
-  SimpleNoiseFile = "sigmas_ave.dat"
-  from CaloTools.CaloToolsConf import SimpleNoiseToolFromTextFile
-  SimpleNoiseTool = SimpleNoiseToolFromTextFile("SimpleNoiseTool")
-  SimpleNoiseTool.CellNoiseFileName = SimpleNoiseFile
-  ToolSvc += SimpleNoiseTool
-
-  topSequence.CaloTopoCluster.TopoMaker.CaloNoiseTool           = SimpleNoiseTool
-  topSequence.CaloTopoCluster.LocalCalib.LCWeight.CaloNoiseTool = SimpleNoiseTool
-  topSequence.CaloTopoCluster.DMCalib.LCDeadMaterial.CaloNoiseTool = SimpleNoiseTool
 
   # remove annoying BadChannel tool
   tlist=[]
diff --git a/Calorimeter/CaloRec/python/CaloClusterTopoGetter.py b/Calorimeter/CaloRec/python/CaloClusterTopoGetter.py
index 0aeba2d994eafa79529ddcf103ba2d06351c1a6c..9f1d68111d0a4ada98513090a3e5255056ad1ef2 100644
--- a/Calorimeter/CaloRec/python/CaloClusterTopoGetter.py
+++ b/Calorimeter/CaloRec/python/CaloClusterTopoGetter.py
@@ -234,7 +234,7 @@ class CaloClusterTopoGetter ( Configured )  :
                                     ,"AVG_TILE_Q"
                                     ,"PTD"
                                     ,"MASS"
-                                    ,"EM_PROBABILITY"
+                                    ,"SECOND_TIME"
                                     ]
 
         doDigiTruthFlag = False
diff --git a/Calorimeter/CaloRec/python/CaloTopoClusterConfig.py b/Calorimeter/CaloRec/python/CaloTopoClusterConfig.py
index a7a9979864d8b45c86372e8db806fd3473cf1258..4bc3520529efcd70671293f87dfb5e34a81ad129 100644
--- a/Calorimeter/CaloRec/python/CaloTopoClusterConfig.py
+++ b/Calorimeter/CaloRec/python/CaloTopoClusterConfig.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 
 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
 from AthenaConfiguration.ComponentFactory import CompFactory
@@ -135,6 +135,7 @@ def getTopoMoments(configFlags):
                                 ,"AVG_TILE_Q"
                                 ,"PTD"
                                 ,"MASS"
+                                , "SECOND_TIME"
                                 ]
 
     # Disable for now, as broken on MC
diff --git a/Calorimeter/CaloRec/python/MakeTowersFromClusters.py b/Calorimeter/CaloRec/python/MakeTowersFromClusters.py
index 4e312a59e41b4b764df4e8c97b0920c770199832..04293c4097d6af7465729fd897bea9c205fa3870 100644
--- a/Calorimeter/CaloRec/python/MakeTowersFromClusters.py
+++ b/Calorimeter/CaloRec/python/MakeTowersFromClusters.py
@@ -24,6 +24,7 @@ def TowersFromClustersDict(clusterBuilderName       = 'TowerFromClusterTool',
                            cellEnergyThreshold      = 0.,
                            applyLCW                 = False,
                            buildCombinedSignal      = False,
+                           removeSamplingData       = True,
                            clusterRange             = 5.):
     ''' Configuration dictionary for tower-to-cluster converter 
     '''
@@ -38,7 +39,8 @@ def TowersFromClustersDict(clusterBuilderName       = 'TowerFromClusterTool',
                    'PrepareLCW'                  : applyLCW,                   ### (control) prepare (and apply) LCW
                    'DoCellIndexCheck'            : doCellIndexCheck,           ### (control) check cell hash indices
                    'BuildCombinedTopoSignal'     : buildCombinedSignal,        ### (control) build combined topo-cluster/topo-tower container
-                   'TopoClusterRange'            : clusterRange,               ### (control) range for topo-cluster in combined mode 
+                   'TopoClusterRange'            : clusterRange,               ### (control) range for topo-cluster in combined mode
+                   'RemoveSamplingData'          : removeSamplingData,         ### (control) remove all sampling data from tower
                    }
     return configDict
 
@@ -146,15 +148,15 @@ def MakeTowersFromClusters(towerMakerName      = 'CaloTowerBuilderAlg',        #
     clusterMoments.TwoGaussianNoise = jobproperties.CaloTopoClusterFlags.doTwoGaussianNoise()
     clusterMoments.MinBadLArQuality = 4000
     clusterMoments.MomentsNames     = [
-        "CENTER_LAMBDA", 
-        #"CENTER_MAG",
+        # "CENTER_LAMBDA", 
+        # "CENTER_MAG",
         "LONGITUDINAL",
-        #"FIRST_ENG_DENS",
-        #"ENG_FRAC_MAX",
+        # "FIRST_ENG_DENS",
+        # "ENG_FRAC_MAX",
         "ENG_FRAC_EM",
-        #"PTD",
+        # "PTD",
         "SIGNIFICANCE",
-        "ENG_POS"
+        # "ENG_POS",
     ]
 
     from IOVDbSvc.CondDB import conddb
diff --git a/Calorimeter/CaloRec/share/CaloTopoSignalFragment.py b/Calorimeter/CaloRec/share/CaloTopoSignalFragment.py
index 79bcb1076bdcb72859eae661db5c0a919ebea7c3..e43ade4a0b84450b9f92b61047f7978f003726bb 100644
--- a/Calorimeter/CaloRec/share/CaloTopoSignalFragment.py
+++ b/Calorimeter/CaloRec/share/CaloTopoSignalFragment.py
@@ -58,7 +58,7 @@ caloTowerMerger.TopoClusterRange        = caloTowerDict['TopoClusterRange']
 caloTowerMerger.TopoClusterContainerKey = caloTowerDict['CaloTopoClusterContainerKey']             #### caloTowerAlgo.CaloFwdTopoTowerBuilder.CaloTopoClusterContainerKey
 caloTowerMerger.TopoTowerContainerKey   = caloTowerAlgo.TowersOutputName
 caloTowerMerger.TopoSignalContainerKey  = 'CaloCalTopoSignals'
-caloTowerMerger.OutputLevel             = Lvl.DEBUG
+## caloTowerMerger.OutputLevel             = Lvl.DEBUG
 
 topSequence+=caloTowerAlgo
 topSequence+=caloTowerMerger
diff --git a/Calorimeter/CaloRec/src/CaloClusterMomentsMaker.cxx b/Calorimeter/CaloRec/src/CaloClusterMomentsMaker.cxx
index 5c679d82e58c506c0e4c76db932c49fea9ee2a8a..1ebd1d49f9e8fa9ab2924c5df7d7c8e6534eb133 100644
--- a/Calorimeter/CaloRec/src/CaloClusterMomentsMaker.cxx
+++ b/Calorimeter/CaloRec/src/CaloClusterMomentsMaker.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 //-----------------------------------------------------------------------
@@ -12,6 +12,7 @@
 //
 // Author List:
 //      Sven Menke
+//      Peter Loch
 //
 //-----------------------------------------------------------------------
 
@@ -39,78 +40,98 @@
 #include <limits>
 #include <sstream>
 
+#include <map>
+#include <string>
+#include <cstdio>
+
 using CLHEP::deg;
 using CLHEP::cm;
 
 
+// Known moments
 namespace {
-
-
-  //FIXME, somehow make sure these names are in sync with the xAOD variable names
-struct MomentName
-{
-  const char* name;
-  xAOD::CaloCluster::MomentType mom;
-};
-
-
-// Must be sorted by name.
-MomentName moment_names[] = {
-  { "AVG_LAR_Q",         xAOD::CaloCluster::AVG_LAR_Q },
-  { "AVG_TILE_Q",        xAOD::CaloCluster::AVG_TILE_Q },
-  { "BADLARQ_FRAC",      xAOD::CaloCluster::BADLARQ_FRAC },
-  { "BAD_CELLS_CORR_E",  xAOD::CaloCluster::BAD_CELLS_CORR_E },
-  { "CELL_SIGNIFICANCE", xAOD::CaloCluster::CELL_SIGNIFICANCE },
-  { "CELL_SIG_SAMPLING", xAOD::CaloCluster::CELL_SIG_SAMPLING },
-  { "CENTER_LAMBDA",     xAOD::CaloCluster::CENTER_LAMBDA },
-  { "CENTER_MAG",        xAOD::CaloCluster::CENTER_MAG },
-  { "CENTER_X",          xAOD::CaloCluster::CENTER_X },
-  { "CENTER_Y",          xAOD::CaloCluster::CENTER_Y },
-  { "CENTER_Z",          xAOD::CaloCluster::CENTER_Z },
-  { "DELTA_ALPHA",       xAOD::CaloCluster::DELTA_ALPHA },
-  { "DELTA_PHI",         xAOD::CaloCluster::DELTA_PHI },
-  { "DELTA_THETA",       xAOD::CaloCluster::DELTA_THETA },
-  { "ENG_BAD_CELLS",     xAOD::CaloCluster::ENG_BAD_CELLS },
-  { "ENG_BAD_HV_CELLS",  xAOD::CaloCluster::ENG_BAD_HV_CELLS },
-  { "ENG_FRAC_CORE",     xAOD::CaloCluster::ENG_FRAC_CORE },
-  { "ENG_FRAC_EM",       xAOD::CaloCluster::ENG_FRAC_EM },
-  { "ENG_FRAC_MAX",      xAOD::CaloCluster::ENG_FRAC_MAX },
-  { "ENG_POS",           xAOD::CaloCluster::ENG_POS },
-  { "FIRST_ENG_DENS",    xAOD::CaloCluster::FIRST_ENG_DENS },
-  { "FIRST_ETA",         xAOD::CaloCluster::FIRST_ETA },
-  { "FIRST_PHI",         xAOD::CaloCluster::FIRST_PHI },
-  { "ISOLATION",         xAOD::CaloCluster::ISOLATION },
-  { "LATERAL",           xAOD::CaloCluster::LATERAL },
-  { "LONGITUDINAL",      xAOD::CaloCluster::LONGITUDINAL },
-  { "MASS",              xAOD::CaloCluster::MASS },
-  { "N_BAD_CELLS",       xAOD::CaloCluster::N_BAD_CELLS },
-  { "N_BAD_HV_CELLS",    xAOD::CaloCluster::N_BAD_HV_CELLS },
-  { "N_BAD_CELLS_CORR",  xAOD::CaloCluster::N_BAD_CELLS_CORR },
-  { "PTD",               xAOD::CaloCluster::PTD },
-  { "SECOND_ENG_DENS",   xAOD::CaloCluster::SECOND_ENG_DENS },
-  { "SECOND_LAMBDA",     xAOD::CaloCluster::SECOND_LAMBDA },
-  { "SECOND_R",          xAOD::CaloCluster::SECOND_R },
-  { "SIGNIFICANCE",      xAOD::CaloCluster::SIGNIFICANCE },
-};
-
-MomentName* moment_names_end =
-  moment_names + sizeof(moment_names)/sizeof(moment_names[0]);
-
-#if 0
-bool operator< (const std::string& v, const MomentName& m)
-{
-  return strcmp (v.c_str(), m.name) < 0;
-}
-#endif
-bool operator< (const MomentName& m, const std::string& v)
-{
-  return strcmp (m.name, v.c_str()) < 0;
-}
-
-
+  // name -> enum translator
+  std::map<std::string,xAOD::CaloCluster::MomentType> momentNameToEnumMap = { 
+    { "AVG_LAR_Q",         xAOD::CaloCluster::AVG_LAR_Q },
+    { "AVG_TILE_Q",        xAOD::CaloCluster::AVG_TILE_Q },
+    { "BADLARQ_FRAC",      xAOD::CaloCluster::BADLARQ_FRAC },
+    { "BAD_CELLS_CORR_E",  xAOD::CaloCluster::BAD_CELLS_CORR_E },
+    { "CELL_SIGNIFICANCE", xAOD::CaloCluster::CELL_SIGNIFICANCE },
+    { "CELL_SIG_SAMPLING", xAOD::CaloCluster::CELL_SIG_SAMPLING },
+    { "CENTER_LAMBDA",     xAOD::CaloCluster::CENTER_LAMBDA },
+    { "CENTER_MAG",        xAOD::CaloCluster::CENTER_MAG },
+    { "CENTER_X",          xAOD::CaloCluster::CENTER_X },
+    { "CENTER_Y",          xAOD::CaloCluster::CENTER_Y },
+    { "CENTER_Z",          xAOD::CaloCluster::CENTER_Z },
+    { "DELTA_ALPHA",       xAOD::CaloCluster::DELTA_ALPHA },
+    { "DELTA_PHI",         xAOD::CaloCluster::DELTA_PHI },
+    { "DELTA_THETA",       xAOD::CaloCluster::DELTA_THETA },
+    { "ENG_BAD_CELLS",     xAOD::CaloCluster::ENG_BAD_CELLS },
+    { "ENG_BAD_HV_CELLS",  xAOD::CaloCluster::ENG_BAD_HV_CELLS },
+    { "ENG_FRAC_CORE",     xAOD::CaloCluster::ENG_FRAC_CORE },
+    { "ENG_FRAC_EM",       xAOD::CaloCluster::ENG_FRAC_EM },
+    { "ENG_FRAC_MAX",      xAOD::CaloCluster::ENG_FRAC_MAX },
+    { "ENG_POS",           xAOD::CaloCluster::ENG_POS },
+    { "FIRST_ENG_DENS",    xAOD::CaloCluster::FIRST_ENG_DENS },
+    { "FIRST_ETA",         xAOD::CaloCluster::FIRST_ETA },
+    { "FIRST_PHI",         xAOD::CaloCluster::FIRST_PHI },
+    { "ISOLATION",         xAOD::CaloCluster::ISOLATION },
+    { "LATERAL",           xAOD::CaloCluster::LATERAL },
+    { "LONGITUDINAL",      xAOD::CaloCluster::LONGITUDINAL },
+    { "MASS",              xAOD::CaloCluster::MASS },
+    { "N_BAD_CELLS",       xAOD::CaloCluster::N_BAD_CELLS },
+    { "N_BAD_HV_CELLS",    xAOD::CaloCluster::N_BAD_HV_CELLS },
+    { "N_BAD_CELLS_CORR",  xAOD::CaloCluster::N_BAD_CELLS_CORR },
+    { "PTD",               xAOD::CaloCluster::PTD },
+    { "SECOND_ENG_DENS",   xAOD::CaloCluster::SECOND_ENG_DENS },
+    { "SECOND_LAMBDA",     xAOD::CaloCluster::SECOND_LAMBDA },
+    { "SECOND_R",          xAOD::CaloCluster::SECOND_R },
+    { "SECOND_TIME",       xAOD::CaloCluster::SECOND_TIME },
+    { "SIGNIFICANCE",      xAOD::CaloCluster::SIGNIFICANCE },
+    { "EM_PROBABILITY",    xAOD::CaloCluster::EM_PROBABILITY }
+  };
+  // enum -> name translator
+  std::map<xAOD::CaloCluster::MomentType,std::string> momentEnumToNameMap = { 
+    { xAOD::CaloCluster::AVG_LAR_Q,          "AVG_LAR_Q"        },
+    { xAOD::CaloCluster::AVG_TILE_Q,         "AVG_TILE_Q"       },
+    { xAOD::CaloCluster::BADLARQ_FRAC,       "BADLARQ_FRAC"     },
+    { xAOD::CaloCluster::BAD_CELLS_CORR_E,   "BAD_CELLS_CORR_E" },
+    { xAOD::CaloCluster::CELL_SIGNIFICANCE,  "CELL_SIGNIFICANCE"},
+    { xAOD::CaloCluster::CELL_SIG_SAMPLING,  "CELL_SIG_SAMPLING"},
+    { xAOD::CaloCluster::CENTER_LAMBDA,      "CENTER_LAMBDA"    },
+    { xAOD::CaloCluster::CENTER_MAG,         "CENTER_MAG"       },
+    { xAOD::CaloCluster::CENTER_X,           "CENTER_X"         },
+    { xAOD::CaloCluster::CENTER_Y,           "CENTER_Y"         },
+    { xAOD::CaloCluster::CENTER_Z,           "CENTER_Z"         },
+    { xAOD::CaloCluster::DELTA_ALPHA,        "DELTA_ALPHA"      },
+    { xAOD::CaloCluster::DELTA_PHI,          "DELTA_PHI"        },
+    { xAOD::CaloCluster::DELTA_THETA,        "DELTA_THETA"      },
+    { xAOD::CaloCluster::ENG_BAD_CELLS,      "ENG_BAD_CELLS"    },
+    { xAOD::CaloCluster::ENG_BAD_HV_CELLS,   "ENG_BAD_HV_CELLS" },
+    { xAOD::CaloCluster::ENG_FRAC_CORE,      "ENG_FRAC_CORE"    },
+    { xAOD::CaloCluster::ENG_FRAC_EM,        "ENG_FRAC_EM"      },
+    { xAOD::CaloCluster::ENG_FRAC_MAX,       "ENG_FRAC_MAX"     },
+    { xAOD::CaloCluster::ENG_POS,            "ENG_POS"          },
+    { xAOD::CaloCluster::FIRST_ENG_DENS,     "FIRST_ENG_DENS"   },
+    { xAOD::CaloCluster::FIRST_ETA,          "FIRST_ETA"        },
+    { xAOD::CaloCluster::FIRST_PHI,          "FIRST_PHI"        },
+    { xAOD::CaloCluster::ISOLATION,          "ISOLATION"        },
+    { xAOD::CaloCluster::LATERAL,            "LATERAL"          },
+    { xAOD::CaloCluster::LONGITUDINAL,       "LONGITUDINAL"     },
+    { xAOD::CaloCluster::MASS,               "MASS"             },
+    { xAOD::CaloCluster::N_BAD_CELLS,        "N_BAD_CELLS"      },
+    { xAOD::CaloCluster::N_BAD_HV_CELLS,     "N_BAD_HV_CELLS"   },
+    { xAOD::CaloCluster::N_BAD_CELLS_CORR,   "N_BAD_CELLS_CORR" },
+    { xAOD::CaloCluster::PTD,                "PTD"              },
+    { xAOD::CaloCluster::SECOND_ENG_DENS,    "SECOND_ENG_DENS"  },
+    { xAOD::CaloCluster::SECOND_LAMBDA,      "SECOND_LAMBDA"    },
+    { xAOD::CaloCluster::SECOND_R,           "SECOND_R"         },
+    { xAOD::CaloCluster::SECOND_TIME,        "SECOND_TIME"      },
+    { xAOD::CaloCluster::SIGNIFICANCE,       "SIGNIFICANCE"     },
+    { xAOD::CaloCluster::EM_PROBABILITY,     "EM_PROBABILITY"   }
+  };
 }
 
-
 //###############################################################################
 
 CaloClusterMomentsMaker::CaloClusterMomentsMaker(const std::string& type, 
@@ -134,117 +155,102 @@ CaloClusterMomentsMaker::CaloClusterMomentsMaker(const std::string& type,
   // Name(s) of Moments to calculate
   declareProperty("MomentsNames",m_momentsNames);
 
-  // Name(s) of Moments which can be stored on the AOD - all others go to ESD
-  // m_momentsNamesAOD.push_back(std::string("FIRST_PHI"));
-  // m_momentsNamesAOD.push_back(std::string("FIRST_ETA"));
-  // m_momentsNamesAOD.push_back(std::string("SECOND_R"));
-  // m_momentsNamesAOD.push_back(std::string("SECOND_LAMBDA"));
-  // m_momentsNamesAOD.push_back(std::string("CENTER_LAMBDA"));
-  // m_momentsNamesAOD.push_back(std::string("FIRST_ENG_DENS"));
-  // m_momentsNamesAOD.push_back(std::string("ENG_BAD_CELLS"));
-  // m_momentsNamesAOD.push_back(std::string("N_BAD_CELLS"));
-
-  //declareProperty("AODMomentsNames",m_momentsNamesAOD);
-  // maximum allowed angle between shower axis and the vector pointing
-  // to the shower center from the IP in degrees. This property is need
+  // Maximum allowed angle between shower axis and the vector pointing
+  // to the shower center from the IP in degrees. This property is needed
   // to protect against cases where all significant cells are in one sampling
-  // and the shower axis can not be defined from them
+  // and the shower axis can thus not be defined.
   declareProperty("MaxAxisAngle",m_maxAxisAngle);
   declareProperty("MinRLateral",m_minRLateral);
   declareProperty("MinLLongitudinal",m_minLLongitudinal);
   declareProperty("MinBadLArQuality",m_minBadLArQuality);
-  // use 2-gaussian noise for Tile
+  // Use 2-gaussian noise for Tile
   declareProperty("TwoGaussianNoise",m_twoGaussianNoise);
   declareProperty("LArHVFraction",m_larHVFraction,"Tool Handle for LArHVFraction");
-
-  /// Not used anymore (with xAOD), but required when configured from  COOL.
+  // Not used anymore (with xAOD), but required when configured from  COOL.
   declareProperty("AODMomentsNames",m_momentsNamesAOD);
   // Use weighting of neg. clusters option?
   declareProperty("WeightingOfNegClusters", m_absOpt);
-
 }
 
 //###############################################################################
 
 StatusCode CaloClusterMomentsMaker::initialize()
 {
-  m_calculateSignificance = false;
-  m_calculateIsolation = false;
-
-  // translate all moment names specified in MomentsNames property to moment enums,
-  // check that they are all valid and there are no repeating names
-  for(const auto& name: m_momentsNames) {
-    const MomentName* it =
-      std::lower_bound (moment_names, moment_names_end, name);
-    if (it != moment_names_end) {
-      m_validMoments.push_back (it->mom);
-      switch (it->mom) {
-      case xAOD::CaloCluster::SIGNIFICANCE:
-      case xAOD::CaloCluster::CELL_SIGNIFICANCE:
-        m_calculateSignificance = true;
-        break;
-      case xAOD::CaloCluster::ISOLATION:
-        m_calculateIsolation = true;
-        break;
-      case xAOD::CaloCluster::ENG_BAD_HV_CELLS:
-        m_calculateLArHVFraction = true;
-      default:
-        break;
-      }
-    }
-    else {
-      msg(MSG::ERROR) << "Moment " << name
-		      << " is not a valid Moment name and will be ignored! "
-		      << "Valid names are:";
-      int count = 0;
-      for (const MomentName& m : moment_names)
-	msg() << ((count++)==0?" ":", ") << m.name;
-      msg() << endmsg;
-    }
-  }
-
+  // loop list of requested moments
+  std::string::size_type nstr(0); int nmom(0); 
+  for ( const auto& mom : m_momentsNames ) {
+    // check if moment is known (enumerator available)
+    auto fmap(momentNameToEnumMap.find(mom)); 
+    if ( fmap != momentNameToEnumMap.end() ) {
+      // valid moment found 
+      nstr = std::max(nstr,mom.length()); ++nmom;
+      if ( fmap->second == xAOD::CaloCluster::SECOND_TIME ) {
+	// special flag for second moment of cell times - this moment is not 
+	// calculated in this tool! Do not add to internal (!) valid moments list. 
+	// Its value is available from xAOD::CaloCluster::secondTime()!
+	m_secondTime = true;
+      } else if ( fmap->second == xAOD::CaloCluster::EM_PROBABILITY ) {
+	ATH_MSG_WARNING( mom << " not calculated in this tool - misconfiguration?" );
+      } else {  
+	// all other valid moments
+	m_validMoments.push_back(fmap->second);
+	// flag some special requests 
+	switch (fmap->second) { 
+	case xAOD::CaloCluster::SIGNIFICANCE:
+	case xAOD::CaloCluster::CELL_SIGNIFICANCE:
+	  m_calculateSignificance = true; 
+	  break;
+	case xAOD::CaloCluster::ISOLATION:
+	  m_calculateIsolation = true;
+	  break;
+	case xAOD::CaloCluster::ENG_BAD_HV_CELLS:
+	  m_calculateLArHVFraction = true;
+	default:
+	  break;
+	} // set special processing flags
+      } // moment calculated with this tool
+    } else { 
+      ATH_MSG_ERROR( "Moment name " << mom << " not known; known moments are:" );
+      char buffer[128]; std::string::size_type lstr(nstr); 
+      // determine field size
+      for ( auto fmom : momentNameToEnumMap ) { lstr = std::max(lstr,fmom.first.length()); } 
+      // print available moments
+      for ( auto fmom : momentNameToEnumMap ) { 
+	sprintf(buffer,"moment name: %-*.*s - enumerator: %i",(int)lstr,(int)lstr,fmom.first.c_str(),(int)fmom.second); 
+	ATH_MSG_INFO(buffer);
+      } 
+      return StatusCode::FAILURE;
+    } // found unknown moment name
+  } // loop configured moment names
   
-  // sort and remove duplicates, order is not required for any of the code below
-  // but still may be useful property
+  // sort and remove duplicates
   std::sort(m_validMoments.begin(), m_validMoments.end());
-  m_validMoments.erase(std::unique(m_validMoments.begin(),
-                                   m_validMoments.end()),
-                       m_validMoments.end());
-
-  
-  /*
-  // translate moment names in AODMomentsNames property into set of enums,
-  // only take valid names which are also in MomentsNames property
-  m_momentsAOD.reserve(m_momentsNamesAOD.size());
-  for(const auto& name: m_momentsNamesAOD) {
-    const MomentName* it =
-      std::lower_bound (moment_names, moment_names_end, name);
-    if (it != moment_names_end) {
-      if (std::find(m_validMoments.begin(), m_validMoments.end(), it->mom)
-          != m_validMoments.end())
-      {
-        m_momentsAOD.push_back(it->mom);
-      }
-    }
+  m_validMoments.erase(std::unique(m_validMoments.begin(),m_validMoments.end()),m_validMoments.end());
+   
+  // print configured moments
+  ATH_MSG_INFO( "Construct and save " << nmom << " cluster moments: " );
+  char buffer[128];
+  for ( auto menum : m_validMoments ) { 
+    sprintf(buffer,"moment name: %-*.*s - enumerator: %i",(int)nstr,(int)nstr,momentEnumToNameMap.at(menum).c_str(),(int)menum); 
+    ATH_MSG_INFO( buffer );
   }
-  */
-  
+  if ( m_secondTime ) { 
+    auto fmom(momentNameToEnumMap.find("SECOND_TIME"));
+    sprintf(buffer,"moment name: %-*.*s - enumerator: %i (save only)",(int)nstr,(int)nstr,fmom->first.c_str(),(int)fmom->second);
+    ATH_MSG_INFO( buffer );
+  }
+
+  // retrieve CaloCell ID server  
   CHECK(detStore()->retrieve(m_calo_id,"CaloCell_ID"));
   
+  // retrieve the calo depth tool
   CHECK(m_caloDepthTool.retrieve());
 
-  if (m_calculateSignificance) { 
-    ATH_CHECK(m_noiseCDOKey.initialize());
-  }
+  // retrieve specific servers and tools for selected processes
+  if (m_calculateSignificance)  { ATH_CHECK(m_noiseCDOKey.initialize()); }
+  if (m_calculateLArHVFraction) { ATH_CHECK(m_larHVFraction.retrieve()); } else { m_larHVFraction.disable(); }
 
-  if (m_calculateLArHVFraction) { 
-    ATH_CHECK(m_larHVFraction.retrieve());
-  }
-  else {
-    m_larHVFraction.disable();
-  }
   return StatusCode::SUCCESS;
-  
 }
 
 StatusCode CaloClusterMomentsMaker::finalize()
@@ -256,6 +262,7 @@ StatusCode CaloClusterMomentsMaker::finalize()
 
 namespace CaloClusterMomentsMaker_detail {
 
+
 struct cellinfo {
   double x;
   double y;
@@ -903,7 +910,7 @@ CaloClusterMomentsMaker::execute(const EventContext& ctx,
 	  }
 	}
       }
-      
+
       // normalize moments and copy to Cluster Moment Store
       size_t size= m_validMoments.size();
       for (size_t iMoment = 0; iMoment != size; ++iMoment) {
@@ -913,9 +920,11 @@ CaloClusterMomentsMaker::execute(const EventContext& ctx,
 	if ( moment == xAOD::CaloCluster::FIRST_PHI ) 
 	  myMoments[iMoment] = CaloPhiRange::fix(myMoments[iMoment]);
 	theCluster->insertMoment(moment,myMoments[iMoment]);
-      }
-    }
-  }
+      } // loop on moments for cluster
+    } // check on requested moments
+    // check on second moment of time if requested
+    if ( m_secondTime ) { theCluster->insertMoment(xAOD::CaloCluster::SECOND_TIME,theCluster->secondTime()); }
+  } // loop on clusters
 
   return StatusCode::SUCCESS;
 }
diff --git a/Calorimeter/CaloRec/src/CaloClusterMomentsMaker.h b/Calorimeter/CaloRec/src/CaloClusterMomentsMaker.h
index 0f3622d0280b78d27007b6380495fe2ac22ed1a1..82e5f0e299c6a731c1ba19d2bc0100b80d725215 100644
--- a/Calorimeter/CaloRec/src/CaloClusterMomentsMaker.h
+++ b/Calorimeter/CaloRec/src/CaloClusterMomentsMaker.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 //Dear emacs, this is -*-c++-*-
@@ -8,7 +8,8 @@
 /**
  * @class CaloClusterMomentsMaker
  * @author Sven Menke <menke@mppmu.mpg.de>
- * @date 28-February-2005
+ * @author Peter Loch <loch@physics.arizona.edu>
+ * @date 23-March-2021
  * @brief Calculate moments for CaloCluster objects
  *
  * This is a CaloClusterCollectionProcessor which can be plugged into a
@@ -25,7 +26,10 @@
  * Note that only cells with positive energy are used in this definition.
  * Common variables to calculate first and second moments of are
  * \f$\phi\f$, \f$\eta\f$, and radial and longitudinal distances from
- * the shower axis and the shower center, respectively.  */
+ * the shower axis and the shower center, respectively. 
+ * 
+ * @since 23-March-2021: second moment of cell time distribution is calculated
+ */
 
 #include "GaudiKernel/ToolHandle.h"
 
@@ -133,6 +137,10 @@ class CaloClusterMomentsMaker: public AthAlgTool, virtual public CaloClusterColl
    * @brief if set to true use abs E value of cells to calculate 
    * cluster moments */
    bool m_absOpt;
+
+   /**
+    * @brief Retreive second moment of cell times */
+   bool m_secondTime = { false };
 };
 
 #endif // CALOCLUSTERMOMENTSMAKER_H
diff --git a/Calorimeter/CaloRec/src/CaloTopoTowerFromClusterMaker.cxx b/Calorimeter/CaloRec/src/CaloTopoTowerFromClusterMaker.cxx
index b3861bb3f862ca3ba15d134129f61c586380966b..563981cda3e3ee503b5c7a1cc44c919c666999ef 100644
--- a/Calorimeter/CaloRec/src/CaloTopoTowerFromClusterMaker.cxx
+++ b/Calorimeter/CaloRec/src/CaloTopoTowerFromClusterMaker.cxx
@@ -76,6 +76,7 @@ CaloTopoTowerFromClusterMaker::CaloTopoTowerFromClusterMaker(const std::string&
   declareProperty("DoCellIndexCheck",            m_doCellIndexCheck,                                                                  "Check cell hash indices for consistency");
   declareProperty("BuildCombinedTopoSignal",     m_buildCombinedSignal,                                                               "Build topo-clusters and topo-towers");
   declareProperty("TopoClusterRange",            m_clusterRange,                                                                      "Rapidity range for using topo-clusters in combined signal mode");
+  declareProperty("RemoveSamplingData",          m_removeSamplingData,                                                                "Remove the associated sampling data");
 }
 
 StatusCode CaloTopoTowerFromClusterMaker::initialize()
@@ -183,6 +184,7 @@ StatusCode CaloTopoTowerFromClusterMaker::initialize()
   ATH_MSG_INFO( CaloRec::Helpers::fmtMsg("BuildCombinedTopoSignal .... %s",             blu[m_buildCombinedSignal].c_str())      );
   ATH_MSG_INFO( CaloRec::Helpers::fmtMsg("TopoClusterRange ........... %.2f",           m_clusterRange)                          );
   ATH_MSG_INFO( CaloRec::Helpers::fmtMsg("ExcludedSamplings .......... %zu (number of)",m_excludedSamplingsName.size())          );
+  ATH_MSG_INFO( CaloRec::Helpers::fmtMsg("RemoveSamplingData ......... %s",             blu[m_removeSamplingData].c_str())       );
 
   return StatusCode::SUCCESS;
 }
@@ -268,8 +270,11 @@ StatusCode CaloTopoTowerFromClusterMaker::execute(const EventContext& ctx,
       clptr->addCellLink(lptr);                                         // transfer cell links to CaloCluster
       clptr->setClusterSize(csize);                                     // set the cluster size spec
       CaloRec::Helpers::calculateKine(clptr,false);                     // calculate kinematics and other signals from cells
-      clptr->setEta0(m_towerGeometrySvc->towerEta(ipc));                // save the tower center eta
-      clptr->setPhi0(m_towerGeometrySvc->towerPhi(ipc));                // save the tower center phi
+      if ( m_removeSamplingData ) {                                     // remove sampling data and invalidate tower center 
+	clptr->clearSamplingData(); clptr->setEta0(0.);	clptr->setPhi0(0.); 
+      } else {                                                          // keep sampling data and valid tower center
+	clptr->setEta0(m_towerGeometrySvc->towerEta(ipc)); clptr->setPhi0(m_towerGeometrySvc->towerPhi(ipc));              
+      }
     } else {
       delete lptr;
     }
diff --git a/Calorimeter/CaloRec/src/CaloTopoTowerFromClusterMaker.h b/Calorimeter/CaloRec/src/CaloTopoTowerFromClusterMaker.h
index 9bfd45b6b7d50dcaba0513cb5351b7170a7e5084..328117f5b711b801d003af6879d9299c7c6ff401 100644
--- a/Calorimeter/CaloRec/src/CaloTopoTowerFromClusterMaker.h
+++ b/Calorimeter/CaloRec/src/CaloTopoTowerFromClusterMaker.h
@@ -69,6 +69,7 @@ private:
   bool                                          m_buildCombinedSignal = { false  };         ///< Build topo-clusters within given @f$ y @f$ range, else topo-towers
   double                                        m_energyThreshold;                          ///< Cell energy threshold, default is set in @c m_energyThresholdDef
   double                                        m_clusterRange;                             ///< Range where topo-clusters are used when <tt>m_buildCombinedSignal = true</tt>
+  bool                                          m_removeSamplingData = { true };            ///< Remove sampling data for towers
   /// @}
 
   /// @name Constants and parameters
diff --git a/Control/AthenaCommon/python/AtlasThreadedJob.py b/Control/AthenaCommon/python/AtlasThreadedJob.py
index 050a048ae0fff303187432eb28fcfab0a9a12693..7bc20c431ff3cd6cda635cd4af9d0a453fa5ee03 100644
--- a/Control/AthenaCommon/python/AtlasThreadedJob.py
+++ b/Control/AthenaCommon/python/AtlasThreadedJob.py
@@ -48,15 +48,16 @@ def _setupAtlasThreadedJob():
     topSequence += SGInputLoader (FailIfNoProxy = False)
     AlgScheduler.setDataLoaderAlg ('SGInputLoader' )
 
-    if theApp._opts.mtes :
-        # Multi-threaded Event Service
+    if (theApp._opts.mtes or jps.ConcurrencyFlags.NumProcs()>0):
+        # Either multi-threaded Event Service or hybrid MP+MT
         from AthenaServices.AthenaServicesConf import AthenaMtesEventLoopMgr
         
         svcMgr += AthenaMtesEventLoopMgr()
         svcMgr.AthenaMtesEventLoopMgr.WhiteboardSvc = "EventDataSvc"
         svcMgr.AthenaMtesEventLoopMgr.SchedulerSvc = AlgScheduler.getScheduler().getName()
+
+    if theApp._opts.mtes:
         svcMgr.AthenaMtesEventLoopMgr.EventRangeChannel = theApp._opts.mtes_channel
-        
         theApp.EventLoop = "AthenaMtesEventLoopMgr"
     else:
         from AthenaServices.AthenaServicesConf import AthenaHiveEventLoopMgr
diff --git a/Control/AthenaKernel/AthenaKernel/IHybridProcessorHelper.h b/Control/AthenaKernel/AthenaKernel/IHybridProcessorHelper.h
new file mode 100644
index 0000000000000000000000000000000000000000..6232f854ff0b2b6a4e0c8ae02b4227d00f665392
--- /dev/null
+++ b/Control/AthenaKernel/AthenaKernel/IHybridProcessorHelper.h
@@ -0,0 +1,23 @@
+/*
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef ATHENAKERNEL_IHYBRIDPROCESSORHELPER_H
+#define ATHENAKERNEL_IHYBRIDPROCESSORHELPER_H
+
+/**
+ * @file  IHybridProcessorHelper.h
+ * @class IHybridProcessorHelper
+ * @brief Helper interface for implementing hybrid MP+MT.
+          Used by the Hybrid Shared Event Queue Consumer MP tool
+ **/
+
+class IHybridProcessorHelper {
+ public: 
+  virtual void resetAppReturnCode() = 0;
+  virtual void setCurrentEventNum(int num) = 0;
+  virtual bool terminateLoop() = 0;
+  virtual int drainScheduler(int& finishedEvts, bool report) = 0;
+};
+
+#endif
diff --git a/Control/AthenaMP/python/PyComps.py b/Control/AthenaMP/python/PyComps.py
index 0a35b431740f1bd0eff77cbfd2ec421f6ba74e24..7d14be6f0052540d4d042d145a02264c1ffd9f18 100644
--- a/Control/AthenaMP/python/PyComps.py
+++ b/Control/AthenaMP/python/PyComps.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 
 #-----Python imports---#
 import os, sys, shutil
@@ -118,12 +118,10 @@ class MpEvtLoopMgr(AthMpEvtLoopMgr):
                                                    ChunkSize=chunk_size) ]
 
             if (self.nThreads >= 1):
+                if(pileup):
+                    raise Exception('Running pileup digitization in mixed MP+MT currently not supported')
                 from AthenaMPTools.AthenaMPToolsConf import SharedHiveEvtQueueConsumer
-                self.Tools += [ SharedHiveEvtQueueConsumer(UseSharedReader=use_shared_reader,
-                                                           UseSharedWriter=use_shared_writer,
-                                                           IsPileup=pileup,
-                                                           IsRoundRobin=(strategy=='RoundRobin'),
-                                                           EventsBeforeFork=events_before_fork,
+                self.Tools += [ SharedHiveEvtQueueConsumer(EventsBeforeFork=events_before_fork,
                                                            Debug=debug_worker)   ]
             else:
                 from AthenaMPTools.AthenaMPToolsConf import SharedEvtQueueConsumer
diff --git a/Control/AthenaMPTools/src/SharedHiveEvtQueueConsumer.cxx b/Control/AthenaMPTools/src/SharedHiveEvtQueueConsumer.cxx
index e8b3b51551dbf75b03a66df3de016ae1469d02dc..e04f24293abd6226b7c8f66734a5591e1867695a 100644
--- a/Control/AthenaMPTools/src/SharedHiveEvtQueueConsumer.cxx
+++ b/Control/AthenaMPTools/src/SharedHiveEvtQueueConsumer.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "SharedHiveEvtQueueConsumer.h"
@@ -7,10 +7,8 @@
 #include "AthenaInterprocess/ProcessGroup.h"
 #include "AthenaInterprocess/Incidents.h"
 
-#include "AthenaKernel/IEventSeek.h"
 #include "AthenaKernel/IEvtSelectorSeek.h"
-#include "AthenaKernel/IEventShare.h"
-#include "AthenaKernel/IDataShare.h"
+#include "AthenaKernel/IHybridProcessorHelper.h"
 #include "GaudiKernel/IEvtSelector.h"
 #include "GaudiKernel/IIoComponentMgr.h"
 #include "GaudiKernel/IFileMgr.h"
@@ -40,31 +38,20 @@ namespace SharedHiveEvtQueueConsumer_d {
 }
 
 SharedHiveEvtQueueConsumer::SharedHiveEvtQueueConsumer(const std::string& type
-					       , const std::string& name
-					       , const IInterface* parent)
+						       , const std::string& name
+						       , const IInterface* parent)
   : AthenaMPToolBase(type,name,parent)
-  , m_useSharedReader(false)
-  , m_useSharedWriter(false)
-  , m_isPileup(false)
-  , m_isRoundRobin(false)
   , m_nEventsBeforeFork(0)
   , m_debug(false)
   , m_rankId(-1)
   , m_chronoStatSvc("ChronoStatSvc", name)
-  , m_evtSeek(0)
   , m_evtSelSeek(0)
   , m_evtContext(0)
-  , m_evtShare(0)
-  , m_dataShare(0)
   , m_sharedEventQueue(0)
   , m_sharedRankQueue(0)
 {
   declareInterface<IAthenaMPTool>(this);
 
-  declareProperty("UseSharedReader",m_useSharedReader);
-  declareProperty("UseSharedWriter",m_useSharedWriter);
-  declareProperty("IsPileup",m_isPileup);
-  declareProperty("IsRoundRobin",m_isRoundRobin);
   declareProperty("EventsBeforeFork",m_nEventsBeforeFork);
   declareProperty("Debug", m_debug);
 
@@ -82,60 +69,19 @@ SharedHiveEvtQueueConsumer::~SharedHiveEvtQueueConsumer()
 StatusCode SharedHiveEvtQueueConsumer::initialize()
 {
   ATH_MSG_DEBUG("In initialize");
-  if(m_isPileup) {
-    m_evtProcessor = ServiceHandle<IEventProcessor>("PileUpEventLoopMgr",name());
-    ATH_MSG_INFO("The job running in pileup mode");
-  }
-  else {
-    ATH_MSG_INFO("The job running in non-pileup mode");
-  }
 
   StatusCode sc = AthenaMPToolBase::initialize();
   if(!sc.isSuccess())
     return sc;
 
-  // For pile-up jobs use event loop manager for seeking
-  // otherwise use event selector
-  if(m_isPileup) {
-    m_evtSeek = dynamic_cast<IEventSeek*>(m_evtProcessor.operator->());
-    if(!m_evtSeek) {
-      ATH_MSG_ERROR("Unable to dyn-cast PileUpEventLoopMgr to IEventSeek");
-      return StatusCode::FAILURE;
-    }
-  }
-  else {
-    sc = serviceLocator()->service(m_evtSelName,m_evtSelSeek);
-    if(sc.isFailure() || m_evtSelSeek==0) {
-      ATH_MSG_ERROR("Error retrieving IEvtSelectorSeek");
-      return StatusCode::FAILURE;
-    }
-    ATH_CHECK( evtSelector()->createContext (m_evtContext) );
-  }
-
-  sc = serviceLocator()->service(m_evtSelName,m_evtShare);
-  if(sc.isFailure() || m_evtShare==0) {
-    if(m_useSharedReader) {
-      ATH_MSG_ERROR("Error retrieving IEventShare");
-      return StatusCode::FAILURE;
-    }
-    msg(MSG::INFO) << "Could not retrieve IEventShare" << endmsg;
-  }
-
-  IConversionSvc* cnvSvc = 0;
-  sc = serviceLocator()->service("AthenaPoolCnvSvc",cnvSvc);
-  m_dataShare = dynamic_cast<IDataShare*>(cnvSvc);
-  if(sc.isFailure() || m_dataShare==0) {
-    if(m_useSharedWriter) {
-      msg(MSG::ERROR) << "Error retrieving AthenaPoolCnvSvc " << cnvSvc << endmsg;
-      return StatusCode::FAILURE;
-    }
-  }
-
-  sc = m_chronoStatSvc.retrieve();
-  if (!sc.isSuccess()) {
-    ATH_MSG_ERROR("Cannot get ChronoStatSvc.");
+  sc = serviceLocator()->service(m_evtSelName,m_evtSelSeek);
+  if(sc.isFailure() || m_evtSelSeek==0) {
+    ATH_MSG_ERROR("Error retrieving IEvtSelectorSeek");
     return StatusCode::FAILURE;
   }
+  ATH_CHECK( evtSelector()->createContext (m_evtContext) );
+
+  ATH_CHECK(m_chronoStatSvc.retrieve());
   
   return StatusCode::SUCCESS;
 }
@@ -285,7 +231,6 @@ SharedHiveEvtQueueConsumer::subProcessLogs(std::vector<std::string>& filenames)
 std::unique_ptr<AthenaInterprocess::ScheduledWork>
 SharedHiveEvtQueueConsumer::bootstrap_func()
 {
-
   if (m_debug) {
     ATH_MSG_INFO("Bootstrap worker PID " << getpid() << " - waiting for SIGUSR1");
     sigset_t mask, oldmask;
@@ -369,28 +314,7 @@ SharedHiveEvtQueueConsumer::bootstrap_func()
     return outwork;
 
   ATH_MSG_INFO("File descriptors re-opened in the AthenaMP event worker PID=" << getpid());
-
   
-  // ________________________ Make Shared Reader/Writer Client ________________________
-  if(m_useSharedReader && m_evtShare) {
-    if(!m_evtShare->makeClient(m_rankId).isSuccess()) {
-      ATH_MSG_ERROR("Failed to make the event selector a share client");
-      return outwork;
-    } else {
-      ATH_MSG_DEBUG("Successfully made the event selector a share client");
-    }
-  }
-
-  if(m_useSharedWriter && m_dataShare) {
-    IProperty* propertyServer = dynamic_cast<IProperty*>(m_dataShare);
-    if (propertyServer==0 || propertyServer->setProperty("MakeStreamingToolClient", m_rankId + 1).isFailure()) {
-      ATH_MSG_ERROR("Could not change AthenaPoolCnvSvc MakeClient Property");
-      return outwork;
-    } else {
-      ATH_MSG_DEBUG("Successfully made the conversion service a share client");
-    }
-  }
-
   // ________________________ I/O reinit ________________________
   if(!m_ioMgr->io_reinitialize().isSuccess()) {
     ATH_MSG_ERROR("Failed to reinitialize I/O");
@@ -412,24 +336,6 @@ SharedHiveEvtQueueConsumer::bootstrap_func()
     ATH_MSG_DEBUG("Successfully restarted the event selector");
   }
 
-  // ________________________ Restart background event selectors in pileup jobs ________________________
-  if(m_isPileup) {
-    const std::list<IService*>& service_list = serviceLocator()->getServices();
-    std::list<IService*>::const_iterator itSvc = service_list.begin(),
-      itSvcLast = service_list.end();
-    for(;itSvc!=itSvcLast;++itSvc) {
-      IEvtSelector* evtsel = dynamic_cast<IEvtSelector*>(*itSvc);
-      if(evtsel && (evtsel != m_evtSelector)) {
-	if((*itSvc)->start().isSuccess())
-	  ATH_MSG_DEBUG("Restarted event selector " << (*itSvc)->name());
-	else {
-	  ATH_MSG_ERROR("Failed to restart event selector " << (*itSvc)->name());
-	  return outwork;
-	}
-      }
-    }
-  }
-
   // ________________________ Worker dir: chdir ________________________
   if(chdir(worker_rundir.string().c_str())==-1) {
     ATH_MSG_ERROR("Failed to chdir to " << worker_rundir.string());
@@ -446,14 +352,13 @@ SharedHiveEvtQueueConsumer::bootstrap_func()
 
 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
-std::unique_ptr<AthenaInterprocess::ScheduledWork> 
-SharedHiveEvtQueueConsumer::exec_func()
+std::unique_ptr<AthenaInterprocess::ScheduledWork> SharedHiveEvtQueueConsumer::exec_func()
 {
   ATH_MSG_INFO("Exec function in the AthenaMP worker PID=" << getpid());
 
   bool all_ok(true);
 
-  if (! initHive().isSuccess()) {
+  if (!initHive().isSuccess()) {
     ATH_MSG_FATAL("unable to initialize Hive");
     all_ok = false;
   }
@@ -476,141 +381,118 @@ SharedHiveEvtQueueConsumer::exec_func()
     }
   }
 
-
-  // ________________________ This is needed only for PileUp jobs __________________________________
-  // **
-  // If either EventsBeforeFork or SkipEvents is nonzero, first we need to advance the event selector
-  // by EventsBeforeFork+SkipEvents and only after that start seeking on the PileUpEventLoopMgr
-  // **
-  if(m_isPileup && all_ok) {
-    if (!m_evtSelSeek) {
-      StatusCode sc = serviceLocator()->service(m_evtSelName,m_evtSelSeek);
-      if(sc.isFailure() || m_evtSelSeek==0) {
-        ATH_MSG_ERROR("Error retrieving Event Selector with IEvtSelectorSeek interface for PileUp job");
-        all_ok = false;
-      }
-      if (evtSelector()->createContext (m_evtContext).isFailure()) {
-        ATH_MSG_ERROR("Error creating IEventSelector context.");
-        all_ok = false;
-      }
-    }
-    if (all_ok) {
-      if((m_nEventsBeforeFork+skipEvents)
-	 && m_evtSelSeek->seek(*m_evtContext, m_nEventsBeforeFork+skipEvents).isFailure()) {
-	ATH_MSG_ERROR("Unable to seek to " << m_nEventsBeforeFork+skipEvents);    
-	all_ok = false;
-      }
-    }
+  IHybridProcessorHelper* hybridHelper = dynamic_cast<IHybridProcessorHelper*>(m_evtProcessor.get());
+  if(!hybridHelper) {
+    ATH_MSG_FATAL("Failed to acquire IHybridProcessorHelper interface");
+    all_ok = false;
   }
-  // ________________________ This is needed only for PileUp jobs __________________________________
-
+  // Reset the application return code.
+  hybridHelper->resetAppReturnCode();
 
+  int finishedEvts =0;
+  int createdEvts =0;
   long intmask = pow(0x100,sizeof(int))-1; // Mask for decoding event number from the value posted to the queue
-  int nEvt(m_nEventsBeforeFork);
-  int nEventsProcessed(0);
   long evtnumAndChunk(0);
-
-  unsigned evtCounter(0);
+//  unsigned evtCounter(0);
   int evtnum(0), chunkSize(1);
 
-  // For the round robin we need to know the maximum number of events for this job
-  if(m_isRoundRobin) {
-    evtnumAndChunk = 1;
-    while(evtnumAndChunk>0) {
-      if(!m_sharedEventQueue->try_receive_basic<long>(evtnumAndChunk)) {
-        usleep(1000);
-      }
-    }
-    evtnumAndChunk *= -1;
+  ATH_MSG_INFO("Starting loop on events");
+
+  StatusCode sc(StatusCode::SUCCESS,true);
+
+  while(!m_sharedEventQueue->try_receive_basic<long>(evtnumAndChunk)) {
+    ATH_MSG_DEBUG("Event queue is empty");
+    usleep(1000);
   }
-  
-  if(all_ok) {
-    while(true) {
-      if(m_isRoundRobin) {
-	evtnum = skipEvents + m_nprocs*evtCounter + m_rankId; 
-	if(evtnum>=evtnumAndChunk+skipEvents) {
-          break;
-        }
-	evtCounter++;
+  bool loop_ended = (evtnumAndChunk<0);
+  if(!loop_ended) {
+    ATH_MSG_DEBUG("Received value from the queue 0x" << std::hex << evtnumAndChunk << std::dec);
+    chunkSize = evtnumAndChunk >> (sizeof(int)*8);
+    evtnum = evtnumAndChunk & intmask;
+    ATH_MSG_INFO("Received from the queue: event num=" << evtnum << " chunk size=" << chunkSize);
+    hybridHelper->setCurrentEventNum(++evtnum);
+  }
+
+  bool no_more_events = false;
+
+  while(!loop_ended) {
+    ATH_MSG_DEBUG(" -> createdEvts: " << createdEvts);
+
+    if(!hybridHelper->terminateLoop()         // No scheduled loop termination
+       && !no_more_events                     // We are not yet done getting events
+       && m_schedulerSvc->freeSlots()>0) {    // There are still free slots in the scheduler
+      ATH_MSG_DEBUG("createdEvts: " << createdEvts << ", freeslots: " << m_schedulerSvc->freeSlots());
+
+      auto ctx = m_evtProcessor->createEventContext();
+      if(!ctx.valid()) {
+        sc = StatusCode::FAILURE;
       }
       else {
-	if(!m_sharedEventQueue->try_receive_basic<long>(evtnumAndChunk)) {
-	  // The event queue is empty, but we should check whether there are more events to come or not
-	  ATH_MSG_DEBUG("Event queue is empty"); 
-	  usleep(1000);
-	  continue;
-	}
-	if(evtnumAndChunk<=0) {
-	  evtnumAndChunk *= -1;
-	  ATH_MSG_DEBUG("No more events are expected. The total number of events for this job = " << evtnumAndChunk);
-	  break;
-	}
-	while (m_schedulerSvc->freeSlots() < 1) {
-	  ATH_MSG_DEBUG("waiting for a free scheduler slot");
-	  usleep(1000000);
-	}
+        sc = m_evtProcessor->executeEvent(std::move(ctx));
+      }
 
-	ATH_MSG_DEBUG("Received value from the queue 0x" << std::hex << evtnumAndChunk << std::dec);
-	chunkSize = evtnumAndChunk >> (sizeof(int)*8);
-	evtnum = evtnumAndChunk & intmask;
-	ATH_MSG_INFO("Received from the queue: event num=" << evtnum << " chunk size=" << chunkSize);
+      if (sc.isFailure()) {
+        ATH_MSG_ERROR("Terminating event processing loop due to errors");
+        loop_ended = true;
       }
-      nEvt+=chunkSize;
-      StatusCode sc;
-      if(m_useSharedReader) {
-	sc = m_evtShare->share(evtnum);
-	if(sc.isFailure()){
-	  ATH_MSG_ERROR("Unable to share " << evtnum);
-	  all_ok=false;
-	  break;
-	} else {
-	  ATH_MSG_INFO("Share of " << evtnum << " succeeded");
+      else {
+	++createdEvts;
+	if(--chunkSize==0) {
+	  // Fetch next chunk
+	  while(!m_sharedEventQueue->try_receive_basic<long>(evtnumAndChunk)) {
+	    ATH_MSG_DEBUG("Event queue is empty");
+	    usleep(1000);
+	  }
+	  if(evtnumAndChunk<0) {
+	    no_more_events = true;
+	    evtnumAndChunk *= -1;
+	    ATH_MSG_DEBUG("No more events are expected. The total number of events for this job = " << evtnumAndChunk);
+	  }
+	  else {
+	    ATH_MSG_DEBUG("Received value from the queue 0x" << std::hex << evtnumAndChunk << std::dec);
+	    chunkSize = evtnumAndChunk >> (sizeof(int)*8);
+	    evtnum = evtnumAndChunk & intmask;
+	    ATH_MSG_INFO("Received from the queue: event num=" << evtnum << " chunk size=" << chunkSize);
+	  }
 	}
-      } else {
-	m_chronoStatSvc->chronoStart("AthenaMP_seek");
-        if (m_evtSeek) {
-          sc=m_evtSeek->seek(evtnum);
-        }
-        else {
-          sc=m_evtSelSeek->seek(*m_evtContext, evtnum);
-        }
-	if(sc.isFailure()){
-	  ATH_MSG_ERROR("Unable to seek to " << evtnum);
-	  all_ok=false;
-	  break;
-	} else {
-	  ATH_MSG_INFO("Seek to " << evtnum << " succeeded");
+	// Advance to the next event
+	if(!no_more_events) {
+	  hybridHelper->setCurrentEventNum(++evtnum);
 	}
-	m_chronoStatSvc->chronoStop("AthenaMP_seek");
       }
-      m_chronoStatSvc->chronoStart("AthenaMP_nextEvent");
-      sc = m_evtProcessor->nextEvent(chunkSize);
-      nEventsProcessed += chunkSize;
-      if(sc.isFailure()){
-	if(chunkSize==1)
-	  ATH_MSG_ERROR("Unable to process event " << evtnum);
-	else
-	  ATH_MSG_ERROR("Unable to process the chunk (" << evtnum << "," << evtnum+chunkSize-1 << ")");
-	all_ok=false;
-	break;
+    }
+    else {
+      // all the events were created but not all finished or the slots were
+      // all busy: the scheduler should finish its job
+      ATH_MSG_DEBUG("Draining the scheduler");
+
+      // Pull out of the scheduler the finished events
+      int ir = hybridHelper->drainScheduler(finishedEvts,true);
+      if(ir < 0) {
+        // some sort of error draining scheduler;
+        loop_ended = true;
+        sc = StatusCode::FAILURE;
+      }
+      else if(ir == 0) {
+	// no more events in scheduler
+        if(no_more_events) {
+          // We are done
+          loop_ended = true;
+          sc = StatusCode::SUCCESS;
+        }
+      }
+      else {
+        // keep going!
       }
-      m_chronoStatSvc->chronoStop("AthenaMP_nextEvent"); 
     }
-  }
+  } // end main loop on finished events
 
   if(all_ok) {
     if(m_evtProcessor->executeRun(0).isFailure()) {
       ATH_MSG_ERROR("Could not finalize the Run");
       all_ok=false;
     } else {
-      StatusCode sc;
-      if (m_evtSeek) {
-        sc = m_evtSeek->seek(evtnumAndChunk+skipEvents);
-      }
-      else {
-        sc = m_evtSelSeek->seek(*m_evtContext, evtnumAndChunk+skipEvents);
-      }
-      if(sc.isFailure()) { 
+      if(m_evtSelSeek->seek(*m_evtContext, evtnumAndChunk+skipEvents).isFailure()) { 
 	ATH_MSG_DEBUG("Seek past maxevt to " << evtnumAndChunk+skipEvents << " returned failure. As expected...");
       }
     }
@@ -624,7 +506,7 @@ SharedHiveEvtQueueConsumer::exec_func()
   *(int*)(outdata) = (all_ok?0:1); // Error code: for now use 0 success, 1 failure
   AthenaMPToolBase::Func_Flag func = AthenaMPToolBase::FUNC_EXEC;
   memcpy((char*)outdata+sizeof(int),&func,sizeof(func));
-  memcpy((char*)outdata+sizeof(int)+sizeof(func),&nEventsProcessed,sizeof(int));
+  memcpy((char*)outdata+sizeof(int)+sizeof(func),&createdEvts,sizeof(int));
 
   outwork->data = outdata;
   outwork->size = outsize;
@@ -753,7 +635,7 @@ SharedHiveEvtQueueConsumer::initHive() {
       }
     }      
 
-    m_evtProcessor = ServiceHandle<IEventProcessor>("AthenaHiveEventLoopMgr",name());
+    m_evtProcessor = ServiceHandle<IEventProcessor>("AthenaMtesEventLoopMgr",name());
 
     if (m_evtProcessor.retrieve().isFailure()) {
       ATH_MSG_ERROR("could not setup " << m_evtProcessor.typeAndName());
diff --git a/Control/AthenaMPTools/src/SharedHiveEvtQueueConsumer.h b/Control/AthenaMPTools/src/SharedHiveEvtQueueConsumer.h
index fbce215993bb7e903ac9099248d295da5cca6e30..7a4bc164fab1e815fc7cd82c8cb1a4a456d9e675 100644
--- a/Control/AthenaMPTools/src/SharedHiveEvtQueueConsumer.h
+++ b/Control/AthenaMPTools/src/SharedHiveEvtQueueConsumer.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef ATHENAMPTOOLS_SHAREDHIVEEVTQUEUECONSUMER_H
@@ -12,10 +12,7 @@
 #include "GaudiKernel/IScheduler.h"
 #include "GaudiKernel/IEvtSelector.h"
 
-class IEventSeek;
 class IEvtSelectorSeek;
-class IEventShare;
-class IDataShare;
 class IChronoStatSvc;
 
 class SharedHiveEvtQueueConsumer final : public AthenaMPToolBase
@@ -56,21 +53,14 @@ class SharedHiveEvtQueueConsumer final : public AthenaMPToolBase
   int decodeProcessResult(const AthenaInterprocess::ProcessResult* presult, bool doFinalize);
 
   // Properties
-  bool m_useSharedReader; // Work in pair with a SharedReader
-  bool m_useSharedWriter; // Work in pair with a SharedWriter
-  bool m_isPileup;        // Are we doing pile-up digitization?
-  bool m_isRoundRobin;    // Are we running in the "reproducible mode"?
   int  m_nEventsBeforeFork;
   bool m_debug;
 
   int  m_rankId;          // Each worker has its own unique RankID from the range (0,...,m_nprocs-1) 
 
   ServiceHandle<IChronoStatSvc>  m_chronoStatSvc;
-  IEventSeek*                    m_evtSeek;
   IEvtSelectorSeek*              m_evtSelSeek;
   IEvtSelector::Context*         m_evtContext;
-  IEventShare*                   m_evtShare;
-  IDataShare*                    m_dataShare;
 
   AthenaInterprocess::SharedQueue*  m_sharedEventQueue;          
   AthenaInterprocess::SharedQueue*  m_sharedRankQueue;          
diff --git a/Control/AthenaServices/src/AthenaMtesEventLoopMgr.cxx b/Control/AthenaServices/src/AthenaMtesEventLoopMgr.cxx
index ebb677ea7ee9d6191c9529ea0a3ecb700e0a57a2..543c6aae3569b359c26e03260a3fb1f26a55b49d 100644
--- a/Control/AthenaServices/src/AthenaMtesEventLoopMgr.cxx
+++ b/Control/AthenaServices/src/AthenaMtesEventLoopMgr.cxx
@@ -717,14 +717,16 @@ StatusCode AthenaMtesEventLoopMgr::stop()
 }
 
 
-StatusCode AthenaMtesEventLoopMgr::nextEvent(int /*maxevt*/)
+StatusCode AthenaMtesEventLoopMgr::nextEvent(int maxevt)
 {
+  if(maxevt==0) return StatusCode::SUCCESS;
+
   yampl::ISocketFactory* socketFactory = new yampl::SocketFactory();
   // Create a socket to communicate with the Pilot
-  yampl::ISocket* socket2Pilot = socketFactory->createClientSocket(yampl::Channel(m_eventRangeChannel.value(),yampl::LOCAL),yampl::MOVE_DATA);
+  m_socket = socketFactory->createClientSocket(yampl::Channel(m_eventRangeChannel.value(),yampl::LOCAL),yampl::MOVE_DATA);
 
   // Reset the application return code.
-  Gaudi::setAppReturnCode(m_appMgrProperty, Gaudi::ReturnCode::Success, true).ignore();  
+  resetAppReturnCode();
 
   int finishedEvts =0;
   int createdEvts =0;
@@ -740,7 +742,7 @@ StatusCode AthenaMtesEventLoopMgr::nextEvent(int /*maxevt*/)
 
   std::unique_ptr<RangeStruct> range;
   while(!range) {
-    range = getNextRange(socket2Pilot);
+    range = getNextRange(m_socket);
     usleep(1000);
   }
 
@@ -782,7 +784,7 @@ StatusCode AthenaMtesEventLoopMgr::nextEvent(int /*maxevt*/)
 	  // Fetch next event range
 	  range.reset();
 	  while(!range) {
-	    range = getNextRange(socket2Pilot);
+	    range = getNextRange(m_socket);
 	    usleep(1000);
 	  }
 	  if(range->eventRangeID.empty()) {
@@ -803,7 +805,7 @@ StatusCode AthenaMtesEventLoopMgr::nextEvent(int /*maxevt*/)
       debug() << "Draining the scheduler" << endmsg;
 
       // Pull out of the scheduler the finished events
-      int ir = drainScheduler(finishedEvts,socket2Pilot);
+      int ir = drainScheduler(finishedEvts,true);
       if(ir < 0) {
 	// some sort of error draining scheduler;
 	loop_ended = true;
@@ -825,7 +827,8 @@ StatusCode AthenaMtesEventLoopMgr::nextEvent(int /*maxevt*/)
 
   info() << "---> Loop Finished (seconds): " << secsFromStart() <<endmsg;
 
-  delete socket2Pilot;
+  delete m_socket;
+  m_socket=nullptr;
   delete socketFactory;
   return sc;
 }
@@ -1204,10 +1207,22 @@ EventContext AthenaMtesEventLoopMgr::createEventContext() {
   return ctx;
 }
 
+void AthenaMtesEventLoopMgr::resetAppReturnCode()
+{
+  Gaudi::setAppReturnCode(m_appMgrProperty, Gaudi::ReturnCode::Success, true).ignore();
+}
+
+void AthenaMtesEventLoopMgr::setCurrentEventNum(int num) {
+  m_currentEvntNum = num;
+}
+
+bool AthenaMtesEventLoopMgr::terminateLoop() {
+  return m_terminateLoop;
+}
 //---------------------------------------------------------------------------
 
 int 
-AthenaMtesEventLoopMgr::drainScheduler(int& finishedEvts,yampl::ISocket* socket){
+AthenaMtesEventLoopMgr::drainScheduler(int& finishedEvts,bool report){
 
   StatusCode sc(StatusCode::SUCCESS);
     
@@ -1273,20 +1288,23 @@ AthenaMtesEventLoopMgr::drainScheduler(int& finishedEvts,yampl::ISocket* socket)
     
     // Some code still needs global context in addition to that passed in the incident
     Gaudi::Hive::setCurrentContext( *thisFinishedEvtContext );
+    info() << "Firing EndProcessing" << endmsg;
     m_incidentSvc->fireIncident(Incident(name(), IncidentType::EndProcessing, *thisFinishedEvtContext ));
 
-    // If we completed an event range, then report it to the pilot
-    OutputStreamSequencerSvc::RangeReport_ptr rangeReport = m_outSeqSvc->getRangeReport();
-    if(rangeReport) {
-      std::string outputFileReport = rangeReport->second + std::string(",ID:")
-	+ rangeReport->first + std::string(",CPU:N/A,WALL:N/A");
-      if( not m_inTestMode ) {
-         // In standalone test mode there is no pilot to talk to
-         void* message2pilot = malloc(outputFileReport.size());
-         memcpy(message2pilot,outputFileReport.data(),outputFileReport.size());
-         socket->send(message2pilot,outputFileReport.size());
+    if(report) {
+      // If we completed an event range, then report it to the pilot
+      OutputStreamSequencerSvc::RangeReport_ptr rangeReport = m_outSeqSvc->getRangeReport();
+      if(rangeReport) {
+	std::string outputFileReport = rangeReport->second + std::string(",ID:")
+	  + rangeReport->first + std::string(",CPU:N/A,WALL:N/A");
+	if( not m_inTestMode ) {
+	  // In standalone test mode there is no pilot to talk to
+	  void* message2pilot = malloc(outputFileReport.size());
+	  memcpy(message2pilot,outputFileReport.data(),outputFileReport.size());
+	  m_socket->send(message2pilot,outputFileReport.size());
+	}
+	info() << "Reported the output " << outputFileReport << endmsg;
       }
-      info() << "Reported the output " << outputFileReport << endmsg;
     }
 
     debug() << "Clearing slot " << thisFinishedEvtContext->slot() 
diff --git a/Control/AthenaServices/src/AthenaMtesEventLoopMgr.h b/Control/AthenaServices/src/AthenaMtesEventLoopMgr.h
index c709563c0f0d57fc133cf9a0251cad2006a54dac..b7e559ea0276162e21677ceae801cf10fec9fa68 100644
--- a/Control/AthenaServices/src/AthenaMtesEventLoopMgr.h
+++ b/Control/AthenaServices/src/AthenaMtesEventLoopMgr.h
@@ -1,7 +1,7 @@
 // -*- C++ -*-
 
 /*
-  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef ATHENASERVICES_ATHENAMTESEVENTLOOPMGR_H
@@ -23,6 +23,7 @@
 #include "AthenaKernel/IEventSeek.h"
 #include "AthenaKernel/ICollectionSize.h"
 #include "AthenaKernel/IConditionsCleanerSvc.h"
+#include "AthenaKernel/IHybridProcessorHelper.h"
 #include "StoreGate/ActiveStoreSvc.h"
 
 #include <memory>
@@ -52,6 +53,7 @@ class AthenaMtesEventLoopMgr
   : virtual public IEventSeek,
     virtual public ICollectionSize,
     virtual public IIncidentListener,
+    virtual public IHybridProcessorHelper,
             public MinimalEventLoopMgr,
             public Athena::TimeoutMaster
 {
@@ -167,10 +169,6 @@ protected:
   StatusCode clearWBSlot(int evtSlot);
   /// Declare the root address of the event
   int declareEventRootAddress(EventContext&);
-  /// Create event context
-  virtual EventContext createEventContext() override;
-  /// Drain the scheduler from all actions that may be queued
-  int drainScheduler(int& finishedEvents,yampl::ISocket* socket);
   /// Instance of the incident listener waiting for AbortEvent. 
   SmartIF< IIncidentListener >  m_abortEventListener;
   /// Name of the scheduler to be used
@@ -201,6 +199,8 @@ public:
   virtual StatusCode finalize() override;
   /// implementation of IAppMgrUI::nextEvent. maxevt==0 returns immediately
   virtual StatusCode nextEvent(int maxevt) override;
+  /// implementation of IEventProcessor::createEventContext()
+  virtual EventContext createEventContext() override;
   /// implementation of IEventProcessor::executeEvent(void* par)
   virtual StatusCode executeEvent( EventContext&& ctx ) override;
   /// implementation of IEventProcessor::executeRun(int maxevt)
@@ -220,6 +220,15 @@ public:
   /// IIncidentListenet interfaces
   virtual void handle(const Incident& inc) override;
 
+  /// Reset the application return code
+  virtual void resetAppReturnCode() override;
+  
+  virtual void setCurrentEventNum(int num) override;
+  virtual bool terminateLoop() override;
+
+  /// Drain the scheduler from all actions that may be queued
+  virtual int drainScheduler(int& finishedEvents, bool report) override;
+
   /// interface dispatcher
   virtual StatusCode queryInterface( const InterfaceID& riid, 
                                      void** ppvInterface ) override;
@@ -294,6 +303,9 @@ private:
   // Hopefully a temporary measurement. For the time being we cannot
   // support event ranges from different input files.
   std::string m_pfn{""};
+
+  // For the event service running:
+  yampl::ISocket* m_socket{nullptr};
 };
 
 #endif // ATHENASERVICES_ATHENAHIVEEVENTLOOPMGR_H
diff --git a/Control/CxxUtils/CxxUtils/SealDebug.h b/Control/CxxUtils/CxxUtils/SealDebug.h
index 46409c639ddcf11610eb9d5a52249b6578e7d1e5..386d2e613313c7dcd398561d4372b55ecc7e0f42 100644
--- a/Control/CxxUtils/CxxUtils/SealDebug.h
+++ b/Control/CxxUtils/CxxUtils/SealDebug.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 /**
@@ -27,6 +27,7 @@
 //# include "SealBase/Macros.h"                   wlav
 //# include "SealBase/sysapi/IOTypes.h"           wlav
 # include <cstddef>
+# include <atomic>
 
 // wlav copied from SealBase/sysapi/DebugAids.h
 // Windows doesn't have this, so fake a suitable substitute
@@ -60,7 +61,7 @@ class DebugAids
 {
 public:
     // Miscellaneous functions
-    static IOFD			stacktraceFd ATLAS_NOT_THREAD_SAFE (IOFD fd = IOFD_INVALID);
+    static IOFD			stacktraceFd (IOFD fd = IOFD_INVALID);
     static void			stacktrace ATLAS_NOT_THREAD_SAFE (IOFD fd = IOFD_INVALID);
     static void			coredump (int sig, ...);
     // sss
@@ -69,7 +70,7 @@ public:
     static void                 setStackTraceAddr2Line ATLAS_NOT_THREAD_SAFE (const char* path);
 
 private:
-    static IOFD			s_stackTraceFd;
+    static std::atomic<IOFD>	 s_stackTraceFd;
 };
 
 //<<<<<< PUBLIC FUNCTIONS                                               >>>>>>
diff --git a/Control/CxxUtils/CxxUtils/exctrace.h b/Control/CxxUtils/CxxUtils/exctrace.h
index 51e93270b206ec171bb2177d88f7865a94103a5b..7da67e38eae5cb3cd4122e1b9b36d79c72e2cf76 100644
--- a/Control/CxxUtils/CxxUtils/exctrace.h
+++ b/Control/CxxUtils/CxxUtils/exctrace.h
@@ -1,10 +1,9 @@
 // This file's extension implies that it's C, but it's really -*- C++ -*-.
 
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
-// $Id$
 /**
  * @file CxxUtils/exctrace.h
  * @author scott snyder <snyder@bnl.gov>
@@ -44,7 +43,7 @@ namespace CxxUtils {
  * @param e The exception to print.
  * @param fd The file descriptor to which to write.
  */
-void exctrace ATLAS_NOT_THREAD_SAFE (const std::exception& e, IOFD fd = IOFD_INVALID);
+void exctrace (const std::exception& e, IOFD fd = IOFD_INVALID);
 
 
 } // namespace CxxUtils
diff --git a/Control/CxxUtils/Root/SealDebug.cxx b/Control/CxxUtils/Root/SealDebug.cxx
index add00f4965c99dadca1f6898fbe15bd333c181f6..cfe05cfbf06622b40118934075e4048409281181 100644
--- a/Control/CxxUtils/Root/SealDebug.cxx
+++ b/Control/CxxUtils/Root/SealDebug.cxx
@@ -243,7 +243,7 @@ namespace Athena {                             // wlav
 //<<<<<< CLASS STRUCTURE INITIALIZATION                                 >>>>>>
 
 /** The default output file descriptor for #stacktrace().  */
-IOFD			DebugAids::s_stackTraceFd = IOFD_INVALID;
+std::atomic<IOFD>  DebugAids::s_stackTraceFd = IOFD_INVALID;
 
 //<<<<<< PRIVATE FUNCTION DEFINITIONS                                   >>>>>>
 
@@ -578,15 +578,19 @@ extern "C" void xl__trbk (void);
     effective for #stacktrace(), but can be overridden by the
     argument given to that function.  */
 IOFD
-DebugAids::stacktraceFd ATLAS_NOT_THREAD_SAFE (IOFD fd /* = IOFD_INVALID */)
+DebugAids::stacktraceFd (IOFD fd /* = IOFD_INVALID */)
 {
-    if (s_stackTraceFd == IOFD_INVALID)
-	s_stackTraceFd = STDERR_HANDLE;
-
-    IOFD old = s_stackTraceFd;
-    if (fd != IOFD_INVALID)
-	s_stackTraceFd = fd;
-    return old;
+  IOFD old = s_stackTraceFd;
+  if (fd == IOFD_INVALID) {
+    if (old == IOFD_INVALID) {
+      s_stackTraceFd.compare_exchange_strong (old, STDERR_HANDLE);
+      return s_stackTraceFd;
+    }
+  }
+  else {
+    s_stackTraceFd.compare_exchange_strong (old, fd);
+  }
+  return old;
 }
 
 /** Produce a stack trace.
@@ -606,11 +610,8 @@ DebugAids::stacktraceFd ATLAS_NOT_THREAD_SAFE (IOFD fd /* = IOFD_INVALID */)
 void
 DebugAids::stacktrace ATLAS_NOT_THREAD_SAFE (IOFD fd /* = IOFD_INVALID */)
 {
-    if (s_stackTraceFd == IOFD_INVALID)
-	s_stackTraceFd = STDERR_HANDLE;
-
     if (fd == IOFD_INVALID)
-	fd = s_stackTraceFd;
+      fd = stacktraceFd();
 
     std::cerr.flush ();
     fflush (stderr);
diff --git a/Control/CxxUtils/Root/exctrace.cxx b/Control/CxxUtils/Root/exctrace.cxx
index 0d7333eca3db689b951fb7e7dbbfdc1631e4d621..48a96c61d0780e81947b4034f57f29c76ae5c16e 100644
--- a/Control/CxxUtils/Root/exctrace.cxx
+++ b/Control/CxxUtils/Root/exctrace.cxx
@@ -1,8 +1,7 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
-// $Id$
 /**
  * @file CxxUtils/src/exctrace.cxx
  * @author scott snyder <snyder@bnl.gov>
@@ -17,9 +16,11 @@
 
 
 #include "CxxUtils/exctrace.h"
+#include "CxxUtils/checker_macros.h"
 #include <cstring>
 #include <cstdio>
 #include <cstdlib>
+#include <iterator>
 #include <execinfo.h>
 #include <unistd.h>
 #include <dlfcn.h>
@@ -34,6 +35,15 @@ using std::free;
 # define MYWRITELIT(fd,str) MYWRITE(fd,str,sizeof(str)-1)
 
 
+namespace {
+bool stacktraceLine ATLAS_NOT_THREAD_SAFE (IOFD fd, unsigned long addr)
+{
+  Athena::DebugAids::stacktraceLine (fd, addr);
+  return false;
+}
+}
+
+
 namespace CxxUtils {
 
 
@@ -46,37 +56,40 @@ namespace CxxUtils {
  * @param e The exception to print.
  * @param fd The file descriptor to which to write.
  */
-void exctrace ATLAS_NOT_THREAD_SAFE (const std::exception& e, IOFD fd /*= IOFD_INVALID*/)
+void exctrace (const std::exception& e, IOFD fd /*= IOFD_INVALID*/)
 {
   if (fd == IOFD_INVALID)
     fd = Athena::DebugAids::stacktraceFd();
 
-  static bool init = false;
-  static int* exctrace_last_depth = 0;
-  static void** exctrace_last_trace = 0;
-
-  if (!init) {
-    init = true;
-    exctrace_last_depth = (int*)dlsym (RTLD_DEFAULT, "exctrace_last_depth");
-    exctrace_last_trace = (void**)dlsym (RTLD_DEFAULT, "exctrace_last_trace");
-  }
+  typedef int (*get_last_trace_fn) (int max_depth, void* trace[]);
+  get_last_trace_fn get_last_trace = (get_last_trace_fn) dlsym (RTLD_DEFAULT, "exctrace_get_last_trace");
+  
 
   MYWRITELIT(fd, "Exception: ");
   MYWRITE(fd, e.what(), strlen (e.what()));
 
-  if (exctrace_last_depth && exctrace_last_trace) {
+  if (get_last_trace) {
+    void* trace[100];
+    int depth = get_last_trace (std::end(trace)-std::begin(trace), trace);
+
     MYWRITELIT(fd, "\n");
     // Index 0 is __cxa_throw.  Skip it.
-    for (int i = 1; i < *exctrace_last_depth; ++i) {
+    for (int i = 1; i < depth; ++i) {
       unsigned long ip =
-        reinterpret_cast<unsigned long> (exctrace_last_trace[i]);
+        reinterpret_cast<unsigned long> (trace[i]);
       // A function that throws may have the call to __cxa_throw
       // as the last instruction in the function.  In that case, the IP
       // we see here will be one beyond the end of the function,
       // and we'll report the wrong function.  So move back the IP
       // slightly for the function that threw.
       if (i == 1) --ip;
-      Athena::DebugAids::stacktraceLine (fd, ip);
+
+      // It's true that stacktraceLine is not really thread-safe.
+      // However, if we're here, things are going south fast anyway,
+      // so we'll just cross our fingers and try to shovel out as much
+      // information as we can.
+      [[maybe_unused]]
+      bool dum ATLAS_THREAD_SAFE = stacktraceLine (fd, ip);
     }
   }
   else
diff --git a/Control/CxxUtils/src/exctrace/exctrace_collector.cxx b/Control/CxxUtils/src/exctrace/exctrace_collector.cxx
index 1051c375beda7ac92d2ecd1e7b5b5d7937f3cd62..881ed0d5cf9b0453f182a20ce5d4b671c3615a4c 100644
--- a/Control/CxxUtils/src/exctrace/exctrace_collector.cxx
+++ b/Control/CxxUtils/src/exctrace/exctrace_collector.cxx
@@ -1,8 +1,6 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
-
-// $Id$
 /**
  * @file CxxUtils/src/exctrace/exctrace_collector.cxx
  * @author scott snyder <snyder@bnl.gov>
@@ -21,6 +19,8 @@
 #include <execinfo.h>
 #include <cstdio>
 #include <typeinfo>
+#include <utility>
+#include <algorithm>
 #include "CxxUtils/checker_macros.h"
 
 // Maximum stack depth.
@@ -28,13 +28,24 @@ static
 const int bt_depth = 100;
 
 // Static buffer used to save the backtrace.
-int exctrace_last_depth = 0;
-void* exctrace_last_trace[bt_depth];
+static thread_local int exctrace_last_depth = 0;
+static thread_local void* exctrace_last_trace[bt_depth];
 
 // The real __cxa_throw function.
 typedef void throwfn (void*, std::type_info*, void (*dest)(void*));
 static throwfn* old_throw;
 
+extern "C" {
+  // Function to retrieve the last trace.
+  // extern "C" because we want to find it with dlsym.
+  int exctrace_get_last_trace (int max_depth, void* trace[])
+  {
+    int ncopy = std::min (exctrace_last_depth, max_depth);
+    std::copy (exctrace_last_trace, exctrace_last_trace+ncopy, trace);
+    return ncopy;
+  }
+}
+
 
 // The __cxa_throw hook function.
 // Record a backtrace, then chain to the real throw function.
diff --git a/DataQuality/DataQualityConfigurations/config/HLT/HLTminbias/collisions_run.config b/DataQuality/DataQualityConfigurations/config/HLT/HLTminbias/collisions_run.config
index 7b347a2a42d1e4ae4076dac766241be8f316ff4f..08b5c811f36d3f246db7bcefe579f76f784e8097 100644
--- a/DataQuality/DataQualityConfigurations/config/HLT/HLTminbias/collisions_run.config
+++ b/DataQuality/DataQualityConfigurations/config/HLT/HLTminbias/collisions_run.config
@@ -90,27 +90,38 @@ dir HLT {
     }
     dir Tracking {
       dir HLT_mb_sptrk_L1RD0_FILLED {
-        hist efficiency_low_mult {
+        hist efficiencyLowMult {
           output = HLT/Run3/TRMBI/SHIFTER
-          description 	= "Normal: Quick rise to almost 100% for 1,2 tracks, no eff. drop for higher multiplicities"
+          description 	= Normal: Quick rise to almost 100% for 1,2 tracks, no eff. drop for higher multiplicities
         }
+        hist nTrkOfflineLowMult {
+          output = HLT/Run3/TRMBI/SHIFTER
+          description 	= Normal: Quick rise to almost 100% for 1,2 tracks, no eff. drop for higher multiplicities
+        }
+        hist nTrkOnlineLowMult {
+          output = HLT/Run3/TRMBI/SHIFTER
+          description 	= Normal: Sharp rise at ntrk ==1, (literally has to be a step function)
+        }
+
       }
       dir HLT_mb_sp.* {
-        hist efficiency_low_mult {
-          output = HLT/Run3/TRMBI/SHIFTER/SPTRK
-          description 	= "Normal: Quick rise to almost 100% for 1,2 tracks, no eff. drop for higher multiplicities"
-        }
         hist nTrkRatio {
           output = HLT/Run3/TRMBI/EXPERT/SPTRK
-          description 	= "Normal: narrow peak slightly below 1 (0.9), if much below it means online tracking has to many fakes"
-
+          description 	= Normal: narrow peak slightly below 1 (0.9), if much below it means online tracking has to many fakes
         }
       }
       dir HLT_.*hmt.* {
-        hist nTrkOffline_vs_decision {
+        hist efficiencyAnyMult {
           output = HLT/Run3/TRMBI/SHIFTER/SPTRK
-          description 	= "Normal: Typical trigger turn-on, should be reaching max around the threshold specified in the trigger name"
-
+          description 	= Normal: Typical trigger turn-on, should be reaching max around the threshold specified in the trigger name
+        }
+        hist nTrkOnline {
+          output = HLT/Run3/TRMBI/EXPERT/SPTRK
+          description 	= Normal: exponent like distribution with a hard cut from the left side
+        }
+        hist nTrkOffline {
+          output = HLT/Run3/TRMBI/EXPERT/SPTRK
+          description 	= Normal: exponent like distribution with a soft cut from the left side
         }
       }
     }
diff --git a/DataQuality/DataQualityConfigurations/config/Tau/collisions_run.config b/DataQuality/DataQualityConfigurations/config/Tau/collisions_run.config
index 3310343ca42a4433ae24246d6fffa0b9cdbb8cc0..b2c0b7329c1ca149f0059283dd1095da0ca66665 100644
--- a/DataQuality/DataQualityConfigurations/config/Tau/collisions_run.config
+++ b/DataQuality/DataQualityConfigurations/config/Tau/collisions_run.config
@@ -13,17 +13,25 @@
 
 output top_level {
   output Tau {
+    output Calo {
+    }
+    output Physics {
+      output Z {
+      }
+      output W {
+      }
+    }
+    output Track {
+    }
     output TauB {
       output Calo {
       }
       output Track {
       }
       output Identification {
-        output tauJetBDTinputs {
-        }
-        output EleVetoBDTinputs {
-        }
-	output BDTLoose15GeV {
+	output RNNLoose {
+	}
+	output RNNMedium {
 	}
       }
       output SubStructure {
@@ -35,11 +43,9 @@ output top_level {
       output Track {
       }
       output Identification {
-        output tauJetBDTinputs {
-        }
-        output EleVetoBDTinputs {
-        }
-	output BDTLoose15GeV {
+	output RNNLoose {
+	}
+	output RNNMedium {
 	}
       }
       output SubStructure {
@@ -51,39 +57,27 @@ output top_level {
       output Track {
       }
       output Identification {
-        output tauJetBDTinputs {
-        }
-        output EleVetoBDTinputs {
-        }
-	output BDTLoose15GeV {
+	output RNNLoose {
+	}
+	output RNNMedium {
 	}
       }
       output SubStructure {
       }
     }
     output Trigger {
-      output TauTrig {
-        output Calo {
-        }
-        output Track {
-        }
-        output Identification {
-          output tauJetBDTinputs {
-          }
-          output EleVetoBDTinputs {
-          }
-	  output BDTLoose15GeV {
-	  }
-        }
-        output SubStructure {
-        }
-      }    
-      output JetTrig {
-      }
-      output EleTrig {
-      }
+	output TauTrig1 {
+	}	
+	output EleTrig {
+	}	
+	output JetTrig {
+	}	
+
+
+
     }
 
+
 #    output Expert  {
 #      output TauMerged {
 #      }
@@ -104,44 +98,18 @@ dir Tau {
     display = StatBox
   }
 
-  hist nHighPtTauCandidates {
-    algorithm = tauHists_Chi2NDF
+  hist tauCharge {
+    algorithm = tauHists_Chi2NDF_noEmpty
     display = StatBox,LogY
   }
 
-  hist tauPhi {
-    algorithm = tauHists_Chi2NDF
-    display = StatBox
-  }
-
-  hist tauEta {
+  hist RNNJetScore {
     algorithm = tauHists_Chi2NDF
-     display = StatBox
-  }
- 
-  hist tauPhiVsEta {
-   algorithm = tauHists_Chi2Scatter
-    display = StatBox
-  }
-
-  hist tauPhiVsEtaEt15 {
-    algorithm = tauHists_Chi2Scatter/Loose
-    display = StatBox
-  }
-
-  hist tauPhiVsEtaEt15BDTLoose {
-    algorithm = tauHists_Chi2Scatter/Loose
-    display = StatBox
-  }
-
-  hist tauCharge {
-    algorithm = tauHists_Chi2NDF_noEmpty
     display = StatBox,LogY
   }
 
-  hist nTauCandidates {
-    algorithm = tauHists_Chi2NDF
-      display = StatBox,LogY
+  hist RNNJetScoreSigTrans {
+    display = StatBox,LogY
   }
 
   hist tauEt {
@@ -149,27 +117,27 @@ dir Tau {
       display = StatBox,LogY
   }
 
-  hist tauEtVsPhi {
-    algorithm = tauHists_Chi2Scatter
-      display = StatBox
+  hist tauEta {
+    algorithm = tauHists_Chi2NDF
+     display = StatBox
   }
 
-  hist tauEtVsEta {
-    algorithm = tauHists_Chi2Scatter
+  hist tauEtaVsLB {
+    algorithm = tauHists_Chi2Scatter/Loose
     display = StatBox
   }
 
-  hist tauEtVsLB {
-    algorithm = tauHists_Chi2Scatter/Loose
+  hist tauPhi {
+    algorithm = tauHists_Chi2NDF
     display = StatBox
   }
 
-
-  hist tauEtaVsLB {
-    algorithm = tauHists_Chi2Scatter/Loose
+  hist tauPhiVsEta {
+   algorithm = tauHists_Chi2Scatter
     display = StatBox
   }
 
+
   hist tauPhiVsLB {
     algorithm =  tauHists_Chi2Scatter/Loose
     display = StatBox
@@ -180,145 +148,402 @@ dir Tau {
     display = StatBox
   }
 
-  hist NumTracks {
+  hist tauNumTracks {
     algorithm = tauHists_Chi2NDF
     display = StatBox
   }
 
-  hist NumCoreTrkVsLB {
-    algorithm = tauHists_Chi2Scatter/veryLoose 
+  hist nCluster {
+    algorithm = tauHists_Chi2NDF/veryLoose
     display = StatBox
   }
 
-  
-  hist nCluster {
-    algorithm = tauHists_Chi2NDF/veryLoose
+  hist tauEtVsEta {
+    algorithm = tauHists_Chi2Scatter
     display = StatBox
   }
 
-  hist PtTESMVA {
+  hist tauEtVsPhi {
+    algorithm = tauHists_Chi2Scatter
+      display = StatBox
+  }
+
+
+  hist nTauCandidates {
     algorithm = tauHists_Chi2NDF
-    display = StatBox
+      display = StatBox,LogY
   }
 
-  hist Ptcombined {
+
+  hist nHighPtTauCandidates {
     algorithm = tauHists_Chi2NDF
+    display = StatBox,LogY
+  }
+
+
+  hist tauPhiVsEta_et15 {
+    algorithm = tauHists_Chi2Scatter/Loose
     display = StatBox
   }
 
-  dir TauB {
-    output = Tau/TauB
+  hist tauPhiVsEta_et15_RNNLoose {
+    algorithm = tauHists_Chi2Scatter/Loose
+    display = StatBox
+  }
+
+
+  dir Calo {
+    output = Tau/Calo
     algorithm = tauHists_Chi2NDF_noEmpty
     hist all_in_dir {
       display = StatBox
     }
 
-    hist Tau_TauB_tauPhiVsEta {
-      algorithm = tauHists_Chi2Scatter
-      display = StatBox
+    hist Tau_Calo_EMRadius {
+      algorithm = tauHists_Chi2NDF_noEmpty
+      display = StatBox,LogY
     }
 
-    hist Tau_TauB_tauEtaVsLB {
-      algorithm = tauHists_Chi2Scatter
-      display = StatBox
+    hist Tau_Calo_hadRadius {
+      algorithm = tauHists_Chi2NDF_noEmpty
+      display = StatBox,LogY
+    } 
+
+    hist Tau_Calo_stripWidth2 {
+      algorithm = tauHists_Chi2NDF_noEmpty
+      display = StatBox,LogY
     }
 
-    hist Tau_TauB_tauPhiVsLB {
-      algorithm = tauHists_Chi2Scatter
+    hist Tau_Calo_isolFrac {
+      algorithm = tauHists_Chi2NDF_noEmpty
       display = StatBox
+    }  
+
+    hist Tau_Calo_nStrip {
+      algorithm = tauHists_Chi2NDF
+      display = StatBox,LogY
+    }
+
+    hist Tau_Calo_etEMAtEMScale {
+      algorithm = tauHists_Chi2NDF_noEmpty
+      display = StatBox,LogY
     }
 
-    hist Tau_TauB_tauEtaVsLBet15BDTLoose {
-      algorithm = tauHists_Chi2Scatter/Loose
+    hist Tau_Calo_etHadAtEMScale {
+      algorithm = tauHists_Chi2NDF_noEmpty
+      display = StatBox,LogY
+    }
+ 
+    hist Tau_Calo_centFracVsLB {
+      algorithm = tauHists_Chi2Scatter_noEmpty
       display = StatBox
     }
 
-    hist Tau_TauB_tauPhiVsLBet15BDTLoose {
-      algorithm = tauHists_Chi2Scatter/Loose
+     hist Tau_Calo_isolFracVsLB {
+       algorithm = tauHists_Chi2Scatter_noEmpty
+       display = StatBox
+     }
+
+     hist Tau_Calo_centralityFraction {
+#        algorithm = tauHists_Chi2NDF
+        display = StatBox
+     }
+
+     hist Tau_Calo_dRmax {
+       algorithm = tauHists_Chi2NDF
+       display = StatBox,LogY
+     }
+
+     hist Tau_Calo_eta {
+       algorithm = tauHists_Chi2NDF
+       display = StatBox
+     } 
+
+     hist Tau_Calo_phi {
+       algorithm = tauHists_Chi2NDF
+       display = StatBox
+     } 
+
+     hist Tau_Calo_trkAvgDist {
+       algorithm = tauHists_Chi2NDF
+       display = StatBox
+     }
+  }
+
+  dir Track {
+    output = Tau/Track
+    algorithm = tauHists_Chi2NDF/noMatch
+
+    hist all_in_dir {
       display = StatBox
     }
 
-    hist Tau_TauB_nTauCandidates {
+    hist Tau_Track_leadTrkPt {
       algorithm = tauHists_Chi2NDF
       display = StatBox,LogY
     }
 
-    hist Tau_TauB_tauCharge {
+    hist Tau_Track_trkWidth2 {
+      algorithm = tauHists_Chi2NDF
+      display = StatBox,LogY
+    }
+    hist Tau_Track_trkWidth2 {
+      algorithm = tauHists_Chi2NDF
+      display = StatBox,LogY
+    }
+
+    hist Tau_Track_ipZ0SinThetaSigLeadTrk {
       algorithm = tauHists_Chi2NDF_noEmpty
+      display = StatBox
+    }
+
+    hist Tau_Track_etOverPtLeadTrk {
+      algorithm = tauHists_Chi2NDF
       display = StatBox,LogY
     }
 
-    hist Tau_TauB_tauEt {
+    hist Tau_Track_ipSigLeadTrk {
       algorithm = tauHists_Chi2NDF
       display = StatBox,LogY
     }
 
-    hist Tau_TauB_tauEta {
+    hist Tau_Track_massTrkSys {
+      algorithm = tauHists_Chi2NDF 
+      display = StatBox,LogY
+    }
+
+    hist Tau_Track_trFlightPathSig {
       algorithm = tauHists_Chi2NDF
+      display = StatBox       
+    }
+
+    hist Tau_Track_numberOfSCTHits {
+      display = StatBox,LogY
+    }  
+
+
+    hist Tau_Track_numberOfPixelHits {
+      display = StatBox,LogY
+    }
+
+
+    hist Tau_Track_numberOfTRTHits {
+      display = StatBox,LogY
+    }
+
+    hist Tau_Track_numberOfTRTHighThresholdHits {
+      display = StatBox,LogY
+    }   
+
+    hist Tau_Track_numberOfTRTHighThresholdOutliers {
+      display = StatBox,LogY
+    }
+
+    hist Tau_Track_numberOfTRTOutliers {
+      display = StatBox,LogY
+    }
+
+
+    hist Tau_Track_d0 {
+      algorithm = tauHists_Chi2NDF_noEmpty/veryLoose
+      display = StatBox,<AxisRange(-5,5,"X")>,LogY
+    }
+
+    hist Tau_Track_eta {
+      algorithm = tauHists_Chi2NDF/Loose
       display = StatBox
     } 
 
-    hist Tau_TauB_tauPhi {
+    hist Tau_Track_pT {
+      algorithm = tauHists_Chi2NDF
+      display = StatBox,LogY
+    }
+
+
+    hist Tau_Track_phi {
       algorithm = tauHists_Chi2NDF
       display = StatBox
     } 
-   
-    dir Calo {
-      output = Tau/TauB/Calo
-      algorithm = tauHists_Chi2NDF_noEmpty
-      hist all_in_dir {
-        display = StatBox
-      }
 
-      hist Tau_TauB_Calo_jetSeedPt {
-        algorithm = tauHists_Chi2NDF
-        display = StatBox
-      }
+    hist Tau_Track_z0 {
+      algorithm = tauHists_Chi2NDF
+      display = StatBox
+    } 
 
+    hist Tau_Track_nHighPtTaus {
+      algorithm = tauHists_Chi2NDF
+      display = StatBox,LogY
+    }
  
-      hist Tau_TauB_Calo_jetSeedEta {
-        algorithm = tauHists_Chi2NDF
+  }
+
+  dir Physics {
+    output = Tau/Physics
+    algorithm = tauHists_Chi2NDF/noMatch
+
+    hist all_in_dir {
+      display = StatBox
+    }
+
+    dir W {
+      output = Tau/Physics/W
+      algorithm = tauHists_Chi2NDF/noMatch
+
+      hist all_in_dir {
         display = StatBox
       }
 
-      hist Tau_TauB_Calo_jetSeedPhi {
+      hist tau_pTVsEta {
         algorithm = tauHists_Chi2NDF
         display = StatBox
-      }      
-
-      hist Tau_TauB_Calo_etEMAtEMScale {
-        algorithm = tauHists_Chi2NDF_noEmpty
-        display = StatBox,LogY
       }
 
-      hist Tau_TauB_Calo_etHadAtEMScale {
-        algorithm = tauHists_Chi2NDF_noEmpty
-        display = StatBox,LogY
-      }
+    }
 
-      hist Tau_TauB_Calo_EMRadius {
-        algorithm = tauHists_Chi2NDF_noEmpty
-        display = StatBox,LogY
+    dir Z {
+      output = Tau/Physics/Z
+      algorithm = tauHists_Chi2NDF/noMatch
+
+      hist all_in_dir {
+        display = StatBox
       }
 
-      hist Tau_TauB_Calo_hadRadius {
-        algorithm = tauHists_Chi2NDF_noEmpty
-        display = StatBox,LogY
+      hist tau_eta {
+        algorithm = tauHists_Chi2NDF
+        display = StatBox
       } 
 
-      hist Tau_TauB_Calo_isolFrac {
-        algorithm = tauHists_Chi2NDF_noEmpty
+      hist tau_pTVsEta {
+        algorithm = tauHists_Chi2NDF
         display = StatBox
-      }  
+      } 
 
-      hist Tau_TauB_Calo_nStrip {
+      hist lepton_pTVsEta {
         algorithm = tauHists_Chi2NDF
-        display = StatBox,LogY
-      }
+        display = StatBox
+      } 
 
-      hist Tau_TauB_Calo_stripWidth2 {
-        algorithm = tauHists_Chi2NDF_noEmpty
-        display = StatBox,LogY
+    }
+
+  }
+
+
+  dir TauB {
+    output = Tau/TauB
+    algorithm = tauHists_Chi2NDF_noEmpty
+    hist all_in_dir {
+      display = StatBox
+    }
+
+    hist Tau_TauB_tauCharge {
+      algorithm = tauHists_Chi2NDF_noEmpty
+      display = StatBox,LogY
+    }
+
+    hist Tau_TauB_RNNJetScore {
+      algorithm = tauHists_Chi2NDF
+      display = StatBox,LogY
+    }
+
+    hist Tau_TauB_RNNJetScoreSigTrans {
+      display = StatBox,LogY
+    }
+
+    hist Tau_TauB_tauEt {
+      algorithm = tauHists_Chi2NDF
+      display = StatBox,LogY
+    }
+
+    hist Tau_TauB_tauEta {
+      algorithm = tauHists_Chi2NDF
+      display = StatBox
+    } 
+
+    hist Tau_TauB_tauEtaVsLB {
+      algorithm = tauHists_Chi2Scatter
+      display = StatBox
+    }
+
+
+    hist Tau_TauB_tauPhi {
+      algorithm = tauHists_Chi2NDF
+      display = StatBox
+    } 
+
+
+    hist Tau_TauB_tauPhiVsEta {
+      algorithm = tauHists_Chi2Scatter
+      display = StatBox
+    }
+
+    hist Tau_TauB_tauPhiVsLB {
+      algorithm = tauHists_Chi2Scatter
+      display = StatBox
+    }
+
+
+    hist Tau_TauB_nTauCandidates {
+      algorithm = tauHists_Chi2NDF
+      display = StatBox,LogY
+    }
+
+
+    dir Calo {
+      output = Tau/TauB/Calo
+      algorithm = tauHists_Chi2NDF_noEmpty
+      hist all_in_dir {
+        display = StatBox
+      }
+
+      hist Tau_TauB_Calo_jetSeedEta {
+        algorithm = tauHists_Chi2NDF
+        display = StatBox
+      }
+
+      hist Tau_TauB_Calo_jetSeedPhi {
+        algorithm = tauHists_Chi2NDF
+        display = StatBox
+      }      
+
+
+      hist Tau_TauB_Calo_jetSeedPt {
+        algorithm = tauHists_Chi2NDF
+        display = StatBox
+      }
+
+      hist Tau_TauB_Calo_EMRadius {
+        algorithm = tauHists_Chi2NDF_noEmpty
+        display = StatBox,LogY
+      }
+
+      hist Tau_TauB_Calo_hadRadius {
+        algorithm = tauHists_Chi2NDF_noEmpty
+        display = StatBox,LogY
+      } 
+
+      hist Tau_TauB_Calo_stripWidth2 {
+        algorithm = tauHists_Chi2NDF_noEmpty
+        display = StatBox,LogY
+      }
+
+      hist Tau_TauB_Calo_isolFrac {
+        algorithm = tauHists_Chi2NDF_noEmpty
+        display = StatBox
+      }  
+
+      hist Tau_TauB_Calo_nStrip {
+        algorithm = tauHists_Chi2NDF
+        display = StatBox,LogY
+      }
+
+      hist Tau_TauB_Calo_etEMAtEMScale {
+        algorithm = tauHists_Chi2NDF_noEmpty
+        display = StatBox,LogY
+      }
+
+      hist Tau_TauB_Calo_etHadAtEMScale {
+        algorithm = tauHists_Chi2NDF_noEmpty
+        display = StatBox,LogY
       }
  
       hist Tau_TauB_Calo_CentFracVsLB {
@@ -330,109 +555,90 @@ dir Tau {
         algorithm = tauHists_Chi2Scatter_noEmpty
 	display = StatBox
       }
-    }
 
-    dir Track {
-      output = Tau/TauB/Track
-      algorithm = tauHists_Chi2NDF/noMatch
-  
-      hist all_in_dir {
+      hist Tau_TauB_Calo_centralityFraction {
+#        algorithm = tauHists_Chi2NDF
         display = StatBox
       }
 
-      hist Tau_TauB_Track_pT {
+      hist Tau_TauB_Calo_dRmax {
         algorithm = tauHists_Chi2NDF
         display = StatBox,LogY
       }
 
-      hist Tau_TauB_Track_eta {
-        algorithm = tauHists_Chi2NDF/Loose
+      hist Tau_TauB_Calo_eta {
+        algorithm = tauHists_Chi2NDF
         display = StatBox
       } 
 
-      hist Tau_TauB_Track_phi {
+      hist Tau_TauB_Calo_phi {
         algorithm = tauHists_Chi2NDF
         display = StatBox
       } 
 
-      hist Tau_TauB_Track_leadTrkPt {
+      hist Tau_TauB_Calo_trkAvgDist {
         algorithm = tauHists_Chi2NDF
-        display = StatBox,LogY
-      }
-
-      hist Tau_TauB_Track_nHighPTtaus {
-	algorithm = tauHists_Chi2NDF
-	display = StatBox,LogY
-      }
-
-      hist Tau_TauB_Track_dRJetSeedAxis {
-	display = StatBox
+        display = StatBox
       }
 
-      hist Tau_TauB_Track_d0 {
-        algorithm = tauHists_Chi2NDF_noEmpty/veryLoose
-        display = StatBox,<AxisRange(-5,5,"X")>,LogY
-      }
+    }
 
-      hist Tau_TauB_Track_z0TJVA {
-        display = StatBox,<AxisRange(-35,35,"X")>,LogY
+    dir Track {
+      output = Tau/TauB/Track
+      algorithm = tauHists_Chi2NDF/noMatch
+  
+      hist all_in_dir {
+        display = StatBox
       }
 
-      hist Tau_TauB_Track_z0PriVtx {
-        display = StatBox,<AxisRange(-35,35,"X")>,LogY
+      hist Tau_TauB_Track_leadTrkPt {
+        algorithm = tauHists_Chi2NDF
+        display = StatBox,LogY
       }
 
       hist Tau_TauB_Track_trkWidth2 {
         algorithm = tauHists_Chi2NDF
         display = StatBox,LogY
       }
-  
-      hist Tau_TauB_Track_rConv {
-        display = StatBox,LogY
-      }
-  
-      hist Tau_TauB_Track_rConvII {
+      hist Tau_TauB_Track_trkWidth2 {
+        algorithm = tauHists_Chi2NDF
         display = StatBox,LogY
       }
-  
+
       hist Tau_TauB_Track_ipZ0SinThetaSigLeadTrk {
         algorithm = tauHists_Chi2NDF_noEmpty
         display = StatBox
       }
 
-      hist Tau_TauB_Track_leadTrackDeltaEta {
-        algorithm = tauHists_Chi2NDF
+      hist Tau_TauB_Track_etOverPtLeadTrk {
+#       algorithm = tauHists_Chi2NDF
         display = StatBox,LogY
       }
-  
-      hist Tau_TauB_Track_leadTrackDeltaPhi {
+
+      hist Tau_TauB_Track_ipSigLeadTrk {
         algorithm = tauHists_Chi2NDF
         display = StatBox,LogY
       }
-  
-      hist Tau_TauB_Track_eProbabilityHT {
-        display = StatBox
-      }
-  
-      hist Tau_TauB_Track_numberOfPixelHits {
-        display = StatBox,LogY
-      }
 
-      hist Tau_TauB_Track_numberOfPixelSharedHits {
+      hist Tau_TauB_Track_massTrkSys {
+        algorithm = tauHists_Chi2NDF 
         display = StatBox,LogY
       }
 
-      hist Tau_TauB_Track_numberOfInnermostPixelLayerHits {
-        display = StatBox,LogY
+      hist Tau_TauB_Track_trFlightPathSig {
+#       algorithm = tauHists_Chi2NDF
+        display = StatBox       
       }
 
       hist Tau_TauB_Track_numberOfSCTHits {
         display = StatBox,LogY
       }  
 
-      hist Tau_TauB_Track_numberOfSCTSharedHits {
+
+      hist Tau_TauB_Track_numberOfPixelHits {
         display = StatBox,LogY
-      }  
+      }
+
 
       hist Tau_TauB_Track_numberOfTRTHits {
         display = StatBox,LogY
@@ -449,187 +655,118 @@ dir Tau {
       hist Tau_TauB_Track_numberOfTRTOutliers {
         display = StatBox,LogY
       }
-  
-      hist Tau_TauB_Track_z0VsLB {
-	display = StatBox,<AxisRange(-35,35,"Y")>
-      }
- 
-    }
 
-    dir Identification {
-      output = Tau/TauB/Identification
-      algorthm = tauHists_Chi2NDF_noEmpty
-      hist all_in_dir {
-        display = StatBox
-      }
 
-      hist Tau_TauB_Identification_tauBDTLoose {
-        algorithm = tauHists_Chi2NDF/Loose 
-        display = StatBox 
+      hist Tau_TauB_Track_d0 {
+        algorithm = tauHists_Chi2NDF_noEmpty/veryLoose
+        display = StatBox,<AxisRange(-5,5,"X")>,LogY
       }
 
-      hist Tau_TauB_Identification_tauBDTMedium {
+      hist Tau_TauB_Track_eta {
         algorithm = tauHists_Chi2NDF/Loose
-        display = StatBox 
-      }
+        display = StatBox
+      } 
 
-      hist Tau_TauB_Identification_tauBDTTight {
-        algorithm = tauHists_Chi2NDF 
-        display = StatBox 
+      hist Tau_TauB_Track_pT {
+        algorithm = tauHists_Chi2NDF
+        display = StatBox,LogY
       }
 
-      hist Tau_TauB_Identification_BDTEleScoreSigTrans {
-        algorithm = tauHists_Chi2NDF_noEmpty
+
+      hist Tau_TauB_Track_phi {
+        algorithm = tauHists_Chi2NDF
         display = StatBox
-       }
+      } 
+
+      hist Tau_TauB_Track_z0 {
+        algorithm = tauHists_Chi2NDF
+        display = StatBox
+      } 
 
-      hist Tau_TauB_Identification_BDTJetScore {
+      hist Tau_TauB_Track_nHighPtTaus {
 	algorithm = tauHists_Chi2NDF
 	display = StatBox,LogY
       }
 
-      hist Tau_TauB_Identification_BDTJetScoreSigTrans {
-	display = StatBox,LogY
-      }
+ 
+    }
 
-      hist Tau_TauB_Identification_muonVeto {
+    dir Identification {
+      output = Tau/TauB/Identification
+      algorthm = tauHists_Chi2NDF_noEmpty
+      hist all_in_dir {
         display = StatBox
       }
 
-      hist Tau_TauB_Identification_eleBDTMedium {
-        algorithm = tauHists_Chi2NDF/veryLoose
-        display = StatBox
+      hist Tau_TauB_Identification_tauRNNLoose {
+        algorithm = tauHists_Chi2NDF/Loose 
+        display = StatBox 
       }
 
-      hist Tau_TauB_Identification_eleBDTTight {
+      hist Tau_TauB_Identification_tauRNNMedium {
         algorithm = tauHists_Chi2NDF/Loose
-        display = StatBox
+        display = StatBox 
       }
 
-      dir tauJetBDTinputs {
-	output = Tau/TauB/Identification/tauJetBDTinputs
-	algoithm = tauHists_Chi2NDF_noEmpty
+      hist Tau_TauB_Identification_muonVeto {
+        display = StatBox
+      }
 
-        hist Tau_TauB_Identification_tauJetBDTinputs_CentFrac {
-#          algorithm = tauHists_Chi2NDF
+      dir RNNLoose {
+        output = Tau/TauB/Identification/RNNLoose
+        algorithm = tauHists_Chi2NDF
+        hist all_in_dir {
           display = StatBox
         }
 
-        hist Tau_TauB_Identification_tauJetBDTinputs_dRmax {
+        hist Tau_TauB_Identification_RNNLoose_phi {
           algorithm = tauHists_Chi2NDF
-          display = StatBox,LogY
-        }
+          display = StatBox
+        } 
 
-        hist Tau_TauB_Identification_tauJetBDTinputs_trkAvgDist {
+        hist Tau_TauB_Identification_RNNLoose_eta {
           algorithm = tauHists_Chi2NDF
           display = StatBox
-        }
+        } 
 
-        hist Tau_TauB_Identification_tauJetBDTinputs_SumPtTrkFrac {
+        hist Tau_TauB_Identification_RNNLoose_et {
           algorithm = tauHists_Chi2NDF
-          display = StatBox,LogY
-        }
-
-        hist Tau_TauB_Identification_tauJetBDTinputs_etOverPtLeadTrk {
-#          algorithm = tauHists_Chi2NDF
-          display = StatBox,LogY
-        }
+          display = StatBox
+        } 
 
-        hist Tau_TauB_Identification_tauJetBDTinputs_absipSigLeadTrk {
+        hist Tau_TauB_Identification_RNNLoose_NumTracks {
           algorithm = tauHists_Chi2NDF
-          display = StatBox,LogY
-        }
-
-        hist Tau_TauB_Identification_tauJetBDTinputs_trFlightPathSig {
-#          algorithm = tauHists_Chi2NDF
           display = StatBox
-        }
+        } 
+      }
 
-        hist Tau_TauB_Identification_tauJetBDTinputs_massTrkSys {
-          algorithm = tauHists_Chi2NDF 
-          display = StatBox,LogY
-        }
+      dir RNNMedium {
 
-        hist Tau_TauB_Identification_tauJetBDTinputs_EMPOverTrkSysP {
-#          algorithm = tauHists_Chi2NDF 
+        output = Tau/TauB/Identification/RNNMedium
+        algorithm = tauHists_Chi2NDF
+        hist all_in_dir {
           display = StatBox
         }
 
-        hist Tau_TauB_Identification_tauJetBDTinputs_mEflowApprox {
-#          algorithm = tauHists_Chi2NDF 
-          display = StatBox,LogY
-        }
-
-        hist Tau_TauB_Identification_tauJetBDTinputs_ptRatioEflowApprox {
-#          algorithm = tauHists_Chi2NDF 
+        hist Tau_TauB_Identification_RNNMedium_phi {
+          algorithm = tauHists_Chi2NDF
           display = StatBox
-        }
+        } 
 
-        hist Tau_TauB_Identification_tauJetBDTinputs_ptIntermediateAxis {
+        hist Tau_TauB_Identification_RNNMedium_eta {
           algorithm = tauHists_Chi2NDF
-          display = StatBox,LogY
-        }
-      }
-
-      dir EleVetoBDTinputs {
-	output = Tau/TauB/Identification/EleVetoBDTinputs
-	algoithm = tauHists_Chi2NDF_noEmpty
-
-        hist Tau_TauB_Identification_EleVetoBDTinputs_etHotShotWinOverPtLeadTrk {
-#          algorithm = tauHists_Chi2NDF 
           display = StatBox
-        }
-
-        hist Tau_TauB_Identification_EleVetoBDTinputs_EMFracFixed {
-#          algorithm = tauHists_Chi2NDF 
-          display = StatBox
-        }
+        } 
 
-        hist Tau_TauB_Identification_EleVetoBDTinputs_hadLeakFracFixed {
-#          algorithm = tauHists_Chi2NDF 
+        hist Tau_TauB_Identification_RNNMedium_et {
+          algorithm = tauHists_Chi2NDF
           display = StatBox
-        }
+        } 
 
-        hist Tau_TauB_Identification_EleVetoBDTinputs_PSSFrac {
-#          algorithm = tauHists_Chi2NDF 
+        hist Tau_TauB_Identification_RNNMedium_NumTracks {
+          algorithm = tauHists_Chi2NDF
           display = StatBox
-        }
-      }
-
-      dir BDTLoose15GeV {
-	output = Tau/TauB/Identification/BDTLoose15GeV
-	algoithm = tauHists_Chi2NDF
-
-	hist Tau_TauB_Identification_BDTLoose15GeV_et {
-          algorithm = tauHists_Chi2NDF 
-	  display = StatBox,LogY
-	}
-
-	hist Tau_TauB_Identification_BDTLoose15GeV_eta {
-          algorithm = tauHists_Chi2NDF 
-	  display = StatBox
-	}
-
-	hist Tau_TauB_Identification_BDTLoose15GeV_phi {
-          algorithm = tauHists_Chi2NDF 
-	  display = StatBox
-	}
-
-	hist Tau_TauB_Identification_BDTLoose15GeV_numTracks {
-          algorithm = tauHists_Chi2NDF 
-	  display = StatBox,LogY
-	}
-
-	hist Tau_TauB_Identification_BDTLoose15GeV_nCluster {
-          algorithm = tauHists_Chi2NDF/Loose 
-	  display = StatBox,LogY
-	}
-
-	hist Tau_TauB_Identification_BDTLoose15GeV_PanMode {
-          algorithm = tauHists_Chi2NDF 
-	  display = StatBox,LogY
-	}
-
+        } 
       }
     }
 
@@ -641,12 +778,17 @@ dir Tau {
         display = StatBox
       }
 
-      hist Tau_TauB_SubStructure_nShot {
-        algorithm = tauHists_Chi2NDF 
+      hist Tau_TauB_SubStructure_shots_pt3 {
+        algorithm = tauHists_Chi2NDF_noEmpty 
         display = StatBox,LogY
-      }  
-      
-      hist Tau_TauB_SubStructure_InvMassEffClusters {
+      }
+
+      hist Tau_TauB_SubStructure_BDTscoreAsP0 {
+        algorithm = tauHists_Chi2NDF_noEmpty 
+        display = StatBox
+      }
+
+      hist Tau_TauB_SubStructure_EMFracTrk {
         algorithm = tauHists_Chi2NDF_noEmpty 
         display = StatBox
       }
@@ -661,12 +803,7 @@ dir Tau {
         display = StatBox
       }
 
-      hist Tau_TauB_SubStructure_shots_pt3 {
-        algorithm = tauHists_Chi2NDF_noEmpty 
-        display = StatBox,LogY
-      }
-
-      hist Tau_TauB_SubStructure_EMFracTrk {
+      hist Tau_TauB_SubStructure_InvMassEffClusters {
         algorithm = tauHists_Chi2NDF_noEmpty 
         display = StatBox
       }
@@ -676,27 +813,37 @@ dir Tau {
         display = StatBox,LogY
       }
 
-      hist Tau_TauB_SubStructure_BDTscoreAsP0 {
-        algorithm = tauHists_Chi2NDF_noEmpty 
-        display = StatBox
+      hist Tau_TauB_SubStructure_nShot {
+        algorithm = tauHists_Chi2NDF 
+        display = StatBox,LogY
+      }  
+
+      hist Tau_TauB_SubStructure_PSSFracEffCluster {
+         algorithm = tauHists_Chi2NDF 
+         display = StatBox
       }
- 
+
+      hist Tau_TauB_SubStructure_ptRatioApprox {
+         algorithm = tauHists_Chi2NDF 
+         display = StatBox
+      }
+
       hist Tau_TauB_SubStructure_PanMode {
         algorithm = tauHists_Chi2NDF 
         display = StatBox
       }
 
-      hist Tau_TauB_SubStructure_PanPt {
+      hist Tau_TauB_SubStructure_PanEta {
         algorithm = tauHists_Chi2NDF 
         display = StatBox
       }
 
-      hist Tau_TauB_SubStructure_PanEta {
+      hist Tau_TauB_SubStructure_PanPhi {
         algorithm = tauHists_Chi2NDF 
         display = StatBox
       }
 
-      hist Tau_TauB_SubStructure_PanPhi {
+      hist Tau_TauB_SubStructure_PanPt {
         algorithm = tauHists_Chi2NDF 
         display = StatBox
       }
@@ -711,38 +858,17 @@ dir Tau {
       display = StatBox
     }
 
-    hist Tau_TauCR_tauPhiVsEta {
-      algorithm = tauHists_Chi2Scatter
-      display = StatBox
-    }
-
-    hist Tau_TauCR_tauEtaVsLB {
-      algorithm = tauHists_Chi2Scatter
-      display = StatBox
-    }
-
-    hist Tau_TauCR_tauPhiVsLB {
-      algorithm = tauHists_Chi2Scatter
-      display = StatBox
-    }
-
-    hist Tau_TauCR_tauEtaVsLBet15BDTLoose {
-      algorithm = tauHists_Chi2Scatter/Loose
-      display = StatBox
-    }
-
-    hist Tau_TauCR_tauPhiVsLBet15BDTLoose {
-      algorithm = tauHists_Chi2Scatter/Loose
-      display = StatBox
+    hist Tau_TauB_tauCharge {
+      algorithm = tauHists_Chi2NDF_noEmpty
+      display = StatBox,LogY
     }
 
-    hist Tau_TauCR_nTauCandidates {
+    hist Tau_TauCR_RNNJetScore {
       algorithm = tauHists_Chi2NDF
       display = StatBox,LogY
     }
 
-    hist Tau_TauCR_tauCharge {
-      algorithm = tauHists_Chi2NDF_noEmpty
+    hist Tau_TauCR_RNNJetScoreSigTrans {
       display = StatBox,LogY
     }
 
@@ -756,10 +882,35 @@ dir Tau {
       display = StatBox
     } 
 
+    hist Tau_TauCR_tauEtaVsLB {
+      algorithm = tauHists_Chi2Scatter
+      display = StatBox
+    }
+
+
     hist Tau_TauCR_tauPhi {
       algorithm = tauHists_Chi2NDF
       display = StatBox
     } 
+
+
+    hist Tau_TauCR_tauPhiVsEta {
+      algorithm = tauHists_Chi2Scatter
+      display = StatBox
+    }
+
+    hist Tau_TauCR_tauPhiVsLB {
+      algorithm = tauHists_Chi2Scatter
+      display = StatBox
+    }
+
+
+    hist Tau_TauCR_nTauCandidates {
+      algorithm = tauHists_Chi2NDF
+      display = StatBox,LogY
+    }
+
+
    
     dir Calo {
       output = Tau/TauCR/Calo
@@ -767,13 +918,6 @@ dir Tau {
       hist all_in_dir {
         display = StatBox
       }
-
-      hist Tau_TauCR_Calo_jetSeedPt {
-        algorithm = tauHists_Chi2NDF
-        display = StatBox
-      }
-
- 
       hist Tau_TauCR_Calo_jetSeedEta {
         algorithm = tauHists_Chi2NDF
         display = StatBox
@@ -784,14 +928,10 @@ dir Tau {
         display = StatBox
       }      
 
-      hist Tau_TauCR_Calo_etEMAtEMScale {
-        algorithm = tauHists_Chi2NDF_noEmpty
-        display = StatBox,LogY
-      }
 
-      hist Tau_TauCR_Calo_etHadAtEMScale {
-        algorithm = tauHists_Chi2NDF_noEmpty
-        display = StatBox,LogY
+      hist Tau_TauCR_Calo_jetSeedPt {
+        algorithm = tauHists_Chi2NDF
+        display = StatBox
       }
 
       hist Tau_TauCR_Calo_EMRadius {
@@ -804,6 +944,11 @@ dir Tau {
         display = StatBox,LogY
       } 
 
+      hist Tau_TauCR_Calo_stripWidth2 {
+        algorithm = tauHists_Chi2NDF_noEmpty
+        display = StatBox,LogY
+      }
+
       hist Tau_TauCR_Calo_isolFrac {
         algorithm = tauHists_Chi2NDF_noEmpty
         display = StatBox
@@ -814,7 +959,12 @@ dir Tau {
         display = StatBox,LogY
       }
 
-      hist Tau_TauCR_Calo_stripWidth2 {
+      hist Tau_TauCR_Calo_etEMAtEMScale {
+        algorithm = tauHists_Chi2NDF_noEmpty
+        display = StatBox,LogY
+      }
+
+      hist Tau_TauCR_Calo_etHadAtEMScale {
         algorithm = tauHists_Chi2NDF_noEmpty
         display = StatBox,LogY
       }
@@ -828,109 +978,90 @@ dir Tau {
         algorithm = tauHists_Chi2Scatter_noEmpty
 	display = StatBox
       }
-    }
 
-    dir Track {
-      output = Tau/TauCR/Track
-      algorithm = tauHists_Chi2NDF/noMatch
-  
-      hist all_in_dir {
+      hist Tau_TauCR_Calo_centralityFraction {
+#        algorithm = tauHists_Chi2NDF
         display = StatBox
       }
 
-      hist Tau_TauCR_Track_pT {
+      hist Tau_TauCR_Calo_dRmax {
         algorithm = tauHists_Chi2NDF
         display = StatBox,LogY
       }
 
-      hist Tau_TauCR_Track_eta {
-        algorithm = tauHists_Chi2NDF/Loose
+      hist Tau_TauCR_Calo_eta {
+        algorithm = tauHists_Chi2NDF
         display = StatBox
       } 
 
-      hist Tau_TauCR_Track_phi {
+      hist Tau_TauCR_Calo_phi {
         algorithm = tauHists_Chi2NDF
         display = StatBox
       } 
 
-      hist Tau_TauCR_Track_leadTrkPt {
+      hist Tau_TauCR_Calo_trkAvgDist {
         algorithm = tauHists_Chi2NDF
-        display = StatBox,LogY
-      }
-
-      hist Tau_TauCR_Track_nHighPTtaus {
-	algorithm = tauHists_Chi2NDF
-	display = StatBox,LogY
-      }
-
-      hist Tau_TauCR_Track_dRJetSeedAxis {
-	display = StatBox
+        display = StatBox
       }
 
-      hist Tau_TauCR_Track_d0 {
-        algorithm = tauHists_Chi2NDF_noEmpty/veryLoose
-        display = StatBox,<AxisRange(-5,5,"X")>,LogY
-      }
+    }
 
-      hist Tau_TauCR_Track_z0TJVA {
-        display = StatBox,<AxisRange(-35,35,"X")>,LogY
+    dir Track {
+      output = Tau/TauCR/Track
+      algorithm = tauHists_Chi2NDF/noMatch
+  
+      hist all_in_dir {
+        display = StatBox
       }
 
-      hist Tau_TauCR_Track_z0PriVtx {
-        display = StatBox,<AxisRange(-35,35,"X")>,LogY
+      hist Tau_TauCR_Track_leadTrkPt {
+        algorithm = tauHists_Chi2NDF
+        display = StatBox,LogY
       }
 
       hist Tau_TauCR_Track_trkWidth2 {
         algorithm = tauHists_Chi2NDF
         display = StatBox,LogY
       }
-  
-      hist Tau_TauCR_Track_rConv {
-        display = StatBox,LogY
-      }
-  
-      hist Tau_TauCR_Track_rConvII {
+      hist Tau_TauCR_Track_trkWidth2 {
+        algorithm = tauHists_Chi2NDF
         display = StatBox,LogY
       }
-  
+
       hist Tau_TauCR_Track_ipZ0SinThetaSigLeadTrk {
         algorithm = tauHists_Chi2NDF_noEmpty
         display = StatBox
       }
 
-      hist Tau_TauCR_Track_leadTrackDeltaEta {
-        algorithm = tauHists_Chi2NDF
+      hist Tau_TauCR_Track_etOverPtLeadTrk {
+#       algorithm = tauHists_Chi2NDF
         display = StatBox,LogY
       }
-  
-      hist Tau_TauCR_Track_leadTrackDeltaPhi {
+
+      hist Tau_TauCR_Track_ipSigLeadTrk {
         algorithm = tauHists_Chi2NDF
         display = StatBox,LogY
       }
-  
-      hist Tau_TauCR_Track_eProbabilityHT {
-        display = StatBox
-      }
-  
-      hist Tau_TauCR_Track_numberOfPixelHits {
-        display = StatBox,LogY
-      }
 
-      hist Tau_TauCR_Track_numberOfPixelSharedHits {
+      hist Tau_TauCR_Track_massTrkSys {
+        algorithm = tauHists_Chi2NDF 
         display = StatBox,LogY
       }
 
-      hist Tau_TauCR_Track_numberOfInnermostPixelLayerHits {
-        display = StatBox,LogY
+      hist Tau_TauCR_Track_trFlightPathSig {
+#       algorithm = tauHists_Chi2NDF
+        display = StatBox       
       }
 
       hist Tau_TauCR_Track_numberOfSCTHits {
         display = StatBox,LogY
       }  
 
-      hist Tau_TauCR_Track_numberOfSCTSharedHits {
+
+      hist Tau_TauCR_Track_numberOfPixelHits {
         display = StatBox,LogY
-      }  
+      }
+
 
       hist Tau_TauCR_Track_numberOfTRTHits {
         display = StatBox,LogY
@@ -947,9 +1078,37 @@ dir Tau {
       hist Tau_TauCR_Track_numberOfTRTOutliers {
         display = StatBox,LogY
       }
-  
-      hist Tau_TauCR_Track_z0VsLB {
-	display = StatBox,<AxisRange(-35,35,"Y")>
+
+
+      hist Tau_TauCR_Track_d0 {
+        algorithm = tauHists_Chi2NDF_noEmpty/veryLoose
+        display = StatBox,<AxisRange(-5,5,"X")>,LogY
+      }
+
+      hist Tau_TauCR_Track_eta {
+        algorithm = tauHists_Chi2NDF/Loose
+        display = StatBox
+      } 
+
+      hist Tau_TauCR_Track_pT {
+        algorithm = tauHists_Chi2NDF
+        display = StatBox,LogY
+      }
+
+
+      hist Tau_TauCR_Track_phi {
+        algorithm = tauHists_Chi2NDF
+        display = StatBox
+      } 
+
+      hist Tau_TauCR_Track_z0 {
+        algorithm = tauHists_Chi2NDF
+        display = StatBox
+      } 
+
+      hist Tau_TauCR_Track_nHighPtTaus {
+	algorithm = tauHists_Chi2NDF
+	display = StatBox,LogY
       }
  
     }
@@ -961,173 +1120,74 @@ dir Tau {
         display = StatBox
       }
 
-      hist Tau_TauCR_Identification_tauBDTLoose {
+      hist Tau_TauCR_Identification_tauRNNLoose {
         algorithm = tauHists_Chi2NDF/Loose 
         display = StatBox 
       }
 
-      hist Tau_TauCR_Identification_tauBDTMedium {
+      hist Tau_TauCR_Identification_tauRNNMedium {
         algorithm = tauHists_Chi2NDF/Loose
         display = StatBox 
       }
 
-      hist Tau_TauCR_Identification_tauBDTTight {
-        algorithm = tauHists_Chi2NDF 
-        display = StatBox 
-      }
-
-      hist Tau_TauCR_Identification_BDTEleScoreSigTrans {
-        algorithm = tauHists_Chi2NDF_noEmpty
-        display = StatBox
-       }
-
-      hist Tau_TauCR_Identification_BDTJetScore {
-	algorithm = tauHists_Chi2NDF
-	display = StatBox,LogY
-      }
-
-      hist Tau_TauCR_Identification_BDTJetScoreSigTrans {
-	display = StatBox,LogY
-      }
-
       hist Tau_TauCR_Identification_muonVeto {
         display = StatBox
       }
 
-      hist Tau_TauCR_Identification_eleBDTMedium {
-        algorithm = tauHists_Chi2NDF/veryLoose
-        display = StatBox
-      }
-
-      hist Tau_TauCR_Identification_eleBDTTight {
-        algorithm = tauHists_Chi2NDF/Loose
-        display = StatBox
-      }
-
-      dir tauJetBDTinputs {
-	output = Tau/TauCR/Identification/tauJetBDTinputs
-	algoithm = tauHists_Chi2NDF_noEmpty
-
-        hist Tau_TauCR_Identification_tauJetBDTinputs_CentFrac {
-#          algorithm = tauHists_Chi2NDF
+      dir RNNLoose {
+        output = Tau/TauCR/Identification/RNNLoose
+        algorithm = tauHists_Chi2NDF
+        hist all_in_dir {
           display = StatBox
         }
 
-        hist Tau_TauCR_Identification_tauJetBDTinputs_dRmax {
-          algorithm = tauHists_Chi2NDF
-          display = StatBox,LogY
-        }
-
-        hist Tau_TauCR_Identification_tauJetBDTinputs_trkAvgDist {
+        hist Tau_TauCR_Identification_RNNLoose_phi {
           algorithm = tauHists_Chi2NDF
           display = StatBox
-        }
+        } 
 
-        hist Tau_TauCR_Identification_tauJetBDTinputs_SumPtTrkFrac {
+        hist Tau_TauCR_Identification_RNNLoose_eta {
           algorithm = tauHists_Chi2NDF
-          display = StatBox,LogY
-        }
-
-        hist Tau_TauCR_Identification_tauJetBDTinputs_etOverPtLeadTrk {
-#          algorithm = tauHists_Chi2NDF
-          display = StatBox,LogY
-        }
+          display = StatBox
+        } 
 
-        hist Tau_TauCR_Identification_tauJetBDTinputs_absipSigLeadTrk {
+        hist Tau_TauCR_Identification_RNNLoose_et {
           algorithm = tauHists_Chi2NDF
-          display = StatBox,LogY
-        }
-
-        hist Tau_TauCR_Identification_tauJetBDTinputs_trFlightPathSig {
-#          algorithm = tauHists_Chi2NDF
           display = StatBox
-        }
-
-        hist Tau_TauCR_Identification_tauJetBDTinputs_massTrkSys {
-          algorithm = tauHists_Chi2NDF 
-          display = StatBox,LogY
-        }
+        } 
 
-        hist Tau_TauCR_Identification_tauJetBDTinputs_EMPOverTrkSysP {
-#          algorithm = tauHists_Chi2NDF 
+        hist Tau_TauCR_Identification_RNNLoose_NumTracks {
+          algorithm = tauHists_Chi2NDF
           display = StatBox
-        }
-
-        hist Tau_TauCR_Identification_tauJetBDTinputs_mEflowApprox {
-#          algorithm = tauHists_Chi2NDF 
-          display = StatBox,LogY
-        }
+        } 
+      }
 
-        hist Tau_TauCR_Identification_tauJetBDTinputs_ptRatioEflowApprox {
-#          algorithm = tauHists_Chi2NDF 
+      dir RNNMedium {
+        output = Tau/TauCR/Identification/RNNMedium
+        algorithm = tauHists_Chi2NDF
+        hist all_in_dir {
           display = StatBox
         }
 
-        hist Tau_TauCR_Identification_tauJetBDTinputs_ptIntermediateAxis {
+        hist Tau_TauCR_Identification_RNNMedium_phi {
           algorithm = tauHists_Chi2NDF
-          display = StatBox,LogY
-        }
-      }
-
-      dir EleVetoBDTinputs {
-	output = Tau/TauCR/Identification/EleVetoBDTinputs
-	algoithm = tauHists_Chi2NDF_noEmpty
-
-        hist Tau_TauCR_Identification_EleVetoBDTinputs_etHotShotWinOverPtLeadTrk {
-#          algorithm = tauHists_Chi2NDF 
           display = StatBox
-        }
+        } 
 
-        hist Tau_TauCR_Identification_EleVetoBDTinputs_EMFracFixed {
-#          algorithm = tauHists_Chi2NDF 
+        hist Tau_TauCR_Identification_RNNMedium_eta {
+          algorithm = tauHists_Chi2NDF
           display = StatBox
-        }
+        } 
 
-        hist Tau_TauCR_Identification_EleVetoBDTinputs_hadLeakFracFixed {
-#          algorithm = tauHists_Chi2NDF 
+        hist Tau_TauCR_Identification_RNNMedium_et {
+          algorithm = tauHists_Chi2NDF
           display = StatBox
-        }
+        } 
 
-        hist Tau_TauCR_Identification_EleVetoBDTinputs_PSSFrac {
-#          algorithm = tauHists_Chi2NDF 
+        hist Tau_TauCR_Identification_RNNMedium_NumTracks {
+          algorithm = tauHists_Chi2NDF
           display = StatBox
-        }
-      }
-
-      dir BDTLoose15GeV {
-	output = Tau/TauCR/Identification/BDTLoose15GeV
-	algoithm = tauHists_Chi2NDF
-
-	hist Tau_TauCR_Identification_BDTLoose15GeV_et {
-          algorithm = tauHists_Chi2NDF 
-	  display = StatBox,LogY
-	}
-
-	hist Tau_TauCR_Identification_BDTLoose15GeV_eta {
-          algorithm = tauHists_Chi2NDF 
-	  display = StatBox
-	}
-
-	hist Tau_TauCR_Identification_BDTLoose15GeV_phi {
-          algorithm = tauHists_Chi2NDF 
-	  display = StatBox
-	}
-
-	hist Tau_TauCR_Identification_BDTLoose15GeV_numTracks {
-          algorithm = tauHists_Chi2NDF 
-	  display = StatBox,LogY
-	}
-
-	hist Tau_TauCR_Identification_BDTLoose15GeV_nCluster {
-          algorithm = tauHists_Chi2NDF/Loose 
-	  display = StatBox,LogY
-	}
-
-	hist Tau_TauCR_Identification_BDTLoose15GeV_PanMode {
-          algorithm = tauHists_Chi2NDF 
-	  display = StatBox,LogY
-	}
-
+        } 
       }
     }
 
@@ -1139,12 +1199,17 @@ dir Tau {
         display = StatBox
       }
 
-      hist Tau_TauCR_SubStructure_nShot {
-        algorithm = tauHists_Chi2NDF 
+      hist Tau_TauCR_SubStructure_shots_pt3 {
+        algorithm = tauHists_Chi2NDF_noEmpty 
         display = StatBox,LogY
-      }  
-      
-      hist Tau_TauCR_SubStructure_InvMassEffClusters {
+      }
+
+      hist Tau_TauCR_SubStructure_BDTscoreAsP0 {
+        algorithm = tauHists_Chi2NDF_noEmpty 
+        display = StatBox
+      }
+
+      hist Tau_TauCR_SubStructure_EMFracTrk {
         algorithm = tauHists_Chi2NDF_noEmpty 
         display = StatBox
       }
@@ -1159,12 +1224,7 @@ dir Tau {
         display = StatBox
       }
 
-      hist Tau_TauCR_SubStructure_shots_pt3 {
-        algorithm = tauHists_Chi2NDF_noEmpty 
-        display = StatBox,LogY
-      }
-
-      hist Tau_TauCR_SubStructure_EMFracTrk {
+      hist Tau_TauCR_SubStructure_InvMassEffClusters {
         algorithm = tauHists_Chi2NDF_noEmpty 
         display = StatBox
       }
@@ -1174,27 +1234,37 @@ dir Tau {
         display = StatBox,LogY
       }
 
-      hist Tau_TauCR_SubStructure_BDTscoreAsP0 {
-        algorithm = tauHists_Chi2NDF_noEmpty 
-        display = StatBox
+      hist Tau_TauCR_SubStructure_nShot {
+        algorithm = tauHists_Chi2NDF 
+        display = StatBox,LogY
+      }  
+
+      hist Tau_TauCR_SubStructure_PSSFracEffCluster {
+         algorithm = tauHists_Chi2NDF 
+         display = StatBox
       }
- 
+
+      hist Tau_TauCR_SubStructure_ptRatioApprox {
+         algorithm = tauHists_Chi2NDF 
+         display = StatBox
+      }
+
       hist Tau_TauCR_SubStructure_PanMode {
         algorithm = tauHists_Chi2NDF 
         display = StatBox
       }
 
-      hist Tau_TauCR_SubStructure_PanPt {
+      hist Tau_TauCR_SubStructure_PanEta {
         algorithm = tauHists_Chi2NDF 
         display = StatBox
       }
 
-      hist Tau_TauCR_SubStructure_PanEta {
+      hist Tau_TauCR_SubStructure_PanPhi {
         algorithm = tauHists_Chi2NDF 
         display = StatBox
       }
 
-      hist Tau_TauCR_SubStructure_PanPhi {
+      hist Tau_TauCR_SubStructure_PanPt {
         algorithm = tauHists_Chi2NDF 
         display = StatBox
       }
@@ -1209,38 +1279,17 @@ dir Tau {
       display = StatBox
     }
 
-    hist Tau_TauE_tauPhiVsEta {
-      algorithm = tauHists_Chi2Scatter
-      display = StatBox
-    }
-
-    hist Tau_TauE_tauEtaVsLB {
-      algorithm = tauHists_Chi2Scatter
-      display = StatBox
-    }
-
-    hist Tau_TauE_tauPhiVsLB {
-      algorithm = tauHists_Chi2Scatter
-      display = StatBox
-    }
-
-    hist Tau_TauE_tauEtaVsLBet15BDTLoose {
-      algorithm = tauHists_Chi2Scatter/Loose
-      display = StatBox
-    }
-
-    hist Tau_TauE_tauPhiVsLBet15BDTLoose {
-      algorithm = tauHists_Chi2Scatter/Loose
-      display = StatBox
+    hist Tau_TauE_tauCharge {
+      algorithm = tauHists_Chi2NDF_noEmpty
+      display = StatBox,LogY
     }
 
-    hist Tau_TauE_nTauCandidates {
+    hist Tau_TauE_RNNJetScore {
       algorithm = tauHists_Chi2NDF
       display = StatBox,LogY
     }
 
-    hist Tau_TauE_tauCharge {
-      algorithm = tauHists_Chi2NDF_noEmpty
+    hist Tau_TauE_RNNJetScoreSigTrans {
       display = StatBox,LogY
     }
 
@@ -1254,10 +1303,34 @@ dir Tau {
       display = StatBox
     } 
 
+    hist Tau_TauE_tauEtaVsLB {
+      algorithm = tauHists_Chi2Scatter
+      display = StatBox
+    }
+
+
     hist Tau_TauE_tauPhi {
       algorithm = tauHists_Chi2NDF
       display = StatBox
     } 
+
+
+    hist Tau_TauE_tauPhiVsEta {
+      algorithm = tauHists_Chi2Scatter
+      display = StatBox
+    }
+
+    hist Tau_TauE_tauPhiVsLB {
+      algorithm = tauHists_Chi2Scatter
+      display = StatBox
+    }
+
+
+    hist Tau_TauE_nTauCandidates {
+      algorithm = tauHists_Chi2NDF
+      display = StatBox,LogY
+    }
+
    
     dir Calo {
       output = Tau/TauE/Calo
@@ -1266,12 +1339,6 @@ dir Tau {
         display = StatBox
       }
 
-      hist Tau_TauE_Calo_jetSeedPt {
-        algorithm = tauHists_Chi2NDF
-        display = StatBox
-      }
-
- 
       hist Tau_TauE_Calo_jetSeedEta {
         algorithm = tauHists_Chi2NDF
         display = StatBox
@@ -1282,14 +1349,10 @@ dir Tau {
         display = StatBox
       }      
 
-      hist Tau_TauE_Calo_etEMAtEMScale {
-        algorithm = tauHists_Chi2NDF_noEmpty
-        display = StatBox,LogY
-      }
 
-      hist Tau_TauE_Calo_etHadAtEMScale {
-        algorithm = tauHists_Chi2NDF_noEmpty
-        display = StatBox,LogY
+      hist Tau_TauE_Calo_jetSeedPt {
+        algorithm = tauHists_Chi2NDF
+        display = StatBox
       }
 
       hist Tau_TauE_Calo_EMRadius {
@@ -1302,6 +1365,11 @@ dir Tau {
         display = StatBox,LogY
       } 
 
+      hist Tau_TauE_Calo_stripWidth2 {
+        algorithm = tauHists_Chi2NDF_noEmpty
+        display = StatBox,LogY
+      }
+
       hist Tau_TauE_Calo_isolFrac {
         algorithm = tauHists_Chi2NDF_noEmpty
         display = StatBox
@@ -1312,7 +1380,12 @@ dir Tau {
         display = StatBox,LogY
       }
 
-      hist Tau_TauE_Calo_stripWidth2 {
+      hist Tau_TauE_Calo_etEMAtEMScale {
+        algorithm = tauHists_Chi2NDF_noEmpty
+        display = StatBox,LogY
+      }
+
+      hist Tau_TauE_Calo_etHadAtEMScale {
         algorithm = tauHists_Chi2NDF_noEmpty
         display = StatBox,LogY
       }
@@ -1326,109 +1399,92 @@ dir Tau {
         algorithm = tauHists_Chi2Scatter_noEmpty
 	display = StatBox
       }
-    }
 
-    dir Track {
-      output = Tau/TauE/Track
-      algorithm = tauHists_Chi2NDF/noMatch
-  
-      hist all_in_dir {
+      hist Tau_TauE_Calo_centralityFraction {
+#        algorithm = tauHists_Chi2NDF
         display = StatBox
       }
 
-      hist Tau_TauE_Track_pT {
+      hist Tau_TauE_Calo_dRmax {
         algorithm = tauHists_Chi2NDF
         display = StatBox,LogY
       }
 
-      hist Tau_TauE_Track_eta {
-        algorithm = tauHists_Chi2NDF/Loose
+      hist Tau_TauE_Calo_eta {
+        algorithm = tauHists_Chi2NDF
         display = StatBox
       } 
 
-      hist Tau_TauE_Track_phi {
+      hist Tau_TauE_Calo_phi {
         algorithm = tauHists_Chi2NDF
         display = StatBox
       } 
 
-      hist Tau_TauE_Track_leadTrkPt {
+      hist Tau_TauE_Calo_trkAvgDist {
         algorithm = tauHists_Chi2NDF
-        display = StatBox,LogY
+        display = StatBox
       }
 
-      hist Tau_TauE_Track_nHighPTtaus {
-	algorithm = tauHists_Chi2NDF
-	display = StatBox,LogY
-      }
 
-      hist Tau_TauE_Track_dRJetSeedAxis {
-	display = StatBox
-      }
+    }
 
-      hist Tau_TauE_Track_d0 {
-        algorithm = tauHists_Chi2NDF_noEmpty/veryLoose
-        display = StatBox,<AxisRange(-5,5,"X")>,LogY
-      }
+    dir Track {
+      output = Tau/TauE/Track
+      algorithm = tauHists_Chi2NDF/noMatch
 
-      hist Tau_TauE_Track_z0TJVA {
-        display = StatBox,<AxisRange(-35,35,"X")>,LogY
+  
+      hist all_in_dir {
+        display = StatBox
       }
 
-      hist Tau_TauE_Track_z0PriVtx {
-        display = StatBox,<AxisRange(-35,35,"X")>,LogY
+      hist Tau_TauE_Track_leadTrkPt {
+        algorithm = tauHists_Chi2NDF
+        display = StatBox,LogY
       }
 
       hist Tau_TauE_Track_trkWidth2 {
         algorithm = tauHists_Chi2NDF
         display = StatBox,LogY
       }
-  
-      hist Tau_TauE_Track_rConv {
-        display = StatBox,LogY
-      }
-  
-      hist Tau_TauE_Track_rConvII {
+      hist Tau_TauE_Track_trkWidth2 {
+        algorithm = tauHists_Chi2NDF
         display = StatBox,LogY
       }
-  
+
       hist Tau_TauE_Track_ipZ0SinThetaSigLeadTrk {
         algorithm = tauHists_Chi2NDF_noEmpty
         display = StatBox
       }
 
-      hist Tau_TauE_Track_leadTrackDeltaEta {
-        algorithm = tauHists_Chi2NDF
+      hist Tau_TauE_Track_etOverPtLeadTrk {
+#       algorithm = tauHists_Chi2NDF
         display = StatBox,LogY
       }
-  
-      hist Tau_TauE_Track_leadTrackDeltaPhi {
+
+      hist Tau_TauE_Track_ipSigLeadTrk {
         algorithm = tauHists_Chi2NDF
         display = StatBox,LogY
       }
-  
-      hist Tau_TauE_Track_eProbabilityHT {
-        display = StatBox
-      }
-  
-      hist Tau_TauE_Track_numberOfPixelHits {
-        display = StatBox,LogY
-      }
 
-      hist Tau_TauE_Track_numberOfPixelSharedHits {
+      hist Tau_TauE_Track_massTrkSys {
+        algorithm = tauHists_Chi2NDF 
         display = StatBox,LogY
       }
 
-      hist Tau_TauE_Track_numberOfInnermostPixelLayerHits {
-        display = StatBox,LogY
+      hist Tau_TauE_Track_trFlightPathSig {
+#       algorithm = tauHists_Chi2NDF
+        display = StatBox       
       }
 
       hist Tau_TauE_Track_numberOfSCTHits {
         display = StatBox,LogY
       }  
 
-      hist Tau_TauE_Track_numberOfSCTSharedHits {
+
+      hist Tau_TauE_Track_numberOfPixelHits {
         display = StatBox,LogY
-      }  
+      }
+
 
       hist Tau_TauE_Track_numberOfTRTHits {
         display = StatBox,LogY
@@ -1445,187 +1501,118 @@ dir Tau {
       hist Tau_TauE_Track_numberOfTRTOutliers {
         display = StatBox,LogY
       }
-  
-      hist Tau_TauE_Track_z0VsLB {
-	display = StatBox,<AxisRange(-35,35,"Y")>
-      }
- 
-    }
 
-    dir Identification {
-      output = Tau/TauE/Identification
-      algorthm = tauHists_Chi2NDF_noEmpty
-      hist all_in_dir {
-        display = StatBox
-      }
 
-      hist Tau_TauE_Identification_tauBDTLoose {
-        algorithm = tauHists_Chi2NDF/Loose 
-        display = StatBox 
+      hist Tau_TauE_Track_d0 {
+        algorithm = tauHists_Chi2NDF_noEmpty/veryLoose
+        display = StatBox,<AxisRange(-5,5,"X")>,LogY
       }
 
-      hist Tau_TauE_Identification_tauBDTMedium {
+      hist Tau_TauE_Track_eta {
         algorithm = tauHists_Chi2NDF/Loose
-        display = StatBox 
-      }
+        display = StatBox
+      } 
 
-      hist Tau_TauE_Identification_tauBDTTight {
-        algorithm = tauHists_Chi2NDF 
-        display = StatBox 
+      hist Tau_TauE_Track_pT {
+        algorithm = tauHists_Chi2NDF
+        display = StatBox,LogY
       }
 
-      hist Tau_TauE_Identification_BDTEleScoreSigTrans {
-        algorithm = tauHists_Chi2NDF_noEmpty
+
+      hist Tau_TauE_Track_phi {
+        algorithm = tauHists_Chi2NDF
+        display = StatBox
+      } 
+
+      hist Tau_TauE_Track_z0 {
+        algorithm = tauHists_Chi2NDF
         display = StatBox
-       }
+      } 
 
-      hist Tau_TauE_Identification_BDTJetScore {
+      hist Tau_TauE_Track_nHighPtTaus {
 	algorithm = tauHists_Chi2NDF
 	display = StatBox,LogY
       }
 
-      hist Tau_TauE_Identification_BDTJetScoreSigTrans {
-	display = StatBox,LogY
-      }
 
-      hist Tau_TauE_Identification_muonVeto {
+ 
+    }
+
+    dir Identification {
+      output = Tau/TauE/Identification
+      algorthm = tauHists_Chi2NDF_noEmpty
+      hist all_in_dir {
         display = StatBox
       }
 
-      hist Tau_TauE_Identification_eleBDTMedium {
-        algorithm = tauHists_Chi2NDF/veryLoose
-        display = StatBox
+      hist Tau_TauE_Identification_tauRNNLoose {
+        algorithm = tauHists_Chi2NDF/Loose 
+        display = StatBox 
       }
 
-      hist Tau_TauE_Identification_eleBDTTight {
+      hist Tau_TauE_Identification_tauRNNMedium {
         algorithm = tauHists_Chi2NDF/Loose
-        display = StatBox
+        display = StatBox 
       }
 
-      dir tauJetBDTinputs {
-	output = Tau/TauE/Identification/tauJetBDTinputs
-	algoithm = tauHists_Chi2NDF_noEmpty
+      hist Tau_TauE_Identification_muonVeto {
+        display = StatBox
+      }
 
-        hist Tau_TauE_Identification_tauJetBDTinputs_CentFrac {
-#          algorithm = tauHists_Chi2NDF
+      dir RNNLoose {
+        output = Tau/TauE/Identification/RNNLoose
+        algorithm = tauHists_Chi2NDF
+        hist all_in_dir {
           display = StatBox
         }
 
-        hist Tau_TauE_Identification_tauJetBDTinputs_dRmax {
-          algorithm = tauHists_Chi2NDF
-          display = StatBox,LogY
-        }
-
-        hist Tau_TauE_Identification_tauJetBDTinputs_trkAvgDist {
+        hist Tau_TauE_Identification_RNNLoose_phi {
           algorithm = tauHists_Chi2NDF
           display = StatBox
-        }
+        } 
 
-        hist Tau_TauE_Identification_tauJetBDTinputs_SumPtTrkFrac {
+        hist Tau_TauE_Identification_RNNLoose_eta {
           algorithm = tauHists_Chi2NDF
-          display = StatBox,LogY
-        }
-
-        hist Tau_TauE_Identification_tauJetBDTinputs_etOverPtLeadTrk {
-#          algorithm = tauHists_Chi2NDF
-          display = StatBox,LogY
-        }
+          display = StatBox
+        } 
 
-        hist Tau_TauE_Identification_tauJetBDTinputs_absipSigLeadTrk {
+        hist Tau_TauE_Identification_RNNLoose_et {
           algorithm = tauHists_Chi2NDF
-          display = StatBox,LogY
-        }
-
-        hist Tau_TauE_Identification_tauJetBDTinputs_trFlightPathSig {
-#          algorithm = tauHists_Chi2NDF
           display = StatBox
-        }
-
-        hist Tau_TauE_Identification_tauJetBDTinputs_massTrkSys {
-          algorithm = tauHists_Chi2NDF 
-          display = StatBox,LogY
-        }
+        } 
 
-        hist Tau_TauE_Identification_tauJetBDTinputs_EMPOverTrkSysP {
-#          algorithm = tauHists_Chi2NDF 
+        hist Tau_TauE_Identification_RNNLoose_NumTracks {
+          algorithm = tauHists_Chi2NDF
           display = StatBox
-        }
-
-        hist Tau_TauE_Identification_tauJetBDTinputs_mEflowApprox {
-#          algorithm = tauHists_Chi2NDF 
-          display = StatBox,LogY
-        }
+        } 
+      }
 
-        hist Tau_TauE_Identification_tauJetBDTinputs_ptRatioEflowApprox {
-#          algorithm = tauHists_Chi2NDF 
+      dir RNNMedium {
+        output = Tau/TauE/Identification/RNNMedium
+        algorithm = tauHists_Chi2NDF
+        hist all_in_dir {
           display = StatBox
         }
 
-        hist Tau_TauE_Identification_tauJetBDTinputs_ptIntermediateAxis {
+        hist Tau_TauE_Identification_RNNMedium_phi {
           algorithm = tauHists_Chi2NDF
-          display = StatBox,LogY
-        }
-      }
-
-      dir EleVetoBDTinputs {
-	output = Tau/TauE/Identification/EleVetoBDTinputs
-	algoithm = tauHists_Chi2NDF_noEmpty
-
-        hist Tau_TauE_Identification_EleVetoBDTinputs_etHotShotWinOverPtLeadTrk {
-#          algorithm = tauHists_Chi2NDF 
           display = StatBox
-        }
+        } 
 
-        hist Tau_TauE_Identification_EleVetoBDTinputs_EMFracFixed {
-#          algorithm = tauHists_Chi2NDF 
+        hist Tau_TauE_Identification_RNNMedium_eta {
+          algorithm = tauHists_Chi2NDF
           display = StatBox
-        }
+        } 
 
-        hist Tau_TauE_Identification_EleVetoBDTinputs_hadLeakFracFixed {
-#          algorithm = tauHists_Chi2NDF 
+        hist Tau_TauE_Identification_RNNMedium_et {
+          algorithm = tauHists_Chi2NDF
           display = StatBox
-        }
+        } 
 
-        hist Tau_TauE_Identification_EleVetoBDTinputs_PSSFrac {
-#          algorithm = tauHists_Chi2NDF 
+        hist Tau_TauE_Identification_RNNMedium_NumTracks {
+          algorithm = tauHists_Chi2NDF
           display = StatBox
-        }
-      }
-
-      dir BDTLoose15GeV {
-	output = Tau/TauE/Identification/BDTLoose15GeV
-	algoithm = tauHists_Chi2NDF
-
-	hist Tau_TauE_Identification_BDTLoose15GeV_et {
-          algorithm = tauHists_Chi2NDF 
-	  display = StatBox,LogY
-	}
-
-	hist Tau_TauE_Identification_BDTLoose15GeV_eta {
-          algorithm = tauHists_Chi2NDF 
-	  display = StatBox
-	}
-
-	hist Tau_TauE_Identification_BDTLoose15GeV_phi {
-          algorithm = tauHists_Chi2NDF 
-	  display = StatBox
-	}
-
-	hist Tau_TauE_Identification_BDTLoose15GeV_numTracks {
-          algorithm = tauHists_Chi2NDF 
-	  display = StatBox,LogY
-	}
-
-	hist Tau_TauE_Identification_BDTLoose15GeV_nCluster {
-          algorithm = tauHists_Chi2NDF/Loose 
-	  display = StatBox,LogY
-	}
-
-	hist Tau_TauE_Identification_BDTLoose15GeV_PanMode {
-          algorithm = tauHists_Chi2NDF 
-	  display = StatBox,LogY
-	}
-
+        } 
       }
     }
 
@@ -1637,12 +1624,17 @@ dir Tau {
         display = StatBox
       }
 
-      hist Tau_TauE_SubStructure_nShot {
-        algorithm = tauHists_Chi2NDF 
+      hist Tau_TauE_SubStructure_shots_pt3 {
+        algorithm = tauHists_Chi2NDF_noEmpty 
         display = StatBox,LogY
-      }  
-      
-      hist Tau_TauE_SubStructure_InvMassEffClusters {
+      }
+
+      hist Tau_TauE_SubStructure_BDTscoreAsP0 {
+        algorithm = tauHists_Chi2NDF_noEmpty 
+        display = StatBox
+      }
+
+      hist Tau_TauE_SubStructure_EMFracTrk {
         algorithm = tauHists_Chi2NDF_noEmpty 
         display = StatBox
       }
@@ -1657,12 +1649,7 @@ dir Tau {
         display = StatBox
       }
 
-      hist Tau_TauE_SubStructure_shots_pt3 {
-        algorithm = tauHists_Chi2NDF_noEmpty 
-        display = StatBox,LogY
-      }
-
-      hist Tau_TauE_SubStructure_EMFracTrk {
+      hist Tau_TauE_SubStructure_InvMassEffClusters {
         algorithm = tauHists_Chi2NDF_noEmpty 
         display = StatBox
       }
@@ -1672,34 +1659,43 @@ dir Tau {
         display = StatBox,LogY
       }
 
-      hist Tau_TauE_SubStructure_BDTscoreAsP0 {
-        algorithm = tauHists_Chi2NDF_noEmpty 
-        display = StatBox
+      hist Tau_TauE_SubStructure_nShot {
+        algorithm = tauHists_Chi2NDF 
+        display = StatBox,LogY
+      }  
+
+      hist Tau_TauE_SubStructure_PSSFracEffCluster {
+         algorithm = tauHists_Chi2NDF 
+         display = StatBox
       }
- 
+
+      hist Tau_TauE_SubStructure_ptRatioApprox {
+         algorithm = tauHists_Chi2NDF 
+         display = StatBox
+      }
+
       hist Tau_TauE_SubStructure_PanMode {
         algorithm = tauHists_Chi2NDF 
         display = StatBox
       }
 
-      hist Tau_TauE_SubStructure_PanPt {
+      hist Tau_TauE_SubStructure_PanEta {
         algorithm = tauHists_Chi2NDF 
         display = StatBox
       }
 
-      hist Tau_TauE_SubStructure_PanEta {
+      hist Tau_TauE_SubStructure_PanPhi {
         algorithm = tauHists_Chi2NDF 
         display = StatBox
       }
 
-      hist Tau_TauE_SubStructure_PanPhi {
+      hist Tau_TauE_SubStructure_PanPt {
         algorithm = tauHists_Chi2NDF 
         display = StatBox
       }
     }
   }
 
-
   dir Trigger {
     output = Tau/Trigger
     algorithm = tauHists_Chi2NDF_noEmpty
@@ -1707,630 +1703,269 @@ dir Tau {
       display = StatBox
     }
 
-    hist TriggerChains {
-      algorithm = tauHists_Chi2NDF/noMatch
-      display = StatBox
-    }
-
-    hist TriggerChains_LB {
-      algorithm = tauHists_Chi2NDF/noMatch
-      display = StatBox
-    }
-
-    dir TauTrig {
-      output = Tau/Trigger/TauTrig
-      algorithm = tauHists_Chi2NDF_noEmpty
+    dir EleTrig {
+      output = Tau/Trigger/EleTrig
+      algorithm = tauHists_Chi2NDF
       hist all_in_dir {
         display = StatBox
       }
 
-      hist Tau_TauTrig_tauPhiVsEta {
-        algorithm = tauHists_Chi2Scatter
+      hist emTriggered_tauCharge {
+        algorithm = tauHists_Chi2NDF_noEmpty
         display = StatBox
-      }
+      } 
 
-      hist Tau_TauTrig_tauEtaVsLB {
-        algorithm = tauHists_Chi2Scatter
-        display = StatBox
+      hist emTriggered_RNNJetScore {
+        algorithm = tauHists_Chi2NDF
+        display = StatBox,LogY
       }
 
-      hist Tau_TauTrig_tauPhiVsLB {
-        algorithm = tauHists_Chi2Scatter
-        display = StatBox
+      hist emTriggered_RNNJetScoreSigTrans {
+        display = StatBox,LogY
       }
 
-      hist Tau_TauTrig_tauEtaVsLBet15BDTLoose {
-        algorithm = tauHists_Chi2Scatter/Loose
+      hist emTriggered_tauEt {
+        algorithm = tauHists_Chi2NDF
+        display = StatBox,LogX
+      }    
+
+      hist emTriggered_tauEta {
+        algorithm = tauHists_Chi2NDF
         display = StatBox
       }
 
-      hist Tau_TauTrig_tauPhiVsLBet15BDTLoose {
+      hist emTriggered_tauEtaVsLB {
         algorithm = tauHists_Chi2Scatter/Loose
         display = StatBox
       }
 
-      hist Tau_TauTrig_nTauCandidates {
+      hist emTriggered_tauPhi {
         algorithm = tauHists_Chi2NDF
-        display = StatBox,LogY
+        display = StatBox
       }
 
-      hist Tau_TauTrig_tauCharge {
-        algorithm = tauHists_Chi2NDF_noEmpty
-        display = StatBox,LogY
-      }
+      hist emTriggered_tauPhiVsEta {
+        algorithm = tauHists_Chi2Scatter
+        display = StatBox
+      }  
 
-      hist Tau_TauTrig_tauEt {
-        algorithm = tauHists_Chi2NDF
-        display = StatBox,LogY
-      }
+      hist emTriggered_tauPhiVsLB {
+        algorithm = tauHists_Chi2Scatter
+        display = StatBox
+      }    
 
-      hist Tau_TauTrig_tauEta {
-        algorithm = tauHists_Chi2NDF
+      hist emTriggered_nTauPerLB {
+        algorithm = tauHists_Chi2NDF 
         display = StatBox
-      } 
+      }
 
-      hist Tau_TauTrig_tauPhi {
+      hist emTriggered_tauNumTracks {
         algorithm = tauHists_Chi2NDF
         display = StatBox
-      } 
-   
-      dir Calo {
-        output = Tau/Trigger/TauTrig/Calo
-        algorithm = tauHists_Chi2NDF_noEmpty
-        hist all_in_dir {
-          display = StatBox
-        }
-
-        hist Tau_TauTrig_Calo_jetSeedPt {
-          algorithm = tauHists_Chi2NDF
-          display = StatBox
-        }
-
- 
-        hist Tau_TauTrig_Calo_jetSeedEta {
-          algorithm = tauHists_Chi2NDF
-          display = StatBox
-        }
-
-        hist Tau_TauTrig_Calo_jetSeedPhi {
-          algorithm = tauHists_Chi2NDF
-          display = StatBox
-        }      
-
-        hist Tau_TauTrig_Calo_etEMAtEMScale {
-          algorithm = tauHists_Chi2NDF_noEmpty
-          display = StatBox,LogY
-        }
-
-        hist Tau_TauTrig_Calo_etHadAtEMScale {
-          algorithm = tauHists_Chi2NDF_noEmpty
-          display = StatBox,LogY
-        }
-
-        hist Tau_TauTrig_Calo_EMRadius {
-          algorithm = tauHists_Chi2NDF_noEmpty
-          display = StatBox,LogY
-        }
-
-        hist Tau_TauTrig_Calo_hadRadius {
-          algorithm = tauHists_Chi2NDF_noEmpty
-          display = StatBox,LogY
-        } 
-
-        hist Tau_TauTrig_Calo_isolFrac {
-          algorithm = tauHists_Chi2NDF_noEmpty
-          display = StatBox
-        }  
-
-        hist Tau_TauTrig_Calo_nStrip {
-          algorithm = tauHists_Chi2NDF
-          display = StatBox,LogY
-        }
-
-        hist Tau_TauTrig_Calo_stripWidth2 {
-          algorithm = tauHists_Chi2NDF_noEmpty
-          display = StatBox,LogY
-        }
- 
-        hist Tau_TauTrig_Calo_CentFracVsLB {
-          algorithm = tauHists_Chi2Scatter_noEmpty
-          display = StatBox
-        }
-
-        hist Tau_TauTrig_Calo_isolFracVsLB {
-          algorithm = tauHists_Chi2Scatter_noEmpty
-          display = StatBox
-        }
       }
 
-      dir Track {
-        output = Tau/Trigger/TauTrig/Track
-        algorithm = tauHists_Chi2NDF/noMatch
-  
-        hist all_in_dir {
-          display = StatBox
-        }
-
-        hist Tau_TauTrig_Track_pT {
-          algorithm = tauHists_Chi2NDF
-          display = StatBox,LogY
-        }
-
-        hist Tau_TauTrig_Track_eta {
-          algorithm = tauHists_Chi2NDF/Loose
-          display = StatBox
-        } 
-
-        hist Tau_TauTrig_Track_phi {
-          algorithm = tauHists_Chi2NDF
-          display = StatBox
-        } 
-
-        hist Tau_TauTrig_Track_leadTrkPt {
-          algorithm = tauHists_Chi2NDF
-          display = StatBox,LogY
-        }
-
-        hist Tau_TauTrig_Track_nHighPTtaus {
-          algorithm = tauHists_Chi2NDF
-          display = StatBox,LogY
-        }
-
-        hist Tau_TauTrig_Track_dRJetSeedAxis {
-          display = StatBox
-        }
-
-        hist Tau_TauTrig_Track_d0 {
-          algorithm = tauHists_Chi2NDF_noEmpty/veryLoose
-          display = StatBox,<AxisRange(-5,5,"X")>,LogY
-        }
-
-        hist Tau_TauTrig_Track_z0TJVA {
-          display = StatBox,<AxisRange(-35,35,"X")>,LogY
-        }
-
-        hist Tau_TauTrig_Track_z0PriVtx {
-          display = StatBox,<AxisRange(-35,35,"X")>,LogY
-        }
-
-        hist Tau_TauTrig_Track_trkWidth2 {
-          algorithm = tauHists_Chi2NDF
-          display = StatBox,LogY
-        }
-  
-        hist Tau_TauTrig_Track_rConv {
-          display = StatBox,LogY
-        }
-  
-        hist Tau_TauTrig_Track_rConvII {
-          display = StatBox,LogY
-        }
-  
-        hist Tau_TauTrig_Track_ipZ0SinThetaSigLeadTrk {
-          algorithm = tauHists_Chi2NDF_noEmpty
-          display = StatBox
-        }
-
-        hist Tau_TauTrig_Track_leadTrackDeltaEta {
-          algorithm = tauHists_Chi2NDF
-          display = StatBox,LogY
-        }
-  
-        hist Tau_TauTrig_Track_leadTrackDeltaPhi {
-          algorithm = tauHists_Chi2NDF
-          display = StatBox,LogY
-        }
-  
-        hist Tau_TauTrig_Track_eProbabilityHT {
-          display = StatBox
-        }
-  
-        hist Tau_TauTrig_Track_numberOfPixelHits {
-          display = StatBox,LogY
-        }
-
-        hist Tau_TauTrig_Track_numberOfPixelSharedHits {
-          display = StatBox,LogY
-        }
-
-        hist Tau_TauTrig_Track_numberOfInnermostPixelLayerHits {
-          display = StatBox,LogY
-        }
-
-        hist Tau_TauTrig_Track_numberOfSCTHits {
-          display = StatBox,LogY
-        }  
-
-        hist Tau_TauTrig_Track_numberOfSCTSharedHits {
-          display = StatBox,LogY
-        }  
-
-        hist Tau_TauTrig_Track_numberOfTRTHits {
-          display = StatBox,LogY
-        }
-
-        hist Tau_TauTrig_Track_numberOfTRTHighThresholdHits {
-          display = StatBox,LogY
-        }   
-
-        hist Tau_TauTrig_Track_numberOfTRTHighThresholdOutliers {
-          display = StatBox,LogY
-        }
-
-        hist Tau_TauTrig_Track_numberOfTRTOutliers {
-          display = StatBox,LogY
-        }
-  
-        hist Tau_TauTrig_Track_z0VsLB {
-          display = StatBox,<AxisRange(-35,35,"Y")>
-        }
- 
+      hist emTriggered_nCluster {
+        algorithm = tauHists_Chi2NDF/veryLoose
+        display = StatBox
       }
 
-      dir Identification {
-        output = Tau/Trigger/TauTrig/Identification
-        algorthm = tauHists_Chi2NDF_noEmpty
-        hist all_in_dir {
-          display = StatBox
-        }
-
-        hist Tau_TauTrig_Identification_tauBDTLoose {
-          algorithm = tauHists_Chi2NDF/Loose 
-          display = StatBox 
-        }
-
-        hist Tau_TauTrig_Identification_tauBDTMedium {
-          algorithm = tauHists_Chi2NDF/Loose
-          display = StatBox 
-        }
-
-        hist Tau_TauTrig_Identification_tauBDTTight {
-          algorithm = tauHists_Chi2NDF 
-          display = StatBox 
-        }
-
-        hist Tau_TauTrig_Identification_BDTEleScoreSigTrans {
-          algorithm = tauHists_Chi2NDF_noEmpty
-          display = StatBox
-         }
+      hist emTriggered_tauEtVsEta {
+        algorithm = tauHists_Chi2Scatter
+        display = StatBox
+      }    
 
-        hist Tau_TauTrig_Identification_BDTJetScore {
-          algorithm = tauHists_Chi2NDF
-          display = StatBox,LogY
-        }
+      hist emTriggered_tauEtVsPhi {
+        algorithm = tauHists_Chi2Scatter
+        display = StatBox
+      }    
 
-        hist Tau_TauTrig_Identification_BDTJetScoreSigTrans {
-          display = StatBox,LogY
-        }
+      hist emTriggered_nTauCandidates {
+        algorithm = tauHists_Chi2NDF
+        display = StatBox
+      }
 
-        hist Tau_TauTrig_Identification_muonVeto {
-          display = StatBox
-        }
+      hist emTriggered_nHighPtTauCandidates {
+        algorithm = tauHists_Chi2NDF
+        display = StatBox
+      }
 
-        hist Tau_TauTrig_Identification_eleBDTMedium {
-          algorithm = tauHists_Chi2NDF/veryLoose
-          display = StatBox
-        }
+    }
 
-        hist Tau_TauTrig_Identification_eleBDTTight {
-          algorithm = tauHists_Chi2NDF/Loose
-          display = StatBox
-        }
+    dir JetTrig {
+      output = Tau/Trigger/JetTrig
+      algorithm = tauHists_Chi2NDF
+      hist all_in_dir {
+        display = StatBox
+      }
 
-        dir tauJetBDTinputs {
-          output = Tau/Trigger/TauTrig/Identification/tauJetBDTinputs
-          algoithm = tauHists_Chi2NDF_noEmpty
-
-          hist Tau_TauTrig_Identification_tauJetBDTinputs_CentFrac {
-#            algorithm = tauHists_Chi2NDF
-            display = StatBox
-          }
-
-          hist Tau_TauTrig_Identification_tauJetBDTinputs_dRmax {
-            algorithm = tauHists_Chi2NDF
-            display = StatBox,LogY
-          }
-
-          hist Tau_TauTrig_Identification_tauJetBDTinputs_trkAvgDist {
-            algorithm = tauHists_Chi2NDF
-            display = StatBox
-          }
-
-          hist Tau_TauTrig_Identification_tauJetBDTinputs_SumPtTrkFrac {
-            algorithm = tauHists_Chi2NDF
-            display = StatBox,LogY
-          }
-
-          hist Tau_TauTrig_Identification_tauJetBDTinputs_etOverPtLeadTrk {
-#            algorithm = tauHists_Chi2NDF
-            display = StatBox,LogY
-          }
-
-          hist Tau_TauTrig_Identification_tauJetBDTinputs_absipSigLeadTrk {
-            algorithm = tauHists_Chi2NDF
-            display = StatBox,LogY
-          }
-
-          hist Tau_TauTrig_Identification_tauJetBDTinputs_trFlightPathSig {
-#            algorithm = tauHists_Chi2NDF
-            display = StatBox
-          }
-
-          hist Tau_TauTrig_Identification_tauJetBDTinputs_massTrkSys {
-            algorithm = tauHists_Chi2NDF 
-            display = StatBox,LogY
-          }
-
-          hist Tau_TauTrig_Identification_tauJetBDTinputs_EMPOverTrkSysP {
-#            algorithm = tauHists_Chi2NDF 
-            display = StatBox
-          }
-
-          hist Tau_TauTrig_Identification_tauJetBDTinputs_mEflowApprox {
-#            algorithm = tauHists_Chi2NDF 
-            display = StatBox,LogY
-          }
-
-          hist Tau_TauTrig_Identification_tauJetBDTinputs_ptRatioEflowApprox {
-#            algorithm = tauHists_Chi2NDF 
-            display = StatBox
-          }
-
-          hist Tau_TauTrig_Identification_tauJetBDTinputs_ptIntermediateAxis {
-            algorithm = tauHists_Chi2NDF
-            display = StatBox,LogY
-          }
-        }
+      hist jetTriggered_tauCharge {
+        algorithm = tauHists_Chi2NDF_noEmpty
+        display = StatBox
+      } 
 
-        dir EleVetoBDTinputs {
-          output = Tau/Trigger/TauTrig/Identification/EleVetoBDTinputs
-          algoithm = tauHists_Chi2NDF_noEmpty
-
-          hist Tau_TauTrig_Identification_EleVetoBDTinputs_etHotShotWinOverPtLeadTrk {
-#            algorithm = tauHists_Chi2NDF 
-            display = StatBox
-          }
-
-          hist Tau_TauTrig_Identification_EleVetoBDTinputs_EMFracFixed {
-#            algorithm = tauHists_Chi2NDF 
-            display = StatBox
-          }
-
-          hist Tau_TauTrig_Identification_EleVetoBDTinputs_hadLeakFracFixed {
-#            algorithm = tauHists_Chi2NDF 
-            display = StatBox
-          }
-
-          hist Tau_TauTrig_Identification_EleVetoBDTinputs_PSSFrac {
-#            algorithm = tauHists_Chi2NDF 
-            display = StatBox
-          }
-        }
+      hist jetTriggered_RNNJetScore {
+        algorithm = tauHists_Chi2NDF
+        display = StatBox,LogY
+      }
 
-        dir BDTLoose15GeV {
-          output = Tau/Trigger/TauTrig/Identification/BDTLoose15GeV
-          algoithm = tauHists_Chi2NDF
-
-          hist Tau_TauTrig_Identification_BDTLoose15GeV_et {
-            algorithm = tauHists_Chi2NDF 
-            display = StatBox,LogY
-          }
-
-          hist Tau_TauTrig_Identification_BDTLoose15GeV_eta {
-            algorithm = tauHists_Chi2NDF 
-	    display = StatBox
-          }
-
-          hist Tau_TauTrig_Identification_BDTLoose15GeV_phi {
-            algorithm = tauHists_Chi2NDF 
-            display = StatBox
-          }
-
-          hist Tau_TauTrig_Identification_BDTLoose15GeV_numTracks {
-            algorithm = tauHists_Chi2NDF 
-	    display = StatBox,LogY
-          }
-
-          hist Tau_TauTrig_Identification_BDTLoose15GeV_nCluster {
-            algorithm = tauHists_Chi2NDF/Loose 
-	    display = StatBox,LogY
-          }
-
-          hist Tau_TauTrig_Identification_BDTLoose15GeV_PanMode {
-            algorithm = tauHists_Chi2NDF 
-	    display = StatBox,LogY
-	  }
-        }
+      hist jetTriggered_RNNJetScoreSigTrans {
+        display = StatBox,LogY
       }
 
-      dir SubStructure {
-        output = Tau/Trigger/TauTrig/SubStructure
+      hist jetTriggered_tauEt {
         algorithm = tauHists_Chi2NDF
-        hist all_in_dir {
-          display = StatBox
-        }
-
-        hist Tau_TauTrig_SubStructure_nShot {
-          algorithm = tauHists_Chi2NDF 
-          display = StatBox,LogY
-        }  
-      
-        hist Tau_TauTrig_SubStructure_InvMassEffClusters {
-          algorithm = tauHists_Chi2NDF_noEmpty 
-          display = StatBox
-        }
-
-        hist Tau_TauTrig_SubStructure_EfracL2EffCluster {
-          algorithm = tauHists_Chi2NDF/Loose 
-          display = StatBox
-        }
-
-        hist Tau_TauTrig_SubStructure_EisoEffCluster {
-          algorithm = tauHists_Chi2NDF_noEmpty/Loose 
-          display = StatBox
-        }
+        display = StatBox,LogX
+      }    
 
-        hist Tau_TauTrig_SubStructure_shots_pt3 {
-          algorithm = tauHists_Chi2NDF_noEmpty 
-          display = StatBox,LogY
-        }
+      hist jetTriggered_tauEta {
+        algorithm = tauHists_Chi2NDF
+        display = StatBox
+      }
 
-        hist Tau_TauTrig_SubStructure_EMFracTrk {
-          algorithm = tauHists_Chi2NDF_noEmpty 
-          display = StatBox
-        }
+      hist jetTriggered_tauEtaVsLB {
+        algorithm = tauHists_Chi2Scatter/Loose
+        display = StatBox
+      }
 
-        hist Tau_TauTrig_SubStructure_NumNeutPFO {
-          algorithm = tauHists_Chi2NDF 
-          display = StatBox,LogY
-        }
+      hist jetTriggered_tauPhi {
+        algorithm = tauHists_Chi2NDF
+        display = StatBox
+      }
 
-        hist Tau_TauTrig_SubStructure_BDTscoreAsP0 {
-          algorithm = tauHists_Chi2NDF_noEmpty 
-          display = StatBox
-        }
- 
-        hist Tau_TauTrig_SubStructure_PanMode {
-          algorithm = tauHists_Chi2NDF 
-          display = StatBox
-        }
+      hist jetTriggered_tauPhiVsEta {
+        algorithm = tauHists_Chi2Scatter
+        display = StatBox
+      }  
 
-        hist Tau_TauTrig_SubStructure_PanPt {
-          algorithm = tauHists_Chi2NDF 
-          display = StatBox
-        }
+      hist jetTriggered_tauPhiVsLB {
+        algorithm = tauHists_Chi2Scatter
+        display = StatBox
+      }    
 
-        hist Tau_TauTrig_SubStructure_PanEta {
-          algorithm = tauHists_Chi2NDF 
-          display = StatBox
-        }
+      hist jetTriggered_nTauPerLB {
+        algorithm = tauHists_Chi2NDF 
+        display = StatBox
+      }
 
-        hist Tau_TauTrig_SubStructure_PanPhi {
-          algorithm = tauHists_Chi2NDF 
-          display = StatBox
-        }
+      hist jetTriggered_tauNumTracks {
+        algorithm = tauHists_Chi2NDF
+        display = StatBox
       }
-    }
 
-    dir JetTrig {
-      output = Tau/Trigger/JetTrig
-      algorithm = tauHists_Chi2NDF_noEmpty
-      hist all_in_dir {
+      hist jetTriggered_nCluster {
+        algorithm = tauHists_Chi2NDF/veryLoose
         display = StatBox
       }
-   
+
+      hist jetTriggered_tauEtVsEta {
+        algorithm = tauHists_Chi2Scatter
+        display = StatBox
+      }    
+
+      hist jetTriggered_tauEtVsPhi {
+        algorithm = tauHists_Chi2Scatter
+        display = StatBox
+      }    
+
       hist jetTriggered_nTauCandidates {
         algorithm = tauHists_Chi2NDF
         display = StatBox
       }
 
-      hist jetTriggered_tauCharge {
-        algorithm = tauHists_Chi2NDF_noEmpty
+      hist jetTriggered_nHighPtTauCandidates {
+        algorithm = tauHists_Chi2NDF
         display = StatBox
       }
 
-      hist jetTriggered_tauEt {
-        algorithm = tauHists_Chi2NDF
-        display = StatBox,LogX
-      }
+    }
 
-      hist jetTriggered_tauEtVsEta {
-        algorithm = tauHists_Chi2Scatter
+    dir TauTrig1 {
+      output = Tau/Trigger/TauTrig1
+      algorithm = tauHists_Chi2NDF
+      hist all_in_dir {
         display = StatBox
       }
 
-      hist jetTriggered_tauEtVsPhi {
-        algorithm =  tauHists_Chi2Scatter
-        display = StatBox
+      hist tauTriggered1_tauTriggered1_tauCharge {
+        algorithm = tauHists_Chi2NDF_noEmpty
+        display = StatBox,LogY
       }
 
-      hist jetTriggered_PtTESMVA {
+      hist tauTriggered1_RNNJetScore {
         algorithm = tauHists_Chi2NDF
         display = StatBox,LogY
-      } 
-   
-      hist jetTriggered_Ptcombined {
-        algorithm = tauHists_Chi2NDF
+      }
+
+      hist tauTriggered1_RNNJetScoreSigTrans {
         display = StatBox,LogY
-      } 
-   
-      hist jetTriggered_tauEta {
+      }
+
+      hist tauTriggered1_tauEt {
         algorithm = tauHists_Chi2NDF
-        display = StatBox
-      } 
+        display = StatBox,LogY
+      }
 
-      hist jetTriggered_tauPhi {
+      hist tauTriggered1_tauEta {
         algorithm = tauHists_Chi2NDF
         display = StatBox
-      } 
-   
-      hist jetTriggered_tauPhiVsEta {
-        algorithm =  tauHists_Chi2Scatter
-        display = StatBox
       }
-    }
 
-    dir EleTrig {
-      output = Tau/Trigger/EleTrig
-      algorithm = tauHists_Chi2NDF_noEmpty
-      hist all_in_dir {
+      hist tauTriggered1_tauEtaVsLB {
+        algorithm = tauHists_Chi2Scatter/Loose
         display = StatBox
       }
 
-      hist emTriggered_nTauCandidates {
+      hist tauTriggered1_tauPhi {
         algorithm = tauHists_Chi2NDF
         display = StatBox
       }
 
-      hist emTriggered_tauCharge {
-        algorithm = tauHists_Chi2NDF_noEmpty
+      hist tauTriggered1_tauPhiVsEta {
+        algorithm = tauHists_Chi2Scatter
         display = StatBox
       }
 
-      hist emTriggered_NumTracks {
-        algorithm = tauHists_Chi2NDF/Loose
+
+      hist tauTriggered1_tauPhiVsLB {
+        algorithm =  tauHists_Chi2Scatter/Loose
         display = StatBox
       }
- 
-      hist emTriggered_tauEt {
+
+      hist tauTriggered1_nTauPerLB {
+        algorithm = tauHists_Chi2NDF 
+        display = StatBox
+      }
+
+      hist tauTriggered1_tauNumTracks {
         algorithm = tauHists_Chi2NDF
-        display = StatBox,LogX
+        display = StatBox
       }
 
-      hist emTriggered_tauEtVsEta {
-        algorithm = tauHists_Chi2Scatter
+      hist tauTriggered1_nCluster {
+        algorithm = tauHists_Chi2NDF/veryLoose
         display = StatBox
       }
 
-      hist emTriggered_tauEtVsPhi {
+      hist tauTriggered1_tauEtVsEta {
         algorithm = tauHists_Chi2Scatter
         display = StatBox
       }
 
-      hist emTriggered_tauEta {
-        algorithm = tauHists_Chi2NDF
+      hist tauTriggered1_tauEtVsPhi {
+        algorithm = tauHists_Chi2Scatter
         display = StatBox
-      } 
+      }
 
-      hist emTriggered_tauPhi {
-        algorithm = tauHists_Chi2NDF
-        display = StatBox
-      } 
 
-      hist emTriggered_PtTESMVA {
+      hist tauTriggered1_nTauCandidates {
         algorithm = tauHists_Chi2NDF
         display = StatBox,LogY
-      } 
-   
-      hist emTriggered_Ptcombined {
+      }
+
+
+      hist tauTriggered1_nHighPtTauCandidates {
         algorithm = tauHists_Chi2NDF
         display = StatBox,LogY
-      } 
-   
-   
-      hist emTriggered_tauPhiVsEta {
-        algorithm = tauHists_Chi2Scatter
-        display = StatBox
       }
     }
   }
diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/src/TPCnvElt.cxx b/Database/AthenaPOOL/AthenaPoolCnvSvc/src/TPCnvElt.cxx
index 5bdf2bf5062212699007183133cf065f4f25c187..3902f42b2b6719afa94ea4baa2d955c02c781beb 100644
--- a/Database/AthenaPOOL/AthenaPoolCnvSvc/src/TPCnvElt.cxx
+++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/src/TPCnvElt.cxx
@@ -1,8 +1,6 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
-
-// $Id$
 /**
  * @file AthenaPoolCnvSvc/src/TPCnvElt.cxx
  * @author scott snyder <snyder@bnl.gov>
@@ -15,6 +13,10 @@
 #include "AthenaPoolCnvSvc/exceptions.h"
 #include "StorageSvc/DbReflex.h"
 
+#include "AthenaKernel/getMessageSvc.h"
+#include "GaudiKernel/MsgStream.h"
+#include "GaudiKernel/System.h"
+
 
 namespace AthenaPoolCnvSvc {
 
@@ -28,7 +30,96 @@ namespace AthenaPoolCnvSvc {
 Guid guidFromTypeinfo (const std::type_info& ti)
 {
   pool::TypeH typ = pool::DbReflex::forTypeInfo (ti);
-  if (!typ) throwExcNoDictForClass (ti);
+  if (!typ) {
+    // Print additional diagnostic information here to try to get a better
+    // handle on why this is happening.
+    // See ATEAM-697.
+    std::string clname = System::typeinfoName (ti);
+    MsgStream msg (Athena::getMessageSvc(), "TPCnvElt");
+    msg << MSG::ERROR << "Cannot find full dictionary information for class " <<
+      clname << endmsg;
+    TClass* cls = static_cast<TClass*>(typ);
+    if (!cls) {
+      msg << MSG::ERROR <<  "No TClass; trying to retrieve again." << endmsg;
+      cls = TClass::GetClass (ti);
+      if (!cls) {
+        msg << MSG::ERROR << "Couldn't retrieve via type_info; try by name." << endmsg;
+        cls = TClass::GetClass (clname.c_str());
+      }
+    }
+    if (cls) {
+      msg << MSG::ERROR << "Got TClass " << cls->GetName() << " " <<
+        cls->HasInterpreterInfoInMemory() << " " <<
+        cls->HasInterpreterInfo() << " " <<
+        cls->GetState() << " " <<
+        cls->HasDictionary() << " " <<
+        cls->IsLoaded() << " " <<
+        cls->IsForeign() << endmsg;
+
+      TClass* cls2 = TClass::GetClass (ti);
+      if (cls2) {
+        msg << MSG::ERROR << "Got TClass by ti " << cls2->GetName() << " " <<
+          (cls == cls2) << " " <<
+          cls2->HasInterpreterInfoInMemory() << " " <<
+          cls2->HasInterpreterInfo() << " " <<
+          cls2->GetState() << " " <<
+          cls2->HasDictionary() << " " <<
+          cls2->IsLoaded() << " " <<
+          cls2->IsForeign() << endmsg;
+      }
+      else {
+        msg << MSG::ERROR << "Could not re-get class by ti" << endmsg;
+      }
+
+      cls2 = TClass::GetClass (clname.c_str());
+      if (cls2) {
+        msg << MSG::ERROR << "Got TClass by name " << cls2->GetName() << " " <<
+          (cls == cls2) << " " <<
+          cls2->HasInterpreterInfoInMemory() << " " <<
+          cls2->HasInterpreterInfo() << " " <<
+          cls2->GetState() << " " <<
+          cls2->HasDictionary() << " " <<
+          cls2->IsLoaded() << " " <<
+          cls2->IsForeign() << endmsg;
+      }
+      else {
+        msg << MSG::ERROR << "Could not re-get class by name" << endmsg;
+      }
+
+      sleep (10);
+
+      cls2 = TClass::GetClass (ti);
+      if (cls2) {
+        msg << MSG::ERROR << "Got TClass by ti " << cls2->GetName() << " " <<
+          (cls == cls2) << " " <<
+          cls2->HasInterpreterInfoInMemory() << " " <<
+          cls2->HasInterpreterInfo() << " " <<
+          cls2->GetState() << " " <<
+          cls2->HasDictionary() << " " <<
+          cls2->IsLoaded() << " " <<
+          cls2->IsForeign() << endmsg;
+      }
+      else {
+        msg << MSG::ERROR << "Could not re-get class by ti" << endmsg;
+      }
+
+      cls2 = TClass::GetClass (clname.c_str());
+      if (cls2) {
+        msg << MSG::ERROR << "Got TClass by name " << cls2->GetName() << " " <<
+          (cls == cls2) << " " <<
+          cls2->HasInterpreterInfoInMemory() << " " <<
+          cls2->HasInterpreterInfo() << " " <<
+          cls2->GetState() << " " <<
+          cls2->HasDictionary() << " " <<
+          cls2->IsLoaded() << " " <<
+          cls2->IsForeign() << endmsg;
+      }
+      else {
+        msg << MSG::ERROR << "Could not re-get class by name" << endmsg;
+      }
+    }
+    throwExcNoDictForClass (ti);
+  }
   return pool::DbReflex::guid (typ);
 }
 
diff --git a/Database/AthenaPOOL/PoolSvc/PoolSvc/IPoolSvc.h b/Database/AthenaPOOL/PoolSvc/PoolSvc/IPoolSvc.h
index 20262d49febf0226fae70eb1a202bc7c490d5419..037518d3a7e3ef1ddaa88bde47215e4fd309776d 100644
--- a/Database/AthenaPOOL/PoolSvc/PoolSvc/IPoolSvc.h
+++ b/Database/AthenaPOOL/PoolSvc/PoolSvc/IPoolSvc.h
@@ -104,12 +104,6 @@ public: // Non-static members
 	   const pool::ICollection::OpenMode& openMode = pool::ICollection::READ,
 	   unsigned int contextId = IPoolSvc::kInputStream) const = 0;
 
-   /// @return void
-   /// @param c [IN] collection to be registered
-   /// @param overwrite [IN] whether to overwrite
-   /// @param sharedCat [IN] whether to use same catalog as data
-   virtual void registerExistingCollection ATLAS_NOT_THREAD_SAFE (pool::ICollection* c, bool overwrite, bool sharedCat = true) = 0;
-
    /// @return a token for a container entry.
    /// @param connection [IN] string containing the connection/file name.
    /// @param collection [IN] string containing the persistent name of the collection.
diff --git a/Database/AthenaPOOL/PoolSvc/src/PoolSvc.cxx b/Database/AthenaPOOL/PoolSvc/src/PoolSvc.cxx
index 39072b98c9051728a3df08393b6595c93d0a0a9b..2bc26371bbd867e9ecf4f2dd370669b4b3d09909 100644
--- a/Database/AthenaPOOL/PoolSvc/src/PoolSvc.cxx
+++ b/Database/AthenaPOOL/PoolSvc/src/PoolSvc.cxx
@@ -543,16 +543,6 @@ pool::ICollection* PoolSvc::createCollection ATLAS_NOT_THREAD_SAFE
    return(collPtr);
 }
 //__________________________________________________________________________
-void PoolSvc::registerExistingCollection ATLAS_NOT_THREAD_SAFE
-  (pool::ICollection* coll, bool overwrite, bool sharedCat)
-{
-   std::lock_guard<CallMutex> lock(m_pool_mut);
-   m_catalog->commit();
-   pool::CollectionFactory* collFac = pool::CollectionFactory::get();
-   collFac->registerExisting(coll, overwrite, sharedCat ? m_catalog : nullptr);
-   m_catalog->start();
-}
-//__________________________________________________________________________
 Token* PoolSvc::getToken(const std::string& connection,
 	const std::string& collection,
 	const unsigned long ientry) const {
diff --git a/Database/AthenaPOOL/PoolSvc/src/PoolSvc.h b/Database/AthenaPOOL/PoolSvc/src/PoolSvc.h
index ec0e564864394c3190e877d4d957ef0bc289efd4..db883011c212c1c5df50103491df79a3500373f2 100644
--- a/Database/AthenaPOOL/PoolSvc/src/PoolSvc.h
+++ b/Database/AthenaPOOL/PoolSvc/src/PoolSvc.h
@@ -109,12 +109,6 @@ public: // Non-static members
 	   const pool::ICollection::OpenMode& openMode = pool::ICollection::READ,
 	   unsigned int contextId = IPoolSvc::kInputStream) const;
 
-   /// @return void
-   /// @param c [IN] collection to be registered
-   /// @param overwrite [IN] whether to overwrite
-   /// @param sharedCat [IN] whether to use same catalog as data
-   void registerExistingCollection ATLAS_NOT_THREAD_SAFE (pool::ICollection* c, bool overwrite, bool sharedCat = true);
-
    /// @return a token for a container entry.
    /// @param connection [IN] string containing the connection/file name.
    /// @param collection [IN] string containing the persistent name of the collection.
diff --git a/Event/xAOD/xAODCaloEvent/Root/CaloClusterAccessors_v1.cxx b/Event/xAOD/xAODCaloEvent/Root/CaloClusterAccessors_v1.cxx
index 0a3353663d6450f8aaaaad3af0ac8700533add0c..3708e0bf83be9daa167123a988ec5204343afd8a 100644
--- a/Event/xAOD/xAODCaloEvent/Root/CaloClusterAccessors_v1.cxx
+++ b/Event/xAOD/xAODCaloEvent/Root/CaloClusterAccessors_v1.cxx
@@ -56,6 +56,7 @@ namespace xAOD {
          DEFINE_ACCESSOR( SIGNIFICANCE );
          DEFINE_ACCESSOR( PTD );
          DEFINE_ACCESSOR( MASS );
+	 DEFINE_ACCESSOR( SECOND_TIME );
          DEFINE_ACCESSOR( CELL_SIGNIFICANCE );
          DEFINE_ACCESSOR( CELL_SIG_SAMPLING );
          DEFINE_ACCESSOR( AVG_LAR_Q );
diff --git a/Event/xAOD/xAODCaloEvent/Root/CaloCluster_v1.cxx b/Event/xAOD/xAODCaloEvent/Root/CaloCluster_v1.cxx
index 6b5b48e5180d0cf0917fde1a4682401c5f2c22b2..52aa125df7910deeef525ff9c2b086f3b675a280 100644
--- a/Event/xAOD/xAODCaloEvent/Root/CaloCluster_v1.cxx
+++ b/Event/xAOD/xAODCaloEvent/Root/CaloCluster_v1.cxx
@@ -33,7 +33,8 @@ namespace xAOD {
     : IParticle(other),
       m_samplingPattern(other.samplingPattern()),
       m_cellLinks(nullptr),
-      m_recoStatus(other.m_recoStatus) {
+      m_recoStatus(other.m_recoStatus),
+      m_secondTime(other.m_secondTime) {
     setSignalState(other.signalState());
     this->makePrivateStore(other);
 #if !(defined(SIMULATIONBASE) || defined(XAOD_ANALYSIS))
@@ -58,6 +59,7 @@ namespace xAOD {
     m_recoStatus=other.m_recoStatus;
     setSignalState(other.signalState());
     m_samplingPattern=other.m_samplingPattern;
+    m_secondTime = other.m_secondTime;
 
 #if !(defined(SIMULATIONBASE) || defined(XAOD_ANALYSIS))
      const CaloClusterCellLink* links=other.getCellLinks();
@@ -922,6 +924,15 @@ namespace xAOD {
     return true;
   }
 
+  void  CaloCluster_v1::setSecondTime(CaloCluster_v1::flt_t stime) { m_secondTime = stime; }
+
+  CaloCluster_v1::flt_t CaloCluster_v1::secondTime() const {
+    if ( m_secondTime < 0. ) { 
+      double stime(0.); return this->retrieveMoment(SECOND_TIME,stime) ? stime : 0.; 
+    } else { 
+      return m_secondTime; 
+    }
+  }
 
 #if !(defined(SIMULATIONBASE) || defined(XAOD_ANALYSIS))
 size_t CaloCluster_v1::size() const {
diff --git a/Event/xAOD/xAODCaloEvent/src/CaloClusterKineHelper.cxx b/Event/xAOD/xAODCaloEvent/src/CaloClusterKineHelper.cxx
index 592ab047a04854fc9a8630a0d3fe4bbca2ec741d..320ba561fb14882a3ab4a62687e2f89756918154 100644
--- a/Event/xAOD/xAODCaloEvent/src/CaloClusterKineHelper.cxx
+++ b/Event/xAOD/xAODCaloEvent/src/CaloClusterKineHelper.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef SIMULATIONBASE
@@ -12,6 +12,8 @@
 #include "CaloGeoHelpers/CaloPhiRange.h"
 #include "CaloEvent/CaloPrefetch.h"
 
+#include <cmath>
+
 namespace {
 
 
@@ -37,6 +39,7 @@ struct CellAccum
       PresenceInSample(),
       theNewEnergy(0),
       theNewTime(0),
+      theNewSecondTime(0),
       theNewEta(0),
       theNewPhi(0),
       phi0(-999),
@@ -55,6 +58,7 @@ struct CellAccum
   bool PresenceInSample[CaloSampling::Unknown];
   double theNewEnergy;
   double theNewTime;
+  double theNewSecondTime;
   double theNewEta;
   double theNewPhi;
   double phi0;
@@ -160,9 +164,10 @@ void accumCell (const CaloClusterCellLink::const_iterator& cellIt, CellAccum& ac
       // Is time defined?
       if ( cell.provenance() & pmask ) {
         // keep the sign of weight for the time norm in case a cell is removed
-        double theTimeNorm = fabsweight * theEnergy * theEnergyNoWeight;
-        accum.theNewTime += theTimeNorm * cell.time();
-        accum.timeNorm += theTimeNorm;
+        double theTimeNorm      = fabsweight * theEnergy * theEnergyNoWeight;
+        accum.theNewTime       += theTimeNorm * cell.time();
+	accum.theNewSecondTime += theTimeNorm * cell.time() * cell.time();
+        accum.timeNorm         += theTimeNorm;
       }
     }
   }
@@ -251,10 +256,17 @@ void CaloClusterKineHelper::calculateKine(xAOD::CaloCluster* clu, const bool use
   clu->setE(accum.theNewEnergy);
   clu->setM(0.0);
 
-  if ( timeNorm != 0. )
+  if ( timeNorm != 0. ) {
     clu->setTime(accum.theNewTime/timeNorm);
-  else 
-    clu->setTime(0);
+    // note that standard deviation of cell time distribution is >= 0. 
+    // (no particular accommodation for <x^2> < <x><x>!) 
+    //    clu->setSecondTime(std::sqrt(std::max(accum.theNewSecondTime/timeNorm-clu->time()*clu->time(),0.)));
+    // consistency with other second moments: store variance!
+    clu->setSecondTime(accum.theNewSecondTime/timeNorm-clu->time()*clu->time());
+  } else { 
+    clu->setTime(0.);      
+    clu->setSecondTime(0.);
+  }
 
 
   //Set Sampling pattern:
diff --git a/Event/xAOD/xAODCaloEvent/xAODCaloEvent/selection.xml b/Event/xAOD/xAODCaloEvent/xAODCaloEvent/selection.xml
index ec86a1c2207f8269e37b1b8eab3219edf155d338..ece9052cf6997976cb9ddca8b2b81c7e77273fb9 100644
--- a/Event/xAOD/xAODCaloEvent/xAODCaloEvent/selection.xml
+++ b/Event/xAOD/xAODCaloEvent/xAODCaloEvent/selection.xml
@@ -6,6 +6,7 @@
       <field name="m_signalState"  transient="true" />
       <field name="m_cellLinks"    transient="true" />
       <field name="m_recoStatus"   transient="true" />
+      <field name="m_secondTime"   transient="true" />
    </class>
    <read sourceClass="xAOD::CaloCluster_v1" version="[1-]"
          targetClass="xAOD::CaloCluster_v1" source="" target="m_signalState" >
@@ -19,6 +20,11 @@
         m_cellLinks = 0;
      ]]>
    </read>
+   <read sourceClass="xAOD::CaloCluster_v1" version="[1-]"
+	 targetClass="xAOD::CaloCluster_v1" source="" target="m_secondTime" >
+     <![CDATA[
+	 m_secondTime = -999;
+     ]]>
    <class name="xAOD::CaloClusterContainer_v1"
           id="24997BCA-3F6A-4530-8826-822EE9FC3C08" />
    <typedef name="xAOD::CaloCluster" />
diff --git a/Event/xAOD/xAODCaloEvent/xAODCaloEvent/versions/CaloCluster_v1.h b/Event/xAOD/xAODCaloEvent/xAODCaloEvent/versions/CaloCluster_v1.h
index 2cd7b51a3c5bf5f932db305a59fee5ced4b095c2..aae9d913cfdc1b5c2ffa9441f464006bf5ff54a5 100644
--- a/Event/xAOD/xAODCaloEvent/xAODCaloEvent/versions/CaloCluster_v1.h
+++ b/Event/xAOD/xAODCaloEvent/xAODCaloEvent/versions/CaloCluster_v1.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 #ifndef XAODCALOEVENT_VERSIONS_CALOCLUSTER_V1_H
 #define XAODCALOEVENT_VERSIONS_CALOCLUSTER_V1_H
@@ -14,7 +14,7 @@ extern "C" {
 // xAOD include(s):
 #include "xAODBase/IParticle.h"
 
-//Defintion of CaloSamples (enum)
+//Definition of CaloSamples (enum)
 #include "CaloGeoHelpers/CaloSampling.h"
 
 #include "xAODCaloEvent/CaloClusterBadChannelData.h"
@@ -45,8 +45,11 @@ namespace xAOD {
    /// Description of a calorimeter cluster
    /// @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
    /// @author Walter Lampl <Walter.Lampl@cern.ch>
+   /// @author Peter Loch <Peter.Loch@cern.ch>
    ///
-   ///
+   /// @since 23-March-2021: added methods to set and retrieve second 
+   ///                       moment of cell time distribution (persistified
+   ///                       as a cluster moment)
    class CaloCluster_v1 : public IParticle {
      friend class ::CaloClusterChangeSignalState;
 
@@ -103,8 +106,8 @@ namespace xAOD {
          DELTA_PHI         = 301,
          /// Angular shower axis deviation (\f$\theta\f$) from IP-to-Center
          DELTA_THETA       = 302,
-         /// Angular shower axis deviation from IP-to-Center
-         DELTA_ALPHA       = 303,
+         /// Angular shower axis deviation (\f$\Delta\alpha\f$) from IP-to-Center
+         DELTA_ALPHA       = 303, 
          CENTER_X          = 401, ///< Cluster Centroid (\f$x\f$)
          CENTER_Y          = 402, ///< Cluster Centroid (\f$y\f$)
          CENTER_Z          = 403, ///< Cluster Centroid (\f$z\f$)
@@ -153,6 +156,8 @@ namespace xAOD {
          DM_WEIGHT         = 903, ///< Dead-material weight (E_dm/E_ooc)
          /// Confidence Level of a tile calorimeter cluster to be noise
          TILE_CONFIDENCE_LEVEL = 904,
+	 /// Second moment of cell time distribution in cluster
+	 SECOND_TIME      = 910,
 
          VERTEX_FRACTION = 1000, /**< Vertex fraction of this cluster wrt. primary vertex of the event. Calculated in CaloRec/CaloClusterVertexFractionMaker.cxx */
          NVERTEX_FRACTION = 1001, /**< slightly updated vertex fraction more pile up independent (similar to nJVF) */
@@ -442,6 +447,16 @@ namespace xAOD {
      void setTime(flt_t);
      /// Access cluster time
      flt_t time() const;
+     /// Set second moment of cell timing distribution
+     void setSecondTime(flt_t stime); 
+     /// Access second moment of cell timing distribution
+     ///
+     /// For clusters read from persistent storage, this method returns the value
+     /// stored for the @c SECOND_TIME moment.
+     ///
+     /// @retval 0 if (1) moment is not available, (2) the cluster time could not be calculated, 
+     ///           or (3) the cluster has only one cell or all cells have exactly the same time.  
+     flt_t secondTime() const; 
 
      /// Access to sampling pattern (one bit per sampling) (Method may be removed later)
      unsigned samplingPattern() const;
@@ -589,13 +604,16 @@ namespace xAOD {
 
      /// Current signal state
      State m_signalState;
-     ///Unique ptr to cell links. For cluster building
+     /// Unique ptr to cell links. For cluster building
      /// transient only , holds cells owned by the cluster if non-nullptr
      std::unique_ptr<CaloClusterCellLink> m_cellLinks;
 
-     ///Reco status (transient only)
+     /// Reco status (transient only)
      CaloRecoStatus m_recoStatus;
 
+     /// Second cell time moment (transient only)
+     double m_secondTime = { -1. };
+
      unsigned sampVarIdx(const CaloSample) const;
 
      float getSamplVarFromAcc(const Accessor<std::vector<float > >& acc,
diff --git a/Generators/EvgenProdTools/scripts/rootconvert.py b/Generators/EvgenProdTools/scripts/rootconvert.py
new file mode 100755
index 0000000000000000000000000000000000000000..d3a3a253844a37f81695f8376759a6b39c418087
--- /dev/null
+++ b/Generators/EvgenProdTools/scripts/rootconvert.py
@@ -0,0 +1,41 @@
+from array import array
+import ROOT as rt
+import yoda
+
+fName = 'MyOutput.yoda.gz'
+yodaAOs = yoda.read(fName)
+rtFile = rt.TFile(fName[:fName.find('.yoda')] + '.root', 'recreate')
+
+for name_slashes in yodaAOs:
+  name = name_slashes.replace("/", "_")
+  yodaAO = yodaAOs[name_slashes]  
+  rtAO = None
+
+  if 'Histo1D' in str(yodaAO):
+    rtAO = rt.TH1D(name, '', yodaAO.numBins(), array('d', yodaAO.xEdges()))
+  
+
+    rtAO.Sumw2()
+    rtErrs = rtAO.GetSumw2()
+    
+    for i in range(rtAO.GetNbinsX()):
+      
+      rtAO.SetBinContent(i + 1, yodaAO.bin(i).sumW())
+      rtErrs.AddAt(yodaAO.bin(i).sumW2(), i+1)
+      
+  elif 'Scatter2D' in str(yodaAO):
+    rtAO = rt.TGraphAsymmErrors(yodaAO.numPoints())
+    rtAO.SetName(name)
+    
+    for i in range(yodaAO.numPoints()):
+      x = yodaAO.point(i).x(); y = yodaAO.point(i).y()
+      xLo, xHi = yodaAO.point(i).xErrs()
+      yLo, yHi = yodaAO.point(i).yErrs()
+      rtAO.SetPoint(i, x, y)
+      rtAO.SetPointError(i, xLo, xHi, yLo, yHi)
+  else:
+    continue
+
+  rtAO.Write(name)
+
+rtFile.Close()
diff --git a/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/HepMcParticleLinkCnv_p1.h b/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/HepMcParticleLinkCnv_p1.h
index 3639f774cf59341af1e6f2aa4687b9c8dbb281b5..32d1dd0321b7c57762c1056a24acecc299e0c75f 100755
--- a/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/HepMcParticleLinkCnv_p1.h
+++ b/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/HepMcParticleLinkCnv_p1.h
@@ -40,13 +40,6 @@ class HepMcParticleLinkCnv_p1 : public T_AthenaPoolTPCnvBase<
    */
   HepMcParticleLinkCnv_p1();
 
-  /** Destructor: 
-   */
-  //virtual ~HepMcParticleLinkCnv_p1(); 
-
-  /////////////////////////////////////////////////////////////////// 
-  // Const methods: 
-  /////////////////////////////////////////////////////////////////// 
 
   /** Method creating the transient representation of @c HepMcParticleLink
    *  from its persistent representation @c HepMcParticleLink_p1
@@ -62,15 +55,6 @@ class HepMcParticleLinkCnv_p1 : public T_AthenaPoolTPCnvBase<
 			    HepMcParticleLink_p1* persObj, 
 			    MsgStream &msg );
 
-  /////////////////////////////////////////////////////////////////// 
-  // Protected methods: 
-  /////////////////////////////////////////////////////////////////// 
- protected: 
-  
-  /////////////////////////////////////////////////////////////////// 
-  // Protected data: 
-  /////////////////////////////////////////////////////////////////// 
- protected: 
 
 }; 
 
diff --git a/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/HepMcParticleLinkCnv_p2.h b/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/HepMcParticleLinkCnv_p2.h
index dbdf608e2280be51413660a38d2624d4f74dc886..8a677b68820fe5916406ecd15288352ae76084d3 100755
--- a/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/HepMcParticleLinkCnv_p2.h
+++ b/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/HepMcParticleLinkCnv_p2.h
@@ -36,13 +36,6 @@ public:
    */
   HepMcParticleLinkCnv_p2();
 
-  /** Destructor:
-   */
-  //virtual ~HepMcParticleLinkCnv_p2();
-
-  ///////////////////////////////////////////////////////////////////
-  // Const methods:
-  ///////////////////////////////////////////////////////////////////
 
   /** Method creating the transient representation of @c HepMcParticleLink
    *  from its persistent representation @c HepMcParticleLink_p2
@@ -57,17 +50,6 @@ public:
   virtual void transToPers( const HepMcParticleLink* transObj,
                             HepMcParticleLink_p2* persObj,
                             MsgStream &msg );
-
-  ///////////////////////////////////////////////////////////////////
-  // Protected methods:
-  ///////////////////////////////////////////////////////////////////
-protected:
-
-  ///////////////////////////////////////////////////////////////////
-  // Protected data:
-  ///////////////////////////////////////////////////////////////////
-protected:
-
 };
 
 ///////////////////////////////////////////////////////////////////
diff --git a/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/HepMcParticleLink_p1.h b/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/HepMcParticleLink_p1.h
index 0957408e33600c118374890d4a52f0609482e30b..170ef09100a8b756cd2386bad1b46b55b8fb0f46 100755
--- a/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/HepMcParticleLink_p1.h
+++ b/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/HepMcParticleLink_p1.h
@@ -36,14 +36,6 @@ class HepMcParticleLink_p1
 			const unsigned short genEvtIndex,
 			const unsigned long barcode );
 
-  /////////////////////////////////////////////////////////////////// 
-  // Const methods: 
-  ///////////////////////////////////////////////////////////////////
-
-  /////////////////////////////////////////////////////////////////// 
-  // Non-const methods: 
-  /////////////////////////////////////////////////////////////////// 
-
   /////////////////////////////////////////////////////////////////// 
   // Protected data: 
   /////////////////////////////////////////////////////////////////// 
diff --git a/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/HepMcParticleLink_p2.h b/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/HepMcParticleLink_p2.h
index c244be767dedd176e77bd20c88fc1b585d007f73..71c772ec93e879fd7d175e6f9de191bd4aea66e3 100755
--- a/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/HepMcParticleLink_p2.h
+++ b/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/HepMcParticleLink_p2.h
@@ -33,14 +33,6 @@ public:
                        const unsigned long barcode,
                        char evtColl );
 
-  ///////////////////////////////////////////////////////////////////
-  // Const methods:
-  ///////////////////////////////////////////////////////////////////
-
-  ///////////////////////////////////////////////////////////////////
-  // Non-const methods:
-  ///////////////////////////////////////////////////////////////////
-
   ///////////////////////////////////////////////////////////////////
   // Protected data:
   ///////////////////////////////////////////////////////////////////
diff --git a/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/McEventCollectionCnv_p1.h b/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/McEventCollectionCnv_p1.h
index 4a008270378034d553d8952b8908249883e2e200..a55f9ecd831f8042a0864c2de81639f73a95ccc9 100755
--- a/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/McEventCollectionCnv_p1.h
+++ b/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/McEventCollectionCnv_p1.h
@@ -65,10 +65,6 @@ class McEventCollectionCnv_p1 : public T_AthenaPoolTPCnvBase<
    */
   virtual ~McEventCollectionCnv_p1();
 
-  ///////////////////////////////////////////////////////////////////
-  // Const methods:
-  ///////////////////////////////////////////////////////////////////
-
   /** Method creating the transient representation of @c McEventCollection
    *  from its persistent representation @c McEventCollection_p1
    */
diff --git a/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/McEventCollectionCnv_p2.h b/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/McEventCollectionCnv_p2.h
index 084c72730ba61d01cc485f19b275bd1c5e61ffaa..b85dd02a6386d6d8b97fc280e0039274f4579b7c 100755
--- a/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/McEventCollectionCnv_p2.h
+++ b/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/McEventCollectionCnv_p2.h
@@ -71,10 +71,6 @@ class McEventCollectionCnv_p2 : public T_AthenaPoolTPCnvBase<
    */
   virtual ~McEventCollectionCnv_p2();
 
-  ///////////////////////////////////////////////////////////////////
-  // Const methods:
-  ///////////////////////////////////////////////////////////////////
-
   /** Method creating the transient representation of @c McEventCollection
    *  from its persistent representation @c McEventCollection_p2
    */
diff --git a/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/McEventCollectionCnv_p3.h b/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/McEventCollectionCnv_p3.h
index 78f89d6c687e0c410c17e448a0fcd08c2549ec77..1d606a400081bedb5d12de476cb3d91de77a93d7 100755
--- a/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/McEventCollectionCnv_p3.h
+++ b/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/McEventCollectionCnv_p3.h
@@ -70,10 +70,6 @@ class McEventCollectionCnv_p3 : public T_AthenaPoolTPCnvBase<
    */
   virtual ~McEventCollectionCnv_p3();
 
-  ///////////////////////////////////////////////////////////////////
-  // Const methods:
-  ///////////////////////////////////////////////////////////////////
-
   /** Method creating the transient representation of @c McEventCollection
    *  from its persistent representation @c McEventCollection_p3
    */
diff --git a/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/McEventCollectionCnv_p4.h b/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/McEventCollectionCnv_p4.h
index 4828f682825d5fc150045e0aa801ec1326cc771b..d261187dc596a2989d83002f116224d3a509e5ea 100755
--- a/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/McEventCollectionCnv_p4.h
+++ b/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/McEventCollectionCnv_p4.h
@@ -75,10 +75,6 @@ class McEventCollectionCnv_p4 : public T_AthenaPoolTPCnvBase<
 
   void setPileup();
 
-  ///////////////////////////////////////////////////////////////////
-  // Const methods:
-  ///////////////////////////////////////////////////////////////////
-
   /** Method creating the transient representation of @c McEventCollection
    *  from its persistent representation @c McEventCollection_p4
    */
diff --git a/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/McEventCollectionCnv_p5.h b/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/McEventCollectionCnv_p5.h
index dfae1c8c7ab4b194917e125ac556f9f67ca1a901..f4d009a8a8532a502059bbf978b157dd454e1aa8 100755
--- a/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/McEventCollectionCnv_p5.h
+++ b/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/McEventCollectionCnv_p5.h
@@ -76,10 +76,6 @@ class McEventCollectionCnv_p5 : public T_AthenaPoolTPCnvBase<
 
   void setPileup();
 
-  ///////////////////////////////////////////////////////////////////
-  // Const methods:
-  ///////////////////////////////////////////////////////////////////
-
   /** Method creating the transient representation of @c McEventCollection
    *  from its persistent representation @c McEventCollection_p5
    */
diff --git a/Generators/GeneratorObjectsTPCnv/src/GenEventCnv_p1.cxx b/Generators/GeneratorObjectsTPCnv/src/GenEventCnv_p1.cxx
index 350e9549da6da9f7b12bc91079b06bb2f20ca735..7c11814fc732273251234aafc29a0eabe1b83509 100755
--- a/Generators/GeneratorObjectsTPCnv/src/GenEventCnv_p1.cxx
+++ b/Generators/GeneratorObjectsTPCnv/src/GenEventCnv_p1.cxx
@@ -95,7 +95,7 @@ void GenEventCnv_p1::persToTrans( const GenEvent_p1* persObj,
   // create the vertices
   for ( unsigned int iVtx = 0; iVtx != nVertices; ++iVtx ) {
     const GenVertex_p1& persVtx = persObj->m_vertices[iVtx];
-    transObj->add_vertex( createGenVertex( *persObj, persVtx, partToEndVtx, *m_pool ) );
+    createGenVertex( *persObj, persVtx, partToEndVtx, *m_pool, transObj );
   } //> end loop over vertices
 
   // set the signal process vertex
diff --git a/Generators/Pythia8_i/test/test_00_Zprime_1000_tt.sh b/Generators/Pythia8_i/test/test_00_Zprime_1000_tt.sh
index 68dfb4a820ddaedca9542474650fe05532d00a3c..5f8b153a18b6b469c0bc163cb1916730c0d06226 100755
--- a/Generators/Pythia8_i/test/test_00_Zprime_1000_tt.sh
+++ b/Generators/Pythia8_i/test/test_00_Zprime_1000_tt.sh
@@ -13,6 +13,8 @@
 
 Gen_tf.py --ecmEnergy=13000. --maxEvents=10000 --firstEvent=-1 --randomSeed=123456 --outputEVNTFile=EVNT.root --outputYODAFile=MyOutput.yoda.gz --postInclude=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Pythia8i/JO_MC/JO_MC_Zprime.py --jobConfig=950072
 
+asetup 22.6.1,AthGeneration
+source setupRivet
 
 echo "art-result:$? Gen_tf"
 
@@ -28,7 +30,8 @@ dcubeRef="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Pythia8i/test_00_Zpr
 bash /cvmfs/atlas.cern.ch/repo/sw/art/dcube/bin/art-dcube $dcubeName MyOutput.root $dcubeXml $dcubeRef
 
 #yodadiff -o yodadiff MyOutput.yoda.gz ~/Qualification_task_ART/Pythia_8/result/Pythia_8/test_00_Zprime_1000_tt/MyOutput.yoda.gz     # use this for histogram comparison if one only care if they are exactly the same
-echo  "art-result: $? Dcube" 
+echo  "art-result: $? Dcube"
+
 
 
 
diff --git a/Generators/Pythia8_i/test/test_01_Z_tautau.sh b/Generators/Pythia8_i/test/test_01_Z_tautau.sh
index 0842307f6175e9f8d2a8219c05a7cb6e1ec05a9b..0435ddc0dc8e2238934bcc2c5bd55848a797c6f1 100755
--- a/Generators/Pythia8_i/test/test_01_Z_tautau.sh
+++ b/Generators/Pythia8_i/test/test_01_Z_tautau.sh
@@ -16,17 +16,21 @@ Gen_tf.py --ecmEnergy=13000. --maxEvents=10000 --firstEvent=-1 --randomSeed=1234
 
 echo "art-result:$? Gen_tf"
 
-python /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Pythia8i/rootconvert.py MyOutput.yoda.gz
+source `which setupRivet`
 
-dcubeName = "Pythia8i"
+python rootconvert.py MyOutput.yoda.gz
+
+echo "art-result: $? convert"
+
+dcubeName="Pythia8i"
 dcubeXml="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Pythia8i/test_01_Z_tautau/config_Ztt.xml"
 dcubeRef="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Pythia8i/test_01_Z_tautau/MyOutput.root"
 
 #dcubeName="Pythia8i"
-#dcubeXml="/afs/cern.ch/user/l/lyue//Qualification_task_ART/Pythia_8/DcubeReference/test_01_Z_tautau/config_Ztt.xml"
-#dcubeRef="/afs/cern.ch/user/l/lyue//Qualification_task_ART/Pythia_8/DcubeReference/test_01_Z_tautau/MyOutput.root"
+#dcubeXml="/afs/cern.ch/user/l/lyue/Qualification_task_ART/Pythia_8/DcubeReference/test_01_Z_tautau/config_Ztt.xml"
+#dcubeRef="/afs/cern.ch/user/l/lyue/Qualification_task_ART/Pythia_8/result_grid/testscripts/test_01_Z_tautau/MyOutput.root"
 
 bash /cvmfs/atlas.cern.ch/repo/sw/art/dcube/bin/art-dcube $dcubeName MyOutput.root $dcubeXml $dcubeRef
 
-#yodadiff -o yodadiff MyOutput.yoda.gz ~/Qualification_task_ART/Pythia_8/result/Pythia_8/test_01_Z_tautau/MyOutput.yoda.gz     # use this for histogram comparison if one only care if they are exactly the same
+#yodadiff -o yodadiff MyOutput.yoda.gz ~/Qualification_task_ART/Pythia_8/result/Pythia_8/test_00_Zprime_1000_tt/MyOutput.yoda.gz     # use this for histogram comparison if one only care if they are exactly the same
 echo  "art-result: $? Dcube" 
diff --git a/Generators/Pythia8_i/test/test_02_minbias.sh b/Generators/Pythia8_i/test/test_02_minbias.sh
index d58ac25ea50566cc67abde380bcb133be13eda28..abd918b4e44e04f3f6469566d2a4692806b33f5e 100755
--- a/Generators/Pythia8_i/test/test_02_minbias.sh
+++ b/Generators/Pythia8_i/test/test_02_minbias.sh
@@ -13,6 +13,7 @@
 
 Gen_tf.py --ecmEnergy=13000. --maxEvents=10000 --firstEvent=-1 --randomSeed=123456 --outputEVNTFile=EVNT.root --outputYODAFile=MyOutput.yoda.gz --postInclude=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Pythia8i/JO_MC/JO_MC_minbias.py --jobConfig=421113
 
+source setupRivet.sh
 
 echo "art-result:$? Gen_tf"
 
diff --git a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/InDetMaterialManager.cxx b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/InDetMaterialManager.cxx
index bcaf9930f2e4a03f284fd23c370774e33189f790..cf163cd72ef086313cf3bd24b3eaeff40547f1d1 100755
--- a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/InDetMaterialManager.cxx
+++ b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/InDetMaterialManager.cxx
@@ -105,7 +105,7 @@ InDetMaterialManager::getMaterial(const std::string& materialName) {
 
 bool
 InDetMaterialManager::hasMaterial(const std::string& materialName) const {
-  return m_store.find(materialName) != m_store.end();
+  return m_weightMap.find(materialName) != m_weightMap.end();
 }
 
 const GeoMaterial*
diff --git a/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/share/InDetDxAOD.py b/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/share/InDetDxAOD.py
index f71ae46426c9aa193296bde2c43ecc942e7d8989..26f8d15e5ce9b28a4ef9f96fc8bf436e820fc861 100644
--- a/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/share/InDetDxAOD.py
+++ b/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/share/InDetDxAOD.py
@@ -10,6 +10,7 @@ from InDetRecExample.InDetJobProperties import InDetFlags
 from DerivationFrameworkInDet.InDetCommon import *
 
 from InDetPrepRawDataToxAOD.InDetDxAODJobProperties import InDetDxAODFlags
+from InDetRecExample import TrackingCommon
 
 # Select active sub-systems
 dumpPixInfo = InDetDxAODFlags.DumpPixelInfo()
@@ -140,7 +141,8 @@ if makeSplitTracks:
     # Create xAOD::TrackParticles out of them
     from TrkParticleCreator.TrkParticleCreatorConf import Trk__TrackParticleCreatorTool
     InDetxAODSplitParticleCreatorTool = Trk__TrackParticleCreatorTool(name = "InDetSplitxAODParticleCreatorTool",
-                                                                      TrackSummaryTool        = InDetTrackSummaryToolSharedHits,
+                                                                      TrackToVertex           = TrackingCommon.getInDetTrackToVertexTool(),
+                                                                      TrackSummaryTool        = TrackingCommon.getInDetTrackSummaryToolSharedHits(),
                                                                       KeepParameters          = True)
     ToolSvc += InDetxAODSplitParticleCreatorTool
     # The following adds truth information, but needs further testing
@@ -148,6 +150,7 @@ if makeSplitTracks:
     #if isIdTrkDxAODSimulation:
     #    InDetSplitTracksTruth = ConfiguredInDetTrackTruth("Tracks_splitID",'SplitTrackDetailedTruth','SplitTrackTruth')
 
+    from xAODTrackingCnv.xAODTrackingCnvConf import xAODMaker__TrackParticleCnvAlg
     xAODSplitTrackParticleCnvAlg = xAODMaker__TrackParticleCnvAlg('InDetSplitTrackParticles')
     xAODSplitTrackParticleCnvAlg.xAODContainerName = 'InDetSplitTrackParticles'
     xAODSplitTrackParticleCnvAlg.xAODTrackParticlesFromTracksContainerName = 'InDetSplitTrackParticles'
diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecPostProcessing.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecPostProcessing.py
index e8f11778a0b54a147d1238039c8838dfb9b9623e..a71279c57b7d46f420b02743dd70eab6d86ef8ff 100755
--- a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecPostProcessing.py
+++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecPostProcessing.py
@@ -143,21 +143,10 @@ if InDetFlags.doLowBetaFinder():
 # -------------------------------------------------------------------------
 
 if InDetFlags.doTTVADecos():
-  from InDetUsedInFitTrackDecoratorTool.InDetUsedInFitTrackDecoratorToolConf import InDet__InDetUsedInFitTrackDecoratorTool
-  InDetUsedInFitDecoratorTool = InDet__InDetUsedInFitTrackDecoratorTool(name                 = "InDetUsedInFitDecoratorTool",
-                                                                        AMVFVerticesDecoName = "TTVA_AMVFVertices",
-                                                                        AMVFWeightsDecoName  = "TTVA_AMVFWeights",
-                                                                        TrackContainer       = InDetKeys.xAODTrackParticleContainer(),
-                                                                        VertexContainer      = InDetKeys.xAODVertexContainer())
-  ToolSvc += InDetUsedInFitDecoratorTool
-
-  from InDetUsedInVertexFitTrackDecorator.InDetUsedInVertexFitTrackDecoratorConf import InDet__InDetUsedInVertexFitTrackDecorator
-  InDetUsedInFitDecorator = InDet__InDetUsedInVertexFitTrackDecorator(name                   = "InDetUsedInFitDecorator",
-                                                                      UsedInFitDecoratorTool = ToolSvc.InDetUsedInFitDecoratorTool)
-
-  topSequence += InDetUsedInFitDecorator
-  if InDetFlags.doPrintConfigurables():
-    printfunc(InDetUsedInFitDecorator)
+
+  # Get a dummy (*unused*) TTVA tool - automatically handles addition of used-in-fit decoration
+  from TrackVertexAssociationTool.getTTVAToolForReco import getTTVAToolForReco
+  getTTVAToolForReco('dummy', TrackContName = InDetKeys.xAODTrackParticleContainer(), VertexContName = InDetKeys.xAODVertexContainer())
 
 # -------------------------------------------------------------------------
 #
diff --git a/InnerDetector/InDetExample/InDetRecExample/share/WriteInDetAOD.py b/InnerDetector/InDetExample/InDetRecExample/share/WriteInDetAOD.py
index 5076d49866e89df991ef19ff34f7ae6e338ace46..a466e795b8db33d6227dc3a7f71f3b2f2d662726 100755
--- a/InnerDetector/InDetExample/InDetRecExample/share/WriteInDetAOD.py
+++ b/InnerDetector/InDetExample/InDetRecExample/share/WriteInDetAOD.py
@@ -8,7 +8,7 @@ InDetAODList = []
 
 if InDetFlags.doxAOD():
 
-  excludedAuxData = "-caloExtension.-cellAssociation.-clusterAssociation.-TTVA_AMVFVertices.-TTVA_AMVFWeights"
+  excludedAuxData = "-caloExtension.-cellAssociation.-clusterAssociation.-TTVA_AMVFVertices_forReco.-TTVA_AMVFWeights_forReco"
 
   if not (InDetFlags.KeepFirstParameters() or InDetFlags.keepAdditionalHitsOnTrackParticle()):
     excludedAuxData += '.-trackParameterCovarianceMatrices.-parameterX.-parameterY.-parameterZ.-parameterPX.-parameterPY.-parameterPZ.-parameterPosition'
diff --git a/InnerDetector/InDetExample/InDetRecExample/share/WriteInDetESD.py b/InnerDetector/InDetExample/InDetRecExample/share/WriteInDetESD.py
index d65fdfb62d71cc9a18924b0f135ba4677524c915..3e205240df49dadfe4861aa6b82844a6eb646615 100755
--- a/InnerDetector/InDetExample/InDetRecExample/share/WriteInDetESD.py
+++ b/InnerDetector/InDetExample/InDetRecExample/share/WriteInDetESD.py
@@ -136,7 +136,7 @@ if globalflags.InputFormat()=='bytestream':
 
 if InDetFlags.doxAOD():
 
-  excludedAuxData = "-caloExtension.-cellAssociation.-clusterAssociation.-TTVA_AMVFVertices.-TTVA_AMVFWeights"
+  excludedAuxData = "-caloExtension.-cellAssociation.-clusterAssociation.-TTVA_AMVFVertices_forReco.-TTVA_AMVFWeights_forReco"
 
   if not (InDetFlags.KeepFirstParameters() or InDetFlags.keepAdditionalHitsOnTrackParticle()):
     excludedAuxData += '.-trackParameterCovarianceMatrices.-parameterX.-parameterY.-parameterZ.-parameterPX.-parameterPY.-parameterPZ.-parameterPosition'
diff --git a/InnerDetector/InDetMonitoring/InDetAlignmentMonitoring/src/IDAlignMonResiduals.h b/InnerDetector/InDetMonitoring/InDetAlignmentMonitoring/src/IDAlignMonResiduals.h
index 36ce3bcf4313e93339628b62e14cdec13073c273..a86fa804dcece684a15beacd51fbd2022e03e0b8 100755
--- a/InnerDetector/InDetMonitoring/InDetAlignmentMonitoring/src/IDAlignMonResiduals.h
+++ b/InnerDetector/InDetMonitoring/InDetAlignmentMonitoring/src/IDAlignMonResiduals.h
@@ -191,7 +191,7 @@ class IDAlignMonResiduals : public ManagedMonitorToolBase
   bool m_extendedPlots{};
   bool m_changedlumiblock{};
   int  m_oldlumiblock{};
-  int m_FinerBinningFactor{};
+  float m_FinerBinningFactor{};
   float m_LBGranularity{};
   std::vector<TString> m_siliconBarrelLayersLabels; 
   std::vector<TString> m_siliconEndcapLayersLabels;
diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/IDPerfMonZmumu.h b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/IDPerfMonZmumu.h
index 7299628961b205b80d1c9d027d5d031f4258daf1..a61ccb9ede36ff51acbb259fd8b0261c0edb7899 100755
--- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/IDPerfMonZmumu.h
+++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/IDPerfMonZmumu.h
@@ -190,7 +190,7 @@ class IDPerfMonZmumu : public AthAlgorithm
   double m_positive_d0{};
   double m_positive_z0_err{};
   double m_positive_d0_err{};
-  double m_positive_sigma_qOverP{};
+  double m_positive_sigma_pt{};
   double m_positive_z0_PV{};
   double m_positive_d0_PV{};
   double m_positive_z0_PVerr{};
@@ -218,7 +218,7 @@ class IDPerfMonZmumu : public AthAlgorithm
   double m_negative_d0{};
   double m_negative_z0_err{};
   double m_negative_d0_err{};
-  double m_negative_sigma_qOverP{};
+  double m_negative_sigma_pt{};
   double m_negative_z0_PV{};
   double m_negative_d0_PV{};
   double m_negative_z0_PVerr{};
diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/TrackMonitoring.py b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/TrackMonitoring.py
index f78edefa20aa6ccb9b6be60f279c757f14141048..d11abd230bd9cc03e02daf3aaa5e7c72469c8104 100644
--- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/TrackMonitoring.py
+++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/TrackMonitoring.py
@@ -129,6 +129,7 @@ for trackCollection in trackCollections:
                                                      NBinsPtRange = 25,
                                                      xHitErrorRange = 0.06,
                                                      maxPtforECHistos = 100., # to be set to 10 or 5 GeV
+                                                     FinerBinningFactor = 0.5, 
                                                      applyHistWeight = useWeightInMonitoring,
                                                      hWeightHistName = "h_eventMuVsTrkEta",
                                                      hWeightInFileName = fileWithWeights,
diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMonZmumu.cxx b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMonZmumu.cxx
index 03a20e4b1f4ed63020d18c25e9ac7edc03259d43..95176f2c1cb186713d7b675e58aa04e605d49f04 100755
--- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMonZmumu.cxx
+++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMonZmumu.cxx
@@ -285,6 +285,7 @@ StatusCode IDPerfMonZmumu::bookTrees()
     m_defaultTree->Branch("Negative_d0",  &m_negative_d0,  "Negative_d0/D");
     m_defaultTree->Branch("Negative_z0_err",  &m_negative_z0_err,  "Negative_z0_err/D");
     m_defaultTree->Branch("Negative_d0_err",  &m_negative_d0_err,  "Negative_d0_err/D");
+    m_defaultTree->Branch("Negative_sigma_pt",  &m_negative_sigma_pt,  "Negative_sigma_pt/D");
 
     m_defaultTree->Branch("Positive_Px",  &m_positive_px,  "Positive_Px/D");
     m_defaultTree->Branch("Positive_Py",  &m_positive_py,  "Positive_Py/D");
@@ -293,6 +294,7 @@ StatusCode IDPerfMonZmumu::bookTrees()
     m_defaultTree->Branch("Positive_d0",  &m_positive_d0,  "Positive_d0/D");
     m_defaultTree->Branch("Positive_z0_err",  &m_positive_z0_err,  "Positive_z0_err/D");
     m_defaultTree->Branch("Positive_d0_err",  &m_positive_d0_err,  "Positive_d0_err/D");
+    m_defaultTree->Branch("Positive_sigma_pt",  &m_positive_sigma_pt,  "Positive_sigma_pt/D");
     
     if (m_doIP) {
       m_defaultTree->Branch("Negative_d0_PV",      &m_negative_d0_PV   ,  "Negative_d0_PV/D");
@@ -329,6 +331,8 @@ StatusCode IDPerfMonZmumu::bookTrees()
     m_IDTree->Branch("Negative_d0",  &m_negative_d0,  "Negative_d0/D");
     m_IDTree->Branch("Negative_z0_err",  &m_negative_z0_err,  "Negative_z0_err/D");
     m_IDTree->Branch("Negative_d0_err",  &m_negative_d0_err,  "Negative_d0_err/D");
+    m_IDTree->Branch("Negative_sigma_pt",  &m_negative_sigma_pt,  "Negative_sigma_pt/D");
+
     m_IDTree->Branch("Positive_Px",  &m_positive_px,  "Positive_Px/D");
     m_IDTree->Branch("Positive_Py",  &m_positive_py,  "Positive_Py/D");
     m_IDTree->Branch("Positive_Pz",  &m_positive_pz,  "Positive_Pz/D");
@@ -336,6 +340,7 @@ StatusCode IDPerfMonZmumu::bookTrees()
     m_IDTree->Branch("Positive_d0",  &m_positive_d0,  "Positive_d0/D");
     m_IDTree->Branch("Positive_z0_err",  &m_positive_z0_err,  "Positive_z0_err/D");
     m_IDTree->Branch("Positive_d0_err",  &m_positive_d0_err,  "Positive_d0_err/D");
+    m_IDTree->Branch("Positive_sigma_pt",  &m_positive_sigma_pt,  "Positive_sigma_pt/D");
     
     if(m_doIP){
       m_IDTree->Branch("Negative_d0_PV",      &m_negative_d0_PV   ,  "Negative_d0_PV/D");
@@ -372,7 +377,7 @@ StatusCode IDPerfMonZmumu::bookTrees()
     m_refit1Tree->Branch("Negative_d0",  &m_negative_d0,  "Negative_d0/D");
     m_refit1Tree->Branch("Negative_z0_err",  &m_negative_z0_err,  "Negative_z0_err/D");
     m_refit1Tree->Branch("Negative_d0_err",  &m_negative_d0_err,  "Negative_d0_err/D");
-    m_refit1Tree->Branch("Negative_sigma_qoverp",  &m_negative_sigma_qOverP,  "Negative_sigma_qoverp/D");
+    m_refit1Tree->Branch("Negative_sigma_pt",  &m_negative_sigma_pt,  "Negative_sigma_pt/D");
 
     m_refit1Tree->Branch("Positive_Px",  &m_positive_px,  "Positive_Px/D");
     m_refit1Tree->Branch("Positive_Py",  &m_positive_py,  "Positive_Py/D");
@@ -381,7 +386,7 @@ StatusCode IDPerfMonZmumu::bookTrees()
     m_refit1Tree->Branch("Positive_d0",  &m_positive_d0,  "Positive_d0/D");
     m_refit1Tree->Branch("Positive_z0_err",  &m_positive_z0_err,  "Positive_z0_err/D");
     m_refit1Tree->Branch("Positive_d0_err",  &m_positive_d0_err,  "Positive_d0_err/D");
-    m_refit1Tree->Branch("Positive_sigma_qoverp",  &m_positive_sigma_qOverP,  "Positive_sigma_qoverp/D");
+    m_refit1Tree->Branch("Positive_sigma_pt",  &m_positive_sigma_pt,  "Positive_sigma_pt/D");
 
     if(m_doIP){
       m_refit1Tree->Branch("Negative_d0_PV",      &m_negative_d0_PV   ,  "Negative_d0_PV/D");
@@ -418,8 +423,7 @@ StatusCode IDPerfMonZmumu::bookTrees()
     m_refit2Tree->Branch("Negative_d0",  &m_negative_d0,  "Negative_d0/D");
     m_refit2Tree->Branch("Negative_z0_err",  &m_negative_z0_err,  "Negative_z0_err/D");
     m_refit2Tree->Branch("Negative_d0_err",  &m_negative_d0_err,  "Negative_d0_err/D");
-
-
+    m_refit2Tree->Branch("Negative_sigma_pt",  &m_negative_sigma_pt,  "Negative_sigma_pt/D");
 
     m_refit2Tree->Branch("Positive_Px",  &m_positive_px,  "Positive_Px/D");
     m_refit2Tree->Branch("Positive_Py",  &m_positive_py,  "Positive_Py/D");
@@ -428,6 +432,7 @@ StatusCode IDPerfMonZmumu::bookTrees()
     m_refit2Tree->Branch("Positive_d0",  &m_positive_d0,  "Positive_d0/D");
     m_refit2Tree->Branch("Positive_z0_err",  &m_positive_z0_err,  "Positive_z0_err/D");
     m_refit2Tree->Branch("Positive_d0_err",  &m_positive_d0_err,  "Positive_d0_err/D");
+    m_refit2Tree->Branch("Positive_sigma_pt",  &m_positive_sigma_pt,  "Positive_sigma_pt/D");
 
 
     if(m_doIP){
@@ -467,7 +472,7 @@ StatusCode IDPerfMonZmumu::bookTrees()
     m_combTree->Branch("Negative_d0",  &m_negative_d0,  "Negative_d0/D");
     m_combTree->Branch("Negative_z0_err",  &m_negative_z0_err,  "Negative_z0_err/D");
     m_combTree->Branch("Negative_d0_err",  &m_negative_d0_err,  "Negative_d0_err/D");
-
+    m_combTree->Branch("Negative_sigma_pt",  &m_negative_sigma_pt,  "Negative_sigma_pt/D");
 
     m_combTree->Branch("Positive_Px",  &m_positive_px,  "Positive_Px/D");
     m_combTree->Branch("Positive_Py",  &m_positive_py,  "Positive_Py/D");
@@ -476,6 +481,7 @@ StatusCode IDPerfMonZmumu::bookTrees()
     m_combTree->Branch("Positive_d0",  &m_positive_d0,  "Positive_d0/D");
     m_combTree->Branch("Positive_z0_err",  &m_positive_z0_err,  "Positive_z0_err/D");
     m_combTree->Branch("Positive_d0_err",  &m_positive_d0_err,  "Positive_d0_err/D");
+    m_combTree->Branch("Positive_sigma_pt",  &m_positive_sigma_pt,  "Positive_sigma_pt/D");
     
     if(m_doIP){
       m_combTree->Branch("Negative_z0_PV",  &m_negative_z0_PV,  "Negative_z0_PV/D");
@@ -514,6 +520,7 @@ StatusCode IDPerfMonZmumu::bookTrees()
     m_MSTree->Branch("Negative_d0",  &m_negative_d0,  "Negative_d0/D");
     m_MSTree->Branch("Negative_z0_err",  &m_negative_z0_err,  "Negative_z0_err/D");
     m_MSTree->Branch("Negative_d0_err",  &m_negative_d0_err,  "Negative_d0_err/D");
+    m_MSTree->Branch("Negative_sigma_pt",  &m_negative_sigma_pt,  "Negative_sigma_pt/D");
 
     m_MSTree->Branch("Positive_Px",  &m_positive_px,  "Positive_Px/D");
     m_MSTree->Branch("Positive_Py",  &m_positive_py,  "Positive_Py/D");
@@ -522,6 +529,7 @@ StatusCode IDPerfMonZmumu::bookTrees()
     m_MSTree->Branch("Positive_d0",  &m_positive_d0,  "Positive_d0/D");
     m_MSTree->Branch("Positive_z0_err",  &m_positive_z0_err,  "Positive_z0_err/D");
     m_MSTree->Branch("Positive_d0_err",  &m_positive_d0_err,  "Positive_d0_err/D");
+    m_MSTree->Branch("Positive_sigma_pt",  &m_positive_sigma_pt,  "Positive_sigma_pt/D");
   }
 
   if( m_isMC && m_truthTree == 0){
@@ -907,14 +915,16 @@ StatusCode IDPerfMonZmumu::execute()
 			<< "  pt: " << muon_pos->trackParticle(xAOD::Muon::InnerDetectorTrackParticle)->pt()
 			<< "  d0: " << m_positive_d0 
 			<< "  z0: " << m_positive_z0
-			<< "  d0unc: " << m_positive_d0_err);
+			<< "  d0unc: " << m_positive_d0_err
+			<< "  sigma_pt: " << m_positive_sigma_pt);
 	  ATH_MSG_DEBUG("mu-  --> pxyz: " << m_negative_px
 			<< ", " << m_negative_py
 			<< ", " << m_negative_pz
 			<< "  pt: " << muon_neg->trackParticle(xAOD::Muon::InnerDetectorTrackParticle)->pt()
 			<< "  d0: " << m_negative_d0
 			<< "  z0: " << m_negative_z0
-			<< " d0unc: " << m_negative_d0_err);
+			<< "  d0unc: " << m_negative_d0_err
+			<< "  sigma_pt: " << m_negative_sigma_pt);
 	  // ntuple variables have been filled in FillRecParametersTP
 	  m_IDTree->Fill();
 	}
@@ -958,14 +968,16 @@ StatusCode IDPerfMonZmumu::execute()
 		      << "  pt: " << muon_pos->trackParticle(xAOD::Muon::CombinedTrackParticle)->pt()
 		      << "  d0: " << m_positive_d0 
 		      << "  z0: " << m_positive_z0
-		      << "  d0unc: " << m_positive_d0_err);
+		      << "  d0unc: " << m_positive_d0_err
+		      << "  sigma_pt: " << m_positive_sigma_pt);
 	ATH_MSG_DEBUG("mu- --> pxyz: " << m_negative_px
 		      << ", " << m_negative_py
 		      << ", " << m_negative_pz 
 		      << "  pt: " << muon_neg->trackParticle(xAOD::Muon::CombinedTrackParticle)->pt()
 		      << "  d0: " << m_negative_d0
 		      << "  z0: " << m_negative_z0
-		      << "  d0unc: " << m_negative_d0_err);
+		      << "  d0unc: " << m_negative_d0_err
+		      << "  sigma_pt: " << m_negative_sigma_pt);
 	// ntuple variables have been filled in FillRecParameters
 	m_combTree->Fill();
       }
@@ -998,14 +1010,16 @@ StatusCode IDPerfMonZmumu::execute()
 		      << "  pt: " << m_xZmm.getMSTrack(m_xZmm.getPosMuon(ZmumuEvent::CB))->pt()
 		      << "  d0: " << m_positive_d0 
 		      << "  z0: " << m_positive_z0
-		      << "  d0unc: " << m_positive_d0_err);
+		      << "  d0unc: " << m_positive_d0_err
+		      << "  sigma_pt: " << m_positive_sigma_pt);
 	ATH_MSG_DEBUG("mu- --> pxyz: " << m_negative_px
 		      << ", " << m_negative_py
 		      << ", " << m_negative_pz 
 		      << "  pt: " << m_xZmm.getMSTrack(m_xZmm.getNegMuon(ZmumuEvent::CB))->pt()
 		      << "  d0: " << m_negative_d0
 		      << "  z0: " << m_negative_z0
-		      << "  d0unc: " << m_negative_d0_err);
+		      << "  d0unc: " << m_negative_d0_err
+		      << "  sigma_pt: " << m_negative_sigma_pt);
 	// ntuple variables have been filled in FillRecParametersTP
 	m_MSTree->Fill();
       }
@@ -1153,12 +1167,14 @@ StatusCode IDPerfMonZmumu::execute()
 			  << m_negative_py << ", "
 			  << m_negative_pz << ") "
 			  << "  d0: " << m_negative_d0
-			  << "  z0: " << m_negative_z0);
+			  << "  z0: " << m_negative_z0
+			  << "  sigma_pt: " << m_positive_sigma_pt);
 	    ATH_MSG_DEBUG("Positive p: (" << m_positive_px << ","
 			  << m_positive_py << ","
 			  << m_positive_pz << ") "
 			  << "  d0: " << m_positive_d0
-			  << "  z0: " << m_positive_z0);	  
+			  << "  z0: " << m_positive_z0	  
+			  << "  sigma_pt: " << m_negative_sigma_pt);
 	    m_refit1Tree->Fill();
 	  }
 	  else {
@@ -1190,12 +1206,14 @@ StatusCode IDPerfMonZmumu::execute()
 			  << m_negative_py << ", "
 			  << m_negative_pz << ") "
 			  << "  d0: " << m_negative_d0
-			  << "  z0: " << m_negative_z0);
+			  << "  z0: " << m_negative_z0
+			  << "  sigma_pt: " << m_positive_sigma_pt);
 	    ATH_MSG_DEBUG("Positive p: (" << m_positive_px << ","
 			  << m_positive_py << ","
 			  << m_positive_pz << ") "
 			  << "  d0: " << m_positive_d0
-			  << "  z0: " << m_positive_z0);	  
+			  << "  z0: " << m_positive_z0	  
+			  << "  sigma_pt: " << m_negative_sigma_pt);
 	    m_refit2Tree->Fill();
 	  }
 	  else {
@@ -1290,7 +1308,7 @@ StatusCode IDPerfMonZmumu::FillRecParametersTP(const xAOD::TrackParticle* trackp
   double PVz0res = 0;
   double PVd0 = 0;
   double PVz0 = 0;
-  double sigma_qOverP = 0;
+  double sigma_pt = 0;
   
   px = trackp->p4().Px();
   py = trackp->p4().Py();
@@ -1300,7 +1318,11 @@ StatusCode IDPerfMonZmumu::FillRecParametersTP(const xAOD::TrackParticle* trackp
   
   d0res = std::sqrt(trackp->definingParametersCovMatrix()(Trk::d0,Trk::d0));
   z0res = std::sqrt(trackp->definingParametersCovMatrix()(Trk::z0,Trk::z0));
-  sigma_qOverP = std::sqrt(trackp->definingParametersCovMatrix()(Trk::qOverP,Trk::qOverP));
+  // computing sigma_pt
+  // pt = sin(theta) / qOverP --> sigma(pt) = (sin(theta)/ qOverP^2) x sigma(qOverP) // neglecting sigma(sin(theta))
+  const Trk::Perigee *thePerigee   = &(trackp->perigeeParameters());
+  double sigma_qOverP = std::sqrt(trackp->definingParametersCovMatrix()(Trk::qOverP,Trk::qOverP));  
+  sigma_pt = (sin(thePerigee->parameters()[Trk::theta]) / pow(thePerigee->parameters()[Trk::qOverP],2)) * sigma_qOverP;
 
   if (vertex == nullptr) {
     ATH_MSG_WARNING("in FillRecParametersTP. WARNING: Vertex is NULL");
@@ -1343,7 +1365,7 @@ StatusCode IDPerfMonZmumu::FillRecParametersTP(const xAOD::TrackParticle* trackp
     m_positive_z0_err = z0res;
     m_positive_d0 = d0;
     m_positive_d0_err = d0res;
-    m_positive_sigma_qOverP = sigma_qOverP;
+    m_positive_sigma_pt = sigma_pt;
     if(m_doIP){
       m_positive_z0_PV = PVz0;
       m_positive_d0_PV = PVd0;
@@ -1360,7 +1382,7 @@ StatusCode IDPerfMonZmumu::FillRecParametersTP(const xAOD::TrackParticle* trackp
     m_negative_z0_err = z0res;
     m_negative_d0 = d0;
     m_negative_d0_err = d0res;
-    m_negative_sigma_qOverP = sigma_qOverP;
+    m_negative_sigma_pt = sigma_pt;
     if(m_doIP){
       m_negative_z0_PV = PVz0;
       m_negative_d0_PV = PVd0;
@@ -1789,7 +1811,7 @@ void IDPerfMonZmumu::Clear4MuNtupleVariables()
   m_positive_z0 = 0.;
   m_positive_d0_err = 0.;
   m_positive_z0_err = 0.;
-  m_positive_sigma_qOverP = 0.;
+  m_positive_sigma_pt = 0.;
   m_positive_1_vtx = 0;
   m_positive_parent = 0;
 
@@ -1800,7 +1822,7 @@ void IDPerfMonZmumu::Clear4MuNtupleVariables()
   m_negative_z0 = 0.;
   m_negative_d0_err = 0.;
   m_negative_z0_err = 0.;
-  m_negative_sigma_qOverP = 0.;
+  m_negative_sigma_pt = 0.;
   m_negative_1_vtx = 0;
   m_negative_parent = 0;
 	
diff --git a/InnerDetector/InDetRecTools/InDetIncSecVxFinderTool/CMakeLists.txt b/InnerDetector/InDetRecTools/InDetIncSecVxFinderTool/CMakeLists.txt
index 7fdad69e34a6fb8da1262c765c2edaf7bd6ff15c..cee93252b62f5d3b625d9acc37ae210d650824ba 100644
--- a/InnerDetector/InDetRecTools/InDetIncSecVxFinderTool/CMakeLists.txt
+++ b/InnerDetector/InDetRecTools/InDetIncSecVxFinderTool/CMakeLists.txt
@@ -12,4 +12,4 @@ atlas_add_component( InDetIncSecVxFinderTool
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps AthContainers CxxUtils xAODTracking GaudiKernel InDetRecToolInterfaces GeoPrimitives TrkTrack TrkParticleBase TrkParameters TrkEventPrimitives VxVertex TrkLinks TrkTrack TrkTrackLink TrkTrackSummary TrkSurfaces TrkVertexFitterInterfaces EventPrimitives InDetTrackSelectionToolLib TrkVertexSeedFinderUtilsLib InDetBeamSpotServiceLib )
+                     LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps AthContainers CxxUtils xAODTracking GaudiKernel InDetRecToolInterfaces GeoPrimitives TrkTrack TrkParticleBase TrkParameters TrkEventPrimitives VxVertex TrkLinks TrkTrack TrkTrackLink TrkTrackSummary TrkSurfaces TrkVertexFitterInterfaces EventPrimitives InDetTrackSelectionToolLib TrkVertexSeedFinderUtilsLib BeamSpotConditionsData )
diff --git a/InnerDetector/InDetRecTools/InDetIncSecVxFinderTool/InDetIncSecVxFinderTool/InDetIterativeSecVtxFinderTool.h b/InnerDetector/InDetRecTools/InDetIncSecVxFinderTool/InDetIncSecVxFinderTool/InDetIterativeSecVtxFinderTool.h
index 991b520f9a01e93a9ff67d79f8e85ca6a5499865..e833099bb26a04fc6be3ce48a6eb4c1b03f7af4e 100755
--- a/InnerDetector/InDetRecTools/InDetIncSecVxFinderTool/InDetIncSecVxFinderTool/InDetIterativeSecVtxFinderTool.h
+++ b/InnerDetector/InDetRecTools/InDetIncSecVxFinderTool/InDetIncSecVxFinderTool/InDetIterativeSecVtxFinderTool.h
@@ -31,11 +31,12 @@
 #include "TrkParameters/TrackParameters.h"
 // we may save out some private stuff
 #include "TTree.h"
-class IBeamCondSvc;
 #include "xAODTracking/VertexFwd.h"
 #include "xAODTracking/TrackParticleFwd.h"
 #include "xAODTracking/VertexContainerFwd.h"
 #include "xAODTracking/TrackParticleContainerFwd.h"
+#include "BeamSpotConditionsData/BeamSpotData.h"
+
 
 namespace Trk
 {
@@ -152,7 +153,7 @@ public:
    ToolHandle< Trk::IImpactPoint3dEstimator > m_ImpactPoint3dEstimator;
    ToolHandle< Trk::IVertexLinearizedTrackFactory > m_LinearizedTrackFactory;
    
-   ServiceHandle<IBeamCondSvc> m_iBeamCondSvc; //!< pointer to the beam condition service
+  SG::ReadCondHandleKey<InDet::BeamSpotData> m_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" };
 
    bool m_useBeamConstraint;
    double m_significanceCutSeeding;
diff --git a/InnerDetector/InDetRecTools/InDetIncSecVxFinderTool/src/InDetIterativeSecVtxFinderTool.cxx b/InnerDetector/InDetRecTools/InDetIncSecVxFinderTool/src/InDetIterativeSecVtxFinderTool.cxx
index 1c277493b25cdcd88d0d0076830b054760220d9f..2bc6d01ebab62f794c8ab8dbbc415c78011472d7 100644
--- a/InnerDetector/InDetRecTools/InDetIncSecVxFinderTool/src/InDetIterativeSecVtxFinderTool.cxx
+++ b/InnerDetector/InDetRecTools/InDetIncSecVxFinderTool/src/InDetIterativeSecVtxFinderTool.cxx
@@ -33,7 +33,6 @@
 //#include <TMath.h>
 
 #include "TrkVertexFitterInterfaces/IImpactPoint3dEstimator.h"
-#include "InDetBeamSpotService/IBeamCondSvc.h"
 #include "InDetTrackSelectionTool/IInDetTrackSelectionTool.h"
 #include "TrkVertexFitterInterfaces/IVertexSeedFinder.h"
 
@@ -77,7 +76,6 @@ InDetIterativeSecVtxFinderTool::InDetIterativeSecVtxFinderTool(const std::string
           m_SeedFinder("Trk::IndexedCrossDistancesSeedFinder", this ),
           m_ImpactPoint3dEstimator("Trk::ImpactPoint3dEstimator", this ),
           m_LinearizedTrackFactory("Trk::FullLinearizedTrackFactory", this ),
-          m_iBeamCondSvc("BeamCondSvc",n),
           m_useBeamConstraint(false),
           m_significanceCutSeeding(10),
           m_maximumChi2cutForSeeding(6.*6.),
@@ -106,7 +104,6 @@ InDetIterativeSecVtxFinderTool::InDetIterativeSecVtxFinderTool(const std::string
     declareProperty("VertexFitterTool", m_iVertexFitter);
     declareProperty("BaseTrackSelector",m_trkFilter);
     declareProperty("SecVtxTrackSelector",m_SVtrkFilter);
-    declareProperty("BeamPositionSvc", m_iBeamCondSvc);
     declareProperty("SeedFinder"       , m_SeedFinder);
     declareProperty("ImpactPoint3dEstimator",m_ImpactPoint3dEstimator);
     declareProperty("LinearizedTrackFactory",m_LinearizedTrackFactory);
@@ -142,8 +139,9 @@ std::pair<xAOD::VertexContainer*, xAOD::VertexAuxContainer*> InDetIterativeSecVt
 
   xAOD::Vertex beamposition;
   beamposition.makePrivateStore();
-  beamposition.setPosition(m_iBeamCondSvc->beamVtx().position());
-  beamposition.setCovariancePosition(m_iBeamCondSvc->beamVtx().covariancePosition());
+  SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey };
+  beamposition.setPosition(beamSpotHandle->beamVtx().position());
+  beamposition.setCovariancePosition(beamSpotHandle->beamVtx().covariancePosition());
 
   typedef DataVector<xAOD::TrackParticle>::const_iterator TrackParticleDataVecIter;
 
@@ -205,8 +203,9 @@ std::pair<xAOD::VertexContainer*, xAOD::VertexAuxContainer*>
 
   xAOD::Vertex beamposition;
   beamposition.makePrivateStore();
-  beamposition.setPosition(m_iBeamCondSvc->beamVtx().position());
-  beamposition.setCovariancePosition(m_iBeamCondSvc->beamVtx().covariancePosition());
+  SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey };
+  beamposition.setPosition(beamSpotHandle->beamVtx().position());
+  beamposition.setCovariancePosition(beamSpotHandle->beamVtx().covariancePosition());
 
   bool selectionPassed;
   m_trkdefiPars.clear() ;
@@ -355,10 +354,11 @@ std::pair<xAOD::VertexContainer*, xAOD::VertexAuxContainer*> InDetIterativeSecVt
     xAOD::Vertex theconstraint;
     if (m_useBeamConstraint) {
       theconstraint = xAOD::Vertex(); // Default constructor creates a private store
-      theconstraint.setPosition( m_iBeamCondSvc->beamVtx().position() );
-      theconstraint.setCovariancePosition( m_iBeamCondSvc->beamVtx().covariancePosition() );
-      theconstraint.setFitQuality( m_iBeamCondSvc->beamVtx().fitQuality().chiSquared(), 
-                                    m_iBeamCondSvc->beamVtx().fitQuality().doubleNumberDoF() );
+      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() );
 
       seedVertex = m_SeedFinder->findSeed( m_privtx.x(), m_privtx.y(),
                                            perigeeList, &theconstraint );
@@ -1743,12 +1743,7 @@ StatusCode InDetIterativeSecVtxFinderTool::initialize()
       return StatusCode::FAILURE;
     }
 
-    sc = m_iBeamCondSvc.retrieve();
-    if (sc.isFailure())
-    {
-      ATH_MSG_ERROR( "Could not find BeamCondSvc." );
-      return sc;
-    }
+    ATH_CHECK(m_beamSpotKey.initialize());
 
     if(m_trkFilter.retrieve().isFailure()) {
       ATH_MSG_ERROR(" Unable to retrieve "<<m_trkFilter );
@@ -1837,8 +1832,8 @@ std::pair<xAOD::VertexContainer*, xAOD::VertexAuxContainer*> InDetIterativeSecVt
   beamposition.setPosition(m_iBeamCondSvc->beamVtx().position());
   beamposition.setCovariancePosition(m_iBeamCondSvc->beamVtx().covariancePosition());
   */
-
-  Trk::RecVertex beamposition(m_iBeamCondSvc->beamVtx());
+  SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey };
+  Trk::RecVertex beamposition(beamSpotHandle->beamVtx());
 
   std::vector<Trk::ITrackLink*> selectedTracks;
 
@@ -1884,8 +1879,8 @@ std::pair<xAOD::VertexContainer*, xAOD::VertexAuxContainer*> InDetIterativeSecVt
   std::vector<Trk::ITrackLink*> selectedTracks;
 
   // TODO: change trkFilter to allow for this replacement
-
-  Trk::RecVertex beamposition(m_iBeamCondSvc->beamVtx());
+  SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey };
+  Trk::RecVertex beamposition(beamSpotHandle->beamVtx());
 
   typedef DataVector<Trk::TrackParticleBase>::const_iterator TrackParticleDataVecIter;
 
diff --git a/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/CMakeLists.txt b/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/CMakeLists.txt
index cd32326b83e7fc6d912c0fef880dd5135c290055..7a878caeccc8f56438f4ccf9cecbd36a12fa8ca0 100644
--- a/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/CMakeLists.txt
+++ b/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/CMakeLists.txt
@@ -7,4 +7,4 @@ atlas_subdir( InDetMultipleVertexSeedFinder )
 atlas_add_component( InDetMultipleVertexSeedFinder
                      src/*.cxx
                      src/components/*.cxx
-                     LINK_LIBRARIES AthenaBaseComps GaudiKernel InDetRecToolInterfaces EventPrimitives xAODTracking InDetMultipleVertexSeedFinderUtilsLib TrkParticleBase TrkTrack VxVertex TrkExInterfaces TrkToolInterfaces TrkVertexFitterInterfaces InDetBeamSpotServiceLib )
+                     LINK_LIBRARIES AthenaBaseComps GaudiKernel InDetRecToolInterfaces EventPrimitives xAODTracking InDetMultipleVertexSeedFinderUtilsLib TrkParticleBase TrkTrack VxVertex TrkExInterfaces TrkToolInterfaces TrkVertexFitterInterfaces BeamSpotConditionsData )
diff --git a/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/InDetMultipleVertexSeedFinder/DivisiveMultiSeedFinder.h b/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/InDetMultipleVertexSeedFinder/DivisiveMultiSeedFinder.h
index b262ba99b6bd46beba3da14ed4f68eda1e25515d..121937d9cd04a11deac6a33e04193d27e057c8df 100644
--- a/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/InDetMultipleVertexSeedFinder/DivisiveMultiSeedFinder.h
+++ b/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/InDetMultipleVertexSeedFinder/DivisiveMultiSeedFinder.h
@@ -8,8 +8,7 @@
 #include "AthenaBaseComps/AthAlgTool.h"
 #include "GaudiKernel/ToolHandle.h"
 #include "InDetRecToolInterfaces/IMultiPVSeedFinder.h"
-
-class IBeamCondSvc;
+#include "BeamSpotConditionsData/BeamSpotData.h"
 
 namespace Trk
 {
@@ -71,7 +70,8 @@ namespace InDet
   ToolHandle<InDetTrackClusterCleaningTool> m_cleaningTool;
   
 //beam spot finder
-  ServiceHandle< IBeamCondSvc > m_beamService; 
+  SG::ReadCondHandleKey<InDet::BeamSpotData> m_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" };
+
   ToolHandle<Trk::IExtrapolator> m_extrapolator; //<! Extrapolator tool
    
    //vertex seed finder
diff --git a/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/InDetMultipleVertexSeedFinder/HistogrammingMultiSeedFinder.h b/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/InDetMultipleVertexSeedFinder/HistogrammingMultiSeedFinder.h
index 702d3d481c1c89482490bc9ea4b9f96aa7398577..f0be795e9174c2ebfbca13fa7f0990a01650e45a 100644
--- a/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/InDetMultipleVertexSeedFinder/HistogrammingMultiSeedFinder.h
+++ b/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/InDetMultipleVertexSeedFinder/HistogrammingMultiSeedFinder.h
@@ -8,6 +8,7 @@
 #include "AthenaBaseComps/AthAlgTool.h"
 #include "GaudiKernel/ToolHandle.h"
 #include "InDetRecToolInterfaces/IMultiPVSeedFinder.h"
+#include "BeamSpotConditionsData/BeamSpotData.h"
 
 /**
  * A multi seed finder for primary vertexing. Uses a 
@@ -23,7 +24,6 @@
  * Mai 2007
  */
 
-class IBeamCondSvc;
 
 namespace Trk
 {
@@ -83,7 +83,7 @@ namespace InDet
    ToolHandle<Trk::IVertexSeedFinder> m_vtxSeedFinder;
 
 //beam spot finder
-  ServiceHandle< IBeamCondSvc > m_beamService;  
+   SG::ReadCondHandleKey<InDet::BeamSpotData> m_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" };
   ToolHandle<Trk::IExtrapolator> m_extrapolator; //<! Extrapolator tool
  };
 }//end of namespace definitions
diff --git a/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/InDetMultipleVertexSeedFinder/SlidingWindowMultiSeedFinder.h b/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/InDetMultipleVertexSeedFinder/SlidingWindowMultiSeedFinder.h
index 4f6bef4829916b1bbbac5ea32c02210e490c68ff..62002d408ceef31c3be42fc78ff6da7a65cf8edf 100644
--- a/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/InDetMultipleVertexSeedFinder/SlidingWindowMultiSeedFinder.h
+++ b/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/InDetMultipleVertexSeedFinder/SlidingWindowMultiSeedFinder.h
@@ -9,8 +9,8 @@
 #include "GaudiKernel/ToolHandle.h"
 //#include "TrkParameters/TrackParameters.h"
 #include "InDetRecToolInterfaces/IMultiPVSeedFinder.h"
+#include "BeamSpotConditionsData/BeamSpotData.h"
 
-class IBeamCondSvc;
 
 namespace Trk
 {
@@ -63,7 +63,7 @@ namespace InDet
    ToolHandle<Trk::IVertexSeedFinder> m_vtxSeedFinder;
    
 //beam spot finder
-  ServiceHandle< IBeamCondSvc > m_beamService;    
+  SG::ReadCondHandleKey<InDet::BeamSpotData> m_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" };
   ToolHandle<Trk::IExtrapolator> m_extrapolator; //<! Extrapolator tool 
 
  };//end of class definitions
diff --git a/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/src/DivisiveMultiSeedFinder.cxx b/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/src/DivisiveMultiSeedFinder.cxx
index dbec9d17a39232f6136f555bf042caf3ad5f58bc..8d45a91dbda4ab36bb620899c8e192f37dcc3fd7 100644
--- a/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/src/DivisiveMultiSeedFinder.cxx
+++ b/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/src/DivisiveMultiSeedFinder.cxx
@@ -9,7 +9,6 @@
 #include "InDetMultipleVertexSeedFinderUtils/InDetTrackZ0SortingTool.h"
 #include "InDetMultipleVertexSeedFinderUtils/InDetTrackClusterCleaningTool.h"
 #include "TrkParticleBase/TrackParticleBase.h"
-#include "InDetBeamSpotService/IBeamCondSvc.h"
 #include "InDetRecToolInterfaces/IMultiPVSeedFinder.h"
 #include "TrkExInterfaces/IExtrapolator.h"
 #include "TrkVertexFitterInterfaces/IVertexSeedFinder.h"
@@ -46,11 +45,7 @@ namespace InDet
    return StatusCode::FAILURE;
   }else msg(MSG::INFO)<<"Track sorting tool retrieved"<<endmsg;  
    
-  if(m_beamService.retrieve().isFailure())
-  {
-   msg(MSG::ERROR)<<"Unable to retrieve "<<m_beamService<<endmsg;
-   return StatusCode::FAILURE;
-  }else msg(MSG::INFO)<<"BeamSpot service retrieved"<<endmsg; 
+  ATH_CHECK(m_beamSpotKey.initialize());
    
   if ( m_extrapolator.retrieve().isFailure() ) 
   {                              
@@ -67,7 +62,6 @@ namespace InDet
                m_sepDistance(0.5), 
                m_nRemaining(1),
                m_ignoreBeamSpot(false),
-               m_beamService("BeamCondSvc",n),
                m_extrapolator("Trk::Extrapolator"), 
                m_vtxSeedFinder("Trk::CrossDistancesSeedFinder")
  {
@@ -88,8 +82,7 @@ namespace InDet
 //vertex finder tool (needed when no beam spot is available)
   declareProperty("VertexSeedFinder",m_vtxSeedFinder);
 
-//beam spot service  
-  declareProperty("BeamSpotSvc", m_beamService);
+
   
 //extrapolator
   declareProperty("Extrapolator",m_extrapolator);   
@@ -106,8 +99,8 @@ namespace InDet
   std::vector<const Trk::Track*>::const_iterator tr = tracks.begin();
   std::vector<const Trk::Track*>::const_iterator tre = tracks.end(); 
   
-//selecting with respect to the beam spot
-  Trk::RecVertex beamrecposition(m_beamService->beamVtx());  
+  SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey };
+  Trk::RecVertex beamrecposition(beamSpotHandle->beamVtx());  
   for(;tr!=tre;++tr) if(m_trkFilter->decision(**tr,&beamrecposition)) preselectedTracks.push_back(*tr);
   if(msgLvl(MSG::DEBUG))msg(MSG::DEBUG)<<"Beam spot position is: "<< beamrecposition.position()<<endmsg;
   Trk::Vertex* beamposition=&beamrecposition;
@@ -264,8 +257,8 @@ namespace InDet
   std::vector<const Trk::TrackParticleBase*>::const_iterator tre = tracks.end(); 
   
 //selecting with respect to the beam spot
-
-  Trk::RecVertex beamrecposition(m_beamService->beamVtx());    
+  SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey };
+  Trk::RecVertex beamrecposition(beamSpotHandle->beamVtx());    
   for(;tr!=tre;++tr) if(m_trkFilter->decision(**tr, &beamrecposition)) preselectedTracks.push_back(*tr);
   if(msgLvl(MSG::DEBUG))msg(MSG::DEBUG)<<"Beam spot position is: "<< beamrecposition.position()<<endmsg;
   Trk::Vertex* beamposition=&beamrecposition;
@@ -443,8 +436,9 @@ namespace InDet
 
 
   xAOD::Vertex * beamposition = new xAOD::Vertex();
-  beamposition->setPosition(m_beamService->beamVtx().position());
-  beamposition->setCovariancePosition(m_beamService->beamVtx().covariancePosition());
+  SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey };
+  beamposition->setPosition(beamSpotHandle->beamVtx().position());
+  beamposition->setCovariancePosition(beamSpotHandle->beamVtx().covariancePosition());
   // for(;tr!=tre;++tr) if(m_trkFilter->decision(**tr, &beamrecposition)) preselectedTracks.push_back(*tr);
   // if(msgLvl(MSG::DEBUG))msg(MSG::DEBUG)<<"Beam spot position is: "<< beamrecposition.position()<<endmsg;
   //Trk::Vertex* beamposition=&beamrecposition;
diff --git a/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/src/HistogrammingMultiSeedFinder.cxx b/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/src/HistogrammingMultiSeedFinder.cxx
index fc7c3bd7441b62cae33a76829bce221efefc0ffd..f2c3aaa9f200fbe472f9cc111bcc4830b791920d 100644
--- a/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/src/HistogrammingMultiSeedFinder.cxx
+++ b/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/src/HistogrammingMultiSeedFinder.cxx
@@ -7,7 +7,6 @@
 //#include "TrkParameters/TrackParameters.h"
 #include "TrkToolInterfaces/ITrackSelectorTool.h"
 #include "InDetMultipleVertexSeedFinderUtils/InDetTrackClusterCleaningTool.h"
-#include "InDetBeamSpotService/IBeamCondSvc.h"
 #include "TrkParticleBase/TrackParticleBase.h"
 #include "TrkExInterfaces/IExtrapolator.h"
 #include "TrkVertexFitterInterfaces/IVertexSeedFinder.h"
@@ -31,12 +30,7 @@ namespace InDet
    return StatusCode::FAILURE;
   }else msg(MSG::INFO)<<"Cluster cleaning tool retrieved"<<endmsg;  
    
-  if(m_beamService.retrieve().isFailure())
-  {
-   msg(MSG::ERROR)<<"Unable to retrieve "<<m_beamService<<endmsg;
-   return StatusCode::FAILURE;
-  }else msg(MSG::INFO)<<"BeamSpot service retrieved"<<endmsg;  
-   
+  ATH_CHECK(m_beamSpotKey.initialize());
   if(m_vtxSeedFinder.retrieve().isFailure())
   {
     msg(MSG::ERROR) << "Unable to retrieve " << m_vtxSeedFinder <<endmsg;
@@ -61,7 +55,6 @@ namespace InDet
          m_histoRange(200.), 
          m_ignoreBeamSpot(false),
          m_vtxSeedFinder("Trk::CrossDistancesSeedFinder"),
-         m_beamService("BeamCondSvc",n),
          m_extrapolator("Trk::Extrapolator") 
  {
   declareInterface<IMultiPVSeedFinder>(this); 
@@ -78,9 +71,6 @@ namespace InDet
 //cleaning tool
   declareProperty("CleaningTool",  m_cleaningTool);
 
-//beam spot service  
-  declareProperty("BeamSpotSvc", m_beamService);
-
 //vertex finder tool (needed when no beam spot is available)
   declareProperty("VertexSeedFinder",m_vtxSeedFinder);
 
@@ -100,7 +90,9 @@ namespace InDet
   std::vector<const Trk::Track*>::const_iterator tre = tracks.end(); 
   
 //beamposition
-  Trk::RecVertex beamrecposition(m_beamService->beamVtx());  
+  SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey };
+
+  Trk::RecVertex beamrecposition(beamSpotHandle->beamVtx());  
   if(msgLvl(MSG::DEBUG))msg(MSG::DEBUG)<<"Beam spot position is: "<< beamrecposition.position()<<endmsg;
   for(;tr!=tre;++tr) if(m_trkFilter->decision(**tr,&beamrecposition)) preselectedTracks.push_back(*tr);
   Trk::Vertex* beamposition=&beamrecposition;
@@ -260,7 +252,8 @@ namespace InDet
   std::vector<const Trk::TrackParticleBase*>::const_iterator tre = tracks.end();
   
 //beamposition
-  Trk::RecVertex beamrecposition(m_beamService->beamVtx());    
+  SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey };
+  Trk::RecVertex beamrecposition(beamSpotHandle->beamVtx());    
   for(;tr!=tre;++tr) if(m_trkFilter->decision(**tr, &beamrecposition)) preselectedTracks.push_back(*tr);
   if(msgLvl(MSG::DEBUG))msg(MSG::DEBUG)<<"Beam spot position is: "<< beamrecposition.position()<<endmsg;
   Trk::Vertex* beamposition=&beamrecposition;
@@ -424,8 +417,10 @@ namespace InDet
 
 
   xAOD::Vertex * beamposition = new xAOD::Vertex();
-  beamposition->setPosition(m_beamService->beamVtx().position());
-  beamposition->setCovariancePosition(m_beamService->beamVtx().covariancePosition());
+  SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey };
+
+  beamposition->setPosition(beamSpotHandle->beamVtx().position());
+  beamposition->setCovariancePosition(beamSpotHandle->beamVtx().covariancePosition());
   // for(;tr!=tre;++tr) if(m_trkFilter->decision(**tr, &beamrecposition)) preselectedTracks.push_back(*tr);
   // if(msgLvl(MSG::DEBUG))msg(MSG::DEBUG)<<"Beam spot position is: "<< beamrecposition.position()<<endmsg;
   //Trk::Vertex* beamposition=&beamrecposition;
diff --git a/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/src/SlidingWindowMultiSeedFinder.cxx b/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/src/SlidingWindowMultiSeedFinder.cxx
index 20e5ecc6f9045d80abdeedfb2f31c96117e0a43d..d11cdddaeb113c35552566df62e934fcff8f0517 100644
--- a/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/src/SlidingWindowMultiSeedFinder.cxx
+++ b/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/src/SlidingWindowMultiSeedFinder.cxx
@@ -9,7 +9,6 @@
 
 #include "TrkToolInterfaces/ITrackSelectorTool.h"
 #include "InDetMultipleVertexSeedFinderUtils/InDetTrackZ0SortingTool.h"
-#include "InDetBeamSpotService/IBeamCondSvc.h"
 #include "TrkParticleBase/TrackParticleBase.h"
 #include "TrkExInterfaces/IExtrapolator.h"
 #include "TrkVertexFitterInterfaces/IVertexSeedFinder.h"
@@ -32,12 +31,7 @@ namespace InDet
    return StatusCode::FAILURE;
   }else msg(MSG::INFO)<<"Track sorting tool retrieved"<<endmsg;  
    
-  if(m_beamService.retrieve().isFailure())
-  {
-   msg(MSG::ERROR)<<"Unable to retieve "<<m_beamService<<endmsg;
-   return StatusCode::FAILURE;
-  }else msg(MSG::INFO)<< "BeamSpot service retrieved"<<endmsg; 
-
+  ATH_CHECK(m_beamSpotKey.initialize());
 
   if(m_vtxSeedFinder.retrieve().isFailure())
   {
@@ -65,7 +59,6 @@ namespace InDet
                                                                           m_ignoreLevel(0),
                                                                           m_ignoreBeamSpot(false),
                                                                           m_vtxSeedFinder("Trk::CrossDistancesSeedFinder"),
-                                                                          m_beamService("BeamCondSvc" ,n),
                                                                           m_extrapolator("Trk::Extrapolator") 
  {
   declareInterface<IMultiPVSeedFinder>(this); 
@@ -85,9 +78,6 @@ namespace InDet
 //vertex finder tool (needed when no beam spot is available)
   declareProperty("VertexSeedFinder",m_vtxSeedFinder);
   
-//beam spot finding tool
-  declareProperty("BeamSpotSvc", m_beamService);
-
 //extrapolator
   declareProperty("Extrapolator", m_extrapolator);  
   
@@ -102,8 +92,8 @@ namespace InDet
   std::vector<const Trk::Track*>::const_iterator tr = tracks.begin();
   std::vector<const Trk::Track*>::const_iterator tre = tracks.end(); 
   
-  
-  Trk::RecVertex  beamRecVertex(m_beamService->beamVtx());
+  SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey };
+  Trk::RecVertex  beamRecVertex(beamSpotHandle->beamVtx());
   for(;tr!=tre;++tr) if(m_trkFilter->decision(**tr,&beamRecVertex)) preselectedTracks.push_back(*tr);
   if(msgLvl(MSG::DEBUG))msg(MSG::DEBUG)<<"Beam spot position is: "<< beamRecVertex.position()<<endmsg;
 
@@ -205,8 +195,8 @@ namespace InDet
   std::vector<const Trk::TrackParticleBase*>::const_iterator tre = tracks.end(); 
   
 //using the beam position for pre-selection  
-  
-  Trk::RecVertex  beamRecVertex(m_beamService->beamVtx()); 
+  SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey };
+  Trk::RecVertex  beamRecVertex(beamSpotHandle->beamVtx()); 
   for(;tr!=tre;++tr) if(m_trkFilter->decision(**tr,&beamRecVertex)) preselectedTracks.push_back(*tr);
   if(msgLvl(MSG::DEBUG))msg(MSG::DEBUG)<<"Beam spot position is: "<< beamRecVertex.position()<<endmsg;
   Trk::Vertex* beamVertex=&beamRecVertex;
@@ -326,8 +316,9 @@ std::vector< std::vector<const Trk::TrackParameters *> > SlidingWindowMultiSeedF
     
     
     xAOD::Vertex * beamposition = new xAOD::Vertex(); 
-    beamposition->setPosition(m_beamService->beamVtx().position());
-    beamposition->setCovariancePosition(m_beamService->beamVtx().covariancePosition());
+    SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey };
+    beamposition->setPosition(beamSpotHandle->beamVtx().position());
+    beamposition->setCovariancePosition(beamSpotHandle->beamVtx().covariancePosition());
     // for(;tr!=tre;++tr) if(m_trkFilter->decision(**tr, &beamrecposition)) preselectedTracks.push_back(*tr);
     // if(msgLvl(MSG::DEBUG))msg(MSG::DEBUG)<<"Beam spot position is: "<< beamrecposition.position()<<endmsg;
     //Trk::Vertex* beamposition=&beamrecposition;
diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/CMakeLists.txt b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/CMakeLists.txt
index 4933303f91d3e80e18f6bb6dd93da8d0e23a11fc..d5cc14d4423200a9f475a6db241d6fc5ddac5679 100644
--- a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/CMakeLists.txt
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/CMakeLists.txt
@@ -37,4 +37,5 @@ if( XAOD_STANDALONE )
 endif()
 
 # Install files from the package:
+atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
 atlas_install_joboptions( share/*.py )
diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/python/__init__.py b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/python/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/InnerDetector/InDetRecTools/TrackVertexAssociationTool/python/getTTVAToolForReco.py b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/python/getTTVAToolForReco.py
new file mode 100644
index 0000000000000000000000000000000000000000..05c6e516e7170385b6025d671382a52fd2ff63a1
--- /dev/null
+++ b/InnerDetector/InDetRecTools/TrackVertexAssociationTool/python/getTTVAToolForReco.py
@@ -0,0 +1,72 @@
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+
+# These are *constants* (OK, the user actually has the ability to change the track/vertex containers in the function calls,
+# but the default container names are constants)
+_DEFAULT_TRACK_CONT  = 'InDetTrackParticles'
+_DEFAULT_VERTEX_CONT = 'PrimaryVertices'
+_DECO_TOOL_NAME      = 'InDetUsedInFitDecoratorTool'
+_DECO_ALG_NAME       = 'InDetUsedInFitDecorator'
+_VERTEX_DECO         = 'TTVA_AMVFVertices_forReco'
+_WEIGHT_DECO         = 'TTVA_AMVFWeights_forReco'
+
+def _assertDecoValue(kwargs, key, default):
+    if key in kwargs.keys():
+        if kwargs[key] != default:
+            raise RuntimeError('Property \'%s\' must be \'%s\': %s = %s' % (key, default, key, kwargs[key]))
+    else:
+        kwargs[key] = default
+
+def _mangleName(theName, theSequence): 
+    return theSequence.name()+"_"+theName
+
+def addUsedInFitDecoratorForReco(TrackContName = _DEFAULT_TRACK_CONT, VertexContName = _DEFAULT_VERTEX_CONT, add2Seq = None):
+    '''Function for adding a used-in-fit decorator alg to a sequence'''
+    from AthenaCommon.AlgSequence import AlgSequence
+    topSequence = AlgSequence()
+    # If not sequence is provided, add the decoration alg to the top sequence
+    if add2Seq is None:
+        add2Seq = topSequence
+    # Name mangling to ensure we do not duplicate names in configs
+    # with a genuine need for multiple instances in multiple sequences (i.e. trigger) 
+    theToolName = _mangleName(_DECO_TOOL_NAME, add2Seq) 
+    theAlgName = _mangleName(_DECO_ALG_NAME, add2Seq) 
+    if not hasattr(add2Seq, theAlgName):
+        import AthenaCommon.CfgMgr as CfgMgr
+        from AthenaCommon.AppMgr import ToolSvc
+        ToolSvc += CfgMgr.InDet__InDetUsedInFitTrackDecoratorTool(  name                    = theToolName,
+                                                                    AMVFVerticesDecoName    = _VERTEX_DECO,
+                                                                    AMVFWeightsDecoName     = _WEIGHT_DECO,
+                                                                    TrackContainer          = TrackContName,
+                                                                    VertexContainer         = VertexContName )
+        add2Seq += CfgMgr.InDet__InDetUsedInVertexFitTrackDecorator(name                    = theAlgName,
+                                                                    UsedInFitDecoratorTool  = getattr(ToolSvc, theToolName) )
+    return
+
+def getTTVAToolForReco(name = None, returnCompFactory = False, addDecoAlg = True, add2Seq = None, **kwargs):
+    '''Function for retrieving a TTVA tool instance and, if it doesn't exist,
+    for adding a used-in-fit track decorator to a sequence'''
+
+    # First some argument checking
+    _assertDecoValue(kwargs, 'AMVFVerticesDeco', _VERTEX_DECO)
+    _assertDecoValue(kwargs, 'AMVFWeightsDeco',  _WEIGHT_DECO)
+
+    # If a name has been provided for the TTVA tool, update our kwargs
+    if name is not None:
+        kwargs['name'] = name
+
+    # Fetch the track and vertex containers for use in the used-in-fit deco tool
+    TrackContName, VertexContName = kwargs.get('TrackContName', _DEFAULT_TRACK_CONT), kwargs.pop('VertexContName', _DEFAULT_VERTEX_CONT)
+
+    # Instantiate our TTVA tool
+    if returnCompFactory:
+        from AthenaConfiguration.ComponentFactory import CompFactory
+        tool = CompFactory.getComp("CP::TrackVertexAssociationTool")(**kwargs)
+    else:
+        import AthenaCommon.CfgMgr as CfgMgr
+        tool = CfgMgr.CP__TrackVertexAssociationTool(**kwargs)
+
+    # Add the decorator to the top sequence (if requested)
+    if addDecoAlg:
+        addUsedInFitDecoratorForReco(TrackContName, VertexContName, add2Seq)
+
+    return tool
diff --git a/LArCalorimeter/LArCalibUtils/src/LArConditionsMergerAlg.h b/LArCalorimeter/LArCalibUtils/src/LArConditionsMergerAlg.h
new file mode 100644
index 0000000000000000000000000000000000000000..360d9cd4703059d2b93d78ef117beb57562a595f
--- /dev/null
+++ b/LArCalorimeter/LArCalibUtils/src/LArConditionsMergerAlg.h
@@ -0,0 +1,38 @@
+//Dear emacs, this is -*- c++ -*-
+
+/*
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef LARCALIBUTILS_LARCONDITIONSMERGERALG
+#define LARCALIBUTILS_LARCONDITIONSMERGERALG
+
+#include "AthenaBaseComps/AthAlgorithm.h"
+#include "StoreGate/CondHandleKeyArray.h"
+#include "StoreGate/WriteCondHandleKey.h"
+
+#include "LArRawConditions/LArConditionsContainer.h"
+
+template<class T>
+class LArConditionsMergerAlg: public AthAlgorithm {
+ public:
+  using AthAlgorithm::AthAlgorithm;
+  ~LArConditionsMergerAlg() = default;
+
+  virtual StatusCode initialize() override;
+  virtual StatusCode execute() override;
+  
+  SG::ReadCondHandleKeyArray<T>  m_readKeys{this, "ReadKeys",{},"Input keys" };
+  Gaudi::Property<std::string> m_writeKey{this,"WriteKey","output","Output key" };
+
+  Gaudi::Property<std::string> m_groupingType{this,"GroupingType","","Cool-channel grouping"};
+
+};
+
+#include "LArConditionsMergerAlg.icc"
+
+#include "LArRawConditions/LArPedestalComplete.h"
+typedef LArConditionsMergerAlg<LArPedestalComplete>  LArPedestalMerger;
+
+
+#endif
diff --git a/LArCalorimeter/LArCalibUtils/src/LArConditionsMergerAlg.icc b/LArCalorimeter/LArCalibUtils/src/LArConditionsMergerAlg.icc
new file mode 100644
index 0000000000000000000000000000000000000000..f5abc966f3f9c24eb977ed6d9873ce6e05a10692
--- /dev/null
+++ b/LArCalorimeter/LArCalibUtils/src/LArConditionsMergerAlg.icc
@@ -0,0 +1,36 @@
+//Dear emacs, this is -*- c++ -*-
+
+/*
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+*/
+
+template<class T>
+StatusCode LArConditionsMergerAlg<T>::initialize() {
+
+  ATH_CHECK(m_readKeys.initialize());
+
+ return StatusCode::SUCCESS;
+} 
+
+
+template<class T>
+StatusCode LArConditionsMergerAlg<T>::execute() {
+	   
+  if (m_readKeys.empty()) return StatusCode::FAILURE;
+  std::unique_ptr<T> out=std::make_unique<T>();
+  ATH_CHECK(out->setGroupingType(m_groupingType,msg()));
+  ATH_CHECK(out->initialize());
+
+  for (auto& key : m_readKeys) {
+    SG::ReadCondHandle<T> handle{key};
+    const T* obj=*handle;
+    bool stat=out->merge(*obj);
+    if (stat) {
+      ATH_MSG_ERROR("Channels where overwritten while merging " << key);
+    }
+  }
+
+  ATH_CHECK(detStore()->record(std::move(out),m_writeKey));
+  
+  return StatusCode::SUCCESS;
+} 
diff --git a/LArCalorimeter/LArCalibUtils/src/components/LArCalibUtils_entries.cxx b/LArCalorimeter/LArCalibUtils/src/components/LArCalibUtils_entries.cxx
index 3868d9f2621f71d0f85bf4c2c7b8ff8271ed3d48..619298bee475cc2dba1d98eb0f690d4d50c1f7c6 100644
--- a/LArCalorimeter/LArCalibUtils/src/components/LArCalibUtils_entries.cxx
+++ b/LArCalorimeter/LArCalibUtils/src/components/LArCalibUtils_entries.cxx
@@ -48,7 +48,7 @@
 #include "LArCalibUtils/LArDuplicateConstants.h"
 #include "LArCalibUtils/LArCalibPatchingAlg.h"
 #include "LArCalibUtils/LArCalibCopyAlg.h"
-
+#include "../LArConditionsMergerAlg.h"
 
 
 typedef LArCalibPatchingAlg<LArRampComplete> LArRampPatcher;
@@ -116,3 +116,4 @@ DECLARE_COMPONENT( LArPhaseToolConst )
 DECLARE_COMPONENT( LArPhaseToolMC )
 DECLARE_COMPONENT( LArPhaseToolTB )
 
+DECLARE_COMPONENT( LArPedestalMerger )
diff --git a/LArCalorimeter/LArCondUtils/share/LArHVPathologyDbRead.py b/LArCalorimeter/LArCondUtils/share/LArHVPathologyDbRead.py
index 8e8d0e9472f9f4547cd719009829e09db8a419b2..9cff40d65964e24bc7f970e2f644578fa93cfc4b 100755
--- a/LArCalorimeter/LArCondUtils/share/LArHVPathologyDbRead.py
+++ b/LArCalorimeter/LArCondUtils/share/LArHVPathologyDbRead.py
@@ -4,7 +4,7 @@
 from time import strptime,time
 from calendar import timegm
 
-if "GloablTag" not in dir():
+if "GlobalTag" not in dir():
     GlobalTag = 'CONDBR2-BLKPA-2017-03'
 
 if "inputsqlite" not in dir():
@@ -24,9 +24,9 @@ if "date" not in dir():
 if "TimeStamp" not in dir():
    try:
        ts=strptime(date+'/UTC','%Y-%m-%d:%H:%M:%S/%Z')
-       TimeStamp=int(timegm(ts))*1000000000L
+       TimeStamp=int(timegm(ts))*1000000000
    except ValueError:
-       print "ERROR in time specification, use e.g. 2007-05-25:14:01:00"
+       print("ERROR in time specification, use e.g. 2007-05-25:14:01:00")
 
 ## basic job configuration
 import AthenaCommon.AtlasUnixGeneratorJob
diff --git a/LArCalorimeter/LArCondUtils/src/LArHVPathologyDbAlg.cxx b/LArCalorimeter/LArCondUtils/src/LArHVPathologyDbAlg.cxx
index 4c605b444f144499ad355938447b39e565f404af..0ef700f00467bf4bdf9bc873db8347667bb9f13f 100644
--- a/LArCalorimeter/LArCondUtils/src/LArHVPathologyDbAlg.cxx
+++ b/LArCalorimeter/LArCondUtils/src/LArHVPathologyDbAlg.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "LArHVPathologyDbAlg.h"
@@ -13,7 +13,6 @@
 #include "CaloIdentifier/LArHEC_ID.h"
 #include "CaloIdentifier/LArFCAL_ID.h"
 #include "LArIdentifier/LArOnlineID.h"
-#include "LArCabling/LArCablingLegacyService.h"
 #include "CaloDetDescr/CaloDetDescrManager.h"
 
 #include "CaloDetDescr/CaloDetectorElements.h"
@@ -42,7 +41,6 @@ LArHVPathologyDbAlg::LArHVPathologyDbAlg(const std::string& name, ISvcLocator* p
   , m_regSvc("IOVRegistrationSvc",name)
   , m_pathologyTool("LArHVPathologyDbTool")
   , m_mode(0)
-  , m_cablingService("LArCablingLegacyService")
   , m_larem_id(0)
   , m_larhec_id(0)
   , m_larfcal_id(0)
@@ -119,6 +117,7 @@ StatusCode LArHVPathologyDbAlg::initialize()
   }
 
   ATH_CHECK( m_hvCablingKey.initialize() );
+  ATH_CHECK( m_cablingKey.initialize() );
 
   return sc;
 }
@@ -181,6 +180,12 @@ StatusCode LArHVPathologyDbAlg::createCondObjects (const EventContext & ctx)
   else {
     SG::ReadCondHandle<LArHVIdMapping> hvIdMapping (m_hvCablingKey, ctx);
 
+    SG::ReadCondHandle<LArOnOffIdMapping> cabHdl (m_cablingKey, ctx);
+    const LArOnOffIdMapping *cabling = *cabHdl;
+    if(!cabling) {
+       ATH_MSG_ERROR("Do not have cabling object with key " << m_cablingKey.key());
+       return StatusCode::FAILURE;
+    }
     // Read input file and construct LArHVPathologiesDb for given folder
     std::ifstream infile;
     infile.open(m_inpFile.value().c_str());
@@ -234,7 +239,7 @@ StatusCode LArHVPathologyDbAlg::createCondObjects (const EventContext & ctx)
           infile >> bec >> pos_neg >> FT >> slot >> channel >> hvModule >> hvLine >> pathologyType;
           msg(MSG::INFO) << " read " << bec << " " << pos_neg << " " << FT << " " << slot << " " << channel << " " << hvModule << " " << hvLine << " " << pathologyType << endmsg;
           HWIdentifier hwid = m_laronline_id->channel_Id(bec,pos_neg,FT,slot,channel);
-          Identifier id = m_cablingService->cnvToIdentifier( hwid);
+          Identifier id = cabling->cnvToIdentifier( hwid);
           cellID = (unsigned int)(id.get_identifier32().get_compact());
           elecList=getElectInd(**hvIdMapping, id,hvModule,hvLine);
           msg(MSG::INFO) << " cellId , elecList size " << cellID << " " << elecList.size() << endmsg;
@@ -284,6 +289,12 @@ StatusCode LArHVPathologyDbAlg::printCondObjects (const EventContext& ctx)
   msg(MSG::INFO) <<" in printCondObjects() " <<endmsg;
 
   SG::ReadCondHandle<LArHVIdMapping> hvIdMapping (m_hvCablingKey, ctx);
+  SG::ReadCondHandle<LArOnOffIdMapping> cabHdl (m_cablingKey, ctx);
+  const LArOnOffIdMapping *cabling = *cabHdl;
+  if(!cabling) {
+     ATH_MSG_ERROR("Do not have cabling object with key " << m_cablingKey.key());
+     return StatusCode::FAILURE;
+  }
 
   std::ofstream *fout=0;
   const AthenaAttributeList* attrlist;
@@ -311,7 +322,7 @@ StatusCode LArHVPathologyDbAlg::printCondObjects (const EventContext& ctx)
          if(fout) *fout<<electPath.cellID<<"\t"<<electPath.electInd<<"\t"<<electPath.pathologyType<<std::endl;    
       } else {
          msg(MSG::INFO) << "Got pathology for cell ID: " << electPath.cellID << endmsg;
-         HWIdentifier hwid = m_cablingService->createSignalChannelID(Identifier32(electPath.cellID));
+         HWIdentifier hwid = cabling->createSignalChannelID(Identifier32(electPath.cellID));
          int HVLine=getHVline(**hvIdMapping,Identifier(electPath.cellID),electPath.electInd);
          if(HVLine<0) {
             msg(MSG::ERROR) << "No HVline for cell "<<electPath.cellID<< endmsg;
diff --git a/LArCalorimeter/LArCondUtils/src/LArHVPathologyDbAlg.h b/LArCalorimeter/LArCondUtils/src/LArHVPathologyDbAlg.h
index 2446378512cf3d3dd34d108a3b5babe6c2f8267e..18c646edcd0c0afe367592849a62a9eaf1b96a63 100644
--- a/LArCalorimeter/LArCondUtils/src/LArHVPathologyDbAlg.h
+++ b/LArCalorimeter/LArCondUtils/src/LArHVPathologyDbAlg.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef LARCONDUTILS_LARHVPATHOLOGYDBALG_H
@@ -9,10 +9,11 @@
 #include "LArRecConditions/LArHVIdMapping.h"
 #include "StoreGate/ReadCondHandleKey.h"
 #include "GaudiKernel/ToolHandle.h"
+#include "StoreGate/ReadCondHandleKey.h"
+#include "LArCabling/LArOnOffIdMapping.h"
 
 class IIOVRegistrationSvc;
 class ILArHVPathologyDbTool;
-class LArCablingLegacyService ;
 class LArEM_ID;
 class LArHEC_ID;
 class LArFCAL_ID;
@@ -55,7 +56,6 @@ class LArHVPathologyDbAlg : public AthAlgorithm
 
   const DataHandle<CaloIdManager> m_caloIdMgr;
   const DataHandle<CaloDetDescrManager> m_calodetdescrmgr;
-  ToolHandle<LArCablingLegacyService> m_cablingService;
   const LArEM_ID*       m_larem_id;
   const LArHEC_ID*       m_larhec_id;
   const LArFCAL_ID*       m_larfcal_id;
@@ -63,6 +63,8 @@ class LArHVPathologyDbAlg : public AthAlgorithm
 
   SG::ReadCondHandleKey<LArHVIdMapping> m_hvCablingKey
     {this, "LArHVIdMapping", "LArHVIdMap", "SG key for HV ID mapping"};
+  SG::ReadCondHandleKey<LArOnOffIdMapping>  m_cablingKey
+     {this, "OnOffMap", "LArOnOffIdMap", "SG key for mapping object"};
 };
 
 #endif
diff --git a/LArCalorimeter/LArRawConditions/LArRawConditions/LArConditionsContainer.h b/LArCalorimeter/LArRawConditions/LArRawConditions/LArConditionsContainer.h
index b33c7f5d81fca7a9989efd4ba87011e97718532c..2ad5daa226bd1d0f5f9568cac83227c9ea9239f2 100755
--- a/LArCalorimeter/LArRawConditions/LArRawConditions/LArConditionsContainer.h
+++ b/LArCalorimeter/LArRawConditions/LArRawConditions/LArConditionsContainer.h
@@ -271,6 +271,9 @@ public:
     /// Initialization done after creation or read back - derived
     /// classes may augment the functionality
     virtual StatusCode  initialize();
+
+    //Merge in data from another conditions container of the same type
+    bool merge(const LArConditionsContainer<T>& other);
     
 
 protected:
diff --git a/LArCalorimeter/LArRawConditions/LArRawConditions/LArConditionsContainer.icc b/LArCalorimeter/LArRawConditions/LArRawConditions/LArConditionsContainer.icc
index 759e4c6f93528f517ce99248dcae6db25cbbb784..1199d5a250b352bc5dc109c7da0ea009dd75d005 100755
--- a/LArCalorimeter/LArRawConditions/LArRawConditions/LArConditionsContainer.icc
+++ b/LArCalorimeter/LArRawConditions/LArRawConditions/LArConditionsContainer.icc
@@ -1204,3 +1204,25 @@ LArConditionsContainer<T>::initialize()
 
 
 
+template<class T> 
+bool LArConditionsContainer<T>::merge(const LArConditionsContainer<T>& other) {
+  unsigned nOverwrites=0;
+  //Loop over gains
+  for (unsigned gain=0;gain<other.nGains();++gain) {
+    auto it=other.begin(gain);
+    auto it_e=other.end(gain);
+    //Loop over channels
+    for (;it!=it_e;++it) {
+      const HWIdentifier hwid=it.channelId();
+      const T& payload=*it;
+      if (!payload.isEmpty()) {
+	const T& currentPayload=this->get(hwid,gain);
+	if (!currentPayload.isEmpty()) {
+	  ++nOverwrites;
+	}
+	this->setPdata(hwid,payload,gain);
+      }
+    }//end loop over channels
+  }//end loop over gains
+  return (nOverwrites!=0);
+}
diff --git a/LArCalorimeter/LArRecConditions/LArRecConditions/LArHVPathologiesDb.h b/LArCalorimeter/LArRecConditions/LArRecConditions/LArHVPathologiesDb.h
index 748deea71d80f4c3b50f6eb95410b0b14adbe627..0f03d47d5a1fa92880f2d37ad616af7888620357 100644
--- a/LArCalorimeter/LArRecConditions/LArRecConditions/LArHVPathologiesDb.h
+++ b/LArCalorimeter/LArRecConditions/LArRecConditions/LArHVPathologiesDb.h
@@ -1,12 +1,20 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef LARTOOLS_LARHVPATHOLOGIESDB_H
 #define LARTOOLS_LARHVPATHOLOGIESDB_H
 
+#include "CxxUtils/bitmask.h"
 #include <vector>
 
+class LArHVPathologyBits {
+   public:
+     static const unsigned short MaskHV=0x1;
+     static const unsigned short MaskCurr=0x2;
+     static const unsigned short SetHVMask=0xFFF0;
+};
+
 class LArHVPathologiesDb
 {
  public:
diff --git a/LArCalorimeter/LArRecUtils/src/LArHVCondAlg.cxx b/LArCalorimeter/LArRecUtils/src/LArHVCondAlg.cxx
index c41808e350a296a4f4a248fc40a8654ce1d6477e..a1248a5d944d159c0524d2f1657bdd84da6cc96e 100755
--- a/LArCalorimeter/LArRecUtils/src/LArHVCondAlg.cxx
+++ b/LArCalorimeter/LArRecUtils/src/LArHVCondAlg.cxx
@@ -6,6 +6,7 @@
 #include "GaudiKernel/IToolSvc.h"
 #include "StoreGate/ReadCondHandle.h"
 #include "LArElecCalib/ILArHVPathologyDbTool.h"
+#include "LArRecConditions/LArHVPathologiesDb.h"
 #include "CaloDetDescr/CaloDetectorElements.h"
 #include "CaloGeoHelpers/CaloPhiRange.h"
 #include "CaloIdentifier/LArEM_ID.h"
@@ -419,15 +420,23 @@ StatusCode LArHVCondAlg::fillPayload(LArHVData* hvdata
                                                                             hvmod.getEtaIndex(),
                                                                             igap,
                                                                             electrode.getElectrodeIndex() ));
-                    curr *= uAkOhm * rValues[ridx];
+                    if(curr > 0.) curr *= uAkOhm * rValues[ridx]; else curr = 0.;
+                    ATH_MSG_VERBOSE("channel. "<<std::hex<<id.get_identifier32()<<std::dec <<" hvline: "<<idx<<" curr. " << curr << " R: "<<rValues[ridx]);
                  }
                  if (hasPathology) {
                     ATH_MSG_VERBOSE( "Has pathology for id: "<< m_larem_id->print_to_string(id)<<" "<<hasPathologyEM[index]);
                     msg(MSG::VERBOSE) << "Original hv: "<<hv<<" ";
                     for (unsigned int ii=0;ii<listElec.size();ii++) {
                        if (listElec[ii]==(2*i+igap) && listElec[ii]<hasPathologyEM[index].size() && hasPathologyEM[index][listElec[ii]]) {
-                          if(hasPathologyEM[index][listElec[ii]]&0xF) hv=0.; else hv=((hasPathologyEM[index][listElec[ii]]&0xFFF0)>>4);
-                          curr=0.;
+                          if(hasPathologyEM[index][listElec[ii]]&LArHVPathologyBits::MaskHV) {
+                             hv=0.;
+                             curr = 0.;
+                          } else if(hasPathologyEM[index][listElec[ii]]&LArHVPathologyBits::MaskCurr) { 
+                             curr = 0.;
+                          } else {
+                             hv=((hasPathologyEM[index][listElec[ii]]&LArHVPathologyBits::SetHVMask)>>4);
+                             curr=0.;
+                          }
                        }
                     }
                     msg(MSG::VERBOSE) << "set hv: "<<hv<<endmsg;
@@ -471,7 +480,8 @@ StatusCode LArHVCondAlg::fillPayload(LArHVData* hvdata
                                                                         igap,
                                                                         0 // not used in EMBPS
                                                               ));
-                curr *= uAkOhm * rValues[ridx];
+                if(curr > 0.) curr *= uAkOhm * rValues[ridx]; else curr = 0;
+                ATH_MSG_VERBOSE("channel. "<<std::hex<<id.get_identifier32()<<std::dec <<" hvline: "<<idx<<" curr. " << curr << " R: "<<rValues[ridx]);
              }
 	     addHV(v,hv,wt);
 	     addCurr(ihv,curr,wt);
@@ -519,14 +529,22 @@ StatusCode LArHVCondAlg::fillPayload(LArHVData* hvdata
                                                                         hvmod.getEtaIndex(),
                                                                         hvmod.getSectorIndex(),
                                                                         electrode.getElectrodeIndex() ));
-                      curr *= uAkOhm * rValues[ridx];
+                      if(curr > 0.) curr *= uAkOhm * rValues[ridx]; else curr = 0.;
+                      ATH_MSG_VERBOSE("channel. "<<std::hex<<id.get_identifier32()<<std::dec <<" hvline: "<<idx<<" curr. " << curr << " R: "<<rValues[ridx]);
                    }
                    if (hasPathology) {
                       msg(MSG::VERBOSE) << "Has pathology for id: "<< m_larem_id->print_to_string(id)<<" "<<hasPathologyEM[index]<<endmsg;
                       for (unsigned int ii=0;ii<listElec.size();ii++) {
                          if (listElec[ii]==(2*i+igap) && listElec[ii]<hasPathologyEM[index].size() && hasPathologyEM[index][listElec[ii]]) {
-                            if(hasPathologyEM[index][listElec[ii]]&0xF) hv=0.; else hv=((hasPathologyEM[index][listElec[ii]]&0xFFF0)>>4);
-                            curr=0.;
+                            if(hasPathologyEM[index][listElec[ii]]&LArHVPathologyBits::MaskHV) {
+                               hv=0.;
+                               curr = 0.;
+                            } else if(hasPathologyEM[index][listElec[ii]]&LArHVPathologyBits::MaskCurr) { 
+                               curr = 0.;
+                            } else {
+                               hv=((hasPathologyEM[index][listElec[ii]]&0xFFF0)>>4);
+                               curr=0.;
+                            }
                          }
                       }
                    }
@@ -568,7 +586,8 @@ StatusCode LArHVCondAlg::fillPayload(LArHVData* hvdata
                                                                         igap,
                                                                         0 // not used in EMECPS
                                                                     ));
-                      curr *= uAkOhm * rValues[ridx];
+                      if(curr >0.) curr *= uAkOhm * rValues[ridx]; else curr=0.;
+                      ATH_MSG_VERBOSE("channel. "<<std::hex<<id.get_identifier32()<<std::dec <<" hvline: "<<idx<<" curr. " << curr << " R: "<<rValues[ridx]);
                    }
                addHV(v,hv,wt);
                addCurr(ihv,curr,wt);
@@ -646,14 +665,22 @@ StatusCode LArHVCondAlg::fillPayload(LArHVData* hvdata
                                                                 subgap.getSubgapIndex(),
                                                                 0 // not used in HEC
                                                                  ));
-              curr *= uAkOhm * rValues[ridx];
+              if(curr > 0.) curr *= uAkOhm * rValues[ridx]; else curr = 0.;
+              ATH_MSG_VERBOSE("channel. "<<std::hex<<id.get_identifier32()<<std::dec <<" hvline: "<<idx<<" cur. " << curr << " R: "<<rValues[ridx]);
            }
            if (hasPathology) {
               msg(MSG::VERBOSE) << "Has pathology for id: "<< m_larhec_id->print_to_string(id)<<" "<<hasPathologyHEC[index]<<endmsg;
               for (unsigned int ii=0;ii<listElec.size();ii++) {
                  if (listElec[ii]==i && listElec[ii]<hasPathologyHEC[index].size() && hasPathologyHEC[index][listElec[ii]]) {
-                      if(hasPathologyHEC[index][listElec[ii]]&0xF) hv=0.; else hv=((hasPathologyHEC[index][listElec[ii]]&0xFFF0)>>4);
-                      curr=0.;
+                      if(hasPathologyHEC[index][listElec[ii]]&LArHVPathologyBits::MaskHV) {
+                         hv=0.;
+                         curr = 0.;
+                      } else if(hasPathologyHEC[index][listElec[ii]]&LArHVPathologyBits::MaskCurr){
+                         curr = 0.;
+                      } else {
+                         hv=((hasPathologyHEC[index][listElec[ii]]&LArHVPathologyBits::SetHVMask)>>4);
+                         curr=0.;
+                      }
                  }
               }
            }
@@ -734,14 +761,22 @@ StatusCode LArHVCondAlg::fillPayload(LArHVData* hvdata
                                                                 hvmod.getSectorIndex(),
                                                                 line->getLineIndex()
                                                                  ));
-              curr *= uAkOhm * rValues[ridx];
+              if(curr > 0.) curr *= uAkOhm * rValues[ridx]; else curr = 0.;
+              ATH_MSG_VERBOSE("channel. "<<std::hex<<id.get_identifier32()<<std::dec <<" hvline: "<<idx<<" curr." << curr << " R: "<<rValues[ridx]);
            }
            if (hasPathology) {
               msg(MSG::VERBOSE) << "Has pathology for id: "<< m_larfcal_id->print_to_string(id)<<" "<<hasPathologyFCAL[index]<<endmsg;
               for (unsigned int ii=0;ii<listElec.size();ii++) {
                  if (listElec[ii]==i && listElec[ii]<hasPathologyFCAL[index].size() && hasPathologyFCAL[index][listElec[ii]]) {
-                      if(hasPathologyFCAL[index][listElec[ii]]&0xF) hv=0.; else hv=((hasPathologyFCAL[index][listElec[ii]]&0xFFF0)>>4);
-                      curr=0.;
+                      if(hasPathologyFCAL[index][listElec[ii]]&LArHVPathologyBits::MaskHV){
+                         hv=0.;
+                         curr = 0.;
+                      } else if(hasPathologyFCAL[index][listElec[ii]]&LArHVPathologyBits::MaskCurr){
+                         curr = 0.;
+                      } else {
+                         hv=((hasPathologyFCAL[index][listElec[ii]]&0xFFF0)>>4);
+                         curr=0.;
+                      }
                  }
               }
            }
diff --git a/MuonSpectrometer/MuonCnv/MuonCnvToolInterfaces/MuonCnvToolInterfaces/IMDT_RDOtoByteStreamTool.h b/MuonSpectrometer/MuonCnv/MuonCnvToolInterfaces/MuonCnvToolInterfaces/IMDT_RDOtoByteStreamTool.h
index 4010afd01d88f6e9b18f85873fddde3f71a51220..98c1cbbe7ef5f53e486e63f859220a7abb4ab35c 100755
--- a/MuonSpectrometer/MuonCnv/MuonCnvToolInterfaces/MuonCnvToolInterfaces/IMDT_RDOtoByteStreamTool.h
+++ b/MuonSpectrometer/MuonCnv/MuonCnvToolInterfaces/MuonCnvToolInterfaces/IMDT_RDOtoByteStreamTool.h
@@ -1,17 +1,15 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef MUONCNVTOOLINTERFACES_IMDT_RDOTOBYTESTREAMTOOL_H
 #define MUONCNVTOOLINTERFACES_IMDT_RDOTOBYTESTREAMTOOL_H
 
 #include "GaudiKernel/IAlgTool.h"
+#include "ByteStreamData/RawEvent.h"
 
 class MdtCsmContainer; 
 class MsgStream ; 
-class RawEventWrite;
-
-static const InterfaceID IID_IMDT_RDOtoByteStreamTool( "Muon::IMDT_RDOtoByteStreamTool", 1, 0 );
 
 namespace Muon {
 
@@ -25,14 +23,11 @@ namespace Muon {
   * Jan-14-2003, BNL
   * Conversion of Rpc Pad Container to byte stream
   */
-class IMDT_RDOtoByteStreamTool: public IAlgTool {
+class IMDT_RDOtoByteStreamTool: virtual public IAlgTool {
 
 public:
 
-  static const InterfaceID& interfaceID() { return IID_IMDT_RDOtoByteStreamTool; };
-
-  virtual StatusCode initialize();
-  virtual StatusCode finalize();
+  DeclareInterfaceID( IMDT_RDOtoByteStreamTool, 1, 0 );
 
   /** Conversion method, which takes the RDO container and converts it into raw data, filled into RawEventWrite.
   @param cont RDO container which will be used to fill the raw event
@@ -40,10 +35,12 @@ public:
   @param log MsgStream to be filled by method.
   @todo Do we really need to pass in a logfile? This is a AlgTool and so can provide its own log objects.
   */
-  StatusCode convert(MdtCsmContainer* cont, RawEventWrite* re, MsgStream& log )=0; 
+  virtual StatusCode convert (const MdtCsmContainer* cont, RawEventWrite* re, MsgStream& log ) const = 0; 
   
 };
-}
+
+} // namespace Muon
+
 #endif
 
 
diff --git a/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/CMakeLists.txt b/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/CMakeLists.txt
index b93dfe777b3afa6e5c4df6916b465a029fa278d3..abc4c57d336e9b6a906d502e1d6fda67652f2e9f 100644
--- a/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/CMakeLists.txt
+++ b/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name.
 atlas_subdir( MuonMDT_CnvTools )
@@ -20,4 +20,4 @@ atlas_add_component( MuonMDT_CnvTools
    AthenaBaseComps StoreGateLib AtlasDetDescr Identifier ByteStreamCnvSvcBaseLib
    MdtCalibSvcLib MuonCalibEvent MuonReadoutGeometry MuonDigitContainer
    MuonIdHelpersLib MuonRDO MuonPrepRawData MuonCablingData GeoModelUtilities
-   MuonCnvToolInterfacesLib MuonMDT_CnvToolsLib )
+   MuonCnvToolInterfacesLib MuonMDT_CnvToolsLib ByteStreamCnvSvcLib )
diff --git a/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/MuonMDT_CnvTools/IMDT_RDOtoByteStreamTool.h b/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/MuonMDT_CnvTools/IMDT_RDOtoByteStreamTool.h
index a40e675fe2d340153e25a55d6a7943d95ea9fcbd..81db08f748e11d84c32ded87e6546279828fb42b 100755
--- a/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/MuonMDT_CnvTools/IMDT_RDOtoByteStreamTool.h
+++ b/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/MuonMDT_CnvTools/IMDT_RDOtoByteStreamTool.h
@@ -1,43 +1,12 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef MUONMDT_CNVTOOLS_IMDT_RDOTOBYTESTREAMTOOL_H
 #define MUONMDT_CNVTOOLS_IMDT_RDOTOBYTESTREAMTOOL_H
 
-#include "GaudiKernel/IAlgTool.h"
-#include "ByteStreamData/RawEvent.h" 
 
-class MdtCsmContainer; 
-class MsgStream ; 
+#include "MuonCnvToolInterfaces/IMDT_RDOtoByteStreamTool.h"
 
-static const InterfaceID IID_IMDT_RDOtoByteStreamTool("Muon::IMDT_RDOtoByteStreamTool", 1, 0);
 
-namespace Muon {
-  
-  
-  class IMDT_RDOtoByteStreamTool: virtual public IAlgTool {
-    
-  public:
-    
-    //    IMdtCsmContByteStreamTool() {};
-    
-    typedef MdtCsmContainer CONTAINER ; 
-    
-    /** AlgTool InterfaceID
-     */
-    static const InterfaceID& interfaceID( );
-    
-    virtual StatusCode convert(CONTAINER* cont, RawEventWrite* re, MsgStream& log )=0; 
-    
-  };
-  
-}
-inline const InterfaceID& Muon::IMDT_RDOtoByteStreamTool::interfaceID()
-{
-  return IID_IMDT_RDOtoByteStreamTool;
-}
 #endif
-
-
-
diff --git a/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MDT_Hid2RESrcID.cxx b/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MDT_Hid2RESrcID.cxx
index 3ca1dfb5c2c7c565d9d2d57926d7a4dbe722ad22..92c80f962a9f1dc12a4c330a97ab371cf2cadf1b 100755
--- a/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MDT_Hid2RESrcID.cxx
+++ b/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MDT_Hid2RESrcID.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "MDT_Hid2RESrcID.h" 
@@ -35,7 +35,7 @@ StatusCode MDT_Hid2RESrcID::set(const MdtIdHelper* mdtId) {
   return StatusCode::SUCCESS; 
 }
 
-uint32_t MDT_Hid2RESrcID::getRodID(const Identifier& offlineId) {
+uint32_t MDT_Hid2RESrcID::getRodID(const Identifier& offlineId) const {
     
   // this method returns a RESrcID for the ROD, for a 
   // given MDT ID offline ID
@@ -116,7 +116,7 @@ uint32_t MDT_Hid2RESrcID::getRodID(const Identifier& offlineId) {
 
 /** mapping SrcID from ROD to ROB
  */ 
-uint32_t MDT_Hid2RESrcID::getRobID( uint32_t rod_id) {
+uint32_t MDT_Hid2RESrcID::getRobID( uint32_t rod_id) const {
 
   SourceIdentifier id = SourceIdentifier(rod_id);
   SourceIdentifier id2 = SourceIdentifier(id.subdetector_id(),id.module_id());
@@ -131,7 +131,7 @@ uint32_t MDT_Hid2RESrcID::getRobID( uint32_t rod_id) {
 
 /** mapping SrcID from ROB to ROS
  */ 
-uint32_t MDT_Hid2RESrcID::getRosID( uint32_t rob_id) {
+uint32_t MDT_Hid2RESrcID::getRosID( uint32_t rob_id) const {
   //  Change Module Type to ROS, moduleid = 0  
   
   SourceIdentifier id (rob_id);
@@ -141,7 +141,7 @@ uint32_t MDT_Hid2RESrcID::getRosID( uint32_t rob_id) {
 
   /** mapping SrcID from ROS to Det
    */ 
-uint32_t MDT_Hid2RESrcID::getDetID  ( uint32_t ros_id) {
+uint32_t MDT_Hid2RESrcID::getDetID  ( uint32_t ros_id) const {
   //  ROS to DET
   
   SourceIdentifier id (ros_id);
diff --git a/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MDT_Hid2RESrcID.h b/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MDT_Hid2RESrcID.h
index 404413e9bb1bea89cc4536b837b9549b4c7e5d1e..f6a11abcb289f8f8b98e294369ac6fd47ab8c1d0 100755
--- a/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MDT_Hid2RESrcID.h
+++ b/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MDT_Hid2RESrcID.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef __MDT_HID2RESRCID__
@@ -44,19 +44,19 @@ public:
   void setSpecialROBNumber(int specialROBNumber) {m_specialROBNumber=specialROBNumber;}
   /**
    */
-  uint32_t getRodID(const Identifier& offlineId);
+  uint32_t getRodID(const Identifier& offlineId) const;
 
   /** Make a ROB Source ID from a ROD source ID
    */ 
-  uint32_t getRobID  ( uint32_t rod_id); 
+  uint32_t getRobID  ( uint32_t rod_id) const; 
 
   /** Make a ROS Source ID from a ROB source ID
    */ 
-  uint32_t getRosID  ( uint32_t rob_id); 
+  uint32_t getRosID  ( uint32_t rob_id) const; 
 
   /** Make a SubDetector ID from ROS source ID 
    */
-  uint32_t getDetID  ( uint32_t ros_id); 
+  uint32_t getDetID  ( uint32_t ros_id) const;
 
  private: 
 
diff --git a/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MdtCsmContByteStreamTool.cxx b/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MdtCsmContByteStreamTool.cxx
index 32010ab07ac20f40ca91240fd3a3824c52d79cbf..4f0fb0b3727347b4fddecda60bc1e73929071674 100755
--- a/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MdtCsmContByteStreamTool.cxx
+++ b/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MdtCsmContByteStreamTool.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "MdtCsmContByteStreamTool.h"
@@ -14,35 +14,35 @@
 Muon::MdtCsmContByteStreamTool::MdtCsmContByteStreamTool
 ( const std::string& type, const std::string& name,const IInterface* parent )
     :  
-    AthAlgTool(type,name,parent),
-    m_hid2re(0)
+    base_class(type,name,parent)
 {
-  declareInterface< Muon::IMDT_RDOtoByteStreamTool  >( this );
 }
 
 StatusCode Muon::MdtCsmContByteStreamTool::initialize() {
   ATH_CHECK( m_idHelperSvc.retrieve() );
-  m_hid2re = new MDT_Hid2RESrcID ();
-  StatusCode status = m_hid2re->set(&m_idHelperSvc->mdtIdHelper());
-  if ( status.isFailure() ){
-    ATH_MSG_FATAL("Could not initialize MDT mapping !");
-    return StatusCode::FAILURE;
-  }
+  m_hid2re = std::make_unique<MDT_Hid2RESrcID> ();
+  ATH_CHECK( m_hid2re->set(&m_idHelperSvc->mdtIdHelper()) );
+
+  ATH_CHECK( m_byteStreamCnvSvc.retrieve() );
+
   return StatusCode::SUCCESS;
 }
 
  
 StatusCode Muon::MdtCsmContByteStreamTool::finalize() {
-   delete m_hid2re;
    return StatusCode::SUCCESS;
 }
 
 
-StatusCode Muon::MdtCsmContByteStreamTool::convert(CONTAINER* cont, RawEventWrite* re, 
-						   MsgStream& log ) {
+StatusCode Muon::MdtCsmContByteStreamTool::convert(const MdtCsmContainer* cont, RawEventWrite* re, 
+						   MsgStream& /*log*/ ) const {
   
-  m_fea.clear();
-  StatusCode status = m_fea.idMap().set(&m_idHelperSvc->mdtIdHelper());
+  // Get the event assembler
+  FullEventAssembler<MDT_Hid2RESrcID>* fea = nullptr;
+  ATH_CHECK( m_byteStreamCnvSvc->getFullEventAssembler (fea,
+                                                        "MdtCsmContByteStream") );
+
+  StatusCode status = fea->idMap().set(&m_idHelperSvc->mdtIdHelper());
   if ( status.isFailure() ){
     ATH_MSG_FATAL("Could not initialize MDT mapping !");
     return StatusCode::FAILURE;
@@ -69,14 +69,10 @@ StatusCode Muon::MdtCsmContByteStreamTool::convert(CONTAINER* cont, RawEventWrit
   ATH_MSG_DEBUG(" start to fill Rod ");
 
   for (auto& p : mapEncoder) {
-    theROD  = m_fea.getRodData( p.first ); 
+    theROD  = fea->getRodData( p.first ); 
     p.second.fillROD( *theROD ) ; 
   } 
   
-  ATH_MSG_DEBUG(" filling the Raw Event ... ");
-  
-  m_fea.fill(re,log); 
-  
   ATH_MSG_DEBUG(" RawEvent size in 32 bit word " << re->size_word());
   //    log <<MSG::DEBUG<<" RawEvent header  " << re->header() << endmsg;
   
diff --git a/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MdtCsmContByteStreamTool.h b/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MdtCsmContByteStreamTool.h
index 20d3d3ec4570ccb1e1db09a4a34bf0d81d113f71..66071577b791be1b1579674fc39fb5b6862323eb 100755
--- a/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MdtCsmContByteStreamTool.h
+++ b/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/src/MdtCsmContByteStreamTool.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef MUONMDT_CNVTOOLS_MDTCSMCONTRAWEVENTTOOL_H
@@ -11,7 +11,8 @@
 #include "MDT_Hid2RESrcID.h"
 #include "ByteStreamData/RawEvent.h" 
 #include "ByteStreamCnvSvcBase/FullEventAssembler.h" 
-#include "MuonMDT_CnvTools/IMDT_RDOtoByteStreamTool.h"
+#include "ByteStreamCnvSvc/ByteStreamCnvSvc.h"
+#include "MuonCnvToolInterfaces/IMDT_RDOtoByteStreamTool.h"
 #include "MuonIdHelpers/IMuonIdHelperSvc.h"
 
 class MdtCsmContainer; 
@@ -23,8 +24,6 @@ namespace Muon {
 /** An AlgTool class to provide conversion from LArRawChannelContainer
   *  to ByteStream, and fill it in RawEvent
   *  created:  Sept 25, 2002, by Hong Ma 
-  *  requirements:   typedef for CONTAINER class method 
-  *  statusCode convert(CONTAINER* cont, RawEvent* re, MsgStream& log ); 
   *
   * Adapted for Muons by Ketevi A. Assamagan
   * Jan-14-2003, BNL
@@ -35,32 +34,32 @@ namespace Muon {
   * Conversion of a Mdt Csm to ByteStream
   */
 
-class MdtCsmContByteStreamTool: public AthAlgTool, virtual public IMDT_RDOtoByteStreamTool
+class MdtCsmContByteStreamTool: public extends<AthAlgTool, IMDT_RDOtoByteStreamTool>
   {
 
 public:
 
-  typedef MdtCsmContainer CONTAINER ; 
-
   /** constructor
   */
    MdtCsmContByteStreamTool( const std::string& type, const std::string& name, const IInterface* parent ) ;
 
-  virtual StatusCode initialize();
-  virtual StatusCode finalize();
+  virtual StatusCode initialize() override;
+  virtual StatusCode finalize() override;
 
-  StatusCode convert(CONTAINER* cont, RawEventWrite* re, MsgStream& log ); 
+  virtual StatusCode convert(const MdtCsmContainer* cont, RawEventWrite* re, MsgStream& log ) const override;
 
 private: 
 
-  MDT_Hid2RESrcID* m_hid2re; 
+  std::unique_ptr<MDT_Hid2RESrcID> m_hid2re; 
 
   ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
-  
-  FullEventAssembler<MDT_Hid2RESrcID> m_fea ;    
 
+  ServiceHandle<ByteStreamCnvSvc> m_byteStreamCnvSvc
+  { this, "ByteStreamCnvSvc", "ByteStreamCnvSvc" };
 };
-}
+
+} // namespace Muon
+
 #endif
 
 
diff --git a/MuonSpectrometer/MuonConfig/python/MuonRIO_OnTrackCreatorConfig.py b/MuonSpectrometer/MuonConfig/python/MuonRIO_OnTrackCreatorConfig.py
index ba4b344dc0dcce083c9fe910250abe4c6ee4f580..207e3a17d2dd4db7d072c8e9438f4b44712c925c 100644
--- a/MuonSpectrometer/MuonConfig/python/MuonRIO_OnTrackCreatorConfig.py
+++ b/MuonSpectrometer/MuonConfig/python/MuonRIO_OnTrackCreatorConfig.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 
 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
 from AthenaConfiguration.ComponentFactory import CompFactory
@@ -98,9 +98,6 @@ def MdtDriftCircleOnTrackCreatorCfg(flags,name="MdtDriftCircleOnTrackCreator", *
     
     kwargs.setdefault("IsMC", flags.Input.isMC)
 
-    if flags.Muon.MuonTrigger:
-        kwargs.setdefault("doMDT", False)
-
     result.addPublicTool(Muon__MdtDriftCircleOnTrackCreator(name, WasConfigured=True, **kwargs),primary=True)
     return result
     
diff --git a/MuonSpectrometer/MuonConfig/python/MuonTrackBuildingConfig.py b/MuonSpectrometer/MuonConfig/python/MuonTrackBuildingConfig.py
index b0d6d39e20114204ace6126a19ff27465556e10a..502aa271712060bf589b68b0e1d8c9dd6b622540 100644
--- a/MuonSpectrometer/MuonConfig/python/MuonTrackBuildingConfig.py
+++ b/MuonSpectrometer/MuonConfig/python/MuonTrackBuildingConfig.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 
 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
 from AthenaConfiguration.ComponentFactory import CompFactory
@@ -32,6 +32,8 @@ def MooTrackFitterCfg(flags, name = 'MooTrackFitter', **kwargs):
     
     kwargs.setdefault("Propagator",      muon_prop)
     # kwargs.setdefault("SLFit" ,          ) # Was "not jobproperties.BField.allToroidOn()" but do not have access to Field here.
+    if flags.Muon.MuonTrigger:
+        kwargs.setdefault("SLFit", False)
     kwargs.setdefault("ReducedChi2Cut",  flags.Muon.Chi2NDofCut)
     
     momentum_estimator=""
@@ -510,7 +512,7 @@ def MuonTrackSelector(flags, name = "MuonTrackSelectorTool", **kwargs):
     
     return Muon__MuonTrackSelectorTool(name, **kwargs)
 
-def MuonTrackBuildingCfg(flags, name = "MuPatTrackBuilder"):
+def MuonTrackBuildingCfg(flags, name = "MuPatTrackBuilder", **kwargs):
     MuPatTrackBuilder=CompFactory.MuPatTrackBuilder
     # This is based on https://gitlab.cern.ch/atlas/athena/blob/release/22.0.3/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonStandalone.py#L162
     result=ComponentAccumulator()
@@ -531,7 +533,7 @@ def MuonTrackBuildingCfg(flags, name = "MuPatTrackBuilder"):
     from MuonConfig.MuonSegmentNameFixConfig import MuonSegmentNameFixCfg
     result.merge(MuonSegmentNameFixCfg(flags))
     
-    track_builder = MuPatTrackBuilder(name=name, TrackSteering = track_steering, MuonSegmentCollection="TrackMuonSegments", SpectrometerTrackOutputLocation="MuonSpectrometerTracks" )
+    track_builder = MuPatTrackBuilder(name=name, TrackSteering = track_steering, MuonSegmentCollection="TrackMuonSegments", SpectrometerTrackOutputLocation="MuonSpectrometerTracks", **kwargs)
 
     result.addEventAlgo( track_builder, primary=True )
     return result
diff --git a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/RpcReadoutElement.h b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/RpcReadoutElement.h
index df9d7988f5f7f732f7a385959179b81be610b45e..dfdeac284e754698fb08d8f0cc3885032a879de7 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/RpcReadoutElement.h
+++ b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/RpcReadoutElement.h
@@ -248,7 +248,7 @@ namespace MuonGM {
 
     int m_dbR, m_dbZ, m_dbPhi;
     bool m_hasDEDontop;
-    int m_nlayers;  // default=2, all BIS RPCs always have 3 gas gaps
+    int m_nlayers;  // default=2, all BI RPCs always have 3 gas gaps, need this flag since amdb only supports a maximum of 2 gas gaps, so this is steering the hardcoded third gas gap for Run3/4 layouts based on amdb primary numbers
 
     int m_nphigasgaps;
     int m_netagasgaps;
diff --git a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/RpcReadoutElement.cxx b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/RpcReadoutElement.cxx
index c9c6da5e5e5e80173ca8b168a4270707b3e6abc3..aff1cc3bf4392657fb588d4705ac937ba7b52f22 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/RpcReadoutElement.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/RpcReadoutElement.cxx
@@ -307,8 +307,8 @@ namespace MuonGM {
   {
     const GenericRPCCache* r = manager()->getGenericRpcDescriptor();
     double xgg=0;
-    if (m_nlayers==3) { // the BIS RPCs are the only ones with 3 gas gaps, they don't have an inner support structure
-      xgg = -rpc3GapLayerThickness + (gasGap-1)*rpc3GapLayerThickness - 0.74; // the values from MuonGeoModel have an offset of 0.74, TO BE INVESTIGATED
+    if (m_nlayers==3) { // the BI RPCs are the only ones with 3 gas gaps, they don't have an inner support structure
+      xgg = -rpc3GapLayerThickness + (gasGap-1)*rpc3GapLayerThickness - 0.74; // the values from MuonGeoModel have an offset of 0.74, TO BE INVESTIGATED, cf. ATLASSIM-5021
     } else {
       xgg = -m_Rsize/2. + m_exthonthick + r->stripPanelThickness + r->GasGapThickness/2.;
       if (gasGap == 1) return xgg;
diff --git a/MuonSpectrometer/MuonG4/MuonG4SD/test/RPCSensitiveDetectorCosmics_gtest.cxx b/MuonSpectrometer/MuonG4/MuonG4SD/test/RPCSensitiveDetectorCosmics_gtest.cxx
index f56e7ad2ae18a59af13949f5602736612ca5c545..2967a3839cadcaa95341363717e8619e73d6a61c 100644
--- a/MuonSpectrometer/MuonG4/MuonG4SD/test/RPCSensitiveDetectorCosmics_gtest.cxx
+++ b/MuonSpectrometer/MuonG4/MuonG4SD/test/RPCSensitiveDetectorCosmics_gtest.cxx
@@ -38,7 +38,7 @@ class RPCSensitiveDetectorCosmicstest : public ::testing::Test {
 TEST_F ( RPCSensitiveDetectorCosmicstest, Initialize )
 {
   G4HCofThisEvent hce;
-  RPCSensitiveDetectorCosmics sd1("name1", "name1", 2); // name, hitCollectionName, nGasGaps; all non-BIS RPCs (Run1+2) have 2 gas gaps, only BIS RPCs have 3 gas gaps
+  RPCSensitiveDetectorCosmics sd1("name1", "name1", 2); // name, hitCollectionName, nGasGaps; all non-BI RPCs (Run1+2) have 2 gas gaps, only BI RPCs have 3 gas gaps
   sd1.Initialize( &hce );
   ASSERT_TRUE(sd1.m_myRPCHitColl.isValid()); //check if initialization of m_myRPCHitColl is successful
 }
@@ -74,7 +74,7 @@ TEST_F ( RPCSensitiveDetectorCosmicstest, ProcessHits )
   G4String nop3 = "gamma";
   DerivedG4SensitiveDetectorTestSetting(sp, totalenergydeposit, physicalname, logicalname, copynos, preStepPos, postStepPos, globaltime0, kineticenergy0, velocity0, globaltime, kineticenergy, globaltime1, kineticenergy1, velocity1, steplength, charge, encoding, antiencoding, astring, atype, nop1, nop2, nop3);//invoking of this function aims to setting testing environment.
 
-  RPCSensitiveDetectorCosmics sd2("name2", "name2", 2); // name, hitCollectionName, nGasGaps; all non-BIS RPCs (Run1+2) have 2 gas gaps, only BIS RPCs have 3 gas gaps
+  RPCSensitiveDetectorCosmics sd2("name2", "name2", 2); // name, hitCollectionName, nGasGaps; all non-BI RPCs (Run1+2) have 2 gas gaps, only BI RPCs have 3 gas gaps
   sd2.Initialize( &hce );//initialize the hit collection m_myCSCHitColl
   sd2.ProcessHits(&sp, &th );//invoke the tested member function
 
diff --git a/MuonSpectrometer/MuonG4/MuonG4SD/test/RPCSensitiveDetector_gtest.cxx b/MuonSpectrometer/MuonG4/MuonG4SD/test/RPCSensitiveDetector_gtest.cxx
index d610d17e3634165b75100137dfca6f94ac9731e5..baed966739cc06906e6da62d632af67c88cc5366 100644
--- a/MuonSpectrometer/MuonG4/MuonG4SD/test/RPCSensitiveDetector_gtest.cxx
+++ b/MuonSpectrometer/MuonG4/MuonG4SD/test/RPCSensitiveDetector_gtest.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "src/RPCSensitiveDetector.h"
@@ -38,7 +38,7 @@ class RPCSensitiveDetectortest : public ::testing::Test {
 TEST_F ( RPCSensitiveDetectortest, Initialize )
 {
   G4HCofThisEvent hce;
-  RPCSensitiveDetector sd1("name1", "name1", 2); // name, hitCollectionName, nGasGaps; all non-BIS RPCs (Run1+2) have 2 gas gaps, only BIS RPCs have 3 gas gaps
+  RPCSensitiveDetector sd1("name1", "name1", 2); // name, hitCollectionName, nGasGaps; all non-BI RPCs (Run1+2) have 2 gas gaps, only BI RPCs have 3 gas gaps
   sd1.Initialize( &hce );
   ASSERT_TRUE(sd1.m_myRPCHitColl.isValid()); //check if initialization of m_myRPCHitColl is successful
 
@@ -75,7 +75,7 @@ TEST_F ( RPCSensitiveDetectortest, ProcessHits )
   G4String nop3 = "gamma";
   DerivedG4SensitiveDetectorTestSetting(sp, totalenergydeposit, physicalname, logicalname, copynos, preStepPos, postStepPos, globaltime0, kineticenergy0, velocity0, globaltime, kineticenergy, globaltime1, kineticenergy1, velocity1, steplength, charge, encoding, antiencoding, astring, atype, nop1, nop2, nop3);//invoking of this function aims to setting testing environment.
 
-  RPCSensitiveDetector sd2("name2", "name2", 2); // name, hitCollectionName, nGasGaps; all non-BIS RPCs (Run1+2) have 2 gas gaps, only BIS RPCs have 3 gas gaps
+  RPCSensitiveDetector sd2("name2", "name2", 2); // name, hitCollectionName, nGasGaps; all non-BI RPCs (Run1+2) have 2 gas gaps, only BI RPCs have 3 gas gaps
   sd2.Initialize( &hce );//initialize the hit collection m_myRPCHitColl
   sd2.ProcessHits(&sp, &th );//invoke the tested member function
 
diff --git a/MuonSpectrometer/MuonGeoModel/src/Rpc.cxx b/MuonSpectrometer/MuonGeoModel/src/Rpc.cxx
index c5ac1e35345bf4ca6c9540cb618c8dadc0eb0470..3e72f1eca58bac27ef8dd2b6ef8a702f152929ec 100644
--- a/MuonSpectrometer/MuonGeoModel/src/Rpc.cxx
+++ b/MuonSpectrometer/MuonGeoModel/src/Rpc.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "MuonGeoModel/Rpc.h"
@@ -79,7 +79,7 @@ namespace MuonGM {
         double centSupThick = r->centralSupPanelThickness;
         double centAlSupThick = r->centralAlSupPanelThickness;
 
-        // Geometrical information to be overwritten for BIS chambers (having 3 gas gaps)
+        // Geometrical information to be overwritten for BI chambers (having 3 gas gaps)
         if (m_nlayers == 3) {
             // width, longWidth, length are taken from geometry DB
             thickness = rpc3GapMaxThickness;
@@ -159,7 +159,7 @@ namespace MuonGM {
                 }
             }
 
-            if (m_nlayers == 2) { // only to be done for standard (non-BIS) RPCs
+            if (m_nlayers == 2) { // only to be done for standard (non-BI) RPCs
                 newpos += extSupThick / 2.;
                 GeoTransform *tlpan = new GeoTransform(GeoTrf::TranslateX3D(newpos));
                 if (RPCprint) {
@@ -170,7 +170,7 @@ namespace MuonGM {
                     prpc->add(pallpan);
                 }
 
-                // The first layer is support for RPCs with 2 gaps, is a layer for 3 gaps (BIS chambers, no supports)
+                // The first layer is support for RPCs with 2 gaps, is a layer for 3 gaps (BI chambers, no supports)
                 newpos += extSupThick / 2.;
             }
 
@@ -229,7 +229,7 @@ namespace MuonGM {
                 }
             }
 
-            if (m_nlayers == 2) { // only to be done for standard (non-BIS) RPCs
+            if (m_nlayers == 2) { // only to be done for standard (non-BI) RPCs
                 newpos += centSupThick / 2.;
                 GeoTransform *tcpan = new GeoTransform(GeoTrf::TranslateX3D(newpos));
                 if (RPCprint) {
@@ -307,11 +307,11 @@ namespace MuonGM {
                 prpc->add(new GeoIdentifierTag(2));
                 prpc->add(tugg);
                 if (m_nlayers == 2)
-                    prpc->add(rugg); // only to be done for standard (non-BIS) RPCs
+                    prpc->add(rugg); // only to be done for standard (non-BI) RPCs
                 prpc->add(puppergg);
             }
 
-            // additional RpcLayer for BIS (3 gaps)
+            // additional RpcLayer for BI (3 gaps)
             if (m_nlayers == 3) {
                 newpos += rpcLayerThickness / 2.;
                 RpcLayer *rthird = new RpcLayer(name, this);
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTGRecTools/CMakeLists.txt b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTGRecTools/CMakeLists.txt
index e3397bbd8d0704a3450f281e063f58a40411b25c..193e190afcfe69eec2c94ee1d422788700e0d5f0 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTGRecTools/CMakeLists.txt
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTGRecTools/CMakeLists.txt
@@ -13,7 +13,7 @@ atlas_add_library( MuonTGRecToolsLib
                    MuonTGRecTools/*.h
                    INTERFACE
                    PUBLIC_HEADERS MuonTGRecTools
-                   LINK_LIBRARIES GaudiKernel TrkGeometry EventPrimitives AthenaBaseComps TrkTrack TrkExInterfaces TrkToolInterfaces TrkFitterUtils TrackRecordLib TrkEventPrimitives TrkGeometry TrkPrepRawData MuonTrackMakerUtils MuonIdHelpersLib MuonPrepRawData AthContainers AthenaKernel TrkExInterfaces TrkSurfaces TrkSegment )
+                   LINK_LIBRARIES GaudiKernel TrkDetDescrInterfaces TrkGeometry EventPrimitives AthenaBaseComps TrkTrack TrkExInterfaces TrkToolInterfaces TrkFitterUtils TrackRecordLib TrkEventPrimitives TrkGeometry TrkPrepRawData MuonTrackMakerUtils MuonIdHelpersLib MuonPrepRawData AthContainers AthenaKernel TrkExInterfaces TrkSurfaces TrkSegment )
 
 # Component(s) in the package:
 atlas_add_component( MuonTGRecTools
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTGRecTools/MuonTGRecTools/MuonTGMeasurementTool.h b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTGRecTools/MuonTGRecTools/MuonTGMeasurementTool.h
index 6a7ab591ba23fe2ebc3cd1c8051cf8bdc5d7f7b1..33e3a3e2dd13fd565476c46a5f456e53506f9c32 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTGRecTools/MuonTGRecTools/MuonTGMeasurementTool.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTGRecTools/MuonTGRecTools/MuonTGMeasurementTool.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef MUONTGRECTOOLS_MUONTGMEASUREMENTTOOL_H
@@ -27,7 +27,9 @@
 #include "MuonPrepRawData/RpcPrepData.h"
 #include "GaudiKernel/ConcurrencyFlags.h"
 #include "EventPrimitives/EventPrimitives.h"
-
+#include "TrkGeometry/TrackingVolume.h"
+#include "TrkGeometry/TrackingGeometry.h"
+#include "TrkDetDescrInterfaces/ITrackingGeometrySvc.h"
 #include <fstream>
 #include <vector>
 #include <string>
@@ -59,8 +61,7 @@ public:
   virtual ~MuonTGMeasurementTool()=default;
 
   virtual StatusCode initialize();
-  virtual StatusCode finalize();
-
+ 
   const std::vector<const Trk::PrepRawData*>* getMeasurementOnLayer(const Trk::Layer* lay) const;
   const std::vector<const Trk::PrepRawData*>* getEtaPhiMeasurementOnLayer(const Trk::Layer* lay, bool phi) const;
   const std::vector<const Trk::Segment*>* getSegments(const Trk::DetachedTrackingVolume* station) const;
@@ -80,15 +81,17 @@ public:
  
 private:
 
-  // --- job options
-  Gaudi::Property<std::string>  m_trackingGeometryName{this,"TrackingGeometryName","AtlasTrackingGeometry"};
-  Gaudi::Property<std::string> m_ExtrapolatorName{this,"ExtrapolatorName"," "};      //!< Name of the Extrapolator Instance 
-    
+     
   ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
 
   SG::ReadCondHandleKey<MuonGM::MuonDetectorManager> m_DetectorManagerKey {this, "DetectorManagerKey", 
       "MuonDetectorManager", 
       "Key of input MuonDetectorManager condition data"};    
+  
+   ServiceHandle<Trk::ITrackingGeometrySvc> m_trackingGeometrySvc { this, "TrackingGeometrySvc", "TrackingGeometrySvc/AtlasTrackingGeometrySvc" };
+    
+   SG::ReadCondHandleKey<Trk::TrackingGeometry> m_trackingGeometryReadKey { this, "TrackingGeometryReadKey", "", "Key of input TrackingGeometry" };
+    
   const MuonGM::MuonDetectorManager* m_muonDetMgr; // nominal MuonDetectorManager from DetectorStore (used if UseDSManager=true)
  
   // -- algorithm members
@@ -96,15 +99,29 @@ private:
   mutable MuonTGSegments* m_segments   ATLAS_THREAD_SAFE; //Marked as thread-safe because it's disabled when running multi-threaded
 
   // projection matrices
-  AmgMatrix(5,5)                  *m_tgcProjEta;
-  AmgMatrix(5,5)                  *m_tgcProjPhi;
-  AmgMatrix(5,5)                  *m_rpcProjEta;
-  AmgMatrix(5,5)                  *m_rpcProjPhi;
+  std::unique_ptr<AmgMatrix(5,5)>                  m_tgcProjEta;
+  std::unique_ptr<AmgMatrix(5,5)>                  m_tgcProjPhi;
+  std::unique_ptr<AmgMatrix(5,5)>                  m_rpcProjEta;
+  std::unique_ptr<AmgMatrix(5,5)>                  m_rpcProjPhi;
 
   // steering
   Gaudi::Property<bool>  m_alignedMode{this,"AlignedMode",true};
   Gaudi::Property<bool>  m_useDSManager{this,"UseDSManager",false};
 
+  inline const Trk::TrackingGeometry* getGeometry() const {
+        /// Good old way of retrieving the volume via the geometry service
+        if (m_trackingGeometryReadKey.empty()) {
+                return m_trackingGeometrySvc->trackingGeometry();
+        }
+        SG::ReadCondHandle < Trk::TrackingGeometry > handle(m_trackingGeometryReadKey, Gaudi::Hive::currentContext());
+        if (!handle.isValid()) {
+            ATH_MSG_WARNING("Could not retrieve a valid tracking geometry");
+                return nullptr;
+        }
+        return handle.cptr();
+    }
+
+
 };
 
 }
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTGRecTools/src/MuonTGMeasurementTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTGRecTools/src/MuonTGMeasurementTool.cxx
index 21389582bf0900d54ab4280486b0ed5bba9d209f..c0e44bff14439e7f746b1f73ed056fb74b49c1bd 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTGRecTools/src/MuonTGMeasurementTool.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTGRecTools/src/MuonTGMeasurementTool.cxx
@@ -11,8 +11,7 @@
 #include "TrkMeasurementBase/MeasurementBase.h"
 #include "TrkSurfaces/DistanceSolution.h"
 #include "TrkGeometry/Layer.h"
-#include "TrkGeometry/TrackingVolume.h"
-#include "TrkGeometry/TrackingGeometry.h"
+
 #include "TrkRIO_OnTrack/RIO_OnTrack.h"
 #include "TrackRecord/TrackRecord.h"
 #include "MuonPrepRawData/MuonPrepDataContainer.h"
@@ -56,33 +55,25 @@ StatusCode Muon::MuonTGMeasurementTool::initialize()
   }
 
   // define projection matrices
-  m_tgcProjEta = new AmgMatrix(5,5);
+  m_tgcProjEta = std::make_unique<AmgMatrix(5,5)>();
   m_tgcProjEta->setIdentity();
   (*m_tgcProjEta)(0,0) = 0.; (*m_tgcProjEta)(1,1) = 0.;
   (*m_tgcProjEta)(0,1) = 1.; (*m_tgcProjEta)(1,0) =-1.;
-  m_tgcProjPhi = new AmgMatrix(5,5);
+  m_tgcProjPhi = std::make_unique<AmgMatrix(5,5)>();
   m_tgcProjPhi->setIdentity();
 
-  m_rpcProjEta = new AmgMatrix(5,5);
+  m_rpcProjEta = std::make_unique<AmgMatrix(5,5)>();
   m_rpcProjEta->setIdentity();
   (*m_rpcProjEta)(0,0) = 0.; (*m_rpcProjEta)(1,1) = 0.;
   (*m_rpcProjEta)(0,1) = 1.; (*m_rpcProjEta)(1,0) = 1.;
-  m_rpcProjPhi = new AmgMatrix(5,5);
+  m_rpcProjPhi = std::make_unique<AmgMatrix(5,5)>();
   m_rpcProjPhi->setIdentity();
 
-  return StatusCode::SUCCESS;
-}
-
-// Finalize method:
-StatusCode Muon::MuonTGMeasurementTool::finalize() 
-{
-  // Get the messaging service, print where you are
-  ATH_MSG_INFO("MuonTGMeasurementTool::finalize()");
-  //delete m_tpMinFinder;
-  delete m_tgcProjEta;
-  delete m_tgcProjPhi;
-  delete m_rpcProjEta;
-  delete m_rpcProjPhi;
+  if (!m_trackingGeometryReadKey.empty()) {
+        ATH_CHECK(m_trackingGeometryReadKey.initialize());
+  } else {
+        ATH_CHECK(m_trackingGeometrySvc.retrieve());
+  }
   return StatusCode::SUCCESS;
 }
 
@@ -90,11 +81,8 @@ const std::vector<const Trk::PrepRawData*>* Muon::MuonTGMeasurementTool::getMeas
 {
   // Get the messaging service, print where you are
   ATH_MSG_DEBUG("Muon::MuonTGMeasurementTool::getMeasurementOnLayer");
-  const std::vector<const Trk::PrepRawData*>* hitsOnLayer = 0; 
+  const std::vector<const Trk::PrepRawData*>* hitsOnLayer = nullptr; 
   // 
-  const Trk::TrackingGeometry* trackingGeometry;
-  if ( detStore()->retrieve(trackingGeometry, m_trackingGeometryName).isFailure() )return hitsOnLayer; 
-  
   if (m_hits && lay) {
     const Trk::DetachedTrackingVolume* station = lay->enclosingDetachedTrackingVolume();
     if (!station) ATH_MSG_WARNING("no enclosing station found");
@@ -165,10 +153,7 @@ const std::vector<const Trk::Segment*>* Muon::MuonTGMeasurementTool::getSegments
   // Get the messaging service, print where you are
   ATH_MSG_DEBUG("Muon::MuonTGMeasurementTool::getSegments");
   const std::vector<const Trk::Segment*>* segments = 0; 
-  // 
-  const Trk::TrackingGeometry* trackingGeometry;
-  if ( detStore()->retrieve(trackingGeometry, m_trackingGeometryName).isFailure() )return segments; 
-
+ 
   if (m_segments && station) {
     unsigned int ist=0;
     while ( ist < m_segments->size() ) {
@@ -205,9 +190,7 @@ const Trk::TrackParameters* Muon::MuonTGMeasurementTool::layerToDetEl(const Trk:
     if (!lay || !parm || !id.get_identifier32().get_compact() ) return projPar;
 
     // get tracking geometry
-    const Trk::TrackingGeometry* trackingGeometry;
-    if ( detStore()->retrieve(trackingGeometry, m_trackingGeometryName).isFailure() )return projPar; 
-
+   
     // check compatibility of layer info and required id ? this was already done when associating !
     if (!lay->layerType()) return projPar;
     Identifier layId(lay->layerType()); 
@@ -307,8 +290,8 @@ const Trk::TrackParameters* Muon::MuonTGMeasurementTool::layerToDetEl(const Trk:
       Amg::VectorX locPar = parm->parameters();
       // projection matrix
       AmgMatrix(5,5)* pMx = 0;
-      if (m_idHelperSvc->rpcIdHelper().measuresPhi(id)) pMx = m_rpcProjPhi;
-      else                                pMx = m_rpcProjEta;
+      if (m_idHelperSvc->rpcIdHelper().measuresPhi(id)) pMx = m_rpcProjPhi.get();
+      else                                pMx = m_rpcProjEta.get();
       // projected parameters 
       double eta = 1.;
       double sign = (m_idHelperSvc->rpcIdHelper().measuresPhi(id) && m_idHelperSvc->rpcIdHelper().doubletPhi(id)==2 ) ? -1. : 1.;
@@ -387,8 +370,8 @@ const Trk::TrackParameters* Muon::MuonTGMeasurementTool::layerToDetEl(const Trk:
       parProj[4]= parm->parameters()[Trk::qOverP];
       //    
       AmgMatrix(5,5)* pMx = 0;
-      if ( m_idHelperSvc->cscIdHelper().measuresPhi(id) )  pMx = m_tgcProjPhi;
-      else                                   pMx = m_tgcProjEta;
+      if ( m_idHelperSvc->cscIdHelper().measuresPhi(id) )  pMx = m_tgcProjPhi.get();
+      else                                   pMx = m_tgcProjEta.get();
       Amg::VectorX locPar = (*pMx)*parProj;
       ATH_MSG_DEBUG("projected parameters (layer->CSC):" << m_idHelperSvc->cscIdHelper().measuresPhi(id) <<"," << locPar );
 
@@ -418,8 +401,8 @@ const Trk::TrackParameters* Muon::MuonTGMeasurementTool::layerToDetEl(const Trk:
       if (!stripSurf) return projPar;
       //
       AmgMatrix(5,5)* pMx = 0;
-      if ( m_idHelperSvc->tgcIdHelper().isStrip(id) )  pMx = m_tgcProjPhi;
-      else                               pMx = m_tgcProjEta;
+      if ( m_idHelperSvc->tgcIdHelper().isStrip(id) )  pMx = m_tgcProjPhi.get();
+      else                               pMx = m_tgcProjEta.get();
       Amg::VectorX locPar = (*pMx)*parm->parameters();
       ATH_MSG_DEBUG("projected parameters (layer->TGC):" << m_idHelperSvc->tgcIdHelper().isStrip(id) <<"," << locPar <<"," << stripSurf );
 
@@ -462,15 +445,11 @@ const Trk::TrackParameters* Muon::MuonTGMeasurementTool::detElToLayer(const Trk:
 {
     // Get the messaging service, print where you are
     ATH_MSG_DEBUG("MuonTGMeasurementTool::detElToLayer");
-    const Trk::TrackParameters* projPar = 0;
+    const Trk::TrackParameters* projPar = nullptr;
 
     // check input
     if (!lay || !parm || !(id.get_identifier32().get_compact()>0) ) return projPar;
 
-    // get tracking geometry
-    const Trk::TrackingGeometry* trackingGeometry;
-    if ( detStore()->retrieve(trackingGeometry, m_trackingGeometryName).isFailure() )return projPar; 
-
     // check compatibility of layer info and required id ? this was already done when associating !
     if (!lay->layerType()) return projPar;
     Identifier layId(lay->layerType());
@@ -561,8 +540,8 @@ const Trk::TrackParameters* Muon::MuonTGMeasurementTool::detElToLayer(const Trk:
       //
       Amg::VectorX locPar = parm->parameters();
       AmgMatrix(5,5)* pMx = 0;
-      if (m_idHelperSvc->rpcIdHelper().measuresPhi(id)) pMx = m_rpcProjPhi;
-      else                                pMx = m_rpcProjEta;
+      if (m_idHelperSvc->rpcIdHelper().measuresPhi(id)) pMx = m_rpcProjPhi.get();
+      else                                pMx = m_rpcProjEta.get();
 
       double eta = 1.;
       double sign = (m_idHelperSvc->rpcIdHelper().measuresPhi(id) && m_idHelperSvc->rpcIdHelper().doubletPhi(id)==2 ) ? -1. : 1.;
@@ -622,8 +601,8 @@ const Trk::TrackParameters* Muon::MuonTGMeasurementTool::detElToLayer(const Trk:
       const Amg::Vector2D csc_shift(0.,lay->getRef());
       // projection : take into account possible misalignment ;
       AmgMatrix(5,5)* pMx = 0;
-      if ( m_idHelperSvc->cscIdHelper().measuresPhi(id) )  pMx = m_tgcProjPhi;
-      else                                   pMx = m_tgcProjEta;
+      if ( m_idHelperSvc->cscIdHelper().measuresPhi(id) )  pMx = m_tgcProjPhi.get();
+      else                                   pMx = m_tgcProjEta.get();
       AmgMatrix(5,5) pMxInv = pMx->inverse();
       Amg::VectorX parProj = pMxInv*parm->parameters();
       Amg::Vector3D corrLocPos = lay->surfaceRepresentation().center()-t*parm->momentum() + t*DN*layNormal;
@@ -651,8 +630,8 @@ const Trk::TrackParameters* Muon::MuonTGMeasurementTool::detElToLayer(const Trk:
       }
 
       AmgMatrix(5,5)* pMx = 0;
-      if ( m_idHelperSvc->tgcIdHelper().isStrip(id) )  pMx = m_tgcProjPhi;
-      else                               pMx = m_tgcProjEta;
+      if ( m_idHelperSvc->tgcIdHelper().isStrip(id) )  pMx = m_tgcProjPhi.get();
+      else                               pMx = m_tgcProjEta.get();
       AmgMatrix(5,5) pMxInv = pMx->inverse();
       Amg::VectorX locPar = pMxInv * parm->parameters();
       ATH_MSG_DEBUG("back projected parameters(TGC->layer):" << m_idHelperSvc->tgcIdHelper().isStrip(id)<<"," << locPar );
@@ -697,14 +676,11 @@ const Trk::RIO_OnTrack* Muon::MuonTGMeasurementTool::measToLayer(const Trk::Laye
   }
     // Get the messaging service, print where you are
     ATH_MSG_DEBUG("MuonTGMeasurementTool::measToLayer");
-    const Trk::RIO_OnTrack* projRIO = 0;
+    const Trk::RIO_OnTrack* projRIO = nullptr;
 
     // check input
     if (!lay || !parm || !rio ) return projRIO;
-
-    // get tracking geometry
-    const Trk::TrackingGeometry* trackingGeometry;
-    if ( detStore()->retrieve(trackingGeometry, m_trackingGeometryName).isFailure() )return projRIO; 
+    
 
     // check compatibility of layer info and required id ? this was already done when associating !
     Identifier id = rio->identify();
@@ -879,10 +855,7 @@ const Identifier Muon::MuonTGMeasurementTool::nearestDetEl(const Trk::Layer* lay
   Identifier nid(0);
   // check input
   if (!lay || !parm || !lay->layerType() ) return nid;
-  
-  // get tracking geometry
-  const Trk::TrackingGeometry* trackingGeometry;
-  if ( detStore()->retrieve(trackingGeometry, m_trackingGeometryName).isFailure() )return nid; 
+ 
 
   // check compatibility of layer info and required id ? this was already done when associating !
   Identifier layId(lay->layerType());
@@ -1204,21 +1177,13 @@ const Trk::Layer* Muon::MuonTGMeasurementTool::associatedLayer(Identifier id, Am
 {
   // Get the messaging service, print where you are
   ATH_MSG_DEBUG("MuonTGMeasurementTool::associatedLayer");
-  const Trk::Layer* lay = 0;
+  const Trk::Layer* lay = nullptr;
   // check input
   if (!id.get_identifier32().get_compact() ) return lay;
   
-  // get tracking geometry
-  const Trk::TrackingGeometry* trackingGeometry;
-  StatusCode sc = detStore()->retrieve(trackingGeometry, m_trackingGeometryName);
-  if ( sc.isFailure() ){
-    ATH_MSG_FATAL("Could not find tool "<< m_trackingGeometryName<<". Exiting.");
-    return lay; 
-  }else ATH_MSG_DEBUG("tracking geometry Svc \""<<m_trackingGeometryName<<"\" booked ");
-  
   // rely on having misalignment uncertainty covered by span safety marge ( don't loose station from static volume 
   //  when misaligned
-  const Trk::TrackingVolume* staticVol = trackingGeometry->lowestStaticTrackingVolume(gp);
+  const Trk::TrackingVolume* staticVol = getGeometry()->lowestStaticTrackingVolume(gp);
   const Trk::DetachedTrackingVolume* station = 0;
   if (staticVol && staticVol->confinedDetachedVolumes()) {
     const std::vector<const Trk::DetachedTrackingVolume*>* detTV = staticVol->confinedDetachedVolumes(); 
diff --git a/MuonSpectrometer/MuonSimEvent/MuonSimEvent/RpcHitIdHelper.h b/MuonSpectrometer/MuonSimEvent/MuonSimEvent/RpcHitIdHelper.h
index 60ec487f6241f139297831e71729a9bd68820300..2d470d8744bbb5ac0ec2e0e5c27bd93f66a0c331 100644
--- a/MuonSpectrometer/MuonSimEvent/MuonSimEvent/RpcHitIdHelper.h
+++ b/MuonSpectrometer/MuonSimEvent/MuonSimEvent/RpcHitIdHelper.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef RpcHitIdHelper_H
@@ -31,7 +31,7 @@ public:
 private:
   RpcHitIdHelper();
   RpcHitIdHelper(unsigned int nGasGaps);
-  void Initialize(unsigned int nGasGaps=2); // all non-BIS RPCs (Run1+2) have 2 gas gaps, only BIS RPCs have 3 gas gaps
+  void Initialize(unsigned int nGasGaps=2); // all non-BI RPCs (Run1+2) have 2 gas gaps, only BI RPCs have 3 gas gaps
   void InitializeStationName();
   static RpcHitIdHelper* m_help;
 
diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkART/DerivationFrameworkPhysicsValidationART/test/test_mc16PHYSVAL_DAOD_NTUP_HIST.sh b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkART/DerivationFrameworkPhysicsValidationART/test/test_mc16PHYSVAL_DAOD_NTUP_HIST.sh
index 60a95d3cabfda3fd872658beca086e4f6eb34eb1..c116437f40c2b102f4200aac39f6481172e2e027 100755
--- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkART/DerivationFrameworkPhysicsValidationART/test/test_mc16PHYSVAL_DAOD_NTUP_HIST.sh
+++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkART/DerivationFrameworkPhysicsValidationART/test/test_mc16PHYSVAL_DAOD_NTUP_HIST.sh
@@ -2,14 +2,13 @@
 #
 # art-description: AOD to DAOD to PHYSVAL
 # art-type: grid
-# art-input: user.khoo.mc16_13TeV.410389.MadGraphPythia8EvtGen_A14NNPDF23_ttgamma_nonallhadronic.recon.AOD.e6155_s3126_r10201.DAOD_PHYSVAL_ART
+# art-input: valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.recon.AOD.e4993_s3227_r12287
 # art-include: master/Athena
 # art-input-nfiles: 10
 # art-cores: 5
 # art-output: art_core_*
 # art-output: PHYSVAL_WEB
 # art-output: DAOD_PHYSVAL.part1.*
-# art-runon: Saturday
 
 echo "ArtProcess: $ArtProcess"
 
diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkBPhys/DerivationFrameworkBPhys/ReVertex.h b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkBPhys/DerivationFrameworkBPhys/ReVertex.h
index 853f03bcf72f2b8d53d7ffa1b85e4d27e64d4cdb..51eb689e08b1c68eb4c1587bf061996d397da80d 100644
--- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkBPhys/DerivationFrameworkBPhys/ReVertex.h
+++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkBPhys/DerivationFrameworkBPhys/ReVertex.h
@@ -53,6 +53,7 @@ public:
 		    const xAOD::TrackParticleContainer* importedTrackCollection,
 		    const xAOD::VertexContainer* pvContainer) const;
    xAOD::Vertex* fit(const std::vector<const xAOD::TrackParticle*> &inputTracks,
+		     const xAOD::TrackParticleContainer* importedTrackCollection,
 		     const xAOD::Vertex* pv) const;
 private:
     std::vector<int> m_TrackIndices;
diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkBPhys/share/BPHY11.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkBPhys/share/BPHY11.py
index a0ea555b5e45204860b990d96b493a50674d0e43..d19526c45dca05465c2a75c147f664e7938bd3cd 100644
--- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkBPhys/share/BPHY11.py
+++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkBPhys/share/BPHY11.py
@@ -50,10 +50,10 @@ BPHY11_JpsiFinder = Analysis__JpsiFinder(
     invMassUpper                = 3600.0,
     invMassLower                = 2600.0,
     Chi2Cut                     = 30.0,
-    oppChargesOnly	        = False,
-    allChargeCombinations	= True,
+    oppChargesOnly	        = True,
+    allMuons                    = True,
     combOnly		        = False,
-    atLeastOneComb              = True,
+    atLeastOneComb              = False,
     useCombinedMeasurement      = False, # Only takes effect if combOnly=True	
     muonCollectionKey           = "Muons",
     TrackParticleCollection     = "InDetTrackParticles",
@@ -144,9 +144,7 @@ BPHY11_LbJpsipK = Analysis__JpsiPlus2Tracks(
   MuonsUsedInJpsi	    = "Muons",
   TrkVertexFitterTool	    = LbJpsipKVertexFit,
   TrackSelectorTool	    = BPHY11_VertexTools.InDetTrackSelectorTool,
-  UseMassConstraint	    = True,
-  UseVertexFittingWithPV    = True,
-  VertexContainer           = "PrimaryVertices"
+  UseMassConstraint	    = True
 )
         
 ToolSvc += BPHY11_LbJpsipK
@@ -202,49 +200,79 @@ ToolSvc += BPHY11_Select_Lb2JpsiKp
 print(BPHY11_Select_Lb2JpsiKp)
 
 #-------------------------------------------------------
+# Adding PV to fit
+
 from DerivationFrameworkBPhys.DerivationFrameworkBPhysConf import DerivationFramework__ReVertex
-BPHY11_LbPlusTrk             = DerivationFramework__ReVertex(
-  name                       = "BPHY11_LbPlusTrk",
+BPHY11_Lb_pK_PV              = DerivationFramework__ReVertex(
+  name                       = "BPHY11_Lb_pK_PV",
   InputVtxContainerName      = "LbJpsipKCandidates",
-  HypothesisNames            = [ BPHY11_Select_Lb2JpsipK.HypothesisName, BPHY11_Select_Lb2JpsiKp.HypothesisName ],
+  HypothesisNames            = [ BPHY11_Select_Lb2JpsipK.HypothesisName ],
   TrackIndices               = [ 0, 1, 2, 3 ],
-  UseAdditionalTrack         = True,
   UseMassConstraint          = True,
   UseVertexFittingWithPV     = True,
 #  VertexMass                 = 5619.6,
   SubVertexMass              = 3096.900,
-  MassInputParticles         = [ 105.658, 105.658, 139.57, 139.57, 139.57 ],
+  MassInputParticles         = [ 105.658, 105.658, 938.272, 493.677 ],
   SubVertexTrackIndices      = [ 1, 2 ],
-  BMassUpper                 = 10000.0,
-  BMassLower                 = 4000.0,
-  Chi2Cut                    = 5.0,
   TrkVertexFitterTool	     = LbJpsipKVertexFit,
-  OutputVtxContainerName     = "LbJpsipKTrkCandidates"
+  OutputVtxContainerName     = "LbJpsipKCandidatesPV"
 )
 
 ToolSvc += BPHY11_LbPlusTrk
 print(BPHY11_LbPlusTrk)
 
-BPHY11_Select_LbPlusTrk     = DerivationFramework__Select_onia2mumu(
-  name                      = "BPHY11_Select_LbPlusTrk",
-  HypothesisName            = "LbPlusTrk",
-  InputVtxContainerName     = "LbJpsipKTrkCandidates",
-  TrkMasses                 = BPHY11_LbPlusTrk.MassInputParticles,
+BPHY11_Select_Lb_pK_PV      = DerivationFramework__Select_onia2mumu(
+  name                      = "BPHY11_Select_Lb_pK_PV",
+  HypothesisName            = "Lb_pK_PV",
+  InputVtxContainerName     = "LbJpsipKCandidatesPV",
+  TrkMasses                 = BPHY11_Lb_pK_PV.MassInputParticles,
   VtxMassHypo               = 5619.6,
-  MassMin                   = 4000.0,
-  MassMax                   = 10000.0,
-  Chi2Max                   = 50.0
+  MassMin                   = 0.0,
+  MassMax                   = 1.0e10,
+  Chi2Max                   = 1.0e10
 )
 
 ToolSvc += BPHY11_Select_LbPlusTrk
 print(BPHY11_Select_LbPlusTrk)
 
+BPHY11_Lb_Kp_PV              = DerivationFramework__ReVertex(
+  name                       = "BPHY11_Lb_Kp_PV",
+  InputVtxContainerName      = "LbJpsipKCandidates",
+  HypothesisNames            = [ BPHY11_Select_Lb2JpsiKp.HypothesisName ],
+  TrackIndices               = [ 0, 1, 2, 3 ],
+  UseMassConstraint          = True,
+  UseVertexFittingWithPV     = True,
+  SubVertexMass              = 3096.900,
+  MassInputParticles         = [ 105.658, 105.658, 493.677, 938.272 ],
+  SubVertexTrackIndices      = [ 1, 2 ],
+  TrkVertexFitterTool	     = LbJpsipKVertexFit,
+  OutputVtxContainerName     = "LbJpsiKpCandidatesPV"
+)
+
+ToolSvc += BPHY11_Lb_Kp_PV
+print  (BPHY11_Lb_Kp_PV)
+
+BPHY11_Select_Lb_Kp_PV      = DerivationFramework__Select_onia2mumu(
+  name                      = "BPHY11_Select_Lb_Kp_PV",
+  HypothesisName            = "Lb_Kp_PV",
+  InputVtxContainerName     = "LbJpsiKpCandidatesPV",
+  TrkMasses                 = BPHY11_Lb_Kp_PV.MassInputParticles,
+  VtxMassHypo               = 5619.6,
+  MassMin                   = 0.0,
+  MassMax                   = 1.0e10,
+  Chi2Max                   = 1.0e10
+)
+
+ToolSvc += BPHY11_Select_Lb_Kp_PV
+print     ( BPHY11_Select_Lb_Kp_PV)
+  
 #-------------------------------------------------------
+# Adding mass constrain to LbJpsipKCandidates candidates
 
 BPHY11_Lb_pK_ReFit           = DerivationFramework__ReVertex(
   name                       = "BPHY11_Lb_pK_ReFit",
-  InputVtxContainerName      = "LbJpsipKCandidates",
-  HypothesisNames            = [ BPHY11_Select_Lb2JpsipK.HypothesisName ],
+  InputVtxContainerName      = "LbJpsipKCandidatesPV",
+  HypothesisNames            = [ BPHY11_Select_Lb_pK_PV.HypothesisName ],
   TrackIndices               = [ 0, 1, 2, 3 ],
   UseMassConstraint          = True,
   UseVertexFittingWithPV     = True,
@@ -275,8 +303,8 @@ print(BPHY11_Select_Lb_pK_ReFit)
 
 BPHY11_Lb_Kp_ReFit           = DerivationFramework__ReVertex(
   name                       = "BPHY11_Lb_Kp_ReFit",
-  InputVtxContainerName      = "LbJpsipKCandidates",
-  HypothesisNames            = [ BPHY11_Select_Lb2JpsiKp.HypothesisName ],
+  InputVtxContainerName      = "LbJpsiKpCandidatesPV",
+  HypothesisNames            = [ BPHY11_Select_Lb_Kp_PV.HypothesisName ],
   TrackIndices               = [ 0, 1, 2, 3 ],
   UseMassConstraint          = True,
   UseVertexFittingWithPV     = True,
@@ -306,6 +334,43 @@ ToolSvc += BPHY11_Select_Lb_Kp_ReFit
 print(BPHY11_Select_Lb_Kp_ReFit)
   
 
+#-------------------------------------------------------
+BPHY11_LbPlusTrk             = DerivationFramework__ReVertex(
+  name                       = "BPHY11_LbPlusTrk",
+  InputVtxContainerName      = "LbJpsipKCandidates",
+  HypothesisNames            = [ BPHY11_Select_Lb2JpsipK.HypothesisName, BPHY11_Select_Lb2JpsiKp.HypothesisName ],
+  TrackIndices               = [ 0, 1, 2, 3 ],
+  UseAdditionalTrack         = True,
+  UseMassConstraint          = True,
+  UseVertexFittingWithPV     = True,
+  SubVertexMass              = 3096.900,
+  MassInputParticles         = [ 105.658, 105.658, 139.57, 139.57, 139.57 ],
+  SubVertexTrackIndices      = [ 1, 2 ],
+  BMassUpper                 = 10000.0,
+  BMassLower                 = 4000.0,
+  Chi2Cut                    = 5.0,
+  TrkVertexFitterTool	     = LbJpsipKVertexFit,
+  OutputVtxContainerName     = "LbJpsipKTrkCandidates"
+)
+
+ToolSvc += BPHY11_LbPlusTrk
+print     ( BPHY11_LbPlusTrk)
+
+BPHY11_Select_LbPlusTrk     = DerivationFramework__Select_onia2mumu(
+  name                      = "BPHY11_Select_LbPlusTrk",
+  HypothesisName            = "LbPlusTrk",
+  InputVtxContainerName     = "LbJpsipKTrkCandidates",
+  TrkMasses                 = BPHY11_LbPlusTrk.MassInputParticles,
+  VtxMassHypo               = 5619.6,
+  MassMin                   = 4000.0,
+  MassMax                   = 10000.0,
+  Chi2Max                   = 50.0
+)
+
+ToolSvc += BPHY11_Select_LbPlusTrk
+print      (BPHY11_Select_LbPlusTrk)
+
+
 
 #from DerivationFrameworkBPhys.DerivationFrameworkBPhysConf import DerivationFramework__SelectEvent
 
@@ -343,8 +408,19 @@ from DerivationFrameworkBPhys.DerivationFrameworkBPhysConf import DerivationFram
 BPHY11_thinningTool_Tracks = DerivationFramework__Thin_vtxTrk(
   name                       = "BPHY11_thinningTool_Tracks",
   TrackParticleContainerName = "InDetTrackParticles",
-  VertexContainerNames       = ["LbJpsipKCandidates"],
-  PassFlags                  = ["passed_Lb_pK","passed_Lb_Kp"] 
+  VertexContainerNames       = ["LbJpsipKCandidates",
+                                "LbJpsipKCandidatesPV",
+                                "LbJpsiKpCandidatesPV",
+                                "LbJpsipKCandidatesReFit",
+                                "LbJpsiKpCandidatesReFit",
+                                "LbJpsipKTrkCandidates"],
+  PassFlags                  = ["passed_Lb_pK",
+                                "passed_Lb_Kp",
+                                "passed_Lb_pK_PV",
+                                "passed_Lb_Kp_PV",
+                                "passed_Lb_pK_ReFit",
+                                "passed_Lb_Kp_ReFit",
+                                "passed_LbPlusTrk"] 
 )
 
 ToolSvc += BPHY11_thinningTool_Tracks
@@ -352,7 +428,13 @@ ToolSvc += BPHY11_thinningTool_Tracks
 from DerivationFrameworkBPhys.DerivationFrameworkBPhysConf import DerivationFramework__BPhysPVThinningTool
 BPHY11_thinningTool_PV = DerivationFramework__BPhysPVThinningTool(
   name                       = "BPHY11_thinningTool_PV",
-  CandidateCollections       = ["LbJpsipKCandidates"],
+  ThinningService            = "BPHY11_ThinningSvc",
+  CandidateCollections       = ["LbJpsipKCandidates",
+                                "LbJpsipKCandidatesPV",
+                                "LbJpsiKpCandidatesPV",
+                                "LbJpsipKCandidatesReFit",
+                                "LbJpsiKpCandidatesReFit",
+                                "LbJpsipKTrkCandidates"],
   KeepPVTracks               = True
 )
 
@@ -401,9 +483,11 @@ DerivationFrameworkJob += CfgMgr.DerivationFramework__DerivationKernel(
     "BPHY11_Kernel",
     AugmentationTools = [BPHY11_JpsiSelectAndWrite,     BPHY11_Select_Jpsi2mumu,
                          BPHY11_LbJpsipKSelectAndWrite, BPHY11_Select_Lb2JpsipK, BPHY11_Select_Lb2JpsiKp,
-                         BPHY11_LbPlusTrk, BPHY11_Select_LbPlusTrk,
+                         BPHY11_Lb_pK_PV, BPHY11_Select_Lb_pK_PV,
+                         BPHY11_Lb_Kp_PV, BPHY11_Select_Lb_Kp_PV,
                          BPHY11_Lb_pK_ReFit, BPHY11_Select_Lb_pK_ReFit,
                          BPHY11_Lb_Kp_ReFit, BPHY11_Select_Lb_Kp_ReFit,
+                         BPHY11_LbPlusTrk, BPHY11_Select_LbPlusTrk,
                          BPHY11_AugOriginalCounts],
     #Only skim if not MC
     SkimmingTools     = [BPHY11_SkimmingOR] if not isSimulation else [],
@@ -466,8 +550,11 @@ StaticContent += ["xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % BPHY11_Jps
 StaticContent += ["xAOD::VertexContainer#%s"        %                 BPHY11_LbJpsipKSelectAndWrite.OutputVtxContainerName]
 StaticContent += ["xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % BPHY11_LbJpsipKSelectAndWrite.OutputVtxContainerName]
 
-StaticContent += ["xAOD::VertexContainer#%s"        %                 BPHY11_LbPlusTrk.OutputVtxContainerName]
-StaticContent += ["xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % BPHY11_LbPlusTrk.OutputVtxContainerName]
+StaticContent += ["xAOD::VertexContainer#%s"        %                 BPHY11_Lb_pK_PV.OutputVtxContainerName]
+StaticContent += ["xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % BPHY11_Lb_pK_PV.OutputVtxContainerName]
+
+StaticContent += ["xAOD::VertexContainer#%s"        %                 BPHY11_Lb_Kp_PV.OutputVtxContainerName]
+StaticContent += ["xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % BPHY11_Lb_Kp_PV.OutputVtxContainerName]
 
 StaticContent += ["xAOD::VertexContainer#%s"        %                 BPHY11_Lb_pK_ReFit.OutputVtxContainerName]
 StaticContent += ["xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % BPHY11_Lb_pK_ReFit.OutputVtxContainerName]
@@ -475,6 +562,9 @@ StaticContent += ["xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % BPHY11_Lb_
 StaticContent += ["xAOD::VertexContainer#%s"        %                 BPHY11_Lb_Kp_ReFit.OutputVtxContainerName]
 StaticContent += ["xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % BPHY11_Lb_Kp_ReFit.OutputVtxContainerName]
 
+StaticContent += ["xAOD::VertexContainer#%s"        %                 BPHY11_LbPlusTrk.OutputVtxContainerName]
+StaticContent += ["xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % BPHY11_LbPlusTrk.OutputVtxContainerName]
+
 
 
 # Tagging information (in addition to that already requested by usual algorithms)
diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkBPhys/src/ReVertex.cxx b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkBPhys/src/ReVertex.cxx
index 9ca2524041251cd3abda4168c33f9f465c8dff9e..e9fb6c9c369f48062d15173a23a76ee13ed1652e 100644
--- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkBPhys/src/ReVertex.cxx
+++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkBPhys/src/ReVertex.cxx
@@ -196,7 +196,7 @@ void ReVertex::fitAndStore(xAOD::VertexContainer* vtxContainer,
 				    const xAOD::TrackParticleContainer* importedTrackCollection,
 				    const xAOD::VertexContainer* pvContainer) const
 {
-   std::unique_ptr<xAOD::Vertex> ptr(fit(inputTracks, nullptr));
+   std::unique_ptr<xAOD::Vertex> ptr(fit(inputTracks, importedTrackCollection, nullptr));
    if(!ptr)return;
 
    double chi2DOF = ptr->chiSquared()/ptr->numberDoF();
@@ -216,11 +216,12 @@ void ReVertex::fitAndStore(xAOD::VertexContainer* vtxContainer,
    std::vector<const xAOD::Vertex*> thePreceding;
    thePreceding.push_back(v);
    if(m_vertexFittingWithPV){
-      const xAOD::Vertex* closestPV = Analysis::JpsiUpsilonCommon::ClosestPV(bHelper, pvContainer);
-      if (!closestPV) return;
-      std::unique_ptr<xAOD::Vertex> ptrPV(fit(inputTracks, closestPV));
+      //
+      const xAOD::Vertex* closestRefPV = Analysis::JpsiUpsilonCommon::ClosestRefPV(bHelper, pvContainer, &(*m_pvRefitter));
+      if (!closestRefPV) return;
+      std::unique_ptr<xAOD::Vertex> ptrPV(fit(inputTracks, importedTrackCollection, closestRefPV));
       if(!ptrPV) return;
-
+      //
       double chi2DOFPV = ptrPV->chiSquared()/ptrPV->numberDoF();
       ATH_MSG_DEBUG("CandidatePV chi2/DOF is " << chi2DOFPV);
       bool chi2CutPassed = (m_chi2cut <= 0.0 || chi2DOFPV < m_chi2cut);
@@ -249,7 +250,8 @@ void ReVertex::fitAndStore(xAOD::VertexContainer* vtxContainer,
     // ---------------------------------------------------------------------------------
     
 xAOD::Vertex* ReVertex::fit(const std::vector<const xAOD::TrackParticle*> &inputTracks,
-				     const xAOD::Vertex* pv) const
+			    const xAOD::TrackParticleContainer* importedTrackCollection,
+			    const xAOD::Vertex* pv) const
 {
    std::unique_ptr<Trk::IVKalState> state = m_VKVFitter->makeState();
    if (m_doMassConst && (m_trkMasses.size()==inputTracks.size())) {
@@ -280,5 +282,18 @@ xAOD::Vertex* ReVertex::fit(const std::vector<const xAOD::TrackParticle*> &input
    if (errorcode != 0) {startingPoint(0) = 0.0; startingPoint(1) = 0.0; startingPoint(2) = 0.0;}
    xAOD::Vertex* theResult = m_VKVFitter->fit(inputTracks, startingPoint, *state);
 
+   // Added by ASC
+   if(theResult != 0){
+      std::vector<ElementLink<DataVector<xAOD::TrackParticle> > > newLinkVector;
+      for(unsigned int i=0; i< theResult->trackParticleLinks().size(); i++)
+	{
+	   ElementLink<DataVector<xAOD::TrackParticle> > mylink=theResult->trackParticleLinks()[i]; //makes a copy (non-const)
+	   mylink.setStorableObject( *importedTrackCollection, true);
+	   newLinkVector.push_back( mylink );
+	}
+      theResult->clearTracks();
+      theResult->setTrackParticleLinks( newLinkVector );
+   }
+   
    return theResult;
 }
diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/DerivationFrameworkEGamma/EGElectronLikelihoodToolWrapper.h b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/DerivationFrameworkEGamma/EGElectronLikelihoodToolWrapper.h
index 62861f13d14a87b3837b89a43b88a8415aa9e55d..55f849d7b79345f92112de85c3b9beb1ab36e8a9 100644
--- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/DerivationFrameworkEGamma/EGElectronLikelihoodToolWrapper.h
+++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/DerivationFrameworkEGamma/EGElectronLikelihoodToolWrapper.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -45,8 +45,14 @@ public:
   virtual StatusCode addBranches() const override final;
 
 private:
-  ToolHandle<IAsgElectronLikelihoodTool> m_tool;
-  ToolHandle<IElectronPhotonShowerShapeFudgeTool> m_fudgeMCTool;
+  ToolHandle<IAsgElectronLikelihoodTool> m_tool{
+    this,
+    "EGammaElectronLikelihoodTool",
+    "",
+    "Electron  Likelihood Selector"
+  };
+  ToolHandle<IElectronPhotonShowerShapeFudgeTool>
+    m_fudgeMCTool{ this, "EGammaFudgeMCTool", "", "Fudging tool" };
 
   SG::ReadHandleKey<xAOD::EgammaContainer> m_ContainerName{ this,
                                                             "ContainerName",
diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/DerivationFrameworkEGamma/EGSelectionToolWrapper.h b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/DerivationFrameworkEGamma/EGSelectionToolWrapper.h
index d62e454e74b0807792940cc299775e5cb78d6433..2db317d6fbb2a00dd772c9b60c75ca9c5cc5ffc2 100644
--- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/DerivationFrameworkEGamma/EGSelectionToolWrapper.h
+++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/DerivationFrameworkEGamma/EGSelectionToolWrapper.h
@@ -9,35 +9,63 @@
 #ifndef DERIVATIONFRAMEWORK_EGSELECTIONTOOLWRAPPER_H
 #define DERIVATIONFRAMEWORK_EGSELECTIONTOOLWRAPPER_H
 
-#include <string>
-
-#include "AthenaBaseComps/AthAlgTool.h"
 #include "DerivationFrameworkInterfaces/IAugmentationTool.h"
+//
+#include "StoreGate/ReadHandle.h"
+#include "StoreGate/ReadHandleKey.h"
+#include "StoreGate/WriteDecorHandle.h"
+#include "StoreGate/WriteHandleKey.h"
+//
+#include "AsgTools/IAsgTool.h"
+#include "AthenaBaseComps/AthAlgTool.h"
 #include "EgammaAnalysisInterfaces/IAsgEGammaIsEMSelector.h"
-//#include "EgammaAnalysisInterfaces/IAsgElectronLikelihoodTool.h"
 #include "EgammaAnalysisInterfaces/IElectronPhotonShowerShapeFudgeTool.h"
-#include "PATCore/IAsgSelectionTool.h"
-#include "AsgTools/IAsgTool.h"
 #include "GaudiKernel/ToolHandle.h"
+#include "xAODEgamma/EgammaContainer.h"
+//
+#include <string>
 
 namespace DerivationFramework {
 
-  class EGSelectionToolWrapper : public AthAlgTool, public IAugmentationTool {
-    public: 
-      EGSelectionToolWrapper(const std::string& t, const std::string& n, const IInterface* p);
-
-      StatusCode initialize();
-      StatusCode finalize();
-      virtual StatusCode addBranches() const;
-
-    private:
-      //ToolHandle<IAsgSelectionTool> m_tool; // can't use isemValue, but can use TAccept and then getInvertedCutBitSet to retrieve isem-like value for both cut-based and LH selectors
-      ToolHandle<IAsgEGammaIsEMSelector> m_tool; // provides isemValue, but will not work with likelihood..
-      ToolHandle<IElectronPhotonShowerShapeFudgeTool> m_fudgeMCTool;
-      std::string m_cut;
-      std::string m_sgName;
-      std::string m_containerName;
-  }; 
+class EGSelectionToolWrapper
+  : public AthAlgTool
+  , public IAugmentationTool
+{
+public:
+  EGSelectionToolWrapper(const std::string& t,
+                         const std::string& n,
+                         const IInterface* p);
+
+  virtual StatusCode initialize() override final;
+  virtual StatusCode addBranches() const override final;
+
+private:
+  ToolHandle<IAsgEGammaIsEMSelector> m_tool{
+    this,
+    "EGammaSelectionTool",
+    "",
+    "Selector tool",
+  };
+  ToolHandle<IElectronPhotonShowerShapeFudgeTool>
+    m_fudgeMCTool{ this, "EGammaFudgeMCTool", "", "Fudging tool" };
+
+  SG::ReadHandleKey<xAOD::EgammaContainer> m_ContainerName{ this,
+                                                            "ContainerN"
+                                                            "ame",
+                                                            "",
+                                                            "Input" };
+
+  // Write decoration handle keys
+  // these are not really configuarable
+  SG::WriteDecorHandleKey<xAOD::EgammaContainer> m_decoratorPass{};
+  SG::WriteDecorHandleKey<xAOD::EgammaContainer> m_decoratorIsEM{};
+  Gaudi::Property<std::string> m_cut{ this, "CutType", "", "cut type" };
+
+  Gaudi::Property<std::string> m_sgName{ this,
+                                         "StoreGateEntryName",
+                                         "",
+                                         "Store entry name" };
+};
 }
 
 #endif // DERIVATIONFRAMEWORK_EGSELECTIONTOOLWRAPPER_H
diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/src/EGElectronLikelihoodToolWrapper.cxx b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/src/EGElectronLikelihoodToolWrapper.cxx
index 4562551d7b43b895f7a67ac7655a77d46c0b7d9c..0f8597c70b146223145eb505bc301d6d4d1ad2bf 100644
--- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/src/EGElectronLikelihoodToolWrapper.cxx
+++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/src/EGElectronLikelihoodToolWrapper.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -29,9 +29,7 @@ EGElectronLikelihoodToolWrapper::EGElectronLikelihoodToolWrapper(
   , m_storeTResult(false)
 {
   declareInterface<DerivationFramework::IAugmentationTool>(this);
-  declareProperty("EGammaElectronLikelihoodTool", m_tool);
-  declareProperty("EGammaFudgeMCTool", m_fudgeMCTool);
-  declareProperty("CutType", m_cut);
+ declareProperty("CutType", m_cut);
   declareProperty("StoreGateEntryName", m_sgName);
   declareProperty("StoreTResult", m_storeTResult);
 }
@@ -81,10 +79,12 @@ EGElectronLikelihoodToolWrapper::addBranches() const
     m_decoratorIsEM, ctx
   };
 
+  SG::WriteDecorHandle<xAOD::EgammaContainer, double>* decoratorResult = nullptr;
   if (m_storeTResult) {
-    SG::WriteDecorHandle<xAOD::EgammaContainer, double> decoratorResult{
+    SG::WriteDecorHandle<xAOD::EgammaContainer, double> concreteHandle{
       m_decoratorResult, ctx
     };
+    decoratorResult = &concreteHandle;
   }
 
   bool applyFF = (!m_fudgeMCTool.empty());
@@ -141,10 +141,8 @@ EGElectronLikelihoodToolWrapper::addBranches() const
         decoratorPass(*par) = 0;
       }
       decoratorIsEM(*par) = isEM;
-      if (m_storeTResult) {
-        static const SG::AuxElement::Decorator<double> decResult(m_sgName +
-                                                                 "Result");
-        decResult(*par) = static_cast<double>(m_tool->calculate(ctx, pCopy));
+      if (decoratorResult) {
+        (*decoratorResult)(*par) = static_cast<double>(m_tool->calculate(ctx, pCopy));
       }
     } else {
       if (theAccept.getCutResult(m_cut)) {
@@ -153,10 +151,10 @@ EGElectronLikelihoodToolWrapper::addBranches() const
         decoratorPass(*par) = 0;
       }
       decoratorIsEM(*par) = isEM;
-      if (m_storeTResult) {
+      if (decoratorResult) {
         static const SG::AuxElement::Decorator<double> decResult(m_sgName +
                                                                  "Result");
-        decResult(*par) = static_cast<double>(m_tool->calculate(ctx, pCopy));
+        (*decoratorResult)(*par) = static_cast<double>(m_tool->calculate(ctx, pCopy));
       }
     }
     // delete the particle copy
diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/src/EGSelectionToolWrapper.cxx b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/src/EGSelectionToolWrapper.cxx
index 5b3715b1dc9ae42e3bd6b09eb13063c66d61f7c4..fc594a66e0816965960876ac3fff577f090d3992 100644
--- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/src/EGSelectionToolWrapper.cxx
+++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/src/EGSelectionToolWrapper.cxx
@@ -9,134 +9,129 @@
 //
 
 #include "DerivationFrameworkEGamma/EGSelectionToolWrapper.h"
-#include "xAODBase/IParticleContainer.h"
 #include "PATCore/AcceptData.h"
+#include "xAODBase/IParticleContainer.h"
 #include "xAODEgamma/EgammaContainer.h"
-#include "xAODEgamma/Photon.h"
 #include "xAODEgamma/Electron.h"
+#include "xAODEgamma/Photon.h"
 
 namespace DerivationFramework {
 
-  EGSelectionToolWrapper::EGSelectionToolWrapper(const std::string& t,
-      const std::string& n,
-      const IInterface* p) : 
-    AthAlgTool(t,n,p),
-    m_cut(""),
-    m_sgName(""),
-    m_containerName("")
-  {
-    declareInterface<DerivationFramework::IAugmentationTool>(this);
-    declareProperty("EGammaSelectionTool", m_tool);
-    declareProperty("EGammaFudgeMCTool", m_fudgeMCTool);
-    declareProperty("CutType", m_cut);
-    declareProperty("StoreGateEntryName", m_sgName);
-    declareProperty("ContainerName", m_containerName);
-  }
+EGSelectionToolWrapper::EGSelectionToolWrapper(const std::string& t,
+                                               const std::string& n,
+                                               const IInterface* p)
+  : AthAlgTool(t, n, p)
+{
+  declareInterface<DerivationFramework::IAugmentationTool>(this);
+}
 
-  StatusCode EGSelectionToolWrapper::initialize()
-  {
-    if (m_sgName=="") {
-      ATH_MSG_ERROR("No SG name provided for the output of EGSelectionToolWrapper!");
-      return StatusCode::FAILURE;
-    }
-    if (m_containerName!="Photons" && m_containerName!="Electrons" && m_containerName!="ForwardElectrons") {
-      ATH_MSG_ERROR("Wrong container provided!");
-      return StatusCode::FAILURE;
-    }
-    CHECK(m_tool.retrieve());
-    if (m_fudgeMCTool.name()!="") CHECK(m_fudgeMCTool.retrieve());
-    return StatusCode::SUCCESS;
+StatusCode
+EGSelectionToolWrapper::initialize()
+{
+  if (m_sgName.empty()) {
+    ATH_MSG_ERROR(
+      "No SG name provided for the output of EGElectronLikelihoodToolWrapper!");
+    return StatusCode::FAILURE;
   }
+  ATH_CHECK(m_tool.retrieve());
 
-  StatusCode EGSelectionToolWrapper::finalize()
-  {
-    return StatusCode::SUCCESS;
+  if (!(m_fudgeMCTool.name().empty())) {
+    ATH_CHECK(m_fudgeMCTool.retrieve());
+  } else {
+    m_fudgeMCTool.disable();
   }
 
-  StatusCode EGSelectionToolWrapper::addBranches() const
-  {
-    // retrieve container
-    const xAOD::IParticleContainer* particles = evtStore()->retrieve< const xAOD::IParticleContainer >( m_containerName );
-    if( ! particles ) {
-        ATH_MSG_ERROR ("Couldn't retrieve IParticles with key: " << m_containerName );
-        return StatusCode::FAILURE;
-    }
+  ATH_CHECK(m_ContainerName.initialize());
+  //
+  m_decoratorPass = m_ContainerName.key() + "." + m_sgName;
+  m_decoratorIsEM = m_ContainerName.key() + "." + m_sgName + "IsEMValue";
+  ATH_CHECK(m_decoratorPass.initialize());
+  ATH_CHECK(m_decoratorIsEM.initialize());
 
-    // Decorator
-    SG::AuxElement::Decorator< char > decoratorPass(m_sgName);
-    SG::AuxElement::Decorator< unsigned int > decoratorIsEM(m_sgName + "IsEMValue");
+  return StatusCode::SUCCESS;
+}
 
-    // Write mask for each element and record to SG for subsequent selection
-    for (xAOD::IParticleContainer::const_iterator pItr = particles->begin(); pItr!=particles->end(); ++pItr) {
+StatusCode
+EGSelectionToolWrapper::addBranches() const
+{
+  // retrieve container
+  const EventContext& ctx = Gaudi::Hive::currentContext();
+  SG::ReadHandle<xAOD::EgammaContainer> particles{ m_ContainerName, ctx };
 
-      xAOD::Type::ObjectType type = (*pItr)->type();
-      if (type!=xAOD::Type::Electron && type!=xAOD::Type::Photon) {
-	  ATH_MSG_ERROR ("addBranches(): Wrong particle type (not electron nor photon) being passed to EGSelectionToolWrapper");
-	  return StatusCode::FAILURE;
-      }
-      if (type==xAOD::Type::Electron && (m_containerName!="Electrons" && m_containerName!="ForwardElectrons")) {
-	  ATH_MSG_ERROR ("addBranches(): Wrong particle type being passed to EGSelectionToolWrapper");
-	  return StatusCode::FAILURE;
-      }
-      if (type==xAOD::Type::Photon && m_containerName!="Photons") {
-	  ATH_MSG_ERROR ("addBranches(): Wrong particle type being passed to EGSelectionToolWrapper");
-	  return StatusCode::FAILURE;
-      }
-      
-      const xAOD::IParticle* pCopy = *pItr;
+  // Decorators
+  SG::WriteDecorHandle<xAOD::EgammaContainer, char> decoratorPass{
+    m_decoratorPass, ctx
+  };
+  SG::WriteDecorHandle<xAOD::EgammaContainer, unsigned int> decoratorIsEM{
+    m_decoratorIsEM, ctx
+  };
 
-      // this should be computed based on some property of the tool or the existence of the ElectronPhotonShowerShapeFudgeTool
-      bool applyFF = (!m_fudgeMCTool.empty());
-      if (applyFF) {
-	// apply the shower shape corrections
-	CP::CorrectionCode correctionCode = CP::CorrectionCode::Ok;
-	if (type==xAOD::Type::Electron) {
-	    const xAOD::Electron* eg = static_cast<const xAOD::Electron*>(*pItr);
-	    xAOD::Electron* el = 0;
-	    correctionCode = m_fudgeMCTool->correctedCopy(*eg, el);
-	    pCopy = el;
-	}
-	else {
-	    const xAOD::Photon* eg = static_cast<const xAOD::Photon*>(*pItr);
-	    xAOD::Photon* ph = 0;
-	    correctionCode = m_fudgeMCTool->correctedCopy(*eg, ph);
-	    pCopy = ph;
-	}
-	if (correctionCode==CP::CorrectionCode::Ok)
-	    ;
-	else if (correctionCode==CP::CorrectionCode::Error)
-	    Error("addBranches()","Error applying fudge factors to current photon");
-	else if (correctionCode==CP::CorrectionCode::OutOfValidityRange)
-	    Warning("addBranches()","Current photon has no valid fudge factors due to out-of-range");
-	else
-	    Warning("addBranches()","Unknown correction code %d from ElectronPhotonShowerShapeFudgeTool",(int) correctionCode);
+  bool applyFF = (!m_fudgeMCTool.empty());
+  // Write mask for each element and record to SG for subsequent selection
+  for (const xAOD::Egamma* par : *particles) {
+    const xAOD::Egamma* pCopy = par;
+    if (applyFF) {
+      xAOD::Type::ObjectType type = par->type();
+      CP::CorrectionCode correctionCode = CP::CorrectionCode::Ok;
+      if (type == xAOD::Type::Electron) {
+        const xAOD::Electron* eg = static_cast<const xAOD::Electron*>(par);
+        xAOD::Electron* el = nullptr;
+        correctionCode = m_fudgeMCTool->correctedCopy(*eg, el);
+        pCopy = el;
+      } else {
+        const xAOD::Photon* eg = static_cast<const xAOD::Photon*>(par);
+        xAOD::Photon* ph = nullptr;
+        correctionCode = m_fudgeMCTool->correctedCopy(*eg, ph);
+        pCopy = ph;
+      }
+      if (correctionCode == CP::CorrectionCode::Ok) {
+        // all OK
+      } else if (correctionCode == CP::CorrectionCode::Error) {
+        Error("addBranches()",
+              "Error applying fudge factors to current photon");
+      } else if (correctionCode == CP::CorrectionCode::OutOfValidityRange) {
+        Warning(
+          "addBranches()",
+          "Current photon has no valid fudge factors due to out-of-range");
+      } else {
+        Warning(
+          "addBranches()",
+          "Unknown correction code %d from ElectronPhotonShowerShapeFudgeTool",
+          (int)correctionCode);
       }
+    }
+    // compute the output of the selector
+    asg::AcceptData theAccept(m_tool->accept(pCopy));
+    // unsigned int isEM = m_tool->IsemValue(); // this one should be done only
+    // for IsEM selectors..
+    unsigned int isEM = (unsigned int)theAccept.getCutResultInvertedBitSet()
+                          .to_ulong(); // this should work for both the
+                                       // cut-based and the LH selectors
 
-      // compute the output of the selector
-      asg::AcceptData theAccept(m_tool->accept(pCopy));
-      //unsigned int isEM = m_tool->IsemValue(); // this one should be done only for IsEM selectors..
-      unsigned int isEM = (unsigned int) theAccept.getCutResultInvertedBitSet().to_ulong(); // this should work for both the cut-based and the LH selectors
-      
-      // decorate the original object
-      if(m_cut==""){
-	bool pass_selection = (bool) theAccept;
-	if(pass_selection) decoratorPass(**pItr) = 1;
-	else decoratorPass(**pItr) = 0;
-	decoratorIsEM(**pItr) = isEM;
+    // decorate the original object
+    if (m_cut == "") {
+      bool pass_selection = (bool)theAccept;
+      if (pass_selection) {
+        decoratorPass(*par) = 1;
+      } else {
+        decoratorPass(*par) = 0;
       }
-      else{
-	if (theAccept.getCutResult(m_cut)) {
-	  decoratorPass(**pItr) = 1;
-	} else {
-	  decoratorPass(**pItr) = 0;
-	}
-	decoratorIsEM(**pItr) = isEM;
+      decoratorIsEM(*par) = isEM;
+    } else {
+      if (theAccept.getCutResult(m_cut)) {
+        decoratorPass(*par) = 1;
+      } else {
+        decoratorPass(*par) = 0;
       }
+      decoratorIsEM(*par) = isEM;
+    }
 
-      // delete the particle copy
-      if (applyFF) delete pCopy;
+    // delete the particle copy
+    if (applyFF) {
+      delete pCopy;
     }
-    
-    return StatusCode::SUCCESS;
   }
+
+  return StatusCode::SUCCESS;
+}
 }
diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkPhys/share/PHYS.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkPhys/share/PHYS.py
index a64098794133cedd596e5d67e53b4a34db1119df..e061c6f8b5ce15405b9677b25f617302c4b8788c 100644
--- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkPhys/share/PHYS.py
+++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkPhys/share/PHYS.py
@@ -19,6 +19,7 @@ from DerivationFrameworkJetEtMiss import METCommon
 from TriggerMenuMT.TriggerAPI.TriggerAPI import TriggerAPI
 from TriggerMenuMT.TriggerAPI.TriggerEnums import TriggerPeriod, TriggerType
 from DerivationFrameworkTrigger.TriggerMatchingHelper import TriggerMatchingHelper
+import re
 
 #====================================================================
 # SET UP STREAM   
@@ -101,15 +102,17 @@ from AthenaConfiguration.AutoConfigFlags import GetFileMD
 from AthenaConfiguration.AllConfigFlags import ConfigFlags
 
 if ConfigFlags.Trigger.EDMVersion == 3:
-   trigger_names_notau = [
-      "HLT_mu26_ivarmedium_L1MU20",
-      "HLT_mu50_L1MU20",
-      "HLT_e26_etcut_L1EM22VHI",
-      "HLT_e26_lhmedium_L1EM22VHI",
-      "HLT_mu22_mu8noL1_L1MU20",
-      "HLT_e7_lhmedium_mu24_L1MU20",
-   ]
-   trigger_names_tau = ["HLT_tau25_mediumRNN_tracktwoMVA_L1TAU12IM",]   
+   r_tau = re.compile("HLT_.*tau.*")
+   r_notau = re.compile("HLT_[1-9]*(e|mu|g).*") 
+   r_veto = re.compile("HLT_.*(LRT).*")   
+   for chain_name in GetFileMD(ConfigFlags.Input.Files)['TriggerMenu']['HLTChains']:
+      result_tau = r_tau.match(chain_name)
+      result_notau = r_notau.match(chain_name)
+      result_veto = r_veto.match(chain_name)
+      if result_tau is not None and result_veto is None: trigger_names_tau.append(chain_name)
+      if result_notau is not None and result_veto is None: trigger_names_notau.append(chain_name)
+   trigger_names_notau = set(trigger_names_notau) - set(trigger_names_tau)
+   trigger_names_notau = list(trigger_names_notau)
 else:
    for chain_name in GetFileMD(ConfigFlags.Input.Files)['TriggerMenu']['HLTChains']:
       if chain_name in trigger_names_full_notau: trigger_names_notau.append(chain_name)
diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTools/DerivationFrameworkTools/InvariantMassTool.h b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTools/DerivationFrameworkTools/InvariantMassTool.h
index 169031f7fee13586f1f9b5150ad5e5d03e02898e..6f27782aeb24c86dea1bce53042221df91daa02d 100644
--- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTools/DerivationFrameworkTools/InvariantMassTool.h
+++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTools/DerivationFrameworkTools/InvariantMassTool.h
@@ -37,8 +37,7 @@ namespace DerivationFramework {
       SG::ReadHandleKey<xAOD::IParticleContainer> m_containerName  {this,"ContainerName","","SG key of first container"};
       SG::ReadHandleKey<xAOD::IParticleContainer> m_containerName2 {this,"SecondContainerName","","SG key of first container"};
       StatusCode getInvariantMasses(std::vector<float>*) const;
-      float calculateInvariantMass(float,float,float,float,float,float,float) const;		
-      float calculateInvariantMass(float,float,float,float,float,float,float,float) const;
+      float calculateInvariantMass(const TVector3& v1, const TVector3&v2,float M1,float M2) const;
   }; 
 }
 
diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTools/src/InvariantMassTool.cxx b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTools/src/InvariantMassTool.cxx
index 6d788c6101383db9a9f83184af9997ac43d8de28..51879ceec53b95b5b5548ad5bbb069c003e51e6d 100644
--- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTools/src/InvariantMassTool.cxx
+++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTools/src/InvariantMassTool.cxx
@@ -77,7 +77,7 @@ namespace DerivationFramework {
   {
 
     // check the relevant information is available
-    if (m_containerName.key()=="") {
+    if (m_containerName.key().empty()) {
       ATH_MSG_WARNING("Input container missing - returning zero");  
       masses->push_back(0.0);
       return StatusCode::FAILURE;
@@ -86,8 +86,8 @@ namespace DerivationFramework {
     SG::ReadHandle<xAOD::IParticleContainer> particles{m_containerName};
     
     bool from2Collections(false);
-    const xAOD::IParticleContainer* particles2(0); 
-    if (m_containerName2.key()!="" && m_containerName2.key()!=m_containerName.key()) {
+    const xAOD::IParticleContainer* particles2{nullptr}; 
+    if (!m_containerName2.key().empty() && m_containerName2.key()!=m_containerName.key()) {
       SG::ReadHandle<xAOD::IParticleContainer> particleHdl2{m_containerName2};
       particles2=particleHdl2.cptr();
       from2Collections = true;
@@ -134,10 +134,11 @@ namespace DerivationFramework {
         unsigned int first = (*pairIt)[0];
         unsigned int second = (*pairIt)[1];    
         if ( (entries[first]==1 && entries2[second]==1) || (entries2[first]==1 && entries[second]==1) ) {
-          float px1 = ((*particles)[first])->p4().Px(); float px2 = ((*particles)[second])->p4().Px();
-          float py1 = ((*particles)[first])->p4().Py(); float py2 = ((*particles)[second])->p4().Py();
-          float pz1 = ((*particles)[first])->p4().Pz(); float pz2 = ((*particles)[second])->p4().Pz();
-          float mass = calculateInvariantMass(px1,px2,py1,py2,pz1,pz2,m_massHypothesis);
+         
+          const float mass = calculateInvariantMass( ((*particles)[first])->p4().Vect(),
+                                                   ((*particles)[second])->p4().Vect(), 
+                                                   m_massHypothesis,
+                                                   m_massHypothesis);  
           masses->push_back(mass);
         }
       }  
@@ -159,10 +160,10 @@ namespace DerivationFramework {
       for (pairIt=pairs.begin(); pairIt!=pairs.end(); ++pairIt) {
         unsigned int first = (*pairIt)[0];
         unsigned int second = (*pairIt)[1];
-        float px1 = ((*particles)[first])->p4().Px(); float px2 = ((*particles2)[second])->p4().Px();
-        float py1 = ((*particles)[first])->p4().Py(); float py2 = ((*particles2)[second])->p4().Py();
-        float pz1 = ((*particles)[first])->p4().Pz(); float pz2 = ((*particles2)[second])->p4().Pz();
-        float mass = calculateInvariantMass(px1,px2,py1,py2,pz1,pz2,m_massHypothesis,m_massHypothesis2);
+        const float mass = calculateInvariantMass( ((*particles)[first])->p4().Vect(),
+                                                   ((*particles)[second])->p4().Vect(), 
+                                                   m_massHypothesis,
+                                                   m_massHypothesis2);  
         masses->push_back(mass);
       }
     } 
@@ -170,28 +171,11 @@ namespace DerivationFramework {
     return StatusCode::SUCCESS; 
 
   }
-
-  float InvariantMassTool::calculateInvariantMass(float px1, float px2, float py1, float py2, float pz1, float pz2, float massH) const 
-  {
-    float e1 = sqrt(px1*px1 + py1*py1 + pz1*pz1 + massH*massH); 
-    float e2 = sqrt(px2*px2 + py2*py2 + pz2*pz2 + massH*massH);
-    float eSum = e1+e2;
-    float pxSum = px1+px2;
-    float pySum = py1+py2;
-    float pzSum = pz1+pz2;
-    float invariantMass = sqrt( (eSum*eSum)-(pxSum*pxSum)-(pySum*pySum)-(pzSum*pzSum) );   	   
-    return invariantMass;
-  }        
-
-  float InvariantMassTool::calculateInvariantMass(float px1, float px2, float py1, float py2, float pz1, float pz2, float massH, float massH2) const
-  {
-    float e1 = sqrt(px1*px1 + py1*py1 + pz1*pz1 + massH*massH);
-    float e2 = sqrt(px2*px2 + py2*py2 + pz2*pz2 + massH2*massH2);
-    float eSum = e1+e2;
-    float pxSum = px1+px2;
-    float pySum = py1+py2;
-    float pzSum = pz1+pz2;
-    float invariantMass = sqrt( (eSum*eSum)-(pxSum*pxSum)-(pySum*pySum)-(pzSum*pzSum) );
-    return invariantMass;
+  float InvariantMassTool::calculateInvariantMass(const TVector3& v1, const TVector3&v2,float M1,float M2) const{
+      TLorentzVector p1(v1, M1 > 0 ? std::hypot(M1, v1.Mag()) : v1.Mag());
+      TLorentzVector p2(v2, M2 > 0 ? std::hypot(M2, v2.Mag()) : v2.Mag());
+      return (p1+p2).M();
+      
   }
+  
 }
diff --git a/PhysicsAnalysis/ElectronPhotonID/EgammaAnalysisHelpers/ATLAS_CHECK_THREAD_SAFETY b/PhysicsAnalysis/ElectronPhotonID/EgammaAnalysisHelpers/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..72028a2909fb2f6fe1f78771e2c533d55d1ad909
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/EgammaAnalysisHelpers/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+PhysicsAnalysis/ElectronPhotonID/EgammaAnalysisHelpers
diff --git a/PhysicsAnalysis/ElectronPhotonID/EgammaAnalysisHelpers/EgammaAnalysisHelpers/AsgEGammaConfigHelper.h b/PhysicsAnalysis/ElectronPhotonID/EgammaAnalysisHelpers/EgammaAnalysisHelpers/AsgEGammaConfigHelper.h
index b21125e1d9696cb8fb0b864cdcd06177de4127a9..c99faa4d49ac8669d3c1231de0f7914d6829bcb5 100644
--- a/PhysicsAnalysis/ElectronPhotonID/EgammaAnalysisHelpers/EgammaAnalysisHelpers/AsgEGammaConfigHelper.h
+++ b/PhysicsAnalysis/ElectronPhotonID/EgammaAnalysisHelpers/EgammaAnalysisHelpers/AsgEGammaConfigHelper.h
@@ -18,8 +18,8 @@
 class TEnv;
 
 namespace AsgConfigHelper{
-  std::string  findConfigFile (std::string input, const std::map<std::string,std::string>& configmap);
-  unsigned int  findMask (std::string input, const std::map<std::string,unsigned int>& maskmap);
+  std::string  findConfigFile (const std::string& input, const std::map<std::string,std::string>& configmap);
+  unsigned int  findMask (const std::string& input, const std::map<std::string,unsigned int>& maskmap);
   std::vector<double> HelperDouble(const std::string& input,  TEnv& env);  
   std::vector<float> HelperFloat(const std::string& input,  TEnv& env);  
   std::vector<int> HelperInt(const std::string& input, TEnv& env);
diff --git a/PhysicsAnalysis/ElectronPhotonID/EgammaAnalysisHelpers/Root/AsgEGammaConfigHelper.cxx b/PhysicsAnalysis/ElectronPhotonID/EgammaAnalysisHelpers/Root/AsgEGammaConfigHelper.cxx
index 09211e9ad376cc05a6bf782a28715cf8d44f7910..545b8e4b20bcc9d35e9c470dd700313e6db1220d 100644
--- a/PhysicsAnalysis/ElectronPhotonID/EgammaAnalysisHelpers/Root/AsgEGammaConfigHelper.cxx
+++ b/PhysicsAnalysis/ElectronPhotonID/EgammaAnalysisHelpers/Root/AsgEGammaConfigHelper.cxx
@@ -10,7 +10,7 @@
 
 namespace AsgConfigHelper{
 
-  std::string findConfigFile (std::string input, const std::map<std::string,std::string>& configmap){
+  std::string findConfigFile (const std::string& input, const std::map<std::string,std::string>& configmap){
     auto confFile_itr=configmap.find(input);
     if(confFile_itr == configmap.end()){
       static const asg::AsgMessaging msg("Egamma::AsgConfigHelper");
@@ -20,7 +20,7 @@ namespace AsgConfigHelper{
     return confFile_itr->second;
   }
   
-  unsigned int findMask (std::string input, const std::map<std::string,unsigned int>& maskmap){
+  unsigned int findMask (const std::string& input, const std::map<std::string,unsigned int>& maskmap){
     auto mask_itr=maskmap.find(input);
     if(mask_itr==maskmap.end()){
       static const asg::AsgMessaging msg("Egamma::AsgConfigHelper");
@@ -37,7 +37,7 @@ namespace AsgConfigHelper{
     std::string tmp = input;
     std::string::size_type first(0);
     std::string::size_type last(0);
-    first = ( input.find("#") ) ;
+    first = ( input.find('#') ) ;
  
     //if we do not find a comment character "#" we are fine
     if (first == std::string::npos) {
@@ -47,7 +47,7 @@ namespace AsgConfigHelper{
     } 
     else {
       //if we have found comment character check if it is inlined between two "#"
-      last = (input.find("#",first+1) );
+      last = (input.find('#',first+1) );
       //if nor error
       if (last == std::string::npos) {
         static const asg::AsgMessaging msg("Egamma::AsgConfigHelper");
@@ -67,10 +67,10 @@ namespace AsgConfigHelper{
   std::vector<T> Helper (const std::string& input,  TEnv& env){ 
     std::vector<T> CutVector;    
     std::string env_input(env.GetValue(input.c_str(), ""));
-    if (env_input.size() > 0) {
+    if (!env_input.empty()) {
       std::string::size_type end;
       do {
-	      end = env_input.find(";");
+	      end = env_input.find(';');
 	      T  myValue(0);
 	      if(AsgConfigHelper::strtof(env_input.substr(0,end),myValue)){
 	        CutVector.push_back(myValue);
@@ -98,10 +98,10 @@ std::vector<int> AsgConfigHelper::HelperInt(const std::string& input, TEnv& env)
 std::vector<std::string> AsgConfigHelper::HelperString(const std::string& input, TEnv& env){
   std::vector<std::string> CutVector;
   std::string env_input(env.GetValue(input.c_str(), ""));
-  if (env_input.size() > 0) {
+  if (!env_input.empty()) {
     std::string::size_type end;
     do {
-	    end = env_input.find(";");
+	    end = env_input.find(';');
 	    std::string myValue("");
 	    if(AsgConfigHelper::strtof(env_input.substr(0,end),myValue)){
 	      CutVector.push_back(myValue);
diff --git a/PhysicsAnalysis/ElectronPhotonID/EgammaAnalysisHelpers/Root/PhotonHelpers.cxx b/PhysicsAnalysis/ElectronPhotonID/EgammaAnalysisHelpers/Root/PhotonHelpers.cxx
index 099e380af8bac7f4b6b04d6dd7aa3bb58049e65f..59ce81007146658674278e3bf04fece2a86bc290 100644
--- a/PhysicsAnalysis/ElectronPhotonID/EgammaAnalysisHelpers/Root/PhotonHelpers.cxx
+++ b/PhysicsAnalysis/ElectronPhotonID/EgammaAnalysisHelpers/Root/PhotonHelpers.cxx
@@ -17,15 +17,17 @@ bool PhotonHelpers::passOQquality(const xAOD::Photon *ph){
     return 0;
   }
   
-  if( !( ( ph->OQ() & 1073741824 )!=0 ||
+  return !( ( ph->OQ() & 1073741824 )!=0 ||
+
 	 ( ( ph->OQ() & 134217728 )!=0 &&
+
 	   ( ph->showerShapeValue(xAOD::EgammaParameters::Reta) > 0.98
+
 	    || ph->showerShapeValue(xAOD::EgammaParameters::f1) > 0.4
+
 	    || (ph->OQ() & 67108864) !=0)
-	   ) ) ){
-    return true;
-  } 
-  return false;
+
+	   ) );
 }
 // ==================================================================
 bool PhotonHelpers::passOQqualityDelayed(const xAOD::Photon *ph){
@@ -36,12 +38,13 @@ bool PhotonHelpers::passOQqualityDelayed(const xAOD::Photon *ph){
     return 0;
   }
   
-  if( !( ( ph->OQ() & 1073741824)!=0 ||
+  return !( ( ph->OQ() & 1073741824)!=0 ||
+
 	 ( ( ph->OQ() & 134217728)!=0 &&
+
 	   ( ph->showerShapeValue(xAOD::EgammaParameters::Reta) > 0.98
+
 	     || ph->showerShapeValue(xAOD::EgammaParameters::f1) > 0.4
-	     ) ) ) ) {
-    return true;
-  }
-  return false;
+
+	     ) ) );
 }
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/ATLAS_CHECK_THREAD_SAFETY b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..274b45e446739e2a710594569b6579daa9c13820
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/ElectronEfficiencyCorrection/ElectronChargeEfficiencyCorrectionTool.h b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/ElectronEfficiencyCorrection/ElectronChargeEfficiencyCorrectionTool.h
index 522c3439f88453b5b41b5d1abce619561f4d5d43..995ee9db9669ea9fdbfdf5cac3e8afe9684411b3 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/ElectronEfficiencyCorrection/ElectronChargeEfficiencyCorrectionTool.h
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/ElectronEfficiencyCorrection/ElectronChargeEfficiencyCorrectionTool.h
@@ -141,7 +141,7 @@ namespace CP {
 
 
     /// Truth charge
-    mutable int m_truthCharge;
+    int m_truthCharge;
 
     //const xAOD::TruthParticle *m_truthparticle;
 
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonShowerShapeFudgeTool/ATLAS_CHECK_THREAD_SAFETY b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonShowerShapeFudgeTool/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..0792ec7bbaf31109d44fed9b91ca9c5adda0d20b
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonShowerShapeFudgeTool/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+PhysicsAnalysis/ElectronPhotonID/ElectronPhotonShowerShapeFudgeTool
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonShowerShapeFudgeTool/ElectronPhotonShowerShapeFudgeTool/ElectronPhotonShowerShapeFudgeTool.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonShowerShapeFudgeTool/ElectronPhotonShowerShapeFudgeTool/ElectronPhotonShowerShapeFudgeTool.h
index 0692194f0e041194289bb62e49032d2900210b9a..eacb4da6421ab5319d5eb70ab30e5288cb6f1f6f 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonShowerShapeFudgeTool/ElectronPhotonShowerShapeFudgeTool/ElectronPhotonShowerShapeFudgeTool.h
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonShowerShapeFudgeTool/ElectronPhotonShowerShapeFudgeTool/ElectronPhotonShowerShapeFudgeTool.h
@@ -36,20 +36,23 @@ public:
 
 public:
   /** Gaudi Service Interface method implementations */
-  virtual StatusCode initialize();
+  virtual StatusCode initialize() override final;
 
-  /** Gaudi Service Interface method implementations */
-  virtual StatusCode finalize();
 
 public:
+  virtual const CP::CorrectionCode applyCorrection(
+    xAOD::Photon& ph) const override final;
 
-   virtual const CP::CorrectionCode applyCorrection(xAOD::Photon& ph ) const;
-
-   virtual const CP::CorrectionCode applyCorrection(xAOD::Electron& el ) const;
+  virtual const CP::CorrectionCode applyCorrection(
+    xAOD::Electron& el) const override final;
 
-   virtual const CP::CorrectionCode correctedCopy( const xAOD::Photon& ph, xAOD::Photon*& output ) const ;
+  virtual const CP::CorrectionCode correctedCopy(
+    const xAOD::Photon& ph,
+    xAOD::Photon*& output) const override final;
 
-   virtual const CP::CorrectionCode correctedCopy( const xAOD::Electron& el, xAOD::Electron*& output) const;
+  virtual const CP::CorrectionCode correctedCopy(
+    const xAOD::Electron& el,
+    xAOD::Electron*& output) const override final;
 
 private:
 
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonShowerShapeFudgeTool/Root/ElectronPhotonShowerShapeFudgeTool.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonShowerShapeFudgeTool/Root/ElectronPhotonShowerShapeFudgeTool.cxx
index 327f39e0bc269ad8c06014d158ffee587ee0450e..da8ee467dd3b2b62cfb2f5b599e4011351e6c6ab 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonShowerShapeFudgeTool/Root/ElectronPhotonShowerShapeFudgeTool.cxx
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonShowerShapeFudgeTool/Root/ElectronPhotonShowerShapeFudgeTool.cxx
@@ -40,10 +40,6 @@ ElectronPhotonShowerShapeFudgeTool::ElectronPhotonShowerShapeFudgeTool(const std
 // Standard Destructor
 ElectronPhotonShowerShapeFudgeTool::~ElectronPhotonShowerShapeFudgeTool()
 {
-  if(finalize().isFailure()){
-    ATH_MSG_ERROR ( "Failure in ElectronPhotonShowerShapeFudgeTool finalize()");
-  }
-
   if ( m_ph_rootTool ) delete m_ph_rootTool;
   if ( m_el_rootTool ) delete m_el_rootTool;
 }
@@ -105,12 +101,6 @@ StatusCode ElectronPhotonShowerShapeFudgeTool::initialize()
 }
 
 
-StatusCode ElectronPhotonShowerShapeFudgeTool::finalize()
-{
-  return StatusCode::SUCCESS;
-}
-
-
 const CP::CorrectionCode ElectronPhotonShowerShapeFudgeTool::applyCorrection( xAOD::Photon& ph) const {
 
   //Input vars to the underlying root tool.
@@ -364,8 +354,7 @@ bool ElectronPhotonShowerShapeFudgeTool::strtof(const std::string& input, float&
   else {
     last = (input.find('#',first+1) );
     if (last == std::string::npos) {
-      static asg::AsgMessaging msg("Egamma::ElectronPhotonShowerShapeFudgeTool");
-      msg.msg(MSG::WARNING)<<" Improper comment format , inline comment should be enclosed between two #  "<<endmsg;
+      ATH_MSG_WARNING("Improper comment format , inline comment should be enclosed between two #");
       return false;
     }
     diff = last - first ;
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonShowerShapeFudgeTool/Root/TPhotonMCShifterTool.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonShowerShapeFudgeTool/Root/TPhotonMCShifterTool.cxx
index 71a915e2e875a076fb7ec8e055c7f61ecf99fbee..fad15d52f3cb65e7ea752d0bbe0e5b0080deff9a 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonShowerShapeFudgeTool/Root/TPhotonMCShifterTool.cxx
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonShowerShapeFudgeTool/Root/TPhotonMCShifterTool.cxx
@@ -151,10 +151,10 @@ void TPhotonMCShifterTool::LoadFFs(int preselection, const std::string& file)
      throw std::runtime_error( "Couldn't open file: " + m_corr_file );
   }
   if (!f->FindKey(Form("TUNE%d",preselection))) {
-    std::cout << "Directory TUNE" << preselection << " does not exist in fudge factor file. Aborting" << std::endl;
-    exit(-1);
+    throw std::runtime_error("Directory TUNE " + std::to_string(preselection) +
+                             " does not exist in fudge factor file.");
   }
-  
+
   h_u_rhad1 = (TH2D*) f->Get(Form("TUNE%d/FF_RHAD1_UNCONV",preselection));
   h_u_rhad1->SetDirectory(nullptr);
  
diff --git a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/CMakeLists.txt b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/CMakeLists.txt
index b1a0b9bf3a210ef158bd7c33db2dbf00f75784ae..bd94845e43cbb765acea7f0fa673862a2a2be3b7 100644
--- a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/CMakeLists.txt
+++ b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 
 # The name of the package:
 atlas_subdir( EgammaAnalysisInterfaces )
@@ -8,7 +8,8 @@ atlas_add_library( EgammaAnalysisInterfacesLib
    EgammaAnalysisInterfaces/*.h
    INTERFACE
    PUBLIC_HEADERS EgammaAnalysisInterfaces
-   LINK_LIBRARIES AsgTools xAODCaloEvent xAODEgamma xAODTracking PATInterfaces PATCoreLib )
+   LINK_LIBRARIES AsgTools AsgServicesLib xAODCaloEvent 
+   xAODEgamma xAODTracking AsgMessagingLib PATInterfaces PATCoreLib )
 
 atlas_add_dictionary( EgammaAnalysisInterfacesDict
    EgammaAnalysisInterfaces/EgammaAnalysisInterfacesDict.h
diff --git a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfacesDict.h b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfacesDict.h
index 7b91c9c6b9b1486306199e53b680f680d2f22bb0..e5a07762ede73f473f4fa028324b4359e678fdb0 100644
--- a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfacesDict.h
+++ b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfacesDict.h
@@ -15,6 +15,8 @@
 
 #include "EgammaAnalysisInterfaces/IAsgElectronEfficiencyCorrectionTool.h"
 
+#include "EgammaAnalysisInterfaces/IegammaMVACalibTool.h"
+#include "EgammaAnalysisInterfaces/IegammaMVASvc.h"
 #include "EgammaAnalysisInterfaces/IEgammaCalibrationAndSmearingTool.h"
 
 #include "EgammaAnalysisInterfaces/IAsgPhotonEfficiencyCorrectionTool.h"
diff --git a/Reconstruction/egamma/egammaInterfaces/egammaInterfaces/IegammaMVACalibTool.h b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IegammaMVACalibTool.h
similarity index 60%
rename from Reconstruction/egamma/egammaInterfaces/egammaInterfaces/IegammaMVACalibTool.h
rename to PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IegammaMVACalibTool.h
index d6540b79374e1e914808a391db610cbc16ff2f73..8936f44499824d5d99e2b090f1e6e4d612bfdedb 100644
--- a/Reconstruction/egamma/egammaInterfaces/egammaInterfaces/IegammaMVACalibTool.h
+++ b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IegammaMVACalibTool.h
@@ -1,10 +1,10 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
-#ifndef EGAMMAINTERFACES_iEGAMMAMVACALIBTOOL_H
-#define EGAMMAINTERFACES_iEGAMMAMVACALIBTOOL_H
+#ifndef EGAMMAANALYSISINTERFACES_IEGAMMAMVACALIBTOOL_H
+#define EGAMMAANALYSISINTERFACES_IEGAMMAMVACALIBTOOL_H
 
-#include "GaudiKernel/IAlgTool.h"
+#include "AsgTools/IAsgTool.h"
 
 // EDM includes
 #include "xAODEgamma/EgammaFwd.h"
@@ -14,16 +14,15 @@
  * @class IegammaMVACalibTool
  * @brief A tool used by the egammaMVASvc to help manage the MVAs.
  **/
-class IegammaMVACalibTool : virtual public IAlgTool {
+class IegammaMVACalibTool : virtual public asg::IAsgTool{
+  ASG_TOOL_INTERFACE(IegammaMVACalibTool)
 public:
-  DeclareInterfaceID(IegammaMVACalibTool, 1, 0);
-
   virtual ~IegammaMVACalibTool() override {};
 
   ///Return MVA energy for the given cluster, an eg object is optional
   virtual float getEnergy(const xAOD::CaloCluster& clus,
                          const xAOD::Egamma* eg) const = 0;
 
-}; 
+};
 
 #endif
diff --git a/Reconstruction/egamma/egammaInterfaces/egammaInterfaces/IegammaMVASvc.h b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IegammaMVASvc.h
similarity index 67%
rename from Reconstruction/egamma/egammaInterfaces/egammaInterfaces/IegammaMVASvc.h
rename to PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IegammaMVASvc.h
index 97497f096a4b317d0e3d61091ba48ff875136ee8..a414a7190476d598862ba1439d986cd03827e1f4 100644
--- a/Reconstruction/egamma/egammaInterfaces/egammaInterfaces/IegammaMVASvc.h
+++ b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IegammaMVASvc.h
@@ -1,24 +1,24 @@
 // Dear Emacs, this is -*- C++ -*-
 
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 
-#ifndef EGAMMAINTERFACES_IEGAMMAMVASVC_H
-#define EGAMMAINTERFACES_IEGAMMAMVASVC_H
-
-#include "GaudiKernel/IService.h"
+#ifndef EGAMMAANALYSISINTERFACES_IEGAMMAMVASVC_H
+#define EGAMMAANALYSISINTERFACES_IEGAMMAMVASVC_H
 
+#include "AsgServices/IAsgService.h"
+#include "AsgMessaging/StatusCode.h"
 // EDM includes
 #include "xAODEgamma/EgammaFwd.h"
 #include "xAODEgamma/EgammaEnums.h"
 #include "xAODCaloEvent/CaloClusterFwd.h"
 
 
-class IegammaMVASvc : virtual public IService {
+class IegammaMVASvc : virtual public asg::IAsgService {
+  ASG_SERVICE_INTERFACE(IegammaMVASvc)
 public:
-  DeclareInterfaceID(IegammaMVASvc, 1, 0);
 
   virtual ~IegammaMVASvc() override {};
 
diff --git a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/selection.xml b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/selection.xml
index 042c1d9ed007d15fb82972e70be0fa8b860c2bfb..4197162871d82982b220b1b0676a1b29b320eff2 100644
--- a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/selection.xml
+++ b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/selection.xml
@@ -9,13 +9,15 @@
   <class name="IAsgDeadHVCellRemovalTool" /> 
 
   <class name="IAsgElectronEfficiencyCorrectionTool" /> 
+  
+  <class name="IegammaMVACalibTool" /> 
+  <class name="IegammaMVASvc" /> 
 
   <class name="IEgammaCalibrationAndSmearingTool" />   
   <variable pattern="EgammaCalibPeriodRunNumbersExample::*"/>
   <class name="EgammaCalibPeriodRunNumbersExample::ROOT6_NamespaceAutoloadHook" /> 
 
   <class name="IAsgPhotonEfficiencyCorrectionTool" /> 
-
   <class name="IElectronPhotonShowerShapeFudgeTool" /> 
 
 <lcgdict>
diff --git a/PhysicsAnalysis/JetMissingEtID/MissingEtDQA/src/PhysValMET.cxx b/PhysicsAnalysis/JetMissingEtID/MissingEtDQA/src/PhysValMET.cxx
index 6ea4204fb7e44ae14eda33cf13c6f5d23c24b516..68c19d6552bd107b3fc419517c0a0f6bb1b31b2b 100644
--- a/PhysicsAnalysis/JetMissingEtID/MissingEtDQA/src/PhysValMET.cxx
+++ b/PhysicsAnalysis/JetMissingEtID/MissingEtDQA/src/PhysValMET.cxx
@@ -548,6 +548,12 @@ namespace MissingEtDQA {
   {
     ATH_MSG_INFO ("Filling hists " << name() << "...");
 
+    //Beamspot weight
+    const xAOD::EventInfo* eventInfo(0);
+    ATH_CHECK(evtStore()->retrieve(eventInfo, "EventInfo"));
+
+    float weight = eventInfo->beamSpotWeight();
+
     //Retrieve MET Truth
     const xAOD::MissingETContainer* met_Truth = 0;
     if(m_doTruth) {
@@ -784,67 +790,67 @@ namespace MissingEtDQA {
       for(const auto& it : *met_Ref) {
     	std::string name = it->name();
     	if(name == "RefEle"){
-    	  (m_MET_Ref[type]).at(0)->Fill((*met_Ref)[name.c_str()]->met()/1000., 1.);
-    	  (m_MET_Ref_x[type]).at(0)->Fill((*met_Ref)[name.c_str()]->mpx()/1000., 1.);
-    	  (m_MET_Ref_y[type]).at(0)->Fill((*met_Ref)[name.c_str()]->mpy()/1000., 1.);
-    	  (m_MET_Ref_phi[type]).at(0)->Fill((*met_Ref)[name.c_str()]->phi(), 1.);
-    	  (m_MET_Ref_sum[type]).at(0)->Fill((*met_Ref)[name.c_str()]->sumet()/1000., 1.);
+	  (m_MET_Ref[type]).at(0)->Fill((*met_Ref)[name.c_str()]->met()/1000., weight);
+	  (m_MET_Ref_x[type]).at(0)->Fill((*met_Ref)[name.c_str()]->mpx()/1000., weight);
+	  (m_MET_Ref_y[type]).at(0)->Fill((*met_Ref)[name.c_str()]->mpy()/1000., weight);
+	  (m_MET_Ref_phi[type]).at(0)->Fill((*met_Ref)[name.c_str()]->phi(), weight);
+	  (m_MET_Ref_sum[type]).at(0)->Fill((*met_Ref)[name.c_str()]->sumet()/1000., weight);
     	}
     	if(name == "RefGamma"){
-    	  (m_MET_Ref[type]).at(1)->Fill((*met_Ref)[name.c_str()]->met()/1000., 1.);
-    	  (m_MET_Ref_x[type]).at(1)->Fill((*met_Ref)[name.c_str()]->mpx()/1000., 1.);
-    	  (m_MET_Ref_y[type]).at(1)->Fill((*met_Ref)[name.c_str()]->mpy()/1000., 1.);
-    	  (m_MET_Ref_phi[type]).at(1)->Fill((*met_Ref)[name.c_str()]->phi(), 1.);
-    	  (m_MET_Ref_sum[type]).at(1)->Fill((*met_Ref)[name.c_str()]->sumet()/1000., 1.);
+	  (m_MET_Ref[type]).at(1)->Fill((*met_Ref)[name.c_str()]->met()/1000., weight);
+	  (m_MET_Ref_x[type]).at(1)->Fill((*met_Ref)[name.c_str()]->mpx()/1000., weight);
+	  (m_MET_Ref_y[type]).at(1)->Fill((*met_Ref)[name.c_str()]->mpy()/1000., weight);
+	  (m_MET_Ref_phi[type]).at(1)->Fill((*met_Ref)[name.c_str()]->phi(), weight);
+	  (m_MET_Ref_sum[type]).at(1)->Fill((*met_Ref)[name.c_str()]->sumet()/1000., weight);
     	}
     	if(name == "RefTau"){
-    	  (m_MET_Ref[type]).at(2)->Fill((*met_Ref)[name.c_str()]->met()/1000., 1.);
-    	  (m_MET_Ref_x[type]).at(2)->Fill((*met_Ref)[name.c_str()]->mpx()/1000., 1.);
-    	  (m_MET_Ref_y[type]).at(2)->Fill((*met_Ref)[name.c_str()]->mpy()/1000., 1.);
-    	  (m_MET_Ref_phi[type]).at(2)->Fill((*met_Ref)[name.c_str()]->phi(), 1.);
-    	  (m_MET_Ref_sum[type]).at(2)->Fill((*met_Ref)[name.c_str()]->sumet()/1000., 1.);
+	  (m_MET_Ref[type]).at(2)->Fill((*met_Ref)[name.c_str()]->met()/1000., weight);
+	  (m_MET_Ref_x[type]).at(2)->Fill((*met_Ref)[name.c_str()]->mpx()/1000., weight);
+	  (m_MET_Ref_y[type]).at(2)->Fill((*met_Ref)[name.c_str()]->mpy()/1000., weight);
+	  (m_MET_Ref_phi[type]).at(2)->Fill((*met_Ref)[name.c_str()]->phi(), weight);
+	  (m_MET_Ref_sum[type]).at(2)->Fill((*met_Ref)[name.c_str()]->sumet()/1000., weight);
     	}
     	if(name == "Muons"){
-    	  (m_MET_Ref[type]).at(3)->Fill((*met_Ref)[name.c_str()]->met()/1000., 1.);
-    	  (m_MET_Ref_x[type]).at(3)->Fill((*met_Ref)[name.c_str()]->mpx()/1000., 1.);
-    	  (m_MET_Ref_y[type]).at(3)->Fill((*met_Ref)[name.c_str()]->mpy()/1000., 1.);
-    	  (m_MET_Ref_phi[type]).at(3)->Fill((*met_Ref)[name.c_str()]->phi(), 1.);
-    	  (m_MET_Ref_sum[type]).at(3)->Fill((*met_Ref)[name.c_str()]->sumet()/1000., 1.);
+	  (m_MET_Ref[type]).at(3)->Fill((*met_Ref)[name.c_str()]->met()/1000., weight);
+	  (m_MET_Ref_x[type]).at(3)->Fill((*met_Ref)[name.c_str()]->mpx()/1000., weight);
+	  (m_MET_Ref_y[type]).at(3)->Fill((*met_Ref)[name.c_str()]->mpy()/1000., weight);
+	  (m_MET_Ref_phi[type]).at(3)->Fill((*met_Ref)[name.c_str()]->phi(), weight);
+	  (m_MET_Ref_sum[type]).at(3)->Fill((*met_Ref)[name.c_str()]->sumet()/1000., weight);
     	}
     	if(name == "RefJet"){
-    	  (m_MET_Ref[type]).at(4)->Fill((*met_Ref)[name.c_str()]->met()/1000., 1.);
-    	  (m_MET_Ref_x[type]).at(4)->Fill((*met_Ref)[name.c_str()]->mpx()/1000., 1.);
-    	  (m_MET_Ref_y[type]).at(4)->Fill((*met_Ref)[name.c_str()]->mpy()/1000., 1.);
-    	  (m_MET_Ref_phi[type]).at(4)->Fill((*met_Ref)[name.c_str()]->phi(), 1.);
-    	  (m_MET_Ref_sum[type]).at(4)->Fill((*met_Ref)[name.c_str()]->sumet()/1000., 1.);
+	  (m_MET_Ref[type]).at(4)->Fill((*met_Ref)[name.c_str()]->met()/1000., weight);
+	  (m_MET_Ref_x[type]).at(4)->Fill((*met_Ref)[name.c_str()]->mpx()/1000., weight);
+	  (m_MET_Ref_y[type]).at(4)->Fill((*met_Ref)[name.c_str()]->mpy()/1000., weight);
+	  (m_MET_Ref_phi[type]).at(4)->Fill((*met_Ref)[name.c_str()]->phi(), weight);
+	  (m_MET_Ref_sum[type]).at(4)->Fill((*met_Ref)[name.c_str()]->sumet()/1000., weight);
     	}
     	if(name == "SoftClus"){
-    	  (m_MET_Ref[type]).at(5)->Fill((*met_Ref)[name.c_str()]->met()/1000., 1.);
-    	  (m_MET_Ref_x[type]).at(5)->Fill((*met_Ref)[name.c_str()]->mpx()/1000., 1.);
-    	  (m_MET_Ref_y[type]).at(5)->Fill((*met_Ref)[name.c_str()]->mpy()/1000., 1.);
-    	  (m_MET_Ref_phi[type]).at(5)->Fill((*met_Ref)[name.c_str()]->phi(), 1.);
-    	  (m_MET_Ref_sum[type]).at(5)->Fill((*met_Ref)[name.c_str()]->sumet()/1000., 1.);
+	  (m_MET_Ref[type]).at(5)->Fill((*met_Ref)[name.c_str()]->met()/1000., weight);
+	  (m_MET_Ref_x[type]).at(5)->Fill((*met_Ref)[name.c_str()]->mpx()/1000., weight);
+	  (m_MET_Ref_y[type]).at(5)->Fill((*met_Ref)[name.c_str()]->mpy()/1000., weight);
+	  (m_MET_Ref_phi[type]).at(5)->Fill((*met_Ref)[name.c_str()]->phi(), weight);
+	  (m_MET_Ref_sum[type]).at(5)->Fill((*met_Ref)[name.c_str()]->sumet()/1000., weight);
     	}
     	if(name == "PVSoftTrk"){
-    	  (m_MET_Ref[type]).at(6)->Fill((*met_Ref)[name.c_str()]->met()/1000., 1.);
-    	  (m_MET_Ref_x[type]).at(6)->Fill((*met_Ref)[name.c_str()]->mpx()/1000., 1.);
-    	  (m_MET_Ref_y[type]).at(6)->Fill((*met_Ref)[name.c_str()]->mpy()/1000., 1.);
-    	  (m_MET_Ref_phi[type]).at(6)->Fill((*met_Ref)[name.c_str()]->phi(), 1.);
-    	  (m_MET_Ref_sum[type]).at(6)->Fill((*met_Ref)[name.c_str()]->sumet()/1000., 1.);
+	  (m_MET_Ref[type]).at(6)->Fill((*met_Ref)[name.c_str()]->met()/1000., weight);
+	  (m_MET_Ref_x[type]).at(6)->Fill((*met_Ref)[name.c_str()]->mpx()/1000., weight);
+	  (m_MET_Ref_y[type]).at(6)->Fill((*met_Ref)[name.c_str()]->mpy()/1000., weight);
+	  (m_MET_Ref_phi[type]).at(6)->Fill((*met_Ref)[name.c_str()]->phi(), weight);
+	  (m_MET_Ref_sum[type]).at(6)->Fill((*met_Ref)[name.c_str()]->sumet()/1000., weight);
     	}
     	if(name == "FinalTrk"){
-    	  (m_MET_Ref[type]).at(7)->Fill((*met_Ref)[name.c_str()]->met()/1000., 1.);
-    	  (m_MET_Ref_x[type]).at(7)->Fill((*met_Ref)[name.c_str()]->mpx()/1000., 1.);
-    	  (m_MET_Ref_y[type]).at(7)->Fill((*met_Ref)[name.c_str()]->mpy()/1000., 1.);
-    	  (m_MET_Ref_phi[type]).at(7)->Fill((*met_Ref)[name.c_str()]->phi(), 1.);
-    	  (m_MET_Ref_sum[type]).at(7)->Fill((*met_Ref)[name.c_str()]->sumet()/1000., 1.);
+	  (m_MET_Ref[type]).at(7)->Fill((*met_Ref)[name.c_str()]->met()/1000., weight);
+	  (m_MET_Ref_x[type]).at(7)->Fill((*met_Ref)[name.c_str()]->mpx()/1000., weight);
+	  (m_MET_Ref_y[type]).at(7)->Fill((*met_Ref)[name.c_str()]->mpy()/1000., weight);
+	  (m_MET_Ref_phi[type]).at(7)->Fill((*met_Ref)[name.c_str()]->phi(), weight);
+	  (m_MET_Ref_sum[type]).at(7)->Fill((*met_Ref)[name.c_str()]->sumet()/1000., weight);
     	}
     	if(name == "FinalClus"){
-    	  (m_MET_Ref[type]).at(8)->Fill((*met_Ref)[name.c_str()]->met()/1000., 1.);
-    	  (m_MET_Ref_x[type]).at(8)->Fill((*met_Ref)[name.c_str()]->mpx()/1000., 1.);
-    	  (m_MET_Ref_y[type]).at(8)->Fill((*met_Ref)[name.c_str()]->mpy()/1000., 1.);
-    	  (m_MET_Ref_phi[type]).at(8)->Fill((*met_Ref)[name.c_str()]->phi(), 1.);
-    	  (m_MET_Ref_sum[type]).at(8)->Fill((*met_Ref)[name.c_str()]->sumet()/1000., 1.);
+	  (m_MET_Ref[type]).at(8)->Fill((*met_Ref)[name.c_str()]->met()/1000., weight);
+	  (m_MET_Ref_x[type]).at(8)->Fill((*met_Ref)[name.c_str()]->mpx()/1000., weight);
+	  (m_MET_Ref_y[type]).at(8)->Fill((*met_Ref)[name.c_str()]->mpy()/1000., weight);
+	  (m_MET_Ref_phi[type]).at(8)->Fill((*met_Ref)[name.c_str()]->phi(), weight);
+	  (m_MET_Ref_sum[type]).at(8)->Fill((*met_Ref)[name.c_str()]->sumet()/1000., weight);
     	}
       }
 
@@ -923,67 +929,67 @@ namespace MissingEtDQA {
       for(const auto& it : *met_Reb) {
     	std::string name = it->name();
     	if(name == "RefEle"){
-    	  (m_MET_Reb[type]).at(0)->Fill((*met_Reb)[name.c_str()]->met()/1000., 1.);
-    	  (m_MET_Reb_x[type]).at(0)->Fill((*met_Reb)[name.c_str()]->mpx()/1000., 1.);
-    	  (m_MET_Reb_y[type]).at(0)->Fill((*met_Reb)[name.c_str()]->mpy()/1000., 1.);
-    	  (m_MET_Reb_phi[type]).at(0)->Fill((*met_Reb)[name.c_str()]->phi(), 1.);
-    	  (m_MET_Reb_sum[type]).at(0)->Fill((*met_Reb)[name.c_str()]->sumet()/1000., 1.);
+	  (m_MET_Reb[type]).at(0)->Fill((*met_Reb)[name.c_str()]->met()/1000., weight);
+	  (m_MET_Reb_x[type]).at(0)->Fill((*met_Reb)[name.c_str()]->mpx()/1000., weight);
+	  (m_MET_Reb_y[type]).at(0)->Fill((*met_Reb)[name.c_str()]->mpy()/1000., weight);
+	  (m_MET_Reb_phi[type]).at(0)->Fill((*met_Reb)[name.c_str()]->phi(), weight);
+	  (m_MET_Reb_sum[type]).at(0)->Fill((*met_Reb)[name.c_str()]->sumet()/1000., weight);
     	}
     	if(name == "RefGamma"){
-    	  (m_MET_Reb[type]).at(1)->Fill((*met_Reb)[name.c_str()]->met()/1000., 1.);
-    	  (m_MET_Reb_x[type]).at(1)->Fill((*met_Reb)[name.c_str()]->mpx()/1000., 1.);
-    	  (m_MET_Reb_y[type]).at(1)->Fill((*met_Reb)[name.c_str()]->mpy()/1000., 1.);
-    	  (m_MET_Reb_phi[type]).at(1)->Fill((*met_Reb)[name.c_str()]->phi(), 1.);
-    	  (m_MET_Reb_sum[type]).at(1)->Fill((*met_Reb)[name.c_str()]->sumet()/1000., 1.);
+	  (m_MET_Reb[type]).at(1)->Fill((*met_Reb)[name.c_str()]->met()/1000., weight);
+	  (m_MET_Reb_x[type]).at(1)->Fill((*met_Reb)[name.c_str()]->mpx()/1000., weight);
+	  (m_MET_Reb_y[type]).at(1)->Fill((*met_Reb)[name.c_str()]->mpy()/1000., weight);
+	  (m_MET_Reb_phi[type]).at(1)->Fill((*met_Reb)[name.c_str()]->phi(), weight);
+	  (m_MET_Reb_sum[type]).at(1)->Fill((*met_Reb)[name.c_str()]->sumet()/1000., weight);
     	}
     	if(name == "RefTau"){
-    	  (m_MET_Reb[type]).at(2)->Fill((*met_Reb)[name.c_str()]->met()/1000., 1.);
-    	  (m_MET_Reb_x[type]).at(2)->Fill((*met_Reb)[name.c_str()]->mpx()/1000., 1.);
-    	  (m_MET_Reb_y[type]).at(2)->Fill((*met_Reb)[name.c_str()]->mpy()/1000., 1.);
-    	  (m_MET_Reb_phi[type]).at(2)->Fill((*met_Reb)[name.c_str()]->phi(), 1.);
-    	  (m_MET_Reb_sum[type]).at(2)->Fill((*met_Reb)[name.c_str()]->sumet()/1000., 1.);
+	  (m_MET_Reb[type]).at(2)->Fill((*met_Reb)[name.c_str()]->met()/1000., weight);
+	  (m_MET_Reb_x[type]).at(2)->Fill((*met_Reb)[name.c_str()]->mpx()/1000., weight);
+	  (m_MET_Reb_y[type]).at(2)->Fill((*met_Reb)[name.c_str()]->mpy()/1000., weight);
+	  (m_MET_Reb_phi[type]).at(2)->Fill((*met_Reb)[name.c_str()]->phi(), weight);
+	  (m_MET_Reb_sum[type]).at(2)->Fill((*met_Reb)[name.c_str()]->sumet()/1000., weight);
     	}
     	if(name == "Muons"){
-    	  (m_MET_Reb[type]).at(3)->Fill((*met_Reb)[name.c_str()]->met()/1000., 1.);
-    	  (m_MET_Reb_x[type]).at(3)->Fill((*met_Reb)[name.c_str()]->mpx()/1000., 1.);
-    	  (m_MET_Reb_y[type]).at(3)->Fill((*met_Reb)[name.c_str()]->mpy()/1000., 1.);
-    	  (m_MET_Reb_phi[type]).at(3)->Fill((*met_Reb)[name.c_str()]->phi(), 1.);
-    	  (m_MET_Reb_sum[type]).at(3)->Fill((*met_Reb)[name.c_str()]->sumet()/1000., 1.);
+	  (m_MET_Reb[type]).at(3)->Fill((*met_Reb)[name.c_str()]->met()/1000., weight);
+	  (m_MET_Reb_x[type]).at(3)->Fill((*met_Reb)[name.c_str()]->mpx()/1000., weight);
+	  (m_MET_Reb_y[type]).at(3)->Fill((*met_Reb)[name.c_str()]->mpy()/1000., weight);
+	  (m_MET_Reb_phi[type]).at(3)->Fill((*met_Reb)[name.c_str()]->phi(), weight);
+	  (m_MET_Reb_sum[type]).at(3)->Fill((*met_Reb)[name.c_str()]->sumet()/1000., weight);
     	}
     	if(name == "RefJet"){
-    	  (m_MET_Reb[type]).at(4)->Fill((*met_Reb)[name.c_str()]->met()/1000., 1.);
-    	  (m_MET_Reb_x[type]).at(4)->Fill((*met_Reb)[name.c_str()]->mpx()/1000., 1.);
-    	  (m_MET_Reb_y[type]).at(4)->Fill((*met_Reb)[name.c_str()]->mpy()/1000., 1.);
-    	  (m_MET_Reb_phi[type]).at(4)->Fill((*met_Reb)[name.c_str()]->phi(), 1.);
-    	  (m_MET_Reb_sum[type]).at(4)->Fill((*met_Reb)[name.c_str()]->sumet()/1000., 1.);
+	  (m_MET_Reb[type]).at(4)->Fill((*met_Reb)[name.c_str()]->met()/1000., weight);
+	  (m_MET_Reb_x[type]).at(4)->Fill((*met_Reb)[name.c_str()]->mpx()/1000., weight);
+	  (m_MET_Reb_y[type]).at(4)->Fill((*met_Reb)[name.c_str()]->mpy()/1000., weight);
+	  (m_MET_Reb_phi[type]).at(4)->Fill((*met_Reb)[name.c_str()]->phi(), weight);
+	  (m_MET_Reb_sum[type]).at(4)->Fill((*met_Reb)[name.c_str()]->sumet()/1000., weight);
     	}
     	if(name == "SoftClus"){
-    	  (m_MET_Reb[type]).at(5)->Fill((*met_Reb)[name.c_str()]->met()/1000., 1.);
-    	  (m_MET_Reb_x[type]).at(5)->Fill((*met_Reb)[name.c_str()]->mpx()/1000., 1.);
-    	  (m_MET_Reb_y[type]).at(5)->Fill((*met_Reb)[name.c_str()]->mpy()/1000., 1.);
-    	  (m_MET_Reb_phi[type]).at(5)->Fill((*met_Reb)[name.c_str()]->phi(), 1.);
-    	  (m_MET_Reb_sum[type]).at(5)->Fill((*met_Reb)[name.c_str()]->sumet()/1000., 1.);
+	  (m_MET_Reb[type]).at(5)->Fill((*met_Reb)[name.c_str()]->met()/1000., weight);
+	  (m_MET_Reb_x[type]).at(5)->Fill((*met_Reb)[name.c_str()]->mpx()/1000., weight);
+	  (m_MET_Reb_y[type]).at(5)->Fill((*met_Reb)[name.c_str()]->mpy()/1000., weight);
+	  (m_MET_Reb_phi[type]).at(5)->Fill((*met_Reb)[name.c_str()]->phi(), weight);
+	  (m_MET_Reb_sum[type]).at(5)->Fill((*met_Reb)[name.c_str()]->sumet()/1000., weight);
     	}
     	if(name == "PVSoftTrk"){
-    	  (m_MET_Reb[type]).at(6)->Fill((*met_Reb)[name.c_str()]->met()/1000., 1.);
-    	  (m_MET_Reb_x[type]).at(6)->Fill((*met_Reb)[name.c_str()]->mpx()/1000., 1.);
-    	  (m_MET_Reb_y[type]).at(6)->Fill((*met_Reb)[name.c_str()]->mpy()/1000., 1.);
-    	  (m_MET_Reb_phi[type]).at(6)->Fill((*met_Reb)[name.c_str()]->phi(), 1.);
-    	  (m_MET_Reb_sum[type]).at(6)->Fill((*met_Reb)[name.c_str()]->sumet()/1000., 1.);
+	  (m_MET_Reb[type]).at(6)->Fill((*met_Reb)[name.c_str()]->met()/1000., weight);
+	  (m_MET_Reb_x[type]).at(6)->Fill((*met_Reb)[name.c_str()]->mpx()/1000., weight);
+	  (m_MET_Reb_y[type]).at(6)->Fill((*met_Reb)[name.c_str()]->mpy()/1000., weight);
+	  (m_MET_Reb_phi[type]).at(6)->Fill((*met_Reb)[name.c_str()]->phi(), weight);
+	  (m_MET_Reb_sum[type]).at(6)->Fill((*met_Reb)[name.c_str()]->sumet()/1000., weight);
     	}
     	if(name == "FinalTrk"){
-    	  (m_MET_Reb[type]).at(7)->Fill((*met_Reb)[name.c_str()]->met()/1000., 1.);
-    	  (m_MET_Reb_x[type]).at(7)->Fill((*met_Reb)[name.c_str()]->mpx()/1000., 1.);
-    	  (m_MET_Reb_y[type]).at(7)->Fill((*met_Reb)[name.c_str()]->mpy()/1000., 1.);
-    	  (m_MET_Reb_phi[type]).at(7)->Fill((*met_Reb)[name.c_str()]->phi(), 1.);
-    	  (m_MET_Reb_sum[type]).at(7)->Fill((*met_Reb)[name.c_str()]->sumet()/1000., 1.);
+	  (m_MET_Reb[type]).at(7)->Fill((*met_Reb)[name.c_str()]->met()/1000., weight);
+	  (m_MET_Reb_x[type]).at(7)->Fill((*met_Reb)[name.c_str()]->mpx()/1000., weight);
+	  (m_MET_Reb_y[type]).at(7)->Fill((*met_Reb)[name.c_str()]->mpy()/1000., weight);
+	  (m_MET_Reb_phi[type]).at(7)->Fill((*met_Reb)[name.c_str()]->phi(), weight);
+	  (m_MET_Reb_sum[type]).at(7)->Fill((*met_Reb)[name.c_str()]->sumet()/1000., weight);
     	}
     	if(name == "FinalClus"){
-    	  (m_MET_Reb[type]).at(8)->Fill((*met_Reb)[name.c_str()]->met()/1000., 1.);
-    	  (m_MET_Reb_x[type]).at(8)->Fill((*met_Reb)[name.c_str()]->mpx()/1000., 1.);
-    	  (m_MET_Reb_y[type]).at(8)->Fill((*met_Reb)[name.c_str()]->mpy()/1000., 1.);
-    	  (m_MET_Reb_phi[type]).at(8)->Fill((*met_Reb)[name.c_str()]->phi(), 1.);
-    	  (m_MET_Reb_sum[type]).at(8)->Fill((*met_Reb)[name.c_str()]->sumet()/1000., 1.);
+	  (m_MET_Reb[type]).at(8)->Fill((*met_Reb)[name.c_str()]->met()/1000., weight);
+	  (m_MET_Reb_x[type]).at(8)->Fill((*met_Reb)[name.c_str()]->mpx()/1000., weight);
+	  (m_MET_Reb_y[type]).at(8)->Fill((*met_Reb)[name.c_str()]->mpy()/1000., weight);
+	  (m_MET_Reb_phi[type]).at(8)->Fill((*met_Reb)[name.c_str()]->phi(), weight);
+	  (m_MET_Reb_sum[type]).at(8)->Fill((*met_Reb)[name.c_str()]->sumet()/1000., weight);
     	}
       }
 
@@ -1010,15 +1016,15 @@ namespace MissingEtDQA {
 	}
       }
 
-      (m_MET_dPhi_Ref[type]).at(0)->Fill( -remainder( leadPhi - (*met_Reb)["FinalClus"]->phi(), 2*M_PI ) );
-      (m_MET_dPhi_Ref[type]).at(1)->Fill( -remainder( subleadPhi - (*met_Reb)["FinalClus"]->phi(), 2*M_PI ) );
-      (m_MET_dPhi_Ref[type]).at(3)->Fill( -remainder( leadPhi - (*met_Reb)["FinalTrk"]->phi(), 2*M_PI ) );
-      (m_MET_dPhi_Ref[type]).at(4)->Fill( -remainder( subleadPhi - (*met_Reb)["FinalTrk"]->phi(), 2*M_PI ) );
+      (m_MET_dPhi_Ref[type]).at(0)->Fill( -remainder( leadPhi - (*met_Reb)["FinalClus"]->phi(), 2*M_PI ), weight );
+      (m_MET_dPhi_Ref[type]).at(1)->Fill( -remainder( subleadPhi - (*met_Reb)["FinalClus"]->phi(), 2*M_PI ), weight );
+      (m_MET_dPhi_Ref[type]).at(3)->Fill( -remainder( leadPhi - (*met_Reb)["FinalTrk"]->phi(), 2*M_PI ), weight );
+      (m_MET_dPhi_Ref[type]).at(4)->Fill( -remainder( subleadPhi - (*met_Reb)["FinalTrk"]->phi(), 2*M_PI ), weight );
     
-      (m_MET_dPhi_Reb[type]).at(0)->Fill( -remainder( leadPhi - (*met_Reb)["FinalClus"]->phi(), 2*M_PI ) );
-      (m_MET_dPhi_Reb[type]).at(1)->Fill( -remainder( subleadPhi - (*met_Reb)["FinalClus"]->phi(), 2*M_PI ) );
-      (m_MET_dPhi_Reb[type]).at(3)->Fill( -remainder( leadPhi - (*met_Reb)["FinalTrk"]->phi(), 2*M_PI ) );
-      (m_MET_dPhi_Reb[type]).at(4)->Fill( -remainder( subleadPhi - (*met_Reb)["FinalTrk"]->phi(), 2*M_PI ) );
+      (m_MET_dPhi_Reb[type]).at(0)->Fill( -remainder( leadPhi - (*met_Reb)["FinalClus"]->phi(), 2*M_PI ), weight );
+      (m_MET_dPhi_Reb[type]).at(1)->Fill( -remainder( subleadPhi - (*met_Reb)["FinalClus"]->phi(), 2*M_PI ), weight );
+      (m_MET_dPhi_Reb[type]).at(3)->Fill( -remainder( leadPhi - (*met_Reb)["FinalTrk"]->phi(), 2*M_PI ), weight );
+      (m_MET_dPhi_Reb[type]).at(4)->Fill( -remainder( subleadPhi - (*met_Reb)["FinalTrk"]->phi(), 2*M_PI ), weight );
   
 
       leadPt = 0.; leadPhi = 0.;
@@ -1043,10 +1049,10 @@ namespace MissingEtDQA {
     	}
       }
 
-      (m_MET_dPhi_Ref[type]).at(2)->Fill( -remainder( leadPhi - (*met_Ref)["FinalClus"]->phi(), 2*M_PI ) );
-      (m_MET_dPhi_Ref[type]).at(5)->Fill( -remainder( leadPhi - (*met_Ref)["FinalTrk"]->phi(), 2*M_PI ) );
-      (m_MET_dPhi_Reb[type]).at(2)->Fill( -remainder( leadPhi - (*met_Reb)["FinalClus"]->phi(), 2*M_PI ) );
-      (m_MET_dPhi_Reb[type]).at(5)->Fill( -remainder( leadPhi - (*met_Reb)["FinalTrk"]->phi(), 2*M_PI ) );
+      (m_MET_dPhi_Ref[type]).at(2)->Fill( -remainder( leadPhi - (*met_Ref)["FinalClus"]->phi(), 2*M_PI ), weight );
+      (m_MET_dPhi_Ref[type]).at(5)->Fill( -remainder( leadPhi - (*met_Ref)["FinalTrk"]->phi(), 2*M_PI ), weight );
+      (m_MET_dPhi_Reb[type]).at(2)->Fill( -remainder( leadPhi - (*met_Reb)["FinalClus"]->phi(), 2*M_PI ), weight );
+      (m_MET_dPhi_Reb[type]).at(5)->Fill( -remainder( leadPhi - (*met_Reb)["FinalTrk"]->phi(), 2*M_PI ), weight );
     
     
       //Fill Correlation Plots
@@ -1054,30 +1060,30 @@ namespace MissingEtDQA {
       for(const auto& it : *met_Ref) {
     	std::string name = it->name();
     	if(name == "RefEle"){
-    	  (m_MET_CorrFinalTrk_Ref[type]).at(0)->Fill((*met_Ref)[name.c_str()]->met()/1000.,(*met_Ref)["FinalTrk"]->met()/1000., 1.);
-    	  (m_MET_CorrFinalClus_Ref[type]).at(0)->Fill((*met_Ref)[name.c_str()]->met()/1000.,(*met_Ref)["FinalClus"]->met()/1000., 1.);
+	  (m_MET_CorrFinalTrk_Ref[type]).at(0)->Fill((*met_Ref)[name.c_str()]->met()/1000.,(*met_Ref)["FinalTrk"]->met()/1000., weight);
+	  (m_MET_CorrFinalClus_Ref[type]).at(0)->Fill((*met_Ref)[name.c_str()]->met()/1000.,(*met_Ref)["FinalClus"]->met()/1000., weight);
     	}
     	if(name == "RefGamma"){
-    	  (m_MET_CorrFinalTrk_Ref[type]).at(1)->Fill((*met_Ref)[name.c_str()]->met()/1000.,(*met_Ref)["FinalTrk"]->met()/1000., 1.);
-    	  (m_MET_CorrFinalClus_Ref[type]).at(1)->Fill((*met_Ref)[name.c_str()]->met()/1000.,(*met_Ref)["FinalClus"]->met()/1000., 1.);
+	  (m_MET_CorrFinalTrk_Ref[type]).at(1)->Fill((*met_Ref)[name.c_str()]->met()/1000.,(*met_Ref)["FinalTrk"]->met()/1000., weight);
+	  (m_MET_CorrFinalClus_Ref[type]).at(1)->Fill((*met_Ref)[name.c_str()]->met()/1000.,(*met_Ref)["FinalClus"]->met()/1000., weight);
     	}
     	if(name == "RefTau"){
-    	  (m_MET_CorrFinalTrk_Ref[type]).at(2)->Fill((*met_Ref)[name.c_str()]->met()/1000.,(*met_Ref)["FinalTrk"]->met()/1000., 1.);
-    	  (m_MET_CorrFinalClus_Ref[type]).at(2)->Fill((*met_Ref)[name.c_str()]->met()/1000.,(*met_Ref)["FinalClus"]->met()/1000., 1.);
+	  (m_MET_CorrFinalTrk_Ref[type]).at(2)->Fill((*met_Ref)[name.c_str()]->met()/1000.,(*met_Ref)["FinalTrk"]->met()/1000., weight);
+	  (m_MET_CorrFinalClus_Ref[type]).at(2)->Fill((*met_Ref)[name.c_str()]->met()/1000.,(*met_Ref)["FinalClus"]->met()/1000., weight);
     	}
     	if(name == "Muons"){
-    	  (m_MET_CorrFinalTrk_Ref[type]).at(3)->Fill((*met_Ref)[name.c_str()]->met()/1000.,(*met_Ref)["FinalTrk"]->met()/1000., 1.);
-    	  (m_MET_CorrFinalClus_Ref[type]).at(3)->Fill((*met_Ref)[name.c_str()]->met()/1000.,(*met_Ref)["FinalClus"]->met()/1000., 1.);
+	  (m_MET_CorrFinalTrk_Ref[type]).at(3)->Fill((*met_Ref)[name.c_str()]->met()/1000.,(*met_Ref)["FinalTrk"]->met()/1000., weight);
+	  (m_MET_CorrFinalClus_Ref[type]).at(3)->Fill((*met_Ref)[name.c_str()]->met()/1000.,(*met_Ref)["FinalClus"]->met()/1000., weight);
     	}
     	if(name == "RefJet"){
-    	  (m_MET_CorrFinalTrk_Ref[type]).at(4)->Fill((*met_Ref)[name.c_str()]->met()/1000.,(*met_Ref)["FinalTrk"]->met()/1000., 1.);
-    	  (m_MET_CorrFinalClus_Ref[type]).at(4)->Fill((*met_Ref)[name.c_str()]->met()/1000.,(*met_Ref)["FinalClus"]->met()/1000., 1.);
+	  (m_MET_CorrFinalTrk_Ref[type]).at(4)->Fill((*met_Ref)[name.c_str()]->met()/1000.,(*met_Ref)["FinalTrk"]->met()/1000., weight);
+	  (m_MET_CorrFinalClus_Ref[type]).at(4)->Fill((*met_Ref)[name.c_str()]->met()/1000.,(*met_Ref)["FinalClus"]->met()/1000., weight);
     	}
     	if(name == "PVSoftTrk"){
-    	  (m_MET_CorrFinalTrk_Ref[type]).at(5)->Fill((*met_Ref)[name.c_str()]->met()/1000.,(*met_Ref)["FinalTrk"]->met()/1000., 1.);
+	  (m_MET_CorrFinalTrk_Ref[type]).at(5)->Fill((*met_Ref)[name.c_str()]->met()/1000.,(*met_Ref)["FinalTrk"]->met()/1000., weight);
     	}
     	if(name == "SoftClus"){
-    	  (m_MET_CorrFinalClus_Ref[type]).at(5)->Fill((*met_Ref)[name.c_str()]->met()/1000.,(*met_Ref)["FinalClus"]->met()/1000., 1.);
+	  (m_MET_CorrFinalClus_Ref[type]).at(5)->Fill((*met_Ref)[name.c_str()]->met()/1000.,(*met_Ref)["FinalClus"]->met()/1000., weight);
     	}
       }
 
@@ -1085,30 +1091,30 @@ namespace MissingEtDQA {
       for(const auto& it : *met_Reb) {
     	std::string name = it->name();
     	if(name == "RefEle"){
-    	  (m_MET_CorrFinalTrk_Reb[type]).at(0)->Fill((*met_Reb)[name.c_str()]->met()/1000.,(*met_Reb)["FinalTrk"]->met()/1000., 1.);
-    	  (m_MET_CorrFinalClus_Reb[type]).at(0)->Fill((*met_Reb)[name.c_str()]->met()/1000.,(*met_Reb)["FinalClus"]->met()/1000., 1.);
+	  (m_MET_CorrFinalTrk_Reb[type]).at(0)->Fill((*met_Reb)[name.c_str()]->met()/1000.,(*met_Reb)["FinalTrk"]->met()/1000., weight);
+	  (m_MET_CorrFinalClus_Reb[type]).at(0)->Fill((*met_Reb)[name.c_str()]->met()/1000.,(*met_Reb)["FinalClus"]->met()/1000., weight);
     	}
     	if(name == "RefGamma"){
-    	  (m_MET_CorrFinalTrk_Reb[type]).at(1)->Fill((*met_Reb)[name.c_str()]->met()/1000.,(*met_Reb)["FinalTrk"]->met()/1000., 1.);
-    	  (m_MET_CorrFinalClus_Reb[type]).at(1)->Fill((*met_Reb)[name.c_str()]->met()/1000.,(*met_Reb)["FinalClus"]->met()/1000., 1.);
+	  (m_MET_CorrFinalTrk_Reb[type]).at(1)->Fill((*met_Reb)[name.c_str()]->met()/1000.,(*met_Reb)["FinalTrk"]->met()/1000., weight);
+	  (m_MET_CorrFinalClus_Reb[type]).at(1)->Fill((*met_Reb)[name.c_str()]->met()/1000.,(*met_Reb)["FinalClus"]->met()/1000., weight);
     	}
     	if(name == "RefTau"){
-    	  (m_MET_CorrFinalTrk_Reb[type]).at(2)->Fill((*met_Reb)[name.c_str()]->met()/1000.,(*met_Reb)["FinalTrk"]->met()/1000., 1.);
-    	  (m_MET_CorrFinalClus_Reb[type]).at(2)->Fill((*met_Reb)[name.c_str()]->met()/1000.,(*met_Reb)["FinalClus"]->met()/1000., 1.);
+	  (m_MET_CorrFinalTrk_Reb[type]).at(2)->Fill((*met_Reb)[name.c_str()]->met()/1000.,(*met_Reb)["FinalTrk"]->met()/1000., weight);
+	  (m_MET_CorrFinalClus_Reb[type]).at(2)->Fill((*met_Reb)[name.c_str()]->met()/1000.,(*met_Reb)["FinalClus"]->met()/1000., weight);
     	}
     	if(name == "Muons"){
-    	  (m_MET_CorrFinalTrk_Reb[type]).at(3)->Fill((*met_Reb)[name.c_str()]->met()/1000.,(*met_Reb)["FinalTrk"]->met()/1000., 1.);
-    	  (m_MET_CorrFinalClus_Reb[type]).at(3)->Fill((*met_Reb)[name.c_str()]->met()/1000.,(*met_Reb)["FinalClus"]->met()/1000., 1.);
+	  (m_MET_CorrFinalTrk_Reb[type]).at(3)->Fill((*met_Reb)[name.c_str()]->met()/1000.,(*met_Reb)["FinalTrk"]->met()/1000., weight);
+	  (m_MET_CorrFinalClus_Reb[type]).at(3)->Fill((*met_Reb)[name.c_str()]->met()/1000.,(*met_Reb)["FinalClus"]->met()/1000., weight);
     	}
     	if(name == "RefJet"){
-    	  (m_MET_CorrFinalTrk_Reb[type]).at(4)->Fill((*met_Reb)[name.c_str()]->met()/1000.,(*met_Reb)["FinalTrk"]->met()/1000., 1.);
-    	  (m_MET_CorrFinalClus_Reb[type]).at(4)->Fill((*met_Reb)[name.c_str()]->met()/1000.,(*met_Reb)["FinalClus"]->met()/1000., 1.);
+	  (m_MET_CorrFinalTrk_Reb[type]).at(4)->Fill((*met_Reb)[name.c_str()]->met()/1000.,(*met_Reb)["FinalTrk"]->met()/1000., weight);
+	  (m_MET_CorrFinalClus_Reb[type]).at(4)->Fill((*met_Reb)[name.c_str()]->met()/1000.,(*met_Reb)["FinalClus"]->met()/1000., weight);
     	}
     	if(name == "PVSoftTrk"){
-    	  (m_MET_CorrFinalTrk_Reb[type]).at(5)->Fill((*met_Reb)[name.c_str()]->met()/1000.,(*met_Reb)["FinalTrk"]->met()/1000., 1.);
+	  (m_MET_CorrFinalTrk_Reb[type]).at(5)->Fill((*met_Reb)[name.c_str()]->met()/1000.,(*met_Reb)["FinalTrk"]->met()/1000., weight);
     	}
     	if(name == "SoftClus"){
-    	  (m_MET_CorrFinalClus_Reb[type]).at(5)->Fill((*met_Reb)[name.c_str()]->met()/1000.,(*met_Reb)["FinalClus"]->met()/1000., 1.);
+	  (m_MET_CorrFinalClus_Reb[type]).at(5)->Fill((*met_Reb)[name.c_str()]->met()/1000.,(*met_Reb)["FinalClus"]->met()/1000., weight);
     	}
       }
 
@@ -1116,22 +1122,22 @@ namespace MissingEtDQA {
       if(m_doTruth)
     	{
     	  ATH_MSG_INFO( "  Resolution:" );
-    	  (m_MET_Resolution_Ref[type]).at(0)->Fill(((*met_Ref)["FinalClus"]->mpx()-(*met_Truth)["NonInt"]->mpx())/1000., 1.);
-    	  (m_MET_Resolution_Ref[type]).at(1)->Fill(((*met_Ref)["FinalClus"]->mpy()-(*met_Truth)["NonInt"]->mpy())/1000., 1.);
-    	  (m_MET_Resolution_Ref[type]).at(2)->Fill(((*met_Ref)["FinalTrk"]->mpx()-(*met_Truth)["NonInt"]->mpx())/1000., 1.);
-    	  (m_MET_Resolution_Ref[type]).at(3)->Fill(((*met_Ref)["FinalTrk"]->mpy()-(*met_Truth)["NonInt"]->mpy())/1000., 1.);
-    	  (m_MET_Resolution_Reb[type]).at(0)->Fill(((*met_Reb)["FinalClus"]->mpx()-(*met_Truth)["NonInt"]->mpx())/1000., 1.);
-    	  (m_MET_Resolution_Reb[type]).at(1)->Fill(((*met_Reb)["FinalClus"]->mpy()-(*met_Truth)["NonInt"]->mpy())/1000., 1.);
-    	  (m_MET_Resolution_Reb[type]).at(2)->Fill(((*met_Reb)["FinalTrk"]->mpx()-(*met_Truth)["NonInt"]->mpx())/1000., 1.);
-    	  (m_MET_Resolution_Reb[type]).at(3)->Fill(((*met_Reb)["FinalTrk"]->mpy()-(*met_Truth)["NonInt"]->mpy())/1000., 1.);
+	  (m_MET_Resolution_Ref[type]).at(0)->Fill(((*met_Ref)["FinalClus"]->mpx()-(*met_Truth)["NonInt"]->mpx())/1000., weight);
+	  (m_MET_Resolution_Ref[type]).at(1)->Fill(((*met_Ref)["FinalClus"]->mpy()-(*met_Truth)["NonInt"]->mpy())/1000., weight);
+	  (m_MET_Resolution_Ref[type]).at(2)->Fill(((*met_Ref)["FinalTrk"]->mpx()-(*met_Truth)["NonInt"]->mpx())/1000., weight);
+	  (m_MET_Resolution_Ref[type]).at(3)->Fill(((*met_Ref)["FinalTrk"]->mpy()-(*met_Truth)["NonInt"]->mpy())/1000., weight);
+	  (m_MET_Resolution_Reb[type]).at(0)->Fill(((*met_Reb)["FinalClus"]->mpx()-(*met_Truth)["NonInt"]->mpx())/1000., weight);
+	  (m_MET_Resolution_Reb[type]).at(1)->Fill(((*met_Reb)["FinalClus"]->mpy()-(*met_Truth)["NonInt"]->mpy())/1000., weight);
+	  (m_MET_Resolution_Reb[type]).at(2)->Fill(((*met_Reb)["FinalTrk"]->mpx()-(*met_Truth)["NonInt"]->mpx())/1000., weight);
+	  (m_MET_Resolution_Reb[type]).at(3)->Fill(((*met_Reb)["FinalTrk"]->mpy()-(*met_Truth)["NonInt"]->mpy())/1000., weight);
     	}
 
       //Fill MET Significance
       ATH_MSG_INFO( "  MET_significance:" );
-      if( (*met_Ref)["FinalClus"]->sumet() != 0) (m_MET_Significance_Ref[type]).at(0)->Fill((*met_Ref)["FinalClus"]->met()/sqrt((*met_Ref)["FinalClus"]->sumet()*1000.), 1.);
-      if( (*met_Ref)["FinalTrk"]->sumet() != 0) (m_MET_Significance_Ref[type]).at(1)->Fill((*met_Ref)["FinalTrk"]->met()/sqrt((*met_Ref)["FinalTrk"]->sumet()*1000.), 1.);
-      if( (*met_Reb)["FinalClus"]->sumet() != 0) (m_MET_Significance_Reb[type]).at(0)->Fill((*met_Reb)["FinalClus"]->met()/sqrt((*met_Reb)["FinalClus"]->sumet()*1000.), 1.);
-      if( (*met_Reb)["FinalTrk"]->sumet() != 0) (m_MET_Significance_Reb[type]).at(1)->Fill((*met_Reb)["FinalTrk"]->met()/sqrt((*met_Reb)["FinalTrk"]->sumet()*1000.), 1.);
+      if( (*met_Ref)["FinalClus"]->sumet() != 0) (m_MET_Significance_Ref[type]).at(0)->Fill((*met_Ref)["FinalClus"]->met()/sqrt((*met_Ref)["FinalClus"]->sumet()*1000.), weight);
+      if( (*met_Ref)["FinalTrk"]->sumet() != 0) (m_MET_Significance_Ref[type]).at(1)->Fill((*met_Ref)["FinalTrk"]->met()/sqrt((*met_Ref)["FinalTrk"]->sumet()*1000.), weight);
+      if( (*met_Reb)["FinalClus"]->sumet() != 0) (m_MET_Significance_Reb[type]).at(0)->Fill((*met_Reb)["FinalClus"]->met()/sqrt((*met_Reb)["FinalClus"]->sumet()*1000.), weight);
+      if( (*met_Reb)["FinalTrk"]->sumet() != 0) (m_MET_Significance_Reb[type]).at(1)->Fill((*met_Reb)["FinalTrk"]->met()/sqrt((*met_Reb)["FinalTrk"]->sumet()*1000.), weight);
 
       //Fill Diff histograms
       TLorentzVector target_tlv;
@@ -1139,51 +1145,51 @@ namespace MissingEtDQA {
     	if(it->name() == "RefEle"){
     	  if(is_electron or (it->sumet() > 0)){
     	    target_tlv.SetPxPyPzE(-it->mpx(), -it->mpy(), 0, it->met());
-    	    (m_MET_Diff_Ref[type]).at(0)->Fill((target_tlv.Pt() - el_tlv.Pt())/1000., 1.);
-    	    (m_MET_Diff_Ref_x[type]).at(0)->Fill((target_tlv.Px() - el_tlv.Px())/1000., 1.);
-    	    (m_MET_Diff_Ref_y[type]).at(0)->Fill((target_tlv.Py() - el_tlv.Py())/1000., 1.);
-    	    (m_MET_Diff_Ref_phi[type]).at(0)->Fill(el_tlv.DeltaPhi(target_tlv), 1.);
-    	    (m_MET_Diff_Ref_sum[type]).at(0)->Fill((it->sumet() - sum_el)/1000., 1.);
+	    (m_MET_Diff_Ref[type]).at(0)->Fill((target_tlv.Pt() - el_tlv.Pt())/1000., weight);
+	    (m_MET_Diff_Ref_x[type]).at(0)->Fill((target_tlv.Px() - el_tlv.Px())/1000., weight);
+	    (m_MET_Diff_Ref_y[type]).at(0)->Fill((target_tlv.Py() - el_tlv.Py())/1000., weight);
+	    (m_MET_Diff_Ref_phi[type]).at(0)->Fill(el_tlv.DeltaPhi(target_tlv), weight);
+	    (m_MET_Diff_Ref_sum[type]).at(0)->Fill((it->sumet() - sum_el)/1000., weight);
     	  }
     	}
     	if(it->name() == "RefGamma"){
     	  if(is_photon or (it->sumet() > 0)){
     	    target_tlv.SetPxPyPzE(-it->mpx(), -it->mpy(), 0, it->met());
-    	    (m_MET_Diff_Ref[type]).at(1)->Fill((target_tlv.Pt() - photon_tlv.Pt())/1000., 1.);
-    	    (m_MET_Diff_Ref_x[type]).at(1)->Fill((target_tlv.Px() - photon_tlv.Px())/1000., 1.);
-    	    (m_MET_Diff_Ref_y[type]).at(1)->Fill((target_tlv.Py() - photon_tlv.Py())/1000., 1.);
-    	    (m_MET_Diff_Ref_phi[type]).at(1)->Fill(photon_tlv.DeltaPhi(target_tlv), 1.);
-    	    (m_MET_Diff_Ref_sum[type]).at(1)->Fill((it->sumet() - sum_photon)/1000., 1.);
+	    (m_MET_Diff_Ref[type]).at(1)->Fill((target_tlv.Pt() - photon_tlv.Pt())/1000., weight);
+	    (m_MET_Diff_Ref_x[type]).at(1)->Fill((target_tlv.Px() - photon_tlv.Px())/1000., weight);
+	    (m_MET_Diff_Ref_y[type]).at(1)->Fill((target_tlv.Py() - photon_tlv.Py())/1000., weight);
+	    (m_MET_Diff_Ref_phi[type]).at(1)->Fill(photon_tlv.DeltaPhi(target_tlv), weight);
+	    (m_MET_Diff_Ref_sum[type]).at(1)->Fill((it->sumet() - sum_photon)/1000., weight);
     	  }
     	}
     	if(it->name() == "RefTau"){
     	  if(is_tau or (it->sumet() > 0)){
     	    target_tlv.SetPxPyPzE(-it->mpx(), -it->mpy(), 0, it->met());
-    	    (m_MET_Diff_Ref[type]).at(2)->Fill((target_tlv.Pt() - tau_tlv.Pt())/1000., 1.);
-    	    (m_MET_Diff_Ref_x[type]).at(2)->Fill((target_tlv.Px() - tau_tlv.Px())/1000., 1.);
-    	    (m_MET_Diff_Ref_y[type]).at(2)->Fill((target_tlv.Py() - tau_tlv.Py())/1000., 1.);
-    	    (m_MET_Diff_Ref_phi[type]).at(2)->Fill(tau_tlv.DeltaPhi(target_tlv), 1.);
-    	    (m_MET_Diff_Ref_sum[type]).at(2)->Fill((it->sumet() - sum_tau)/1000., 1.);
+	    (m_MET_Diff_Ref[type]).at(2)->Fill((target_tlv.Pt() - tau_tlv.Pt())/1000., weight);
+	    (m_MET_Diff_Ref_x[type]).at(2)->Fill((target_tlv.Px() - tau_tlv.Px())/1000., weight);
+	    (m_MET_Diff_Ref_y[type]).at(2)->Fill((target_tlv.Py() - tau_tlv.Py())/1000., weight);
+	    (m_MET_Diff_Ref_phi[type]).at(2)->Fill(tau_tlv.DeltaPhi(target_tlv), weight);
+	    (m_MET_Diff_Ref_sum[type]).at(2)->Fill((it->sumet() - sum_tau)/1000., weight);
     	  }
     	}
     	if(it->name() == "Muons"){
     	  if(is_muon or (it->sumet() > 0)){
     	    target_tlv.SetPxPyPzE(-it->mpx(), -it->mpy(), 0, it->met());
-    	    (m_MET_Diff_Ref[type]).at(3)->Fill((target_tlv.Pt() - mu_tlv.Pt())/1000., 1.);
-    	    (m_MET_Diff_Ref_x[type]).at(3)->Fill((target_tlv.Px() - mu_tlv.Px())/1000., 1.);
-    	    (m_MET_Diff_Ref_y[type]).at(3)->Fill((target_tlv.Py() - mu_tlv.Py())/1000., 1.);
-    	    (m_MET_Diff_Ref_phi[type]).at(3)->Fill(mu_tlv.DeltaPhi(target_tlv), 1.);
-    	    (m_MET_Diff_Ref_sum[type]).at(3)->Fill((it->sumet() - sum_mu)/1000., 1.);
+	    (m_MET_Diff_Ref[type]).at(3)->Fill((target_tlv.Pt() - mu_tlv.Pt())/1000., weight);
+	    (m_MET_Diff_Ref_x[type]).at(3)->Fill((target_tlv.Px() - mu_tlv.Px())/1000., weight);
+	    (m_MET_Diff_Ref_y[type]).at(3)->Fill((target_tlv.Py() - mu_tlv.Py())/1000., weight);
+	    (m_MET_Diff_Ref_phi[type]).at(3)->Fill(mu_tlv.DeltaPhi(target_tlv), weight);
+	    (m_MET_Diff_Ref_sum[type]).at(3)->Fill((it->sumet() - sum_mu)/1000., weight);
     	  }
     	}
     	if(it->name() == "RefJet"){
     	  if(is_jet or (it->sumet() > 0)){
     	    target_tlv.SetPxPyPzE(-it->mpx(), -it->mpy(), 0, it->met());
-    	    (m_MET_Diff_Ref[type]).at(4)->Fill((target_tlv.Pt() - jet_tlv.Pt())/1000., 1.);
-    	    (m_MET_Diff_Ref_x[type]).at(4)->Fill((target_tlv.Px() - jet_tlv.Px())/1000., 1.);
-    	    (m_MET_Diff_Ref_y[type]).at(4)->Fill((target_tlv.Py() - jet_tlv.Py())/1000., 1.);
-    	    (m_MET_Diff_Ref_phi[type]).at(4)->Fill(jet_tlv.DeltaPhi(target_tlv), 1.);
-    	    (m_MET_Diff_Ref_sum[type]).at(4)->Fill((it->sumet() - sum_jet)/1000., 1.);
+	    (m_MET_Diff_Ref[type]).at(4)->Fill((target_tlv.Pt() - jet_tlv.Pt())/1000., weight);
+	    (m_MET_Diff_Ref_x[type]).at(4)->Fill((target_tlv.Px() - jet_tlv.Px())/1000., weight);
+	    (m_MET_Diff_Ref_y[type]).at(4)->Fill((target_tlv.Py() - jet_tlv.Py())/1000., weight);
+	    (m_MET_Diff_Ref_phi[type]).at(4)->Fill(jet_tlv.DeltaPhi(target_tlv), weight);
+	    (m_MET_Diff_Ref_sum[type]).at(4)->Fill((it->sumet() - sum_jet)/1000., weight);
     	  }
     	}
       }
@@ -1202,51 +1208,51 @@ namespace MissingEtDQA {
     	if(it->name() == "RefEle"){
     	  if(is_electron or (it->sumet() > 0)){
     	    target_tlv.SetPxPyPzE(-it->mpx(), -it->mpy(), 0, it->met());
-    	    (m_MET_Diff_Reb[type]).at(0)->Fill((target_tlv.Pt() - el_tlv.Pt())/1000., 1.);
-    	    (m_MET_Diff_Reb_x[type]).at(0)->Fill((target_tlv.Px() - el_tlv.Px())/1000., 1.);
-    	    (m_MET_Diff_Reb_y[type]).at(0)->Fill((target_tlv.Py() - el_tlv.Py())/1000., 1.);
-    	    (m_MET_Diff_Reb_phi[type]).at(0)->Fill(el_tlv.DeltaPhi(target_tlv), 1.);
-    	    (m_MET_Diff_Reb_sum[type]).at(0)->Fill((it->sumet() - sum_el)/1000., 1.);
+    	    (m_MET_Diff_Reb[type]).at(0)->Fill((target_tlv.Pt() - el_tlv.Pt())/1000., weight);
+    	    (m_MET_Diff_Reb_x[type]).at(0)->Fill((target_tlv.Px() - el_tlv.Px())/1000., weight);
+    	    (m_MET_Diff_Reb_y[type]).at(0)->Fill((target_tlv.Py() - el_tlv.Py())/1000., weight);
+    	    (m_MET_Diff_Reb_phi[type]).at(0)->Fill(el_tlv.DeltaPhi(target_tlv), weight);
+    	    (m_MET_Diff_Reb_sum[type]).at(0)->Fill((it->sumet() - sum_el)/1000., weight);
     	  }
     	}
     	if(it->name() == "RefGamma"){
     	  if(is_photon or (it->sumet() > 0)){
     	    target_tlv.SetPxPyPzE(-it->mpx(), -it->mpy(), 0, it->met());
-    	    (m_MET_Diff_Reb[type]).at(1)->Fill((target_tlv.Pt() - photon_tlv.Pt())/1000., 1.);
-    	    (m_MET_Diff_Reb_x[type]).at(1)->Fill((target_tlv.Px() - photon_tlv.Px())/1000., 1.);
-    	    (m_MET_Diff_Reb_y[type]).at(1)->Fill((target_tlv.Py() - photon_tlv.Py())/1000., 1.);
-    	    (m_MET_Diff_Reb_phi[type]).at(1)->Fill(photon_tlv.DeltaPhi(target_tlv), 1.);
-    	    (m_MET_Diff_Reb_sum[type]).at(1)->Fill((it->sumet() - sum_photon)/1000., 1.);
+    	    (m_MET_Diff_Reb[type]).at(1)->Fill((target_tlv.Pt() - photon_tlv.Pt())/1000., weight);
+    	    (m_MET_Diff_Reb_x[type]).at(1)->Fill((target_tlv.Px() - photon_tlv.Px())/1000., weight);
+    	    (m_MET_Diff_Reb_y[type]).at(1)->Fill((target_tlv.Py() - photon_tlv.Py())/1000., weight);
+    	    (m_MET_Diff_Reb_phi[type]).at(1)->Fill(photon_tlv.DeltaPhi(target_tlv), weight);
+    	    (m_MET_Diff_Reb_sum[type]).at(1)->Fill((it->sumet() - sum_photon)/1000., weight);
     	  }
     	}
     	if(it->name() == "RefTau"){
     	  if(is_tau or (it->sumet() > 0)){
     	    target_tlv.SetPxPyPzE(-it->mpx(), -it->mpy(), 0, it->met());
-    	    (m_MET_Diff_Reb[type]).at(2)->Fill((target_tlv.Pt() - tau_tlv.Pt())/1000., 1.);
-    	    (m_MET_Diff_Reb_x[type]).at(2)->Fill((target_tlv.Px() - tau_tlv.Px())/1000., 1.);
-    	    (m_MET_Diff_Reb_y[type]).at(2)->Fill((target_tlv.Py() - tau_tlv.Py())/1000., 1.);
-    	    (m_MET_Diff_Reb_phi[type]).at(2)->Fill(tau_tlv.DeltaPhi(target_tlv), 1.);
-    	    (m_MET_Diff_Reb_sum[type]).at(2)->Fill((it->sumet() - sum_tau)/1000., 1.);
+    	    (m_MET_Diff_Reb[type]).at(2)->Fill((target_tlv.Pt() - tau_tlv.Pt())/1000., weight);
+    	    (m_MET_Diff_Reb_x[type]).at(2)->Fill((target_tlv.Px() - tau_tlv.Px())/1000., weight);
+    	    (m_MET_Diff_Reb_y[type]).at(2)->Fill((target_tlv.Py() - tau_tlv.Py())/1000., weight);
+    	    (m_MET_Diff_Reb_phi[type]).at(2)->Fill(tau_tlv.DeltaPhi(target_tlv), weight);
+    	    (m_MET_Diff_Reb_sum[type]).at(2)->Fill((it->sumet() - sum_tau)/1000., weight);
     	  }
     	}
     	if(it->name() == "Muons"){
     	  if(is_muon or (it->sumet() > 0)){
     	    target_tlv.SetPxPyPzE(-it->mpx(), -it->mpy(), 0, it->met());
-    	    (m_MET_Diff_Reb[type]).at(3)->Fill((target_tlv.Pt() - mu_tlv.Pt())/1000., 1.);
-    	    (m_MET_Diff_Reb_x[type]).at(3)->Fill((target_tlv.Px() - mu_tlv.Px())/1000., 1.);
-    	    (m_MET_Diff_Reb_y[type]).at(3)->Fill((target_tlv.Py() - mu_tlv.Py())/1000., 1.);
-    	    (m_MET_Diff_Reb_phi[type]).at(3)->Fill(mu_tlv.DeltaPhi(target_tlv), 1.);
-    	    (m_MET_Diff_Reb_sum[type]).at(3)->Fill((it->sumet() - sum_mu)/1000., 1.);
+    	    (m_MET_Diff_Reb[type]).at(3)->Fill((target_tlv.Pt() - mu_tlv.Pt())/1000., weight);
+    	    (m_MET_Diff_Reb_x[type]).at(3)->Fill((target_tlv.Px() - mu_tlv.Px())/1000., weight);
+    	    (m_MET_Diff_Reb_y[type]).at(3)->Fill((target_tlv.Py() - mu_tlv.Py())/1000., weight);
+    	    (m_MET_Diff_Reb_phi[type]).at(3)->Fill(mu_tlv.DeltaPhi(target_tlv), weight);
+    	    (m_MET_Diff_Reb_sum[type]).at(3)->Fill((it->sumet() - sum_mu)/1000., weight);
     	  }
     	}
     	if(it->name() == "RefJet"){
     	  if(is_jet or (it->sumet() > 0)){
     	    target_tlv.SetPxPyPzE(-it->mpx(), -it->mpy(), 0, it->met());
-    	    (m_MET_Diff_Reb[type]).at(4)->Fill((target_tlv.Pt() - jetReb_tlv.Pt())/1000., 1.);
-    	    (m_MET_Diff_Reb_x[type]).at(4)->Fill((target_tlv.Px() - jetReb_tlv.Px())/1000., 1.);
-    	    (m_MET_Diff_Reb_y[type]).at(4)->Fill((target_tlv.Py() - jetReb_tlv.Py())/1000., 1.);
-    	    (m_MET_Diff_Reb_phi[type]).at(4)->Fill(jetReb_tlv.DeltaPhi(target_tlv), 1.);
-    	    (m_MET_Diff_Reb_sum[type]).at(4)->Fill((it->sumet() - sum_jetReb)/1000., 1.);
+    	    (m_MET_Diff_Reb[type]).at(4)->Fill((target_tlv.Pt() - jetReb_tlv.Pt())/1000., weight);
+    	    (m_MET_Diff_Reb_x[type]).at(4)->Fill((target_tlv.Px() - jetReb_tlv.Px())/1000., weight);
+    	    (m_MET_Diff_Reb_y[type]).at(4)->Fill((target_tlv.Py() - jetReb_tlv.Py())/1000., weight);
+    	    (m_MET_Diff_Reb_phi[type]).at(4)->Fill(jetReb_tlv.DeltaPhi(target_tlv), weight);
+    	    (m_MET_Diff_Reb_sum[type]).at(4)->Fill((it->sumet() - sum_jetReb)/1000., weight);
     	  }
     	}
       }
@@ -1276,11 +1282,11 @@ namespace MissingEtDQA {
       	  ATH_MSG_WARNING("Building MET FinalClus sum failed.");
       	}
 
-      	m_MET_Calo->Fill((*met_Calo)["FinalClus"]->met()/1000., 1.);
-      	m_MET_Calo_x->Fill((*met_Calo)["FinalClus"]->mpx()/1000., 1.);
-      	m_MET_Calo_y->Fill((*met_Calo)["FinalClus"]->mpy()/1000., 1.);
-      	m_MET_Calo_phi->Fill((*met_Calo)["FinalClus"]->phi(), 1.);
-      	m_MET_Calo_sum->Fill((*met_Calo)["FinalClus"]->sumet()/1000., 1.);
+	m_MET_Calo->Fill((*met_Calo)["FinalClus"]->met()/1000., weight);
+	m_MET_Calo_x->Fill((*met_Calo)["FinalClus"]->mpx()/1000., weight);
+	m_MET_Calo_y->Fill((*met_Calo)["FinalClus"]->mpy()/1000., weight);
+	m_MET_Calo_phi->Fill((*met_Calo)["FinalClus"]->phi(), weight);
+	m_MET_Calo_sum->Fill((*met_Calo)["FinalClus"]->sumet()/1000., weight);
 
       }
 
@@ -1289,11 +1295,11 @@ namespace MissingEtDQA {
     // Fill MET Track
     ATH_MSG_INFO( "  MET_Track:" );
 
-    m_MET_Track->Fill((*met_Track)["Track"]->met()/1000., 1.);
-    m_MET_Track_x->Fill((*met_Track)["Track"]->mpx()/1000., 1.);
-    m_MET_Track_y->Fill((*met_Track)["Track"]->mpy()/1000., 1.);
-    m_MET_Track_phi->Fill((*met_Track)["Track"]->phi(), 1.);
-    m_MET_Track_sum->Fill((*met_Track)["Track"]->sumet()/1000., 1.);
+    m_MET_Track->Fill((*met_Track)["Track"]->met()/1000., weight);
+    m_MET_Track_x->Fill((*met_Track)["Track"]->mpx()/1000., weight);
+    m_MET_Track_y->Fill((*met_Track)["Track"]->mpy()/1000., weight);
+    m_MET_Track_phi->Fill((*met_Track)["Track"]->phi(), weight);
+    m_MET_Track_sum->Fill((*met_Track)["Track"]->sumet()/1000., weight);
     
     const xAOD::VertexContainer *vxCont = 0;
     ATH_CHECK( evtStore()->retrieve(vxCont, "PrimaryVertices") );
@@ -1302,17 +1308,17 @@ namespace MissingEtDQA {
       const std::string name = "PVTrack_vx"+std::to_string(N);
       if(vx->vertexType()!=xAOD::VxType::NoVtx) {
 	if(vx->vertexType()==xAOD::VxType::PriVtx) {
-	  m_MET_PVTrack_Nominal->Fill((*met_Track)[name]->met()/1000., 1.);
-	  m_MET_PVTrack_Nominal_x->Fill((*met_Track)[name]->mpx()/1000., 1.);
-	  m_MET_PVTrack_Nominal_y->Fill((*met_Track)[name]->mpy()/1000., 1.);
-	  m_MET_PVTrack_Nominal_phi->Fill((*met_Track)[name]->phi(), 1.);
-	  m_MET_PVTrack_Nominal_sum->Fill((*met_Track)[name]->sumet()/1000., 1.);
+	  m_MET_PVTrack_Nominal->Fill((*met_Track)[name]->met()/1000., weight);
+	  m_MET_PVTrack_Nominal_x->Fill((*met_Track)[name]->mpx()/1000., weight);
+	  m_MET_PVTrack_Nominal_y->Fill((*met_Track)[name]->mpy()/1000., weight);
+	  m_MET_PVTrack_Nominal_phi->Fill((*met_Track)[name]->phi(), weight);
+	  m_MET_PVTrack_Nominal_sum->Fill((*met_Track)[name]->sumet()/1000., weight);
 	} else { 
-	  m_MET_PVTrack_Pileup->Fill((*met_Track)[name]->met()/1000., 1.);
-	  m_MET_PVTrack_Pileup_x->Fill((*met_Track)[name]->mpx()/1000., 1.);
-	  m_MET_PVTrack_Pileup_y->Fill((*met_Track)[name]->mpy()/1000., 1.);
-	  m_MET_PVTrack_Pileup_phi->Fill((*met_Track)[name]->phi(), 1.);
-	  m_MET_PVTrack_Pileup_sum->Fill((*met_Track)[name]->sumet()/1000., 1.);
+	  m_MET_PVTrack_Pileup->Fill((*met_Track)[name]->met()/1000., weight);
+	  m_MET_PVTrack_Pileup_x->Fill((*met_Track)[name]->mpx()/1000., weight);
+	  m_MET_PVTrack_Pileup_y->Fill((*met_Track)[name]->mpy()/1000., weight);
+	  m_MET_PVTrack_Pileup_phi->Fill((*met_Track)[name]->phi(), weight);
+	  m_MET_PVTrack_Pileup_sum->Fill((*met_Track)[name]->sumet()/1000., weight);
 	}
       }
     }
diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/python/SpecialTrackAssociatorConfig.py b/PhysicsAnalysis/JetTagging/JetTagTools/python/SpecialTrackAssociatorConfig.py
index b339ec19c00e654a8db29771ac0087bbc4c8392b..15440572471e0dd5fe0dd5d3b70dfbd7da3a2312 100644
--- a/PhysicsAnalysis/JetTagging/JetTagTools/python/SpecialTrackAssociatorConfig.py
+++ b/PhysicsAnalysis/JetTagging/JetTagTools/python/SpecialTrackAssociatorConfig.py
@@ -1,10 +1,9 @@
 # Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 
 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
-from AthenaConfiguration.ComponentFactory import CompFactory
 
-# import the TrackToVertexIPEstimator configurable
-CP__TrackVertexAssociationTool=CompFactory.CP.TrackVertexAssociationTool
+# Import a reco TTVA tool
+from TrackVertexAssociationTool.getTTVAToolForReco import getTTVAToolForReco
 
 def SpecialTrackAssociatorCfg( name = 'SpecialTrackAssociator', PrimaryVertexCollectionName="", useBTagFlagsDefaults = True, **options ):
     """Sets up a SpecialTrackAssociator tool and returns it.
@@ -17,11 +16,10 @@ def SpecialTrackAssociatorCfg( name = 'SpecialTrackAssociator', PrimaryVertexCol
     output: The actual tool."""
     acc = ComponentAccumulator()
     if useBTagFlagsDefaults:
-        defaults = { 'WorkingPoint'           : 'Loose',
-                   }
+        defaults = { 'WorkingPoint': 'Loose' }
     for option in defaults:
         options.setdefault(option, defaults[option])
     options['name'] = name
-    acc.setPrivateTools(CP__TrackVertexAssociationTool( **options))
- 
+    acc.setPrivateTools(getTTVAToolForReco(returnCompFactory=True, **options))
+
     return acc
diff --git a/PhysicsAnalysis/JpsiUpsilonTools/JpsiUpsilonTools/JpsiPlus2Tracks.h b/PhysicsAnalysis/JpsiUpsilonTools/JpsiUpsilonTools/JpsiPlus2Tracks.h
index e297f381ed83762af887eaa4f469414db19b9a6d..b61f20f0892b7dc6d3c6adb73110cc4460ddadc9 100644
--- a/PhysicsAnalysis/JpsiUpsilonTools/JpsiUpsilonTools/JpsiPlus2Tracks.h
+++ b/PhysicsAnalysis/JpsiUpsilonTools/JpsiUpsilonTools/JpsiPlus2Tracks.h
@@ -61,7 +61,7 @@ namespace Analysis {
         bool  passCuts(xAOD::BPhysHelper &bHelper, const std::vector<double> &masses, const std::string &str) const;
         bool  vertexCuts(xAOD::BPhysHelper &bHelper) const;
         xAOD::Vertex* fit(const std::vector<const xAOD::TrackParticle*>&,
-                          const xAOD::TrackParticleContainer*, const xAOD::Vertex* pv, const xAOD::TrackParticleContainer* GSL) const;
+                          const xAOD::TrackParticleContainer*, const xAOD::TrackParticleContainer* GSL) const;
         //-------------------------------------------------------------------------------------
         
     private:
@@ -106,9 +106,6 @@ namespace Analysis {
         // (to reduce the pileup contribution before vertexing)
         std::vector<double> m_manualMassHypo;
         int m_requiredNMuons;
-        // fit with PV
-        bool m_vertexFittingWithPV;
-        SG::ReadHandleKey<xAOD::VertexContainer> m_PVerticesCollection;
         std::vector<double> m_altMassMuonTracks;
         std::vector<double>  m_mumukkMasses;
         std::vector<double>  m_mumupipiMasses;
diff --git a/PhysicsAnalysis/JpsiUpsilonTools/JpsiUpsilonTools/JpsiUpsilonCommon.h b/PhysicsAnalysis/JpsiUpsilonTools/JpsiUpsilonTools/JpsiUpsilonCommon.h
index 0be5b4c8646fc77b14f51147604dfec227208dfc..6a4ccb92226b5efb199400cc42c3affd030bcdfa 100644
--- a/PhysicsAnalysis/JpsiUpsilonTools/JpsiUpsilonTools/JpsiUpsilonCommon.h
+++ b/PhysicsAnalysis/JpsiUpsilonTools/JpsiUpsilonTools/JpsiUpsilonCommon.h
@@ -16,6 +16,7 @@ namespace xAOD{
 }
 
 namespace Analysis {
+   class PrimaryVertexRefitter;
 
    class JpsiUpsilonCommon{
     public:
@@ -29,7 +30,7 @@ namespace Analysis {
         static bool   cutRange(double value, double min, double max);
         static bool   cutAcceptGreaterOR(const std::vector<double> &values, double min);
         static bool   cutAcceptGreater(double value, double min);
-        static const xAOD::Vertex* ClosestPV(xAOD::BPhysHelper&, const xAOD::VertexContainer*);
+        static const xAOD::Vertex* ClosestRefPV(xAOD::BPhysHelper&, const xAOD::VertexContainer*, const Analysis::PrimaryVertexRefitter*);
         template< size_t N>
         static bool isContainedIn(const xAOD::TrackParticle*, const std::array<const xAOD::TrackParticle*, N>& );
    };
diff --git a/PhysicsAnalysis/JpsiUpsilonTools/src/JpsiPlus2Tracks.cxx b/PhysicsAnalysis/JpsiUpsilonTools/src/JpsiPlus2Tracks.cxx
index c3ec88a7bda2b2d6becc437eb6117d9333153531..40ab1aa8b838985924b6ae83d10f7797c5982755 100644
--- a/PhysicsAnalysis/JpsiUpsilonTools/src/JpsiPlus2Tracks.cxx
+++ b/PhysicsAnalysis/JpsiUpsilonTools/src/JpsiPlus2Tracks.cxx
@@ -46,7 +46,6 @@ namespace Analysis {
         ATH_CHECK(m_TrkParticleGSFCollection.initialize(!m_TrkParticleGSFCollection.key().empty()));
         if(m_MuonsUsedInJpsi.key() == "NONE") m_MuonsUsedInJpsi = "";
         ATH_CHECK(m_MuonsUsedInJpsi.initialize(!m_MuonsUsedInJpsi.key().empty()));
-        ATH_CHECK(m_PVerticesCollection.initialize());
 
         if(!m_manualMassHypo.empty() && m_manualMassHypo.size() !=4){
             ATH_MSG_FATAL("Invalid number of elements given for manualMass hypothesis - needs 4");
@@ -120,9 +119,7 @@ namespace Analysis {
     m_finalDiTrackMassLower(-1.0),
     m_finalDiTrackPt(-1.0),
     m_trkDeltaZ(-1.0),
-    m_requiredNMuons(0),
-    m_vertexFittingWithPV(false),
-    m_PVerticesCollection("PrimaryVertices")
+    m_requiredNMuons(0)
     {
         declareInterface<JpsiPlus2Tracks>(this);
         declareProperty("pionpionHypothesis",m_pipiMassHyp);
@@ -162,8 +159,6 @@ namespace Analysis {
         declareProperty("TrkDeltaZ"             ,m_trkDeltaZ             );
         declareProperty("ManualMassHypo",        m_manualMassHypo);
         declareProperty("RequireNMuonTracks",   m_requiredNMuons);
-        declareProperty("UseVertexFittingWithPV", m_vertexFittingWithPV);
-        declareProperty("VertexContainer", m_PVerticesCollection);
         declareProperty("AlternativeMassConstraintTrack", m_altMassMuonTracks);
         declareProperty("UseGSFTrackIndices", m_useGSFTrackIndices);
         declareProperty("GSFCollection", m_TrkParticleGSFCollection);
@@ -228,14 +223,6 @@ namespace Analysis {
             ATH_MSG_DEBUG("Muon container size "<< importedMuonCollection->size());
         }
 
-        // Get primary vertices
-        const xAOD::VertexContainer* importedPVerticesCollection(0);
-        if(m_vertexFittingWithPV){
-           SG::ReadHandle<xAOD::VertexContainer> h(m_PVerticesCollection);
-           ATH_CHECK(h.isValid());
-           importedPVerticesCollection = h.cptr();
-           ATH_MSG_DEBUG("PVertices container size "<< importedPVerticesCollection->size());
-        }
         // Typedef for vectors of tracks and VxCandidates
         typedef std::vector<const xAOD::TrackParticle*> TrackBag;
         
@@ -412,7 +399,7 @@ namespace Analysis {
                     if (!passes4TrackMass) continue;
 
                     //Managed pointer, "release" if you don't want it deleted. Automatically deleted otherwise
-                    std::unique_ptr<xAOD::Vertex> bVertex (fit(QuadletTracks, importedTrackCollection, nullptr, importedGSFTrackCollection)); // do vertexing
+                    std::unique_ptr<xAOD::Vertex> bVertex (fit(QuadletTracks, importedTrackCollection, importedGSFTrackCollection)); // do vertexing
                     if(!bVertex) continue;
                     double bChi2DOF = bVertex->chiSquared()/bVertex->numberDoF();
                     ATH_MSG_DEBUG("Candidate chi2/DOF is " << bChi2DOF);
@@ -426,21 +413,6 @@ namespace Analysis {
                     // Set links to J/psi
                     std::vector<const xAOD::Vertex*> theJpsiPreceding;
                     theJpsiPreceding.push_back(*jpsiItr);
-                    if(m_vertexFittingWithPV){
-                        const xAOD::Vertex* closestPV = JpsiUpsilonCommon::ClosestPV(bHelper, importedPVerticesCollection);
-                        std::unique_ptr<xAOD::Vertex> bVertexPV (fit(QuadletTracks, importedTrackCollection, closestPV, importedGSFTrackCollection));
-                        if(!bVertexPV) continue;
-                        double bChi2DOFPV = bVertexPV->chiSquared()/bVertexPV->numberDoF();
-                        bool chi2CutPassed = (m_chi2cut <= 0.0 || bChi2DOFPV < m_chi2cut);
-                        if(!chi2CutPassed) continue;
-                        xAOD::BPhysHelper bHelperPV(bVertexPV.get());
-                        bHelperPV.setRefTrks();
-                        bool passesCutsPV = vertexCuts(bHelperPV);
-                        if(!passesCutsPV) continue;
-                        bHelperPV.setPrecedingVertices(theJpsiPreceding, importedJpsiCollection);
-                        bContainer->push_back(bVertexPV.release());//ptr is released preventing deletion
-                        continue; //Don't store other vertex
-                    }
                     bHelper.setPrecedingVertices(theJpsiPreceding, importedJpsiCollection);
                     bContainer->push_back(bVertex.release());//ptr is released preventing deletion
 
@@ -459,7 +431,7 @@ namespace Analysis {
     // ---------------------------------------------------------------------------------
     
     xAOD::Vertex* JpsiPlus2Tracks::fit(const std::vector<const xAOD::TrackParticle*> &inputTracks,
-                                       const xAOD::TrackParticleContainer* importedTrackCollection, const xAOD::Vertex* pv, 
+                                       const xAOD::TrackParticleContainer* importedTrackCollection,
                                        const xAOD::TrackParticleContainer* gsfCollection) const {
 
         std::unique_ptr<Trk::IVKalState> state = m_VKVFitter->makeState();
@@ -480,20 +452,6 @@ namespace Analysis {
             if (m_altMassConst<0.0) m_VKVFitter->setMassForConstraint(jpsiTableMass,indices,*state);
             if (m_altMassConst>0.0) m_VKVFitter->setMassForConstraint(m_altMassConst,indices,*state);
         }
-        if (pv) {
-	   m_VKVFitter->setCnstType(8,*state);
-	   m_VKVFitter->setVertexForConstraint(pv->position().x(),
-					       pv->position().y(),
-					       pv->position().z(),
-                                               *state);
-	   m_VKVFitter->setCovVrtForConstraint(pv->covariancePosition()(Trk::x,Trk::x),
-					       pv->covariancePosition()(Trk::y,Trk::x),
-					       pv->covariancePosition()(Trk::y,Trk::y),
-					       pv->covariancePosition()(Trk::z,Trk::x),
-					       pv->covariancePosition()(Trk::z,Trk::y),
-					       pv->covariancePosition()(Trk::z,Trk::z),
-                                               *state);
-	}
 
         // Do the fit itself.......
         // Starting point (use the J/psi position)
diff --git a/PhysicsAnalysis/JpsiUpsilonTools/src/JpsiUpsilonCommon.cxx b/PhysicsAnalysis/JpsiUpsilonTools/src/JpsiUpsilonCommon.cxx
index 0a3f5ef93238b9782bf409e04dbc8831e8cfd2f0..a084a4075b251d73989dcebbfa5080fdf31043a7 100644
--- a/PhysicsAnalysis/JpsiUpsilonTools/src/JpsiUpsilonCommon.cxx
+++ b/PhysicsAnalysis/JpsiUpsilonTools/src/JpsiUpsilonCommon.cxx
@@ -6,6 +6,7 @@
 #include "TLorentzVector.h"
 #include "xAODBPhys/BPhysHelper.h"
 #include "xAODTracking/VertexContainer.h"
+#include "JpsiUpsilonTools/PrimaryVertexRefitter.h"
 
 namespace Analysis {   
     // *********************************************************************************
@@ -90,10 +91,14 @@ namespace Analysis {
         return false;
     }
 
-    const xAOD::Vertex* JpsiUpsilonCommon::ClosestPV(xAOD::BPhysHelper& bHelper, const xAOD::VertexContainer* importedPVerticesCollection){
+    const xAOD::Vertex* JpsiUpsilonCommon::ClosestRefPV(xAOD::BPhysHelper& bHelper,
+							const xAOD::VertexContainer* importedPVerticesCollection,
+							const Analysis::PrimaryVertexRefitter *pvRefitter){
        const xAOD::Vertex* vtx_closest = nullptr; // vertex closest to bVertex track
        double dc = 1e10;
-       for (const xAOD::Vertex* vtx : *importedPVerticesCollection) {
+       for (const xAOD::Vertex* PV : *importedPVerticesCollection) {
+	  const xAOD::Vertex* refPV = pvRefitter ? pvRefitter->refitVertex(PV, bHelper.vtx(), false) : nullptr;
+	  const xAOD::Vertex* vtx = refPV ? refPV : PV;
           TVector3 posPV(vtx->position().x(),vtx->position().y(),vtx->position().z());
           auto &helperpos = bHelper.vtx()->position();
           TVector3 posV(helperpos.x(), helperpos.y(), helperpos.z());
diff --git a/PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/share/PhysValMuon_jobOptions.py b/PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/share/PhysValMuon_jobOptions.py
index 8b51e095ac0671359e368294f7d3591f61bae0c2..59c52a942c1716a14e120b065dcef31f39aaab2c 100644
--- a/PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/share/PhysValMuon_jobOptions.py
+++ b/PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/share/PhysValMuon_jobOptions.py
@@ -2,17 +2,8 @@ from AthenaCommon.CfgGetter import getPublicTool
 getPublicTool("MuonCombinedInDetDetailedTrackSelectorTool")
 
 algseq = CfgMgr.AthSequencer("AthAlgSeq")
-from InDetUsedInFitTrackDecoratorTool.InDetUsedInFitTrackDecoratorToolConf import InDet__InDetUsedInFitTrackDecoratorTool
-PhysValMuUsedInFitDecoratorTool = InDet__InDetUsedInFitTrackDecoratorTool(name                 = "PhysValMuUsedInFitDecoratorTool",
-                                                                          AMVFVerticesDecoName = "TTVA_AMVFVertices",
-                                                                          AMVFWeightsDecoName  = "TTVA_AMVFWeights",
-                                                                          TrackContainer       = "InDetTrackParticles",
-                                                                          VertexContainer      = "PrimaryVertices" )
-ToolSvc += PhysValMuUsedInFitDecoratorTool
-from InDetUsedInVertexFitTrackDecorator.InDetUsedInVertexFitTrackDecoratorConf import InDet__InDetUsedInVertexFitTrackDecorator
-PhysValMuInDetUsedInFitDecorator = InDet__InDetUsedInVertexFitTrackDecorator(name                   = "PhysValMuInDetUsedInFitDecorator",
-                                                                             UsedInFitDecoratorTool = ToolSvc.PhysValMuUsedInFitDecoratorTool)
-algseq += PhysValMuInDetUsedInFitDecorator
+from TrackVertexAssociationTool.getTTVAToolForReco import addUsedInFitDecoratorForReco
+addUsedInFitDecoratorForReco(add2Seq = algseq)
 from IsolationAlgs.IsoUpdatedTrackCones import GetUpdatedIsoTrackCones
 if not hasattr(algseq,"IsolationBuilderTight500"):
     algseq += GetUpdatedIsoTrackCones()
diff --git a/PhysicsAnalysis/TruthParticleID/McParticleTools/src/HepMcReaderTool.cxx b/PhysicsAnalysis/TruthParticleID/McParticleTools/src/HepMcReaderTool.cxx
index 5d9f75f433afdd9c08ca684de67126bca4e32bea..03391fffc683600df216e31366c80c2b5ca923e2 100755
--- a/PhysicsAnalysis/TruthParticleID/McParticleTools/src/HepMcReaderTool.cxx
+++ b/PhysicsAnalysis/TruthParticleID/McParticleTools/src/HepMcReaderTool.cxx
@@ -124,11 +124,6 @@ StatusCode HepMcReaderTool::read( HepMC::GenEvent* evt )
   return StatusCode::SUCCESS;
 }
 
-
-/////////////////////////////////////////////////////////////////// 
-/// Non-const methods: 
-/////////////////////////////////////////////////////////////////// 
-
 void HepMcReaderTool::setupFrontend( Gaudi::Details::PropertyBase& /*prop*/ )
 {
   // defaults
diff --git a/Projects/AthDataQuality/version.txt b/Projects/AthDataQuality/version.txt
index 3513fa3975b574aae593eb37e7953d5b924301cc..4d15ca0406c60c5d409bc33ab5858a0090feb7d2 100644
--- a/Projects/AthDataQuality/version.txt
+++ b/Projects/AthDataQuality/version.txt
@@ -1 +1 @@
-22.0.28
+22.0.30
diff --git a/Projects/AthGeneration/version.txt b/Projects/AthGeneration/version.txt
index 3e310491880ead81f048317add9dd7d1dab6da06..7d45883c79396603a1ef322b371e3f4ebe7bb1d0 100644
--- a/Projects/AthGeneration/version.txt
+++ b/Projects/AthGeneration/version.txt
@@ -1 +1 @@
-22.6.1
+22.6.2
diff --git a/Projects/AthSimulation/version.txt b/Projects/AthSimulation/version.txt
index 3513fa3975b574aae593eb37e7953d5b924301cc..4d15ca0406c60c5d409bc33ab5858a0090feb7d2 100644
--- a/Projects/AthSimulation/version.txt
+++ b/Projects/AthSimulation/version.txt
@@ -1 +1 @@
-22.0.28
+22.0.30
diff --git a/Projects/Athena/version.txt b/Projects/Athena/version.txt
index 4d15ca0406c60c5d409bc33ab5858a0090feb7d2..e5078b479cf7c53b9a657a8440d822748ade1826 100644
--- a/Projects/Athena/version.txt
+++ b/Projects/Athena/version.txt
@@ -1 +1 @@
-22.0.30
+22.0.31
diff --git a/Projects/VP1Light/version.txt b/Projects/VP1Light/version.txt
index 3513fa3975b574aae593eb37e7953d5b924301cc..4d15ca0406c60c5d409bc33ab5858a0090feb7d2 100644
--- a/Projects/VP1Light/version.txt
+++ b/Projects/VP1Light/version.txt
@@ -1 +1 @@
-22.0.28
+22.0.30
diff --git a/Reconstruction/Jet/JetMonitoring/JetMonitoring/EfficiencyResponseHistos.h b/Reconstruction/Jet/JetMonitoring/JetMonitoring/EfficiencyResponseHistos.h
index d05bc65e1abc380392e56becc48be0552317c4e3..5dbadef0e7002712a0cb23a461c731edc3db87d0 100644
--- a/Reconstruction/Jet/JetMonitoring/JetMonitoring/EfficiencyResponseHistos.h
+++ b/Reconstruction/Jet/JetMonitoring/JetMonitoring/EfficiencyResponseHistos.h
@@ -1,7 +1,7 @@
 //  -*- c++ -*- 
 
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef JETMONITORING_EFFICIENCYRESPONSEHISTOS_H
@@ -22,7 +22,7 @@ public:
 
   virtual StatusCode initialize() ;
   virtual int buildHistos();
-  virtual int fillHistosFromContainer(const xAOD::JetContainer &cont);
+  virtual int fillHistosFromContainer(const xAOD::JetContainer &cont, float weight);
 
 protected:
   ToolHandleArray<HistoDefinitionTool> m_histoDef;
diff --git a/Reconstruction/Jet/JetMonitoring/JetMonitoring/HIEfficiencyResponseHistos.h b/Reconstruction/Jet/JetMonitoring/JetMonitoring/HIEfficiencyResponseHistos.h
index f576206e48df02a929a6d42742ca4031f2d76854..e97f8ec9478c88f12f488312429dcfe5f17c4c6b 100644
--- a/Reconstruction/Jet/JetMonitoring/JetMonitoring/HIEfficiencyResponseHistos.h
+++ b/Reconstruction/Jet/JetMonitoring/JetMonitoring/HIEfficiencyResponseHistos.h
@@ -1,7 +1,7 @@
 //  -*- c++ -*- 
 
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef JETMONITORING_EFFICIENCYRESPONSEHISTOSHI_H
@@ -24,7 +24,7 @@ public:
 
   virtual StatusCode initialize() ;
   virtual int buildHistos();
-  virtual int fillHistosFromContainer(const xAOD::JetContainer &cont);
+  virtual int fillHistosFromContainer(const xAOD::JetContainer &cont, float weight);
 
   ///HI
 private:
diff --git a/Reconstruction/Jet/JetMonitoring/JetMonitoring/HIJetUEMonitoring.h b/Reconstruction/Jet/JetMonitoring/JetMonitoring/HIJetUEMonitoring.h
index b234e92615e782d78f477f204b99ccff8624b773..dee42ca28cb2d1daa183500a57350ab92f91f476 100644
--- a/Reconstruction/Jet/JetMonitoring/JetMonitoring/HIJetUEMonitoring.h
+++ b/Reconstruction/Jet/JetMonitoring/JetMonitoring/HIJetUEMonitoring.h
@@ -25,7 +25,7 @@ class HIJetUEMonitoring : public JetHistoBase {
   ~HIJetUEMonitoring(){};
   virtual StatusCode initialize() ;
   virtual int buildHistos();
-  virtual int fillHistosFromJet(const xAOD::Jet &j);
+  virtual int fillHistosFromJet(const xAOD::Jet &j, float weight);
   //  virtual int getEventShape();
 
  private:
diff --git a/Reconstruction/Jet/JetMonitoring/JetMonitoring/HistosForJetSelection.h b/Reconstruction/Jet/JetMonitoring/JetMonitoring/HistosForJetSelection.h
index 19b4644146290ab944c4962d19630e501ca98d49..a32b864a5592c503ccbe2c1ac8c2921fe4f0a48e 100644
--- a/Reconstruction/Jet/JetMonitoring/JetMonitoring/HistosForJetSelection.h
+++ b/Reconstruction/Jet/JetMonitoring/JetMonitoring/HistosForJetSelection.h
@@ -1,7 +1,7 @@
 //  -*- c++ -*- 
 
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef JETMONITORING_HISTOFORJETSELECTION_H
@@ -35,7 +35,7 @@ public:
   virtual StatusCode initialize() ;
   virtual int buildHistos();
 
-  virtual int fillHistosFromContainer(const xAOD::JetContainer & cont);
+  virtual int fillHistosFromContainer(const xAOD::JetContainer & cont, float weight);
 
   virtual int finalizeHistos();
 
diff --git a/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetAttributeHisto.h b/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetAttributeHisto.h
index 06b54f33d6db39c4fc3c2af258d6492f3d05b14e..e2fa4a461ccc7037c8fab3d92b22e3bbc55df288 100644
--- a/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetAttributeHisto.h
+++ b/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetAttributeHisto.h
@@ -1,7 +1,7 @@
 //  -*- c++ -*- 
 
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef JETMONITORING_JETATTRIBUTEHISTOS_H
@@ -43,8 +43,8 @@ public:
 
   virtual StatusCode initialize() ;
   virtual int buildHistos();
-  virtual int fillHistosFromJet(const xAOD::Jet &j);
-  virtual int fillHistosFromContainer(const xAOD::JetContainer & cont);
+  virtual int fillHistosFromJet(const xAOD::Jet &j, float weight);
+  virtual int fillHistosFromContainer(const xAOD::JetContainer & cont, float weight);
   
 protected:
   /// Rename an histo according to the tool's path. redefine here to take m_selectedIndex into account.
diff --git a/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetHistoBase.h b/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetHistoBase.h
index 5f1f5b8020551c2cbfc4da2df946a7ae84844a55..c8d3b6342503c9ccbc5e03778f2a05cd8ba7917d 100644
--- a/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetHistoBase.h
+++ b/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetHistoBase.h
@@ -1,7 +1,7 @@
 //  -*- c++ -*- 
 
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef JETMONITORING_JETHISTOGROUP_H
@@ -36,8 +36,8 @@ class JetHistoBase :  public HistoGroupBase {
   virtual StatusCode initialize() ;
 
   
-  virtual int fillHistosFromContainer(const xAOD::JetContainer & cont);
-  virtual int fillHistosFromJet(const xAOD::Jet &j);
+  virtual int fillHistosFromContainer(const xAOD::JetContainer & cont, float weight);
+  virtual int fillHistosFromJet(const xAOD::Jet &j, float /*weight*/);
 
   virtual int finalizeHistos();
 
diff --git a/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetKinematicHistos.h b/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetKinematicHistos.h
index 52827d7946fcc2122bf2a2056aa9b7a667f63136..ce1b35b0501c701a993462e399f1241476c52473 100644
--- a/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetKinematicHistos.h
+++ b/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetKinematicHistos.h
@@ -1,7 +1,7 @@
 //  -*- c++ -*- 
 
 /*
-  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef JETMONITORING_JETKINEMATICHISTOS_H
@@ -28,8 +28,8 @@ public:
 
   virtual int buildHistos();
 
-  virtual int fillHistosFromContainer(const xAOD::JetContainer & cont);
-  virtual int fillHistosFromJet(const xAOD::Jet &j);
+  virtual int fillHistosFromContainer(const xAOD::JetContainer & cont, float weight);
+  virtual int fillHistosFromJet(const xAOD::Jet &j, float weight);
 
 protected:
 
diff --git a/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetSubStructureHistos.h b/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetSubStructureHistos.h
index 782e68927e55df53878d16747aea87622b5d7794..257c3a5af8f3d8bac1e294b220a7387a4039a55f 100644
--- a/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetSubStructureHistos.h
+++ b/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetSubStructureHistos.h
@@ -26,7 +26,7 @@ public:
 
   virtual int buildHistos();
 
-  virtual int fillHistosFromJet(const xAOD::Jet &j);
+  virtual int fillHistosFromJet(const xAOD::Jet &j, float weight);
 
 protected:
 
diff --git a/Reconstruction/Jet/JetMonitoring/JetMonitoring/LeadingJetsRelations.h b/Reconstruction/Jet/JetMonitoring/JetMonitoring/LeadingJetsRelations.h
index efe82bdc783a431e7fde01ed36b95a5b33f6fac6..baeaf8944a7d29147ffaf849806e8e91006401b8 100644
--- a/Reconstruction/Jet/JetMonitoring/JetMonitoring/LeadingJetsRelations.h
+++ b/Reconstruction/Jet/JetMonitoring/JetMonitoring/LeadingJetsRelations.h
@@ -1,7 +1,7 @@
 //  -*- c++ -*- 
 
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef JETMONITORING_LEADINGJETRELATION_H
@@ -23,7 +23,7 @@ public:
 
   virtual StatusCode initialize() ;
   virtual int buildHistos();
-  virtual int fillHistosFromContainer(const xAOD::JetContainer &cont);
+  virtual int fillHistosFromContainer(const xAOD::JetContainer &cont, float weight);
 
 protected:
   ToolHandleArray<HistoDefinitionTool> m_histoDef;
diff --git a/Reconstruction/Jet/JetMonitoring/Root/EfficiencyResponseHistos.cxx b/Reconstruction/Jet/JetMonitoring/Root/EfficiencyResponseHistos.cxx
index 1fbc305e44a78897718c619d01d2493eca66fc93..a726531b04d6e430373578b5675bed3d0f25b984 100644
--- a/Reconstruction/Jet/JetMonitoring/Root/EfficiencyResponseHistos.cxx
+++ b/Reconstruction/Jet/JetMonitoring/Root/EfficiencyResponseHistos.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "JetMonitoring/EfficiencyResponseHistos.h"
@@ -53,7 +53,7 @@ int EfficiencyResponseHistos::buildHistos(){
 }
 
 
-int EfficiencyResponseHistos::fillHistosFromContainer(const xAOD::JetContainer &cont){
+int EfficiencyResponseHistos::fillHistosFromContainer(const xAOD::JetContainer &cont, float weight){
 
   const xAOD::JetContainer* refContainer = 0;
   CHECK( evtStore()->retrieve( refContainer, m_refContainerName), 1 );
@@ -77,17 +77,17 @@ int EfficiencyResponseHistos::fillHistosFromContainer(const xAOD::JetContainer &
     double dr = sqrt(dr2min);
     double refPt = refjet->pt() * toGeV;
 
-    m_eff1->Fill(refPt, dr<0.1 ?  1 : 0 ); // 0 weight if not matching close enough
-    m_eff2->Fill(refPt, dr<0.2 ?  1 : 0 ); // 0 weight if not matching close enough
-    m_eff3->Fill(refPt, dr<0.3 ?  1 : 0 ); // 0 weight if not matching close enough
+    m_eff1->Fill(refPt, dr<0.1 ?  weight : 0 ); // 0 weight if not matching close enough
+    m_eff2->Fill(refPt, dr<0.2 ?  weight : 0 ); // 0 weight if not matching close enough
+    m_eff3->Fill(refPt, dr<0.3 ?  weight : 0 ); // 0 weight if not matching close enough
     
-    m_deltaRclosest->Fill( dr );
+    m_deltaRclosest->Fill( dr, weight );
 
     if( dr < 0.3) {
       double relDiff = ( matched->pt()* toGeV - refPt )/refPt;
-      m_etres->Fill( relDiff );
-      m_etres_eta->Fill( refjet->eta(), relDiff);
-      m_etres_pt->Fill( refPt, relDiff);
+      m_etres->Fill( relDiff, weight );
+      m_etres_eta->Fill( refjet->eta(), relDiff, weight);
+      m_etres_pt->Fill( refPt, relDiff, weight);
 
     }
 
diff --git a/Reconstruction/Jet/JetMonitoring/Root/HIEfficiencyResponseHistos.cxx b/Reconstruction/Jet/JetMonitoring/Root/HIEfficiencyResponseHistos.cxx
index 4f64c32fe5f52aeae24e7f6e8c85fc6b2ba5af48..8ae1ca6c0fd852bf1b8148f1a281b8f9e1460cae 100644
--- a/Reconstruction/Jet/JetMonitoring/Root/HIEfficiencyResponseHistos.cxx
+++ b/Reconstruction/Jet/JetMonitoring/Root/HIEfficiencyResponseHistos.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "JetMonitoring/HIEfficiencyResponseHistos.h"
@@ -96,7 +96,7 @@ int HIEfficiencyResponseHistos::buildHistos(){
 }
 
 
-int HIEfficiencyResponseHistos::fillHistosFromContainer(const xAOD::JetContainer &cont){
+int HIEfficiencyResponseHistos::fillHistosFromContainer(const xAOD::JetContainer &cont, float weight){
   m_n=2;
   m_harmonic=m_n-1;
   m_eventShape=nullptr;
@@ -141,29 +141,29 @@ int HIEfficiencyResponseHistos::fillHistosFromContainer(const xAOD::JetContainer
 
     if (fabs(refjet->eta()) > 2.1 ) continue;
     //   if (refPt<100 ) continue;
-    m_eff1->Fill(refPt, dr<0.1 ?  1 : 0 ); // 0 weight if not matching close enough
-    m_eff2->Fill(refPt, dr<0.2 ?  1 : 0 ); // 0 weight if not matching close enough
-    m_eff3->Fill(refPt, dr<0.3 ?  1 : 0 ); // 0 weight if not matching close enough
+    m_eff1->Fill(refPt, dr<0.1 ?  weight : 0 ); // 0 weight if not matching close enough
+    m_eff2->Fill(refPt, dr<0.2 ?  weight : 0 ); // 0 weight if not matching close enough
+    m_eff3->Fill(refPt, dr<0.3 ?  weight : 0 ); // 0 weight if not matching close enough
 
     if (m_FCalET > 2.7){
-      m_eff1_0_10->Fill(refPt, dr<0.1 ?  1 : 0 ); // 0 weight if not matching close enough
-      m_eff2_0_10->Fill(refPt, dr<0.2 ?  1 : 0 ); // 0 weight if not matching close enough
-      m_eff3_0_10->Fill(refPt, dr<0.3 ?  1 : 0 ); // 0 weight if not matching close enough
+      m_eff1_0_10->Fill(refPt, dr<0.1 ?  weight : 0 ); // 0 weight if not matching close enough
+      m_eff2_0_10->Fill(refPt, dr<0.2 ?  weight : 0 ); // 0 weight if not matching close enough
+      m_eff3_0_10->Fill(refPt, dr<0.3 ?  weight : 0 ); // 0 weight if not matching close enough
     }
     if (m_FCalET < 2.7 && m_FCalET > 1.75 ){//10-20%
-      m_eff1_10_20->Fill(refPt, dr<0.1 ?  1 : 0 ); // 0 weight if not matching close enough
-      m_eff2_10_20->Fill(refPt, dr<0.2 ?  1 : 0 ); // 0 weight if not matching close enough
-      m_eff3_10_20->Fill(refPt, dr<0.3 ?  1 : 0 ); // 0 weight if not matching close enough
+      m_eff1_10_20->Fill(refPt, dr<0.1 ?  weight : 0 ); // 0 weight if not matching close enough
+      m_eff2_10_20->Fill(refPt, dr<0.2 ?  weight : 0 ); // 0 weight if not matching close enough
+      m_eff3_10_20->Fill(refPt, dr<0.3 ?  weight : 0 ); // 0 weight if not matching close enough
     }
     if (m_FCalET < 1.75 && m_FCalET > 0.65 ){//20-40%
-      m_eff1_20_40->Fill(refPt, dr<0.1 ?  1 : 0 ); // 0 weight if not matching close enough
-      m_eff2_20_40->Fill(refPt, dr<0.2 ?  1 : 0 ); // 0 weight if not matching close enough
-      m_eff3_20_40->Fill(refPt, dr<0.3 ?  1 : 0 ); // 0 weight if not matching close enough
+      m_eff1_20_40->Fill(refPt, dr<0.1 ?  weight : 0 ); // 0 weight if not matching close enough
+      m_eff2_20_40->Fill(refPt, dr<0.2 ?  weight : 0 ); // 0 weight if not matching close enough
+      m_eff3_20_40->Fill(refPt, dr<0.3 ?  weight : 0 ); // 0 weight if not matching close enough
     }
     if (m_FCalET < 0.20 ){//60-100%
-      m_eff1_60_100->Fill(refPt, dr<0.1 ?  1 : 0 ); // 0 weight if not matching close enough
-      m_eff2_60_100->Fill(refPt, dr<0.2 ?  1 : 0 ); // 0 weight if not matching close enough
-      m_eff3_60_100->Fill(refPt, dr<0.3 ?  1 : 0 ); // 0 weight if not matching close enough
+      m_eff1_60_100->Fill(refPt, dr<0.1 ?  weight : 0 ); // 0 weight if not matching close enough
+      m_eff2_60_100->Fill(refPt, dr<0.2 ?  weight : 0 ); // 0 weight if not matching close enough
+      m_eff3_60_100->Fill(refPt, dr<0.3 ?  weight : 0 ); // 0 weight if not matching close enough
     }
     m_deltaRclosest->Fill( dr );
     float Acos = std::acos(std::cos(2*(matched->getAttribute<float>("JetEtaJESScaleMomentum_phi") - m_psiN_FCal)));
@@ -172,39 +172,39 @@ int HIEfficiencyResponseHistos::fillHistosFromContainer(const xAOD::JetContainer
 
     if( dr < 0.2) {
       double relDiff = ( matched->pt()* toGeV - refPt )/refPt;
-      m_etres->Fill( relDiff );
+      m_etres->Fill( relDiff, weight );
       m_etres_eta->Fill( refjet->eta(), relDiff);
       if (matched->pt()* toGeV > 100) {
-	m_etres_eta_hpt->Fill( refjet->eta(), relDiff);
-	m_etres_pt_hpt_RP->Fill( m_psiN_FCal, relDiff );
-	m_etres_pt_hpt_2Dphi->Fill( Acos, relDiff );
+	m_etres_eta_hpt->Fill( refjet->eta(), relDiff, weight);
+	m_etres_pt_hpt_RP->Fill( m_psiN_FCal, relDiff, weight );
+	m_etres_pt_hpt_2Dphi->Fill( Acos, relDiff, weight );
       }
-      m_etres_pt->Fill( refPt, relDiff);
-      m_etres_pt_2Dphi->Fill( Acos, relDiff );
-      m_etres_pt_RP->Fill( m_psiN_FCal, relDiff );
+      m_etres_pt->Fill( refPt, relDiff, weight);
+      m_etres_pt_2Dphi->Fill( Acos, relDiff, weight );
+      m_etres_pt_RP->Fill( m_psiN_FCal, relDiff, weight );
       if (m_FCalET > 2.7){
-	m_etres_0_10->Fill( relDiff );
-	m_etres_eta_0_10->Fill( refjet->eta(), relDiff);
-	if (matched->pt()* toGeV > 100) m_etres_eta_hpt_0_10->Fill( refjet->eta(), relDiff);
-	m_etres_pt_0_10->Fill( refPt, relDiff);
+	m_etres_0_10->Fill( relDiff, weight );
+	m_etres_eta_0_10->Fill( refjet->eta(), relDiff, weight);
+	if (matched->pt()* toGeV > 100) m_etres_eta_hpt_0_10->Fill( refjet->eta(), relDiff, weight);
+	m_etres_pt_0_10->Fill( refPt, relDiff, weight);
       }
       if (m_FCalET < 2.7 && m_FCalET > 1.75 ){//10-20%
-	m_etres_10_20->Fill( relDiff );
-	m_etres_eta_10_20->Fill( refjet->eta(), relDiff);
-	if (matched->pt()* toGeV > 100) m_etres_eta_hpt_10_20->Fill( refjet->eta(), relDiff);
-	m_etres_pt_10_20->Fill( refPt, relDiff);
+	m_etres_10_20->Fill( relDiff, weight );
+	m_etres_eta_10_20->Fill( refjet->eta(), relDiff, weight);
+	if (matched->pt()* toGeV > 100) m_etres_eta_hpt_10_20->Fill( refjet->eta(), relDiff, weight);
+	m_etres_pt_10_20->Fill( refPt, relDiff, weight);
       }
       if (m_FCalET < 1.75 && m_FCalET > 0.65 ){//20-40%
-	m_etres_20_40->Fill( relDiff );
-	m_etres_eta_20_40->Fill( refjet->eta(), relDiff);
-	if (matched->pt()* toGeV > 100) m_etres_eta_hpt_20_40->Fill( refjet->eta(), relDiff);
-	m_etres_pt_20_40->Fill( refPt, relDiff);
+	m_etres_20_40->Fill( relDiff, weight );
+	m_etres_eta_20_40->Fill( refjet->eta(), relDiff, weight);
+	if (matched->pt()* toGeV > 100) m_etres_eta_hpt_20_40->Fill( refjet->eta(), relDiff, weight);
+	m_etres_pt_20_40->Fill( refPt, relDiff, weight);
       }
       if (m_FCalET < 0.20 ){//60-100%
-	m_etres_60_100->Fill( relDiff );
-	m_etres_eta_60_100->Fill( refjet->eta(), relDiff);
-	if (matched->pt()* toGeV > 100) m_etres_eta_hpt_60_100->Fill( refjet->eta(), relDiff);
-	m_etres_pt_60_100->Fill( refPt, relDiff);
+	m_etres_60_100->Fill( relDiff, weight );
+	m_etres_eta_60_100->Fill( refjet->eta(), relDiff, weight);
+	if (matched->pt()* toGeV > 100) m_etres_eta_hpt_60_100->Fill( refjet->eta(), relDiff, weight);
+	m_etres_pt_60_100->Fill( refPt, relDiff, weight);
       }
 
     }
diff --git a/Reconstruction/Jet/JetMonitoring/Root/HIJetUEMonitoring.cxx b/Reconstruction/Jet/JetMonitoring/Root/HIJetUEMonitoring.cxx
index 825f245f74373f7c835887ee4837e013fae1ab5f..d875297ee5b844e5ac7933f410671bd3b9bcc356 100644
--- a/Reconstruction/Jet/JetMonitoring/Root/HIJetUEMonitoring.cxx
+++ b/Reconstruction/Jet/JetMonitoring/Root/HIJetUEMonitoring.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 //HIJetUEMonitoring.cxx
@@ -134,7 +134,7 @@ int HIJetUEMonitoring::buildHistos(){
   return 0;
 }
 
-int HIJetUEMonitoring::fillHistosFromJet(const xAOD::Jet &j){
+int HIJetUEMonitoring::fillHistosFromJet(const xAOD::Jet &j, float weight){
 
   const xAOD::EventInfo* evtInfo;
   CHECK(evtStore()->retrieve( evtInfo ), 1);
@@ -165,7 +165,7 @@ int HIJetUEMonitoring::fillHistosFromJet(const xAOD::Jet &j){
     }
   }
 
-  m_FCALET->Fill(m_FCalET);
+  m_FCALET->Fill(m_FCalET, weight);
 
   // m_jetScale is a property of the base tool
   //const xAOD::JetFourMom_t p4 = j.jetP4( (xAOD::JetScale) m_jetScale);
@@ -178,104 +178,104 @@ int HIJetUEMonitoring::fillHistosFromJet(const xAOD::Jet &j){
 
   if (fabs(j.getAttribute<float>("JetEtaJESScaleMomentum_eta"))<2.8){
     if (m_FCalET > 2.7){//0-10%
-      m_SubtractedET_pt_0_10->Fill(j.getAttribute<float>("JetEtaJESScaleMomentum_pt")*toGeV,SubtractedET ); 
+      m_SubtractedET_pt_0_10->Fill(j.getAttribute<float>("JetEtaJESScaleMomentum_pt")*toGeV,SubtractedET, weight ); 
     }
     if (m_FCalET < 2.7 && m_FCalET > 1.75 ){//10-20%
-      m_SubtractedET_pt_10_20->Fill(j.getAttribute<float>("JetEtaJESScaleMomentum_pt")*toGeV,SubtractedET ); 
+      m_SubtractedET_pt_10_20->Fill(j.getAttribute<float>("JetEtaJESScaleMomentum_pt")*toGeV,SubtractedET, weight ); 
     }
     if (m_FCalET < 1.75 && m_FCalET > 0.65 ){//20-40%
-      m_SubtractedET_pt_20_40->Fill(j.getAttribute<float>("JetEtaJESScaleMomentum_pt")*toGeV,SubtractedET ); 
+      m_SubtractedET_pt_20_40->Fill(j.getAttribute<float>("JetEtaJESScaleMomentum_pt")*toGeV,SubtractedET, weight ); 
     }
     if (m_FCalET < 0.20 ){//60-100%
-      m_SubtractedET_pt_60_100->Fill(j.getAttribute<float>("JetEtaJESScaleMomentum_pt")*toGeV,SubtractedET ); 
+      m_SubtractedET_pt_60_100->Fill(j.getAttribute<float>("JetEtaJESScaleMomentum_pt")*toGeV,SubtractedET, weight ); 
     }
   }
 
   if (j.getAttribute<float>("JetEtaJESScaleMomentum_pt")*toGeV > m_ptcut){
     // ATH_MSG_INFO(" FCal ET: "<< m_FCalET<<"  SubtractedE:, "<<SubtractedET<<" m_psiN_FCal: "<<m_psiN_FCal<<" Acos: "<<Acos <<" m_vN_fcal: "<<m_vN_fcal<<" ptcut: "<<m_ptcut);
-    m_2dSubtractedET_pT->Fill( j.getAttribute<float>("JetEtaJESScaleMomentum_pt")*toGeV, SubtractedET);
+    m_2dSubtractedET_pT->Fill( j.getAttribute<float>("JetEtaJESScaleMomentum_pt")*toGeV, SubtractedET, weight);
 
-    m_SubtractedET_Centrality->Fill( m_FCalET, SubtractedET);
-    m_2dSubtractedET_Centrality->Fill( m_FCalET, SubtractedET);
-    m_2dSubtractedET_Expected_Centrality->Fill( m_FCalET, (SubtractedET/m_FCalET)*0.025);
+    m_SubtractedET_Centrality->Fill( m_FCalET, SubtractedET, weight);
+    m_2dSubtractedET_Centrality->Fill( m_FCalET, SubtractedET, weight);
+    m_2dSubtractedET_Expected_Centrality->Fill( m_FCalET, (SubtractedET/m_FCalET)*0.025, weight);
 
-    m_2dSubtractedET_Expected_eta->Fill(j.getAttribute<float>("JetEtaJESScaleMomentum_eta") , (SubtractedET/m_FCalET)*0.025);
-    m_SubtractedET_Expected_eta->Fill(j.getAttribute<float>("JetEtaJESScaleMomentum_eta") , (SubtractedET/m_FCalET)*0.025);
-    m_2dSubtractedET_2Dphi->Fill( Acos,SubtractedET);
-    m_SubtractedET_eta->Fill(j.getAttribute<float>("JetEtaJESScaleMomentum_eta"),SubtractedET ); 
-    m_SubtractedET_pt->Fill(j.getAttribute<float>("JetEtaJESScaleMomentum_pt")*toGeV,SubtractedET ); 
-    m_SubtractedET_2Dphi->Fill( Acos,SubtractedET);
+    m_2dSubtractedET_Expected_eta->Fill(j.getAttribute<float>("JetEtaJESScaleMomentum_eta") , (SubtractedET/m_FCalET)*0.025, weight);
+    m_SubtractedET_Expected_eta->Fill(j.getAttribute<float>("JetEtaJESScaleMomentum_eta") , (SubtractedET/m_FCalET)*0.025, weight);
+    m_2dSubtractedET_2Dphi->Fill( Acos,SubtractedET, weight);
+    m_SubtractedET_eta->Fill(j.getAttribute<float>("JetEtaJESScaleMomentum_eta"),SubtractedET, weight); 
+    m_SubtractedET_pt->Fill(j.getAttribute<float>("JetEtaJESScaleMomentum_pt")*toGeV,SubtractedET, weight ); 
+    m_SubtractedET_2Dphi->Fill( Acos,SubtractedET, weight);
 
     if (m_FCalET > 2.7){//0-10%
-      m_JetUnsubtractedScaleMomentum_pt_0_10->Fill( j.getAttribute<float>("JetUnsubtractedScaleMomentum_pt")*toGeV );
-      m_JetUnsubtractedScaleMomentum_eta_0_10->Fill( j.getAttribute<float>("JetUnsubtractedScaleMomentum_eta") );
-      m_JetUnsubtractedScaleMomentum_phi_0_10->Fill( j.getAttribute<float>("JetUnsubtractedScaleMomentum_phi") );
-      m_JetUnsubtractedScaleMomentum_m_0_10->Fill( j.getAttribute<float>("JetUnsubtractedScaleMomentum_m")*toGeV );
-      m_JetSubtractedScaleMomentum_pt_0_10->Fill( j.getAttribute<float>("JetSubtractedScaleMomentum_pt")*toGeV );
-      m_JetSubtractedScaleMomentum_eta_0_10->Fill( j.getAttribute<float>("JetSubtractedScaleMomentum_eta") );
-      m_JetSubtractedScaleMomentum_phi_0_10->Fill( j.getAttribute<float>("JetSubtractedScaleMomentum_phi") );
-      m_JetSubtractedScaleMomentum_m_0_10->Fill( j.getAttribute<float>("JetSubtractedScaleMomentum_m")*toGeV );
-      m_2dSubtractedET_Expected_eta_0_10->Fill(j.getAttribute<float>("JetEtaJESScaleMomentum_eta") , (SubtractedET/m_FCalET)*0.025);
-      m_SubtractedET_Expected_eta_0_10->Fill(j.getAttribute<float>("JetEtaJESScaleMomentum_eta") , (SubtractedET/m_FCalET)*0.025);
-
-      m_2dSubtractedET_2Dphi_0_10->Fill( Acos,SubtractedET);
-      m_SubtractedET_eta_0_10->Fill(j.getAttribute<float>("JetEtaJESScaleMomentum_eta"),SubtractedET ); 
-      m_SubtractedET_2Dphi_0_10->Fill( Acos,SubtractedET);
+      m_JetUnsubtractedScaleMomentum_pt_0_10->Fill( j.getAttribute<float>("JetUnsubtractedScaleMomentum_pt")*toGeV, weight );
+      m_JetUnsubtractedScaleMomentum_eta_0_10->Fill( j.getAttribute<float>("JetUnsubtractedScaleMomentum_eta"), weight );
+      m_JetUnsubtractedScaleMomentum_phi_0_10->Fill( j.getAttribute<float>("JetUnsubtractedScaleMomentum_phi"), weight );
+      m_JetUnsubtractedScaleMomentum_m_0_10->Fill( j.getAttribute<float>("JetUnsubtractedScaleMomentum_m")*toGeV, weight );
+      m_JetSubtractedScaleMomentum_pt_0_10->Fill( j.getAttribute<float>("JetSubtractedScaleMomentum_pt")*toGeV, weight );
+      m_JetSubtractedScaleMomentum_eta_0_10->Fill( j.getAttribute<float>("JetSubtractedScaleMomentum_eta"), weight );
+      m_JetSubtractedScaleMomentum_phi_0_10->Fill( j.getAttribute<float>("JetSubtractedScaleMomentum_phi"), weight );
+      m_JetSubtractedScaleMomentum_m_0_10->Fill( j.getAttribute<float>("JetSubtractedScaleMomentum_m")*toGeV, weight );
+      m_2dSubtractedET_Expected_eta_0_10->Fill(j.getAttribute<float>("JetEtaJESScaleMomentum_eta") , (SubtractedET/m_FCalET)*0.025, weight);
+      m_SubtractedET_Expected_eta_0_10->Fill(j.getAttribute<float>("JetEtaJESScaleMomentum_eta") , (SubtractedET/m_FCalET)*0.025, weight);
+
+      m_2dSubtractedET_2Dphi_0_10->Fill( Acos,SubtractedET, weight);
+      m_SubtractedET_eta_0_10->Fill(j.getAttribute<float>("JetEtaJESScaleMomentum_eta"),SubtractedET, weight ); 
+      m_SubtractedET_2Dphi_0_10->Fill( Acos,SubtractedET, weight);
     }
     if (m_FCalET < 2.7 && m_FCalET > 1.75 ){//10-20%
-      m_JetUnsubtractedScaleMomentum_pt_10_20->Fill( j.getAttribute<float>("JetUnsubtractedScaleMomentum_pt")*toGeV );
-      m_JetUnsubtractedScaleMomentum_eta_10_20->Fill( j.getAttribute<float>("JetUnsubtractedScaleMomentum_eta") );
-      m_JetUnsubtractedScaleMomentum_phi_10_20->Fill( j.getAttribute<float>("JetUnsubtractedScaleMomentum_phi") );
-      m_JetUnsubtractedScaleMomentum_m_10_20->Fill( j.getAttribute<float>("JetUnsubtractedScaleMomentum_m")*toGeV );
-      m_JetSubtractedScaleMomentum_pt_10_20->Fill( j.getAttribute<float>("JetSubtractedScaleMomentum_pt")*toGeV );
-      m_JetSubtractedScaleMomentum_eta_10_20->Fill( j.getAttribute<float>("JetSubtractedScaleMomentum_eta") );
-      m_JetSubtractedScaleMomentum_phi_10_20->Fill( j.getAttribute<float>("JetSubtractedScaleMomentum_phi") );
-      m_JetSubtractedScaleMomentum_m_10_20->Fill( j.getAttribute<float>("JetSubtractedScaleMomentum_m")*toGeV );
-
-      m_2dSubtractedET_Expected_eta_10_20->Fill(j.getAttribute<float>("JetEtaJESScaleMomentum_eta") , (SubtractedET/m_FCalET)*0.025);
-      m_SubtractedET_Expected_eta_10_20->Fill(j.getAttribute<float>("JetEtaJESScaleMomentum_eta") , (SubtractedET/m_FCalET)*0.025);
-
-      m_2dSubtractedET_2Dphi_10_20->Fill( Acos,SubtractedET);
-
-      m_SubtractedET_eta_10_20->Fill(j.getAttribute<float>("JetEtaJESScaleMomentum_eta"),SubtractedET ); 
-      m_SubtractedET_2Dphi_10_20->Fill( Acos,SubtractedET);
+      m_JetUnsubtractedScaleMomentum_pt_10_20->Fill( j.getAttribute<float>("JetUnsubtractedScaleMomentum_pt")*toGeV, weight );
+      m_JetUnsubtractedScaleMomentum_eta_10_20->Fill( j.getAttribute<float>("JetUnsubtractedScaleMomentum_eta"), weight );
+      m_JetUnsubtractedScaleMomentum_phi_10_20->Fill( j.getAttribute<float>("JetUnsubtractedScaleMomentum_phi"), weight );
+      m_JetUnsubtractedScaleMomentum_m_10_20->Fill( j.getAttribute<float>("JetUnsubtractedScaleMomentum_m")*toGeV, weight );
+      m_JetSubtractedScaleMomentum_pt_10_20->Fill( j.getAttribute<float>("JetSubtractedScaleMomentum_pt")*toGeV, weight );
+      m_JetSubtractedScaleMomentum_eta_10_20->Fill( j.getAttribute<float>("JetSubtractedScaleMomentum_eta"), weight );
+      m_JetSubtractedScaleMomentum_phi_10_20->Fill( j.getAttribute<float>("JetSubtractedScaleMomentum_phi"), weight );
+      m_JetSubtractedScaleMomentum_m_10_20->Fill( j.getAttribute<float>("JetSubtractedScaleMomentum_m")*toGeV, weight );
+
+      m_2dSubtractedET_Expected_eta_10_20->Fill(j.getAttribute<float>("JetEtaJESScaleMomentum_eta") , (SubtractedET/m_FCalET)*0.025, weight);
+      m_SubtractedET_Expected_eta_10_20->Fill(j.getAttribute<float>("JetEtaJESScaleMomentum_eta") , (SubtractedET/m_FCalET)*0.025, weight);
+
+      m_2dSubtractedET_2Dphi_10_20->Fill( Acos,SubtractedET, weight);
+
+      m_SubtractedET_eta_10_20->Fill(j.getAttribute<float>("JetEtaJESScaleMomentum_eta"),SubtractedET, weight ); 
+      m_SubtractedET_2Dphi_10_20->Fill( Acos,SubtractedET, weight);
     }
 
     if (m_FCalET < 1.75 && m_FCalET > 0.65 ){//20-40%
-      m_JetUnsubtractedScaleMomentum_pt_20_40->Fill( j.getAttribute<float>("JetUnsubtractedScaleMomentum_pt")*toGeV );
-      m_JetUnsubtractedScaleMomentum_eta_20_40->Fill( j.getAttribute<float>("JetUnsubtractedScaleMomentum_eta") );
-      m_JetUnsubtractedScaleMomentum_phi_20_40->Fill( j.getAttribute<float>("JetUnsubtractedScaleMomentum_phi") );
-      m_JetUnsubtractedScaleMomentum_m_20_40->Fill( j.getAttribute<float>("JetUnsubtractedScaleMomentum_m")*toGeV );
-      m_JetSubtractedScaleMomentum_pt_20_40->Fill( j.getAttribute<float>("JetSubtractedScaleMomentum_pt")*toGeV );
-      m_JetSubtractedScaleMomentum_eta_20_40->Fill( j.getAttribute<float>("JetSubtractedScaleMomentum_eta") );
-      m_JetSubtractedScaleMomentum_phi_20_40->Fill( j.getAttribute<float>("JetSubtractedScaleMomentum_phi") );
-      m_JetSubtractedScaleMomentum_m_20_40->Fill( j.getAttribute<float>("JetSubtractedScaleMomentum_m")*toGeV );
-
-      m_2dSubtractedET_Expected_eta_20_40->Fill(j.getAttribute<float>("JetEtaJESScaleMomentum_eta") , (SubtractedET/m_FCalET)*0.025);
-      m_SubtractedET_Expected_eta_20_40->Fill(j.getAttribute<float>("JetEtaJESScaleMomentum_eta") , (SubtractedET/m_FCalET)*0.025);
-
-      m_2dSubtractedET_2Dphi_20_40->Fill( Acos,SubtractedET);
-
-      m_SubtractedET_eta_20_40->Fill(j.getAttribute<float>("JetEtaJESScaleMomentum_eta"),SubtractedET ); 
-      m_SubtractedET_2Dphi_20_40->Fill( Acos,SubtractedET);
+      m_JetUnsubtractedScaleMomentum_pt_20_40->Fill( j.getAttribute<float>("JetUnsubtractedScaleMomentum_pt")*toGeV, weight );
+      m_JetUnsubtractedScaleMomentum_eta_20_40->Fill( j.getAttribute<float>("JetUnsubtractedScaleMomentum_eta"), weight );
+      m_JetUnsubtractedScaleMomentum_phi_20_40->Fill( j.getAttribute<float>("JetUnsubtractedScaleMomentum_phi"), weight );
+      m_JetUnsubtractedScaleMomentum_m_20_40->Fill( j.getAttribute<float>("JetUnsubtractedScaleMomentum_m")*toGeV, weight );
+      m_JetSubtractedScaleMomentum_pt_20_40->Fill( j.getAttribute<float>("JetSubtractedScaleMomentum_pt")*toGeV, weight );
+      m_JetSubtractedScaleMomentum_eta_20_40->Fill( j.getAttribute<float>("JetSubtractedScaleMomentum_eta"), weight );
+      m_JetSubtractedScaleMomentum_phi_20_40->Fill( j.getAttribute<float>("JetSubtractedScaleMomentum_phi"), weight );
+      m_JetSubtractedScaleMomentum_m_20_40->Fill( j.getAttribute<float>("JetSubtractedScaleMomentum_m")*toGeV, weight );
+
+      m_2dSubtractedET_Expected_eta_20_40->Fill(j.getAttribute<float>("JetEtaJESScaleMomentum_eta") , (SubtractedET/m_FCalET)*0.025, weight);
+      m_SubtractedET_Expected_eta_20_40->Fill(j.getAttribute<float>("JetEtaJESScaleMomentum_eta") , (SubtractedET/m_FCalET)*0.025, weight);
+
+      m_2dSubtractedET_2Dphi_20_40->Fill( Acos,SubtractedET, weight);
+
+      m_SubtractedET_eta_20_40->Fill(j.getAttribute<float>("JetEtaJESScaleMomentum_eta"),SubtractedET, weight ); 
+      m_SubtractedET_2Dphi_20_40->Fill( Acos,SubtractedET, weight);
     }
     if (m_FCalET < 0.20 ){//60-100%
-      m_JetUnsubtractedScaleMomentum_pt_60_100->Fill( j.getAttribute<float>("JetUnsubtractedScaleMomentum_pt")*toGeV );
-      m_JetUnsubtractedScaleMomentum_eta_60_100->Fill( j.getAttribute<float>("JetUnsubtractedScaleMomentum_eta") );
-      m_JetUnsubtractedScaleMomentum_phi_60_100->Fill( j.getAttribute<float>("JetUnsubtractedScaleMomentum_phi") );
-      m_JetUnsubtractedScaleMomentum_m_60_100->Fill( j.getAttribute<float>("JetUnsubtractedScaleMomentum_m")*toGeV );
-      m_JetSubtractedScaleMomentum_pt_60_100->Fill( j.getAttribute<float>("JetSubtractedScaleMomentum_pt")*toGeV );
-      m_JetSubtractedScaleMomentum_eta_60_100->Fill( j.getAttribute<float>("JetSubtractedScaleMomentum_eta") );
-      m_JetSubtractedScaleMomentum_phi_60_100->Fill( j.getAttribute<float>("JetSubtractedScaleMomentum_phi") );
-      m_JetSubtractedScaleMomentum_m_60_100->Fill( j.getAttribute<float>("JetSubtractedScaleMomentum_m")*toGeV );
-
-      m_2dSubtractedET_Expected_eta_60_100->Fill(j.getAttribute<float>("JetEtaJESScaleMomentum_eta") , (SubtractedET/m_FCalET)*0.025);
-      m_SubtractedET_Expected_eta_60_100->Fill(j.getAttribute<float>("JetEtaJESScaleMomentum_eta") , (SubtractedET/m_FCalET)*0.025);
-
-      m_2dSubtractedET_2Dphi_60_100->Fill( Acos,SubtractedET);
-
-      m_SubtractedET_eta_60_100->Fill(j.getAttribute<float>("JetEtaJESScaleMomentum_eta"),SubtractedET ); 
-      m_SubtractedET_2Dphi_60_100->Fill( Acos,SubtractedET);
+      m_JetUnsubtractedScaleMomentum_pt_60_100->Fill( j.getAttribute<float>("JetUnsubtractedScaleMomentum_pt")*toGeV, weight );
+      m_JetUnsubtractedScaleMomentum_eta_60_100->Fill( j.getAttribute<float>("JetUnsubtractedScaleMomentum_eta"), weight );
+      m_JetUnsubtractedScaleMomentum_phi_60_100->Fill( j.getAttribute<float>("JetUnsubtractedScaleMomentum_phi"), weight );
+      m_JetUnsubtractedScaleMomentum_m_60_100->Fill( j.getAttribute<float>("JetUnsubtractedScaleMomentum_m")*toGeV, weight );
+      m_JetSubtractedScaleMomentum_pt_60_100->Fill( j.getAttribute<float>("JetSubtractedScaleMomentum_pt")*toGeV, weight );
+      m_JetSubtractedScaleMomentum_eta_60_100->Fill( j.getAttribute<float>("JetSubtractedScaleMomentum_eta"), weight );
+      m_JetSubtractedScaleMomentum_phi_60_100->Fill( j.getAttribute<float>("JetSubtractedScaleMomentum_phi"), weight );
+      m_JetSubtractedScaleMomentum_m_60_100->Fill( j.getAttribute<float>("JetSubtractedScaleMomentum_m")*toGeV, weight );
+
+      m_2dSubtractedET_Expected_eta_60_100->Fill(j.getAttribute<float>("JetEtaJESScaleMomentum_eta") , (SubtractedET/m_FCalET)*0.025, weight);
+      m_SubtractedET_Expected_eta_60_100->Fill(j.getAttribute<float>("JetEtaJESScaleMomentum_eta") , (SubtractedET/m_FCalET)*0.025, weight);
+
+      m_2dSubtractedET_2Dphi_60_100->Fill( Acos,SubtractedET, weight);
+
+      m_SubtractedET_eta_60_100->Fill(j.getAttribute<float>("JetEtaJESScaleMomentum_eta"),SubtractedET, weight ); 
+      m_SubtractedET_2Dphi_60_100->Fill( Acos,SubtractedET, weight);
     }
 
   }
diff --git a/Reconstruction/Jet/JetMonitoring/Root/HistosForJetSelection.cxx b/Reconstruction/Jet/JetMonitoring/Root/HistosForJetSelection.cxx
index c825629812dc2e0e6a32ad102d5b2c0dff90dcfd..8cbd94f191306fd1d4a0b916a182a2c958f7232c 100644
--- a/Reconstruction/Jet/JetMonitoring/Root/HistosForJetSelection.cxx
+++ b/Reconstruction/Jet/JetMonitoring/Root/HistosForJetSelection.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "JetMonitoring/HistosForJetSelection.h"
@@ -77,7 +77,7 @@ int HistosForJetSelection::buildHistos(){
 
   
   
-int HistosForJetSelection::fillHistosFromContainer(const xAOD::JetContainer & cont){
+int HistosForJetSelection::fillHistosFromContainer(const xAOD::JetContainer & cont, float weight){
 
   ConstDataVector< xAOD::JetContainer > tmpCont(SG::VIEW_ELEMENTS);
   const xAOD::JetContainer * contPtr = NULL;
@@ -132,7 +132,7 @@ int HistosForJetSelection::fillHistosFromContainer(const xAOD::JetContainer & co
   // then fill histos
   for( auto jtool : m_histoTools){
     ATH_MSG_DEBUG ("    Filling  " << jtool->name() << "..." );
-    jtool->fillHistosFromContainer(*contPtr);
+    jtool->fillHistosFromContainer(*contPtr, weight);
   }
   return 0;
 }
diff --git a/Reconstruction/Jet/JetMonitoring/Root/JetAttributeHisto.cxx b/Reconstruction/Jet/JetMonitoring/Root/JetAttributeHisto.cxx
index 49cc74ee1da0cfa81f7f7aa631b59f7c9ad484dc..57259b3c9967c82dbdf79e20a814b94c15b4d164 100644
--- a/Reconstruction/Jet/JetMonitoring/Root/JetAttributeHisto.cxx
+++ b/Reconstruction/Jet/JetMonitoring/Root/JetAttributeHisto.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "JetMonitoring/JetAttributeHisto.h"
@@ -12,7 +12,7 @@ namespace jet {
   class HistoFiller {
   public:
     virtual ~HistoFiller() {}
-    virtual void fill(const xAOD::Jet & ){};
+    virtual void fill(const xAOD::Jet &, float /*weight*/ ){};
     // allows to avoid invalid attribute
     virtual bool isValid(const xAOD::Jet &){return false;}
   };
@@ -47,7 +47,7 @@ namespace jet {
   struct AttFiller : public HistoFiller, public AccessorAndHisto<T, TH1F> {
     AttFiller(const std::string & attname, TH1F* h, bool gev1)  : AccessorAndHisto<T, TH1F>(attname, h, gev1) {}
 
-    virtual void fill(const xAOD::Jet & j){this->m_h->Fill( this->m_accessor(j)*scale1 ); };
+    virtual void fill(const xAOD::Jet & j, float weight){this->m_h->Fill( this->m_accessor(j)*scale1, weight ); };
     virtual bool isValid(const xAOD::Jet &j){return this->m_accessor.isAvailable(j);}
   };
 
@@ -56,9 +56,9 @@ namespace jet {
   struct VecAttFiller : public HistoFiller, public AccessorAndHisto<std::vector<T>, TH1F> {
     VecAttFiller(const std::string & attname, TH1F* h, bool gev1)  : AccessorAndHisto<std::vector<T>, TH1F>(attname, h, gev1) {}
 
-    virtual void fill(const xAOD::Jet & j){
+    virtual void fill(const xAOD::Jet & j, float weight){
       const std::vector<T> & vec = this->m_accessor( j);
-      for(const T& v : vec ) this->m_h->Fill( v *scale1 );
+      for(const T& v : vec ) this->m_h->Fill( v *scale1, weight );
     }
     virtual bool isValid(const xAOD::Jet & j){return this->m_accessor.isAvailable(j);}
 
@@ -68,9 +68,9 @@ namespace jet {
   struct VecAttIndexFiller : public HistoFiller, public AccessorAndHisto<std::vector<T>, TH1F> {
     VecAttIndexFiller(const std::string & attname, TH1F* h, size_t index, bool gev1) : AccessorAndHisto<std::vector<T>,TH1F>(attname,h, gev1), m_index(index) {}
 
-    virtual void fill(const xAOD::Jet & j){
+    virtual void fill(const xAOD::Jet & j, float weight){
       const std::vector<T> & vec = this->m_accessor( j);
-      if( vec.size() > m_index) this->m_h->Fill( vec[m_index]*scale1 );
+      if( vec.size() > m_index) this->m_h->Fill( vec[m_index]*scale1, weight );
     }
     virtual bool isValid(const xAOD::Jet & j){return this->m_accessor.isAvailable(j);}
 
@@ -85,7 +85,7 @@ namespace jet {
   struct AttvsAttFiller : public HistoFiller, public AccessorAndHisto2<T,T, HTYPE> {
     AttvsAttFiller(const std::string & att1,const std::string & att2  , HTYPE* h, bool gev1, bool gev2) : AccessorAndHisto2<T,T, HTYPE>(att1,att2,h, gev1, gev2) {}
 
-    virtual void fill(const xAOD::Jet & j){this->m_h->Fill( this->m_accessor(j)*scale1, this->m_accessor2(j)*scale2 ); };
+    virtual void fill(const xAOD::Jet & j, float weight){this->m_h->Fill( this->m_accessor(j)*scale1, this->m_accessor2(j)*scale2, weight ); };
     virtual bool isValid(const xAOD::Jet &j){return (this->m_accessor.isAvailable(j))&&(this->m_accessor2.isAvailable(j));}
 
   };
@@ -94,11 +94,11 @@ namespace jet {
   struct AttvsVecAttIndexFiller : public HistoFiller, public AccessorAndHisto2<std::vector<T>,T, HTYPE> {
     AttvsVecAttIndexFiller(const std::string & att1,const std::string & att2  , HTYPE* h, size_t index , bool gev1, bool gev2, bool swapAxis=false) : AccessorAndHisto2<std::vector<T>,T, HTYPE>(att1,att2,h, gev1, gev2) , m_index(index), m_swap(swapAxis){}
 
-    virtual void fill(const xAOD::Jet & j){
+    virtual void fill(const xAOD::Jet & j, float weight){
       const std::vector<T> & vec = this->m_accessor( j);
       if( vec.size() > m_index) {
-        if( m_swap) this->m_h->Fill( this->m_accessor2(j)*scale2, vec[m_index]*scale1 ) ;
-        else        this->m_h->Fill( vec[m_index] *scale1, this->m_accessor2(j)*scale2) ;
+        if( m_swap) this->m_h->Fill( this->m_accessor2(j)*scale2, vec[m_index]*scale1, weight ) ;
+        else        this->m_h->Fill( vec[m_index] *scale1, this->m_accessor2(j)*scale2, weight) ;
       }
     }
 
@@ -296,18 +296,18 @@ int JetAttributeHisto::buildHistos(){
   return 0;
 }
 
-int JetAttributeHisto::fillHistosFromJet(const xAOD::Jet &j){
-  m_histoFiller->fill(j);
+int JetAttributeHisto::fillHistosFromJet(const xAOD::Jet &j, float weight){
+  m_histoFiller->fill(j, weight);
   return 0;
 }
 
-int JetAttributeHisto::fillHistosFromContainer(const xAOD::JetContainer & cont){
+int JetAttributeHisto::fillHistosFromContainer(const xAOD::JetContainer & cont, float weight){
   if (cont.empty() ) return 0;
   const xAOD::Jet * j0 = cont[0];
   if ( !m_histoFiller->isValid(*j0) ){
     return 0;
   }
-  return JetHistoBase::fillHistosFromContainer(cont);
+  return JetHistoBase::fillHistosFromContainer(cont, weight);
 }
 
 
diff --git a/Reconstruction/Jet/JetMonitoring/Root/JetContainerHistoFiller.cxx b/Reconstruction/Jet/JetMonitoring/Root/JetContainerHistoFiller.cxx
index b5ac8f10e60a9e03364f951a0f38b9729957dd63..d5d664bf202a5bd247dbc714838ba583ce7d5cc4 100644
--- a/Reconstruction/Jet/JetMonitoring/Root/JetContainerHistoFiller.cxx
+++ b/Reconstruction/Jet/JetMonitoring/Root/JetContainerHistoFiller.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "JetMonitoring/JetContainerHistoFiller.h"
@@ -52,13 +52,14 @@ int JetContainerHistoFiller::fillHistos(){
     return 0;
   }
 
+  float weight = evtInfo->beamSpotWeight();
 
   /// simply call fillHistosFromContainer() for each tool...
   int count = 0;
   for( auto jtool : m_histoTools){
     ATH_MSG_DEBUG ("Filling hists " << jtool->name() << "..." << jCont);
 
-    count += jtool->fillHistosFromContainer(*jCont);
+    count += jtool->fillHistosFromContainer(*jCont, weight);
   }
 
   return count;    
diff --git a/Reconstruction/Jet/JetMonitoring/Root/JetHistoBase.cxx b/Reconstruction/Jet/JetMonitoring/Root/JetHistoBase.cxx
index aba0dc46256ef454642306cab84dcbb021697d9e..76b0de5e8141eb11b9e654762dd42764d121a70d 100644
--- a/Reconstruction/Jet/JetMonitoring/Root/JetHistoBase.cxx
+++ b/Reconstruction/Jet/JetMonitoring/Root/JetHistoBase.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "JetMonitoring/JetHistoBase.h"
@@ -21,13 +21,13 @@ StatusCode JetHistoBase::initialize() {
 
 
 
-int JetHistoBase::fillHistosFromContainer(const xAOD::JetContainer & cont){
+int JetHistoBase::fillHistosFromContainer(const xAOD::JetContainer & cont, float weight){
   int count=0;
-  for( const xAOD::Jet* jet : cont ){ count+=fillHistosFromJet( *jet );}
+  for( const xAOD::Jet* jet : cont ){ count+=fillHistosFromJet( *jet, weight );}
   return count;    
 }
 
-int JetHistoBase::fillHistosFromJet(const xAOD::Jet &) { return 0;}
+int JetHistoBase::fillHistosFromJet(const xAOD::Jet &, float /*weight*/) { return 0;}
 
 int JetHistoBase::finalizeHistos() {return 0;}
 
diff --git a/Reconstruction/Jet/JetMonitoring/Root/JetKinematicHistos.cxx b/Reconstruction/Jet/JetMonitoring/Root/JetKinematicHistos.cxx
index a69451cdc4ec78f3a71329c7ce84d9a4f6f72b94..3cce6af5dcbdbc425fa238bb256968da83330958 100644
--- a/Reconstruction/Jet/JetMonitoring/Root/JetKinematicHistos.cxx
+++ b/Reconstruction/Jet/JetMonitoring/Root/JetKinematicHistos.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "JetMonitoring/JetKinematicHistos.h"
@@ -96,42 +96,42 @@ int JetKinematicHistos::buildHistos(){
 
 
 
-int JetKinematicHistos::fillHistosFromContainer(const xAOD::JetContainer & cont){
+int JetKinematicHistos::fillHistosFromContainer(const xAOD::JetContainer & cont, float weight){
   // fill the N if needed. 
-  if (m_doN) m_njet->Fill( cont.size() );
+  if (m_doN) m_njet->Fill( cont.size(), weight );
   // Perform the loop over jets in the base class :
-  return JetHistoBase::fillHistosFromContainer(cont);
+  return JetHistoBase::fillHistosFromContainer(cont, weight);
 }
 
 
-int JetKinematicHistos::fillHistosFromJet(const xAOD::Jet &j){
+int JetKinematicHistos::fillHistosFromJet(const xAOD::Jet &j, float weight){
 
   if(m_jetScale != "JetAssignedScaleMomentum" && !j.isAvailable<float>(m_jetScale+"_pt")){
-    if(m_doNConstit) m_nConstit->Fill( j.numConstituents() );
+    if(m_doNConstit) m_nConstit->Fill( j.numConstituents(), weight );
     return 0;
   }
 
   // m_jetScale is a property of the base tool
   const xAOD::JetFourMom_t p4 = j.jetP4(m_jetScale);
-  m_pt->Fill( p4.Pt()*toGeV );
-  m_eta->Fill( p4.Eta() );
-  m_phi->Fill( p4.Phi() );
+  m_pt->Fill( p4.Pt()*toGeV, weight );
+  m_eta->Fill( p4.Eta(), weight );
+  m_phi->Fill( p4.Phi(), weight );
   if (p4.Pt()*toGeV > 200.0){ // high eta
-    m_pt_high->Fill( p4.Pt()*toGeV );
-    m_eta_high->Fill( p4.Eta() );
-    if(m_doE) m_e_high->Fill( p4.E()*toGeV );
-    if(m_doM) m_m_high->Fill( p4.M()*toGeV );
-    if(m_doNConstit) m_nConstit_high->Fill( j.numConstituents() );
+    m_pt_high->Fill( p4.Pt()*toGeV, weight );
+    m_eta_high->Fill( p4.Eta(), weight );
+    if(m_doE) m_e_high->Fill( p4.E()*toGeV, weight );
+    if(m_doM) m_m_high->Fill( p4.M()*toGeV, weight );
+    if(m_doNConstit) m_nConstit_high->Fill( j.numConstituents(), weight );
   }
 
-  if(m_doE) m_e->Fill( p4.E()*toGeV );
-  if(m_doM) m_m->Fill( p4.M()*toGeV );
+  if(m_doE) m_e->Fill( p4.E()*toGeV, weight );
+  if(m_doM) m_m->Fill( p4.M()*toGeV, weight );
   
-  if(m_doOccupancy) m_occupancyEtaPhi->Fill( p4.Eta(), p4.Phi() );
-  if(m_doAveragePt) m_averagePtEtaPhi->Fill( p4.Eta(), p4.Phi() , p4.Pt()*toGeV);
-  if(m_doAverageE) m_averageE_EtaPhi->Fill( p4.Eta(), p4.Phi() , p4.E()*toGeV);
+  if(m_doOccupancy) m_occupancyEtaPhi->Fill( p4.Eta(), p4.Phi(), weight );
+  if(m_doAveragePt) m_averagePtEtaPhi->Fill( p4.Eta(), p4.Phi() , p4.Pt()*toGeV, weight);
+  if(m_doAverageE) m_averageE_EtaPhi->Fill( p4.Eta(), p4.Phi() , p4.E()*toGeV, weight);
 
-  if(m_doNConstit) m_nConstit->Fill( j.numConstituents() );
+  if(m_doNConstit) m_nConstit->Fill( j.numConstituents(), weight );
   return 0;
 }
 
diff --git a/Reconstruction/Jet/JetMonitoring/Root/JetSubStructureHistos.cxx b/Reconstruction/Jet/JetMonitoring/Root/JetSubStructureHistos.cxx
index 7b44b80acf01be013c2949696fff3c8156ccb1fa..404eed0b58631e0ba8c04524c84c26172e262c7a 100644
--- a/Reconstruction/Jet/JetMonitoring/Root/JetSubStructureHistos.cxx
+++ b/Reconstruction/Jet/JetMonitoring/Root/JetSubStructureHistos.cxx
@@ -63,17 +63,17 @@ int JetSubStructureHistos::buildHistos(){
 
 
 
-int JetSubStructureHistos::fillHistosFromJet(const xAOD::Jet &j){
+int JetSubStructureHistos::fillHistosFromJet(const xAOD::Jet &j, float weight){
   //For definitions see JetSubStructureMomentTools
   
-  if( j.getAttribute<float>("Tau1") > 1e-8 ) m_tau21->Fill( j.getAttribute<float>("Tau2") / j.getAttribute<float>("Tau1") );
-  if( j.getAttribute<float>("Tau2") > 1e-8 ) m_tau32->Fill( j.getAttribute<float>("Tau3") / j.getAttribute<float>("Tau2") );
-  if( j.getAttribute<float>("Tau1_wta") > 1e-8 ) m_tau21_wta->Fill( j.getAttribute<float>("Tau2_wta") / j.getAttribute<float>("Tau1_wta") );
-  if( j.getAttribute<float>("Tau2_wta") > 1e-8 ) m_tau32_wta->Fill( j.getAttribute<float>("Tau3_wta") / j.getAttribute<float>("Tau2_wta") );
-
-  if( j.getAttribute<float>("ECF1") > 1e-8 ) m_C1->Fill( j.getAttribute<float>("ECF2") / pow( j.getAttribute<float>("ECF1"), 2.0) );
-  if( j.getAttribute<float>("ECF2") > 1e-8 ) m_C2->Fill( ( j.getAttribute<float>("ECF3") * j.getAttribute<float>("ECF1") ) / pow( j.getAttribute<float>("ECF2"), 2.0) );
-  if( j.getAttribute<float>("ECF2") > 1e-8 ) m_D2->Fill( ( j.getAttribute<float>("ECF3") * pow( j.getAttribute<float>("ECF1"), 3.0 ) ) / pow( j.getAttribute<float>("ECF2"), 3.0) );
+  if( j.getAttribute<float>("Tau1") > 1e-8 ) m_tau21->Fill( j.getAttribute<float>("Tau2") / j.getAttribute<float>("Tau1"), weight );
+  if( j.getAttribute<float>("Tau2") > 1e-8 ) m_tau32->Fill( j.getAttribute<float>("Tau3") / j.getAttribute<float>("Tau2"), weight );
+  if( j.getAttribute<float>("Tau1_wta") > 1e-8 ) m_tau21_wta->Fill( j.getAttribute<float>("Tau2_wta") / j.getAttribute<float>("Tau1_wta"), weight );
+  if( j.getAttribute<float>("Tau2_wta") > 1e-8 ) m_tau32_wta->Fill( j.getAttribute<float>("Tau3_wta") / j.getAttribute<float>("Tau2_wta"), weight );
+
+  if( j.getAttribute<float>("ECF1") > 1e-8 ) m_C1->Fill( j.getAttribute<float>("ECF2") / pow( j.getAttribute<float>("ECF1"), 2.0), weight );
+  if( j.getAttribute<float>("ECF2") > 1e-8 ) m_C2->Fill( ( j.getAttribute<float>("ECF3") * j.getAttribute<float>("ECF1") ) / pow( j.getAttribute<float>("ECF2"), 2.0), weight );
+  if( j.getAttribute<float>("ECF2") > 1e-8 ) m_D2->Fill( ( j.getAttribute<float>("ECF3") * pow( j.getAttribute<float>("ECF1"), 3.0 ) ) / pow( j.getAttribute<float>("ECF2"), 3.0), weight );
 
   return 0;
 }
diff --git a/Reconstruction/Jet/JetMonitoring/Root/LeadingJetsRelations.cxx b/Reconstruction/Jet/JetMonitoring/Root/LeadingJetsRelations.cxx
index 7097095eae0e352bc1891ed813d93b02c4c16587..4ff6d2bfc86bc52387d1da2dbdc24c3acb603d23 100644
--- a/Reconstruction/Jet/JetMonitoring/Root/LeadingJetsRelations.cxx
+++ b/Reconstruction/Jet/JetMonitoring/Root/LeadingJetsRelations.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "JetMonitoring/LeadingJetsRelations.h"
@@ -44,7 +44,7 @@ int LeadingJetsRelations::buildHistos(){
 }
 
 
-int LeadingJetsRelations::fillHistosFromContainer(const xAOD::JetContainer &cont){
+int LeadingJetsRelations::fillHistosFromContainer(const xAOD::JetContainer &cont, float weight){
   if( cont.size()<2) return 0;
 
   const xAOD::Jet * j1 = cont[0];
@@ -55,13 +55,13 @@ int LeadingJetsRelations::fillHistosFromContainer(const xAOD::JetContainer &cont
   if(dPhi > 2*3.14159) dPhi -= 2*3.14159;
   double dR = sqrt( dPhi*dPhi + dEta*dEta);
   
-  if(m_histDeltaEta) m_histDeltaEta->Fill( dEta);
-  if(m_histDeltaPhi) m_histDeltaPhi->Fill( dPhi);
-  if(m_histDeltaR) m_histDeltaR->Fill( dR);
+  if(m_histDeltaEta) m_histDeltaEta->Fill( dEta, weight);
+  if(m_histDeltaPhi) m_histDeltaPhi->Fill( dPhi, weight);
+  if(m_histDeltaR) m_histDeltaR->Fill( dR, weight);
 
-  if(m_histFrac) m_histFrac->Fill( j2->pt() / j1->pt());
+  if(m_histFrac) m_histFrac->Fill( j2->pt() / j1->pt(), weight);
 
-  if(m_histEta1Eta2) m_histEta1Eta2->Fill( j1->eta(), j2->eta() );
+  if(m_histEta1Eta2) m_histEta1Eta2->Fill( j1->eta(), j2->eta(), weight );
 
   return 0;
 }
diff --git a/Reconstruction/Jet/JetRec/python/JetAlgorithm.py b/Reconstruction/Jet/JetRec/python/JetAlgorithm.py
index 163cfb21d5fa5fafbf130ce6de6ef7e0637cf8d3..79ea227347daa777062e3123ea6bb200d2de49d2 100644
--- a/Reconstruction/Jet/JetRec/python/JetAlgorithm.py
+++ b/Reconstruction/Jet/JetRec/python/JetAlgorithm.py
@@ -104,10 +104,6 @@ def addJetRecoToAlgSequence(job =None, useTruth =None, eventShapeTools =None,
   if jetFlags.useTracks:
     ctools += [jtm.tracksel, jtm.trackselloose_trackjets]
     if jetFlags.useVertices:
-      # Decorations may be made by a separate ID algorithm.
-      if not hasattr (job, 'InDetUsedInFitDecorator'):
-        ctools += [jtm.tvassocdeco]
-          
       ctools += [jtm.tvassoc]
    
   # LCOriginTopoClusters and EMOriginTopoClusters are shallow copies
diff --git a/Reconstruction/Jet/JetRec/python/JetRecStandardTools.py b/Reconstruction/Jet/JetRec/python/JetRecStandardTools.py
index 15f2208f27536c4728d7fcf818a3297cd9c31a06..cc23a1855cfc4c44907de44126376e2166def2bc 100644
--- a/Reconstruction/Jet/JetRec/python/JetRecStandardTools.py
+++ b/Reconstruction/Jet/JetRec/python/JetRecStandardTools.py
@@ -32,7 +32,6 @@ from JetRecTools.JetRecToolsConf import ChargedHadronSubtractionTool
 from JetRecTools.JetRecToolsConf import JetTrackSelectionTool
 from JetRecTools.JetRecToolsConf import JetTrackSelectionTool2
 from JetRecTools.JetRecToolsConf import SimpleJetTrackSelectionTool
-from JetRecTools.JetRecToolsConf import JetUsedInFitTrackDecoratorTool
 from JetRecTools.JetRecToolsConf import TrackVertexAssociationTool
 
 try:
@@ -158,14 +157,8 @@ else:
 # Track-vertex association.
 #--------------------------------------------------------------
 
-# Need to add used-in-fit decorator beforehand:
-from InDetUsedInFitTrackDecoratorTool.InDetUsedInFitTrackDecoratorToolConf import InDet__InDetUsedInFitTrackDecoratorTool
-jtm += InDet__InDetUsedInFitTrackDecoratorTool("jetUsedInFitTrkDecoTool", TrackContainer = jtm.trackContainer, VertexContainer = jtm.vertexContainer)
-
-jtm += JetUsedInFitTrackDecoratorTool("tvassocdeco", Decorator = jtm.jetUsedInFitTrkDecoTool)
-
-from TrackVertexAssociationTool.TrackVertexAssociationToolConf import CP__TrackVertexAssociationTool
-jtm += CP__TrackVertexAssociationTool("jetLooseTVAtool", WorkingPoint="Custom", d0_cut=2.0, dzSinTheta_cut=2.0)
+from TrackVertexAssociationTool.getTTVAToolForReco import getTTVAToolForReco
+jtm += getTTVAToolForReco("jetLooseTVAtool", WorkingPoint="Custom", d0_cut=2.0, dzSinTheta_cut=2.0, TrackContName=jtm.trackContainer, VertexContName=jtm.vertexContainer)
 
 jtm += TrackVertexAssociationTool(
   "tvassoc",
diff --git a/Reconstruction/Jet/JetRecTools/python/JetRecToolsConfig.py b/Reconstruction/Jet/JetRecTools/python/JetRecToolsConfig.py
index 27a961e90a83657754aa64b053a1e18eb36004c5..0b7b2c0c9dfdd84cfd1f5d2abe2f5aa6ad6f2216 100644
--- a/Reconstruction/Jet/JetRecTools/python/JetRecToolsConfig.py
+++ b/Reconstruction/Jet/JetRecTools/python/JetRecToolsConfig.py
@@ -55,18 +55,22 @@ def getTrackSelTool(trkopt="",doWriteTracks=False, cutLevel="Loose", minPt=500):
 
     return jettrackselloose
 
-def getTrackVertexAssocTool(trkopt=""):
+def getTrackVertexAssocTool(trkopt="", theSequence=None):
     if trkopt: "_{}".format(trkopt)
     # Track-vertex association
     # This is to be deprecated
     # In fact can probably be switched already to match legacy master
     # but for a future MR
-    idtvassoc = CompFactory.getComp("CP::TrackVertexAssociationTool")(
+    from TrackVertexAssociationTool.getTTVAToolForReco import getTTVAToolForReco
+    idtvassoc = getTTVAToolForReco(
         "idloosetvassoc",
         WorkingPoint = "Custom",
         d0_cut = 2.0,
         dzSinTheta_cut = 2.0,
-        TrackContName = trackcollectionmap[trkopt]["Tracks"]
+        TrackContName = trackcollectionmap[trkopt]["Tracks"],
+        VertexContName = trackcollectionmap[trkopt]["Vertices"],
+        returnCompFactory = True,
+        add2Seq=theSequence
     )
 
     jettvassoc = CompFactory.TrackVertexAssociationTool(
@@ -74,7 +78,7 @@ def getTrackVertexAssocTool(trkopt=""):
         TrackParticleContainer  = trackcollectionmap[trkopt]["Tracks"],
         TrackVertexAssociation  = trackcollectionmap[trkopt]["TVA"],
         VertexContainer         = trackcollectionmap[trkopt]["Vertices"],
-        TrackVertexAssoTool     = idtvassoc,
+        TrackVertexAssoTool     = idtvassoc
     )
     return jettvassoc
 
@@ -83,8 +87,10 @@ def getTrackUsedInFitTool(trkopt=""):
     # InDet decorator tool:
     IDUsedInFitTrkDecoTool = CompFactory.getComp("InDet::InDetUsedInFitTrackDecoratorTool")(
         "IDUsedInFitTrkDecoTool",
-        TrackContainer  = trackcollectionmap[trkopt]["Tracks"],
-        VertexContainer = trackcollectionmap[trkopt]["Vertices"]
+        TrackContainer       = trackcollectionmap[trkopt]["Tracks"],
+        VertexContainer      = trackcollectionmap[trkopt]["Vertices"],
+        AMVFVerticesDecoName = "TTVA_AMVFVertices_forReco",
+        AMVFWeightsDecoName  = "TTVA_AMVFWeights_forReco"
     )
     # Jet wrapper:
     JetUsedInFitTrkDecoTool = CompFactory.JetUsedInFitTrackDecoratorTool(
diff --git a/Reconstruction/MET/METReconstruction/python/LegacyRunII/METRecoConfig.py b/Reconstruction/MET/METReconstruction/python/LegacyRunII/METRecoConfig.py
index f8d4dfb203cdeb9194cd467fd5bd0b175ee92b1e..7684023b308f1c728f13088570317830365f2889 100644
--- a/Reconstruction/MET/METReconstruction/python/LegacyRunII/METRecoConfig.py
+++ b/Reconstruction/MET/METReconstruction/python/LegacyRunII/METRecoConfig.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 
 from __future__ import print_function
 from AthenaCommon import CfgMgr
@@ -241,7 +241,8 @@ class METConfig:
                                                               maxZ0SinTheta=3,
                                                               maxD0=2,
                                                               minPt=500)
-        self.trkvxtool=CfgMgr.CP__TrackVertexAssociationTool("TrackVertexAssociationTool_MET", WorkingPoint="Nominal")
+        from TrackVertexAssociationTool.getTTVAToolForReco import getTTVAToolForReco
+        self.trkvxtool=getTTVAToolForReco("TrackVertexAssociationTool_MET", WorkingPoint="Nominal")
         self.trkisotool = CfgMgr.xAOD__TrackIsolationTool("TrackIsolationTool_MET")
         self.trkisotool.TrackSelectionTool = self.trkseltool # As configured above
         from TrackToCalo.TrackToCaloConf import Trk__ParticleCaloExtensionTool, Rec__ParticleCaloCellAssociationTool            
diff --git a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/CaloTrkMuIdTools/CaloMuonScoreTool.h b/Reconstruction/MuonIdentification/CaloTrkMuIdTools/CaloTrkMuIdTools/CaloMuonScoreTool.h
index 9d1bb50fa290e4fe8632d38005818c60d2c7c1ef..582605ce68bfbfa2b9b7bc963ca058db92a96af2 100644
--- a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/CaloTrkMuIdTools/CaloMuonScoreTool.h
+++ b/Reconstruction/MuonIdentification/CaloTrkMuIdTools/CaloTrkMuIdTools/CaloMuonScoreTool.h
@@ -43,7 +43,7 @@ public:
   virtual StatusCode initialize();
   
   // Compute the muon score given a track particle
-  float getMuonScore(const xAOD::TrackParticle* trk) const;
+  float getMuonScore(const xAOD::TrackParticle* trk, const CaloCellContainer* cells = nullptr, const CaloExtensionCollection* extensionCache = nullptr) const;
 
   // run the ONNX inference on the input tensor
   float runOnnxInference(std::vector<float> &tensor) const;
diff --git a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/CaloTrkMuIdTools/TrackDepositInCaloTool.h b/Reconstruction/MuonIdentification/CaloTrkMuIdTools/CaloTrkMuIdTools/TrackDepositInCaloTool.h
index 093f0c8cd9345cfdf8d6b306ea5e78621f6c2c26..143a65b6f171e49625252f5e86e88d6856141ca9 100755
--- a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/CaloTrkMuIdTools/TrackDepositInCaloTool.h
+++ b/Reconstruction/MuonIdentification/CaloTrkMuIdTools/CaloTrkMuIdTools/TrackDepositInCaloTool.h
@@ -66,7 +66,7 @@ class TrackDepositInCaloTool: public AthAlgTool, virtual public ITrackDepositInC
     */
     std::vector<DepositInCalo> getDeposits(const Trk::TrackParameters* par, const CaloCellContainer* caloCellCont = nullptr) const;
 
-    std::vector<DepositInCalo> getDeposits(const xAOD::TrackParticle* tp) const;
+    std::vector<DepositInCalo> getDeposits(const xAOD::TrackParticle* tp, const CaloCellContainer* caloCellCont = nullptr, const CaloExtensionCollection* extensionCache = nullptr) const;
     
     std::vector<DepositInCalo> deposits(const Trk::TrackParameters *par, const double deltaR=0.3, const bool inCell= true) const;
     /**
diff --git a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/src/CaloMuonScoreTool.cxx b/Reconstruction/MuonIdentification/CaloTrkMuIdTools/src/CaloMuonScoreTool.cxx
index 12bb65e6cc27b206570cf41777623ac34be61382..a5f96564446345e4c1f9c6c4b99dba31d7827877 100644
--- a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/src/CaloMuonScoreTool.cxx
+++ b/Reconstruction/MuonIdentification/CaloTrkMuIdTools/src/CaloMuonScoreTool.cxx
@@ -12,6 +12,7 @@
 
 #include "TrkParameters/TrackParameters.h"
 #include "ParticleCaloExtension/ParticleCellAssociationCollection.h"
+#include "TrkCaloExtension/CaloExtensionCollection.h"
 
 #include <string>
 #include <iostream>
@@ -149,7 +150,7 @@ void CaloMuonScoreTool::fillInputVectors(std::unique_ptr<const Rec::ParticleCell
 ///////////////////////////////////////////////////////////////////////////////
 // CaloMuonScoreTool::getMuonScore
 ///////////////////////////////////////////////////////////////////////////////
-float CaloMuonScoreTool::getMuonScore( const xAOD::TrackParticle* trk ) const {  
+float CaloMuonScoreTool::getMuonScore( const xAOD::TrackParticle* trk, const CaloCellContainer* cells, const CaloExtensionCollection* extensionCache ) const {  
   ATH_MSG_DEBUG("in CaloMuonScoreTool::getMuonScore()");
 
   double track_eta = trk->eta();
@@ -165,7 +166,7 @@ float CaloMuonScoreTool::getMuonScore( const xAOD::TrackParticle* trk ) const {
   ATH_MSG_DEBUG("Finding calo cell association for track particle within cone of delta R="<<m_CaloCellAssociationConeSize);
 
   // - associate calocells to trackparticle
-  std::unique_ptr<const Rec::ParticleCellAssociation> association = m_caloCellAssociationTool->particleCellAssociation(*trk,m_CaloCellAssociationConeSize,nullptr);
+  std::unique_ptr<const Rec::ParticleCellAssociation> association = m_caloCellAssociationTool->particleCellAssociation(*trk,m_CaloCellAssociationConeSize,cells, extensionCache);
   if(!association){
     ATH_MSG_VERBOSE("Could not get particleCellAssociation");
     return -1.;
diff --git a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/src/TrackDepositInCaloTool.cxx b/Reconstruction/MuonIdentification/CaloTrkMuIdTools/src/TrackDepositInCaloTool.cxx
index cad4b2bb14eb7bfa93c8f3f2d51d0b665bc2e92b..6b0e25a0d2669710f1314496a8bed83e942986fe 100755
--- a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/src/TrackDepositInCaloTool.cxx
+++ b/Reconstruction/MuonIdentification/CaloTrkMuIdTools/src/TrackDepositInCaloTool.cxx
@@ -28,6 +28,7 @@
 #include "ParticleCaloExtension/ParticleCaloAssociation.h"
 #include "TrkCaloExtension/CaloExtension.h"
 #include "TrkCaloExtension/CaloExtensionHelpers.h"
+#include "TrkCaloExtension/CaloExtensionCollection.h"
 #include "GaudiKernel/ITHistSvc.h"
 // --- ROOT ---
 #include "TH1F.h"
@@ -199,7 +200,7 @@ std::vector<DepositInCalo> TrackDepositInCaloTool::getDeposits(const Trk::TrackP
 ///////////////////////////////////////////////////////////////////////////////
 // - New getDeposits
 ///////////////////////////////////////////////////////////////////////////////
-std::vector<DepositInCalo> TrackDepositInCaloTool::getDeposits(const xAOD::TrackParticle* tp) const {
+std::vector<DepositInCalo> TrackDepositInCaloTool::getDeposits(const xAOD::TrackParticle* tp, const CaloCellContainer* caloCellCont, const CaloExtensionCollection* extensionCache) const {
 
     ATH_MSG_DEBUG("In TrackDepositsInCaloTool::getDeposits() - new");
     std::vector<DepositInCalo> result;
@@ -208,7 +209,7 @@ std::vector<DepositInCalo> TrackDepositInCaloTool::getDeposits(const xAOD::Track
 // - associate calocells to trackparticle, cone size 0.2, use cache
 
     std::unique_ptr<const Rec::ParticleCellAssociation> association = 
-      m_caloCellAssociationTool->particleCellAssociation(*tp,0.2,nullptr);
+      m_caloCellAssociationTool->particleCellAssociation(*tp,0.2,caloCellCont, extensionCache);
 
     if(!association) return result;
        ATH_MSG_VERBOSE(" particleCellAssociation done  " << association.get() );
diff --git a/Reconstruction/MuonIdentification/ICaloTrkMuIdTools/CMakeLists.txt b/Reconstruction/MuonIdentification/ICaloTrkMuIdTools/CMakeLists.txt
index 3e5abe061ba251a45a03f4394d77615ce468de51..ab82b2e7e654a8d0011ec9af252096ddd6ded2b2 100644
--- a/Reconstruction/MuonIdentification/ICaloTrkMuIdTools/CMakeLists.txt
+++ b/Reconstruction/MuonIdentification/ICaloTrkMuIdTools/CMakeLists.txt
@@ -8,4 +8,4 @@ atlas_subdir( ICaloTrkMuIdTools )
 # Component(s) in the package:
 atlas_add_library( ICaloTrkMuIdTools
                    PUBLIC_HEADERS ICaloTrkMuIdTools
-		   LINK_LIBRARIES CaloEvent CaloIdentifier xAODCaloEvent xAODTracking GaudiKernel muonEvent TrkSurfaces TrkEventPrimitives TrkParameters TrkTrack CaloDetDescrLib )
+                   LINK_LIBRARIES CaloEvent CaloIdentifier xAODCaloEvent xAODTracking GaudiKernel muonEvent TrkSurfaces TrkEventPrimitives TrkParameters TrkTrack CaloDetDescrLib TrkCaloExtension )
diff --git a/Reconstruction/MuonIdentification/ICaloTrkMuIdTools/ICaloTrkMuIdTools/ICaloMuonScoreTool.h b/Reconstruction/MuonIdentification/ICaloTrkMuIdTools/ICaloTrkMuIdTools/ICaloMuonScoreTool.h
index 6eabefed1fe3e21904765736f07321cf7667ddca..411af7b5703159147df992828c1c126f35059fb8 100644
--- a/Reconstruction/MuonIdentification/ICaloTrkMuIdTools/ICaloTrkMuIdTools/ICaloMuonScoreTool.h
+++ b/Reconstruction/MuonIdentification/ICaloTrkMuIdTools/ICaloTrkMuIdTools/ICaloMuonScoreTool.h
@@ -7,6 +7,9 @@
 
 #include "GaudiKernel/IAlgTool.h"
 #include "xAODTracking/TrackParticle.h"
+#include "TrkCaloExtension/CaloExtensionCollection.h"
+
+class CaloCellContainer;
 
 static const InterfaceID IID_ICaloMuonScoreTool("ICaloMuonScoreTool",1,0);
 
@@ -18,7 +21,7 @@ class ICaloMuonScoreTool : virtual public IAlgTool
 
   static const InterfaceID& interfaceID(){return IID_ICaloMuonScoreTool;}
   
-  virtual float getMuonScore(const xAOD::TrackParticle* trk) const = 0;
+  virtual float getMuonScore(const xAOD::TrackParticle* trk, const CaloCellContainer* cells = nullptr, const CaloExtensionCollection* extensionCache = nullptr) const = 0;
   
 };
 
diff --git a/Reconstruction/MuonIdentification/ICaloTrkMuIdTools/ICaloTrkMuIdTools/ITrackDepositInCaloTool.h b/Reconstruction/MuonIdentification/ICaloTrkMuIdTools/ICaloTrkMuIdTools/ITrackDepositInCaloTool.h
index 541990f68534086e12d97d0558890c8b4749022c..319aa115d96fe0d234e334b3ff24c732b3848024 100644
--- a/Reconstruction/MuonIdentification/ICaloTrkMuIdTools/ICaloTrkMuIdTools/ITrackDepositInCaloTool.h
+++ b/Reconstruction/MuonIdentification/ICaloTrkMuIdTools/ICaloTrkMuIdTools/ITrackDepositInCaloTool.h
@@ -15,6 +15,7 @@
 #include "CaloEvent/CaloCell.h"
 #include "CaloEvent/CaloCellContainer.h"
 #include "xAODTracking/TrackParticle.h"
+#include "TrkCaloExtension/CaloExtensionCollection.h"
 
 static const InterfaceID IID_ITrackDepositInCaloTool("ITrackDepositInCaloTool", 1, 0);
 
@@ -51,7 +52,7 @@ class ITrackDepositInCaloTool: virtual public IAlgTool
     */
     virtual std::vector<DepositInCalo> getDeposits(const Trk::TrackParameters* par, const CaloCellContainer* caloCellCont = nullptr) const = 0;
     
-    virtual std::vector<DepositInCalo> getDeposits(const xAOD::TrackParticle* tp) const = 0;
+    virtual std::vector<DepositInCalo> getDeposits(const xAOD::TrackParticle* tp, const CaloCellContainer* caloCellCont = nullptr,  const CaloExtensionCollection* extensionCache = nullptr) const = 0;
     
     virtual StatusCode getTraversedLayers(const Trk::TrackParameters* par, std::map<double, const CaloDetDescriptor*>& caloInfo, std::vector<Amg::Vector3D>& extrapolations) const = 0;
     /**
diff --git a/Reconstruction/MuonIdentification/MuidTrackBuilder/src/CombinedMuonTrackBuilder.cxx b/Reconstruction/MuonIdentification/MuidTrackBuilder/src/CombinedMuonTrackBuilder.cxx
index ec847f245f2a3aa1cdefb0dd5a59926103b6ea3c..57a21a2ad1285fd6487e18745b1057f3dc56b125 100755
--- a/Reconstruction/MuonIdentification/MuidTrackBuilder/src/CombinedMuonTrackBuilder.cxx
+++ b/Reconstruction/MuonIdentification/MuidTrackBuilder/src/CombinedMuonTrackBuilder.cxx
@@ -1482,8 +1482,8 @@ CombinedMuonTrackBuilder::standaloneFit(const Trk::Track& inputSpectrometerTrack
 
             if (checkTrack("refineFit", refinedTrack.get(), track.get())) {
                 ATH_MSG_VERBOSE("refined track checks out");
+                track.swap(refinedTrack);
             }
-            track.swap(refinedTrack);
         } else {
             ATH_MSG_VERBOSE("refined track fit failed");
             ++improvementsFailed;
@@ -1529,8 +1529,8 @@ CombinedMuonTrackBuilder::standaloneFit(const Trk::Track& inputSpectrometerTrack
                           << " Chi2/DoF= " << fitChi2);
 
             ++m_countDegradedStandaloneFit;
-            if (improvementsFailed == 2) {
-                ATH_MSG_WARNING("reject track, quality degraded and improvements failed");
+            if (improvementsFailed >= 2) {
+                ATH_MSG_DEBUG("reject track, quality degraded and improvements failed");
                  if (haveSpectrometerRefit) {
                         delete spectrometerFit;
                 }
diff --git a/Reconstruction/MuonIdentification/MuonCombinedConfig/python/MuonCombinedRecToolsConfig.py b/Reconstruction/MuonIdentification/MuonCombinedConfig/python/MuonCombinedRecToolsConfig.py
index a615b6b95d90dfd7e94b4347d738aa91f988a792..4514e9ae42e8fb2e036735e259253613388e3492 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedConfig/python/MuonCombinedRecToolsConfig.py
+++ b/Reconstruction/MuonIdentification/MuonCombinedConfig/python/MuonCombinedRecToolsConfig.py
@@ -15,60 +15,8 @@ mm = 1
 
 def MuonCombinedTrackSummaryToolCfg(flags, name="", **kwargs):
     # Based on https://gitlab.cern.ch/atlas/athena/blob/release/22.0.8/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/CombinedMuonTrackSummary.py
-    # FIXME - check all of this once the ID configuration is available, because probably we can simplify this a lot
-    result = AtlasExtrapolatorCfg(flags)
-    extrapolator = result.getPrimary()
-    result.addPublicTool(extrapolator)
-
-    from InDetConfig. InDetRecToolConfig import InDetBoundaryCheckToolCfg
-    acc = InDetBoundaryCheckToolCfg(flags, name="CombinedMuonIDBoundaryCheckTool")
-    boundary_tool = result.popToolsAndMerge(acc)
-
-    from InDetConfig.InDetRecToolConfig import InDetTrackHoleSearchToolCfg
-    acc = InDetTrackHoleSearchToolCfg(flags,
-                                      name            = "CombinedMuonIDHoleSearch",
-                                      Extrapolator    = extrapolator,
-                                      CountDeadModulesAfterLastHit = True,
-                                      BoundaryCheckTool = boundary_tool,
-                                      Cosmics         = (flags.Beam.Type=="cosmics"))
-    indet_hole_search_tool = acc.getPrimary()
-    result.addPublicTool(indet_hole_search_tool)
-    result.merge(acc)
-    #FIXME - need InDet to provide configuration for PixelConditionsSummaryTool
-    # Also assuming we don't use DetailedPixelHoleSearch (since it seems to be off in standard workflows)
-    from InDetConfig.InDetRecToolConfig import InDetTrackSummaryHelperToolCfg
-    acc = InDetTrackSummaryHelperToolCfg(flags,
-                                         name="CombinedMuonIDSummaryHelper", 
-                                         AssoTool        = None, 
-                                         PixelToTPIDTool = None,
-                                         TestBLayerTool  = None,
-                                         DoSharedHits    = False,
-                                         usePixel        = True,
-                                         useSCT          = True,
-                                         useTRT          = True,
-                                         HoleSearch      = indet_hole_search_tool)
-    indet_track_summary_helper_tool = acc.getPrimary()
-    result.addPublicTool(indet_track_summary_helper_tool)
-    result.merge(acc)
-
-
-    from MuonConfig.MuonRecToolsConfig import MuonTrackSummaryHelperToolCfg
-    acc = MuonTrackSummaryHelperToolCfg(flags)
-    muon_track_summary_helper_tool = acc.getPrimary()
-    track_summary_tool = CompFactory.Trk.TrackSummaryTool(name="CombinedMuonTrackSummary",
-                                                          doSharedHits             = False,
-                                                          doHolesInDet             = True,
-                                                          doHolesMuon              = False,
-                                                          AddDetailedInDetSummary  = True,
-                                                          AddDetailedMuonSummary   = True,
-                                                          InDetSummaryHelperTool   = indet_track_summary_helper_tool,
-                                                          TRT_ElectronPidTool      = None,
-                                                          PixelToTPIDTool          = None,
-                                                          MuonSummaryHelperTool    = muon_track_summary_helper_tool,
-                                                          PixelExists              = True )
-    result.merge(acc)
-    result.addPublicTool(track_summary_tool)
-    result.setPrivateTools(track_summary_tool)
+    from TrkConfig.AtlasTrackSummaryToolConfig import AtlasTrackSummaryToolCfg
+    result = AtlasTrackSummaryToolCfg(flags, name = "CombinedMuonTrackSummary")
     return result
 
 def MuonTrackToVertexCfg(flags, name = 'MuonTrackToVertexTool', **kwargs ):
diff --git a/Reconstruction/MuonIdentification/MuonCombinedTrackFindingTools/src/MuonStauRecoTool.cxx b/Reconstruction/MuonIdentification/MuonCombinedTrackFindingTools/src/MuonStauRecoTool.cxx
index 67bba1ae5aca9fca0aeaaae469d570deeabf86d7..48458e1a885797f57ebbc68525ee500a97b9c3b8 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedTrackFindingTools/src/MuonStauRecoTool.cxx
+++ b/Reconstruction/MuonIdentification/MuonCombinedTrackFindingTools/src/MuonStauRecoTool.cxx
@@ -610,7 +610,8 @@ namespace MuonCombined {
         TrkDriftCircleMath::Segment segment = result;
         segment.hitsOnTrack(dcs.size());
         unsigned int ndofFit = segment.ndof();
-        double chi2NdofSegmentFit = segment.chi2()/(double)(ndofFit);
+        if (ndofFit < 1) continue;
+        double chi2NdofSegmentFit = segment.chi2()/ndofFit;
         bool hasDropHit = false;
         unsigned int dropDepth = 0;
         if( !segmentFinder.dropHits(segment, hasDropHit, dropDepth) ){
@@ -698,8 +699,8 @@ namespace MuonCombined {
 
         if( !isSelected ) continue;
 
-        hits.push_back(Muon::TimePointBetaFitter::Hit(distance,time,er));
-        candidate.stauHits.push_back(MuGirlNS::StauHit(MuGirlNS::MDTT_STAU_HIT, time+tof, ix, iy, iz, id, ie, er,sh, isEta, propTime));
+        hits.emplace_back(distance,time,er);
+        candidate.stauHits.emplace_back(MuGirlNS::MDTT_STAU_HIT, time+tof, ix, iy, iz, id, ie, er,sh, isEta, propTime);
       }
     }
     // fit data
diff --git a/Reconstruction/PFlow/PFlowValidation/PFODQA/src/ClusterValidationPlots.cxx b/Reconstruction/PFlow/PFlowValidation/PFODQA/src/ClusterValidationPlots.cxx
index 06a1f03382b3f0f363b7e0ef4ed81209cb225961..3118b1205ceb16ea73d835b1ed6e8012a6513f9b 100644
--- a/Reconstruction/PFlow/PFlowValidation/PFODQA/src/ClusterValidationPlots.cxx
+++ b/Reconstruction/PFlow/PFlowValidation/PFODQA/src/ClusterValidationPlots.cxx
@@ -1,15 +1,15 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "ClusterValidationPlots.h"
 
-ClusterValidationPlots::ClusterValidationPlots(PlotBase* pParent, std::string sDir,  std::string sClusterContainerName) : PlotBase(pParent, sDir),m_ClusterPlots(this,"PFO_JetETMiss/",sClusterContainerName),m_ClusterMomentPlots(this,"PFO_JetETMiss/",sClusterContainerName)
+ClusterValidationPlots::ClusterValidationPlots(PlotBase* pParent, std::string sDir, SG::ReadHandleKey<xAOD::CaloClusterContainer>& sClusterContainerName) : PlotBase(pParent, sDir),m_ClusterPlots(this,"PFO_JetETMiss/",sClusterContainerName),m_ClusterMomentPlots(this,"PFO_JetETMiss/",sClusterContainerName)
 {}
 
-void ClusterValidationPlots::fill(const xAOD::CaloCluster& theCluster){
-  m_ClusterPlots.fill(theCluster);
-  m_ClusterMomentPlots.fill(theCluster);
+void ClusterValidationPlots::fill(const xAOD::CaloCluster& theCluster, const xAOD::EventInfo& eventInfo){
+  m_ClusterPlots.fill(theCluster, eventInfo);
+  m_ClusterMomentPlots.fill(theCluster, eventInfo);
 }
 
 
diff --git a/Reconstruction/PFlow/PFlowValidation/PFODQA/src/ClusterValidationPlots.h b/Reconstruction/PFlow/PFlowValidation/PFODQA/src/ClusterValidationPlots.h
index d062bfe8ce2739b252cd0e936921ae850f2c949f..8354900662506632dd3855acd67ec18d2b6a0e89 100644
--- a/Reconstruction/PFlow/PFlowValidation/PFODQA/src/ClusterValidationPlots.h
+++ b/Reconstruction/PFlow/PFlowValidation/PFODQA/src/ClusterValidationPlots.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef CLUSTERVALIDATIONPLOTS_H
@@ -8,17 +8,21 @@
 #include "TrkValHistUtils/PlotBase.h"
 #include "PFOHistUtils/ClusterPlots.h"
 #include "PFOHistUtils/ClusterMomentPlots.h"
-#include "xAODCaloEvent/CaloCluster.h"
+#include "xAODEventInfo/EventInfo.h"
+#include "StoreGate/ReadHandleKey.h"
+#include "xAODCaloEvent/CaloClusterContainer.h"
+
+
 
 class ClusterValidationPlots : public PlotBase {
 
  public:
 
   /** Standard Constructor */
-  ClusterValidationPlots(PlotBase* pParent, std::string sDir, std::string sClusterContainerName);
+  ClusterValidationPlots(PlotBase* pParent, std::string sDir, SG::ReadHandleKey<xAOD::CaloClusterContainer>& sClusterContainerName);
 
   /** fill the histograms up */
-  void fill(const xAOD::CaloCluster& theCluster);
+  void fill(const xAOD::CaloCluster& theCluster, const xAOD::EventInfo& eventInfo);
 
  private:
   /** 4-vector histograms */
diff --git a/Reconstruction/PFlow/PFlowValidation/PFODQA/src/PhysValCluster.cxx b/Reconstruction/PFlow/PFlowValidation/PFODQA/src/PhysValCluster.cxx
index 78e8af556d0b8bdc8b492556c55bb2b83d052baf..38d77b508a102cb7438debdad778bd62603bf47f 100644
--- a/Reconstruction/PFlow/PFlowValidation/PFODQA/src/PhysValCluster.cxx
+++ b/Reconstruction/PFlow/PFlowValidation/PFODQA/src/PhysValCluster.cxx
@@ -1,27 +1,27 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "PhysValCluster.h"
 #include "xAODCaloEvent/CaloClusterContainer.h"
+#include "xAODEventInfo/EventInfo.h"
+#include "GaudiKernel/EventContext.h"
 
 PhysValCluster::PhysValCluster (const std::string& type, const std::string& name, const IInterface* parent ) : ManagedMonitorToolBase( type, name, parent ) {
-  declareProperty( "ClusterContainerName", m_clusterContainerName="");
 }
 
-PhysValCluster::~PhysValCluster() {}
-
 StatusCode PhysValCluster::initialize(){
-  ATH_CHECK(ManagedMonitorToolBase::initialize());
-  return StatusCode::SUCCESS;
+  ATH_CHECK(m_clusterContainerName.initialize());
+  ATH_CHECK(m_eventInfoName.initialize());
+  return ManagedMonitorToolBase::initialize();
 }
 
 
 StatusCode PhysValCluster::bookHistograms(){
 
-  std::string theName = "TopoClusters/TopoClusters_JetETMiss/JetETMiss_"+m_clusterContainerName;
+  std::string theName = "TopoClusters/TopoClusters_JetETMiss/JetETMiss_"+m_clusterContainerName.key();
 
-  m_clusterValidationPlots.reset(new ClusterValidationPlots(0,theName, theName));
+  m_clusterValidationPlots.reset(new ClusterValidationPlots(0,theName, m_clusterContainerName));
   m_clusterValidationPlots->setDetailLevel(100);
   m_clusterValidationPlots->initialize();
   std::vector<HistData> hists = m_clusterValidationPlots->retrieveBookedHistograms();
@@ -36,30 +36,22 @@ StatusCode PhysValCluster::bookHistograms(){
 
 StatusCode PhysValCluster::fillHistograms(){
 
-  const xAOD::CaloClusterContainer* theClusterContainer = NULL;
-
-  if( evtStore()->contains<xAOD::CaloClusterContainer>(m_clusterContainerName)){
-
-    ATH_CHECK( evtStore()->retrieve(theClusterContainer,m_clusterContainerName) );
+  const EventContext& ctx = Gaudi::Hive::currentContext();
+  SG::ReadHandle<xAOD::EventInfo> evInfoHdl{m_eventInfoName, ctx}; 
+  if(!evInfoHdl.isValid()){
+     ATH_MSG_ERROR("Do not have EventInfo with key " << m_eventInfoName.key());
+     return StatusCode::FAILURE;
+  }
 
-    if (!theClusterContainer){
-      ATH_MSG_WARNING(" Have NULL pointer to xAOD::CaloClusterContainer ");
-      return StatusCode::FAILURE;
-    }
-  
-    xAOD::CaloClusterContainer::const_iterator firstCluster = theClusterContainer->begin();
-    xAOD::CaloClusterContainer::const_iterator lastCluster = theClusterContainer->end();
+  SG::ReadHandle<xAOD::CaloClusterContainer> clusHdl{m_clusterContainerName, ctx};
 
-    for (; firstCluster != lastCluster; ++firstCluster) {
-      const xAOD::CaloCluster* theCluster = *firstCluster;
-      m_clusterValidationPlots->fill(*theCluster);
+  if(clusHdl.isValid()){
+    for(auto cluster: *clusHdl) {
+      m_clusterValidationPlots->fill(*cluster,*evInfoHdl);
     }
   }
-  else ATH_MSG_WARNING(" Cluster container : " << m_clusterContainerName << " not found");
+  else ATH_MSG_WARNING(" Cluster container : " << m_clusterContainerName.key() << " not found");
   return StatusCode::SUCCESS;
 
 }
 
-StatusCode PhysValCluster::procHistograms(){
-   return StatusCode::SUCCESS;
-}
diff --git a/Reconstruction/PFlow/PFlowValidation/PFODQA/src/PhysValCluster.h b/Reconstruction/PFlow/PFlowValidation/PFODQA/src/PhysValCluster.h
index 81819f4343db75359ab692d42132ff68b47f8c69..87b3890cb774564576bd5bbdb759b83cd5422946 100644
--- a/Reconstruction/PFlow/PFlowValidation/PFODQA/src/PhysValCluster.h
+++ b/Reconstruction/PFlow/PFlowValidation/PFODQA/src/PhysValCluster.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef PHYSVALCLUSTER_H
@@ -7,7 +7,10 @@
 
 #include "ClusterValidationPlots.h"
 #include "AthenaMonitoring/ManagedMonitorToolBase.h"
-#include <string>
+#include "StoreGate/ReadHandle.h"
+#include "StoreGate/ReadHandleKey.h"
+#include "xAODEventInfo/EventInfo.h"
+#include "xAODCaloEvent/CaloClusterContainer.h"
 
 class PhysValCluster : public ManagedMonitorToolBase {
 
@@ -16,19 +19,18 @@ class PhysValCluster : public ManagedMonitorToolBase {
   /** Standard Constructor */
   PhysValCluster (const std::string& type, const std::string& name, const IInterface* parent );
 
-  /** Standard Destructor */
-  virtual ~PhysValCluster();
-  
   /** Standard AlgTool Functions */
   virtual StatusCode initialize();
   virtual StatusCode bookHistograms();
   virtual StatusCode fillHistograms();
-  virtual StatusCode procHistograms();
 
  private:
 
   /** String that defines with Cluster container to use */
-  std::string m_clusterContainerName;
+  SG::ReadHandleKey<xAOD::CaloClusterContainer> m_clusterContainerName{this, "ClusterContainerName", "", "Validated cluster container key"};
+  /** Event info key */
+  SG::ReadHandleKey<xAOD::EventInfo> m_eventInfoName{this, "EventInfoName", "EventInfo", "Key for event info"};
+
 
   /** Pointer to class that defines which histogram blocks to fill */
   std::unique_ptr<ClusterValidationPlots> m_clusterValidationPlots;
diff --git a/Reconstruction/PFlow/PFlowValidation/PFOHistUtils/PFOHistUtils/ClusterMomentPlots.h b/Reconstruction/PFlow/PFlowValidation/PFOHistUtils/PFOHistUtils/ClusterMomentPlots.h
index 4c559bf56e2f63ec2ce53ab0a6e8f2c61b35d5ff..e92ca40348a57753181796ca49142b21bc11751d 100644
--- a/Reconstruction/PFlow/PFlowValidation/PFOHistUtils/PFOHistUtils/ClusterMomentPlots.h
+++ b/Reconstruction/PFlow/PFlowValidation/PFOHistUtils/PFOHistUtils/ClusterMomentPlots.h
@@ -1,12 +1,14 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef CLUSTERMOMENTPLOTS_H
 #define CLUSTERMOMENTPLOTS_H
 
 #include "TrkValHistUtils/PlotBase.h"
-#include "xAODCaloEvent/CaloCluster.h"
+#include "xAODEventInfo/EventInfo.h"
+#include "StoreGate/ReadHandleKey.h"
+#include "xAODCaloEvent/CaloClusterContainer.h"
 
 namespace PFO {
 
@@ -14,9 +16,9 @@ namespace PFO {
 
   public:
 
-     ClusterMomentPlots(PlotBase *pParent, std::string sDir, std::string sClusterContainerName);
+     ClusterMomentPlots(PlotBase *pParent, std::string sDir, SG::ReadHandleKey<xAOD::CaloClusterContainer>& sClusterContainerName);
 
-     void fill(const xAOD::CaloCluster& cluster);
+     void fill(const xAOD::CaloCluster& cluster, const xAOD::EventInfo& eventInfo);
 
   private:
 
@@ -40,7 +42,7 @@ namespace PFO {
      TH1* m_EM_PROBABILITY;
 
      void initializePlots();
-     std::string m_sClusterContainerName;
+     SG::ReadHandleKey<xAOD::CaloClusterContainer> m_sClusterContainerName;
 
   };
 
diff --git a/Reconstruction/PFlow/PFlowValidation/PFOHistUtils/PFOHistUtils/ClusterPlots.h b/Reconstruction/PFlow/PFlowValidation/PFOHistUtils/PFOHistUtils/ClusterPlots.h
index d027299d7ae5d31065e17e59ed017d3a97e0db1d..07ad1032c17d65f69f311a493c68999b55f24bf8 100644
--- a/Reconstruction/PFlow/PFlowValidation/PFOHistUtils/PFOHistUtils/ClusterPlots.h
+++ b/Reconstruction/PFlow/PFlowValidation/PFOHistUtils/PFOHistUtils/ClusterPlots.h
@@ -1,12 +1,15 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef CLUSTERPLOTS_H
 #define CLUSTERPLOTS_H
 
 #include "TrkValHistUtils/PlotBase.h"
-#include "xAODCaloEvent/CaloCluster.h"
+#include "xAODEventInfo/EventInfo.h"
+#include "StoreGate/ReadHandleKey.h"
+#include "xAODCaloEvent/CaloClusterContainer.h"
+
 
 namespace PFO {
 
@@ -14,9 +17,9 @@ namespace PFO {
 
   public:
 
-     ClusterPlots(PlotBase *pParent, std::string sDir, std::string sClusterContainerName);
+     ClusterPlots(PlotBase *pParent, std::string sDir, SG::ReadHandleKey<xAOD::CaloClusterContainer>& sClusterContainerName);
 
-     void fill(const xAOD::CaloCluster& Cluster);
+     void fill(const xAOD::CaloCluster& Cluster, const xAOD::EventInfo& eventInfo);
 
   private:
      TH1* m_Cluster_pt;
@@ -40,7 +43,7 @@ namespace PFO {
      TH1* m_Cluster_eSample_HAD;
 
      void initializePlots();
-     std::string m_sClusterContainerName;
+     SG::ReadHandleKey<xAOD::CaloClusterContainer> m_sClusterContainerName;
 
   };
 
diff --git a/Reconstruction/PFlow/PFlowValidation/PFOHistUtils/src/ClusterMomentPlots.cxx b/Reconstruction/PFlow/PFlowValidation/PFOHistUtils/src/ClusterMomentPlots.cxx
index a50dd2be866e64bb19d2d28c3d73df31e2368206..7c014102fadc4afc7ed43345c740f5fd1cb99001 100644
--- a/Reconstruction/PFlow/PFlowValidation/PFOHistUtils/src/ClusterMomentPlots.cxx
+++ b/Reconstruction/PFlow/PFlowValidation/PFOHistUtils/src/ClusterMomentPlots.cxx
@@ -1,12 +1,12 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "PFOHistUtils/ClusterMomentPlots.h"
 
 namespace PFO {
 
-  ClusterMomentPlots::ClusterMomentPlots(PlotBase* pParent, std::string sDir, std::string sClusterContainerName) : PlotBase(pParent, sDir), m_sClusterContainerName(sClusterContainerName){
+  ClusterMomentPlots::ClusterMomentPlots(PlotBase* pParent, std::string sDir, SG::ReadHandleKey<xAOD::CaloClusterContainer>& sClusterContainerName) : PlotBase(pParent, sDir), m_sClusterContainerName(sClusterContainerName){
     m_LATERAL = nullptr;
     m_LONGITUDINAL = nullptr;
     m_SECOND_R = nullptr;
@@ -30,118 +30,118 @@ namespace PFO {
 
   void ClusterMomentPlots::initializePlots(){
 
-    m_LATERAL = Book1D("PFO_LATERAL",m_sClusterContainerName + "_LATERAL",60,-1.0,2.0);
-    m_LONGITUDINAL = Book1D("PFO_LONGITUDINAL",m_sClusterContainerName + "_LONGITUDINAL",60,-1.0,2.0);
-    m_SECOND_R = Book1D("PFO_SECOND_R",m_sClusterContainerName + "_SECOND_R",60,-1.0,50.0); 
-    m_CENTER_LAMBDA = Book1D("PFO_CENTER_LAMBDA",m_sClusterContainerName + "_CENTER_LAMBDA",60,-1.0,3000.0);
-    m_FIRST_ENG_DENS = Book1D("PFO_FIRST_ENG_DENS",m_sClusterContainerName + "_FIRST_ENG_DENS",60,-1.0,2.0);
-    m_ENG_FRAC_MAX = Book1D("PFO_ENG_FRAC_MAX",m_sClusterContainerName + "_ENG_FRAC_MAX",60,-1.0,2.0);
-    m_ISOLATION = Book1D("PFO_ISOLATION",m_sClusterContainerName + "_ISOLATION",60,-1.0,2.0);
-    m_ENG_BAD_CELLS = Book1D("PFO_ENG_BAD_CELLS",m_sClusterContainerName + "_ENG_BAD_CELLS",120,-1.0,100.0);
-    m_N_BAD_CELLS = Book1D("PFO_N_BAD_CELLS",m_sClusterContainerName + "_N_BAD_CELLS",120,-1.0,20.0);
-    m_BADLARQ_FRAC = Book1D("PFO_BADLARQ_FRAC",m_sClusterContainerName + "_BADLARQ_FRAC",140,-3.0,5.0);
-    m_ENG_POS = Book1D("PFO_ENG_POS",m_sClusterContainerName + "_ENG_POS",60,-100.0,10000.0);
-    m_SIGNIFICANCE = Book1D("PFO_SIGNIFICANCE",m_sClusterContainerName + "_SIGNIFICANCE",300,-20.0,20.0);
-    m_AVG_LAR_Q = Book1D("PFO_AVG_LAR_Q",m_sClusterContainerName + "_AVG_LAR_Q",240,-1.0,200.0);
-    m_AVG_TILE_Q = Book1D("PFO_AVG_TILE_Q",m_sClusterContainerName + "_AVG_TILE_Q",240,-1.0,200.0);
-    m_CELL_SIG_SAMPLING = Book1D("PFO_CELL_SIG_SAMPLING",m_sClusterContainerName + "_CELL_SIG_SAMPLING",31,-1.0,30);
-    m_ENG_BAD_HV_CELLS = Book1D("PFO_ENG_BAD_HV_CELLS",m_sClusterContainerName + "_ENG_BAD_HV_CELLS",500,-5000.0,20000.0); 
-    m_N_BAD_HV_CELLS = Book1D("PFO_N_BAD_HV_CELLS",m_sClusterContainerName + "_N_BAD_HV_CELLS",50,-1.0,100.0);
-    m_EM_PROBABILITY = Book1D("PFO_EM_PROBABILITY",m_sClusterContainerName + "_EM_PROBABILITY",50,-0.05,1.05); 
+    m_LATERAL = Book1D("PFO_LATERAL",m_sClusterContainerName.key() + "_LATERAL",60,-1.0,2.0);
+    m_LONGITUDINAL = Book1D("PFO_LONGITUDINAL",m_sClusterContainerName.key() + "_LONGITUDINAL",60,-1.0,2.0);
+    m_SECOND_R = Book1D("PFO_SECOND_R",m_sClusterContainerName.key() + "_SECOND_R",60,-1.0,50.0); 
+    m_CENTER_LAMBDA = Book1D("PFO_CENTER_LAMBDA",m_sClusterContainerName.key() + "_CENTER_LAMBDA",60,-1.0,3000.0);
+    m_FIRST_ENG_DENS = Book1D("PFO_FIRST_ENG_DENS",m_sClusterContainerName.key() + "_FIRST_ENG_DENS",60,-1.0,2.0);
+    m_ENG_FRAC_MAX = Book1D("PFO_ENG_FRAC_MAX",m_sClusterContainerName.key() + "_ENG_FRAC_MAX",60,-1.0,2.0);
+    m_ISOLATION = Book1D("PFO_ISOLATION",m_sClusterContainerName.key() + "_ISOLATION",60,-1.0,2.0);
+    m_ENG_BAD_CELLS = Book1D("PFO_ENG_BAD_CELLS",m_sClusterContainerName.key() + "_ENG_BAD_CELLS",120,-1.0,100.0);
+    m_N_BAD_CELLS = Book1D("PFO_N_BAD_CELLS",m_sClusterContainerName.key() + "_N_BAD_CELLS",120,-1.0,20.0);
+    m_BADLARQ_FRAC = Book1D("PFO_BADLARQ_FRAC",m_sClusterContainerName.key() + "_BADLARQ_FRAC",140,-3.0,5.0);
+    m_ENG_POS = Book1D("PFO_ENG_POS",m_sClusterContainerName.key() + "_ENG_POS",60,-100.0,10000.0);
+    m_SIGNIFICANCE = Book1D("PFO_SIGNIFICANCE",m_sClusterContainerName.key() + "_SIGNIFICANCE",300,-20.0,20.0);
+    m_AVG_LAR_Q = Book1D("PFO_AVG_LAR_Q",m_sClusterContainerName.key() + "_AVG_LAR_Q",240,-1.0,200.0);
+    m_AVG_TILE_Q = Book1D("PFO_AVG_TILE_Q",m_sClusterContainerName.key() + "_AVG_TILE_Q",240,-1.0,200.0);
+    m_CELL_SIG_SAMPLING = Book1D("PFO_CELL_SIG_SAMPLING",m_sClusterContainerName.key() + "_CELL_SIG_SAMPLING",31,-1.0,30);
+    m_ENG_BAD_HV_CELLS = Book1D("PFO_ENG_BAD_HV_CELLS",m_sClusterContainerName.key() + "_ENG_BAD_HV_CELLS",500,-5000.0,20000.0); 
+    m_N_BAD_HV_CELLS = Book1D("PFO_N_BAD_HV_CELLS",m_sClusterContainerName.key() + "_N_BAD_HV_CELLS",50,-1.0,100.0);
+    m_EM_PROBABILITY = Book1D("PFO_EM_PROBABILITY",m_sClusterContainerName.key() + "_EM_PROBABILITY",50,-0.05,1.05); 
 
   }
 
-  void ClusterMomentPlots::fill(const xAOD::CaloCluster& cluster){
+  void ClusterMomentPlots::fill(const xAOD::CaloCluster& cluster, const xAOD::EventInfo& eventInfo){
 
     double moment_LATERAL = 0.0;
     bool gotMoment = cluster.retrieveMoment(xAOD::CaloCluster::LATERAL,moment_LATERAL);
-    if (true == gotMoment) m_LATERAL->Fill(moment_LATERAL);
-    else m_LATERAL->Fill(-1.0);
+    if (true == gotMoment) m_LATERAL->Fill(moment_LATERAL,eventInfo.beamSpotWeight());
+    else m_LATERAL->Fill(-1.0,eventInfo.beamSpotWeight());
 
     double moment_LONGITUDINAL = 0.0;
     gotMoment = cluster.retrieveMoment(xAOD::CaloCluster::LONGITUDINAL,moment_LONGITUDINAL);
-    if (true == gotMoment) m_LONGITUDINAL->Fill(moment_LONGITUDINAL);
-    else m_LONGITUDINAL->Fill(-1.0);
+    if (true == gotMoment) m_LONGITUDINAL->Fill(moment_LONGITUDINAL,eventInfo.beamSpotWeight());
+    else m_LONGITUDINAL->Fill(-1.0,eventInfo.beamSpotWeight());
     
     double moment_SECOND_R = 0.0;
     gotMoment = cluster.retrieveMoment(xAOD::CaloCluster::SECOND_R,moment_SECOND_R);
-    if (true == gotMoment) m_SECOND_R->Fill(moment_SECOND_R);
-    else m_SECOND_R->Fill(-1.0);
+    if (true == gotMoment) m_SECOND_R->Fill(moment_SECOND_R,eventInfo.beamSpotWeight());
+    else m_SECOND_R->Fill(-1.0,eventInfo.beamSpotWeight());
 
     double moment_CENTER_LAMBDA = 0.0;
     gotMoment = cluster.retrieveMoment(xAOD::CaloCluster::CENTER_LAMBDA,moment_CENTER_LAMBDA);
-    if (true == gotMoment) m_CENTER_LAMBDA->Fill(moment_CENTER_LAMBDA);
-    else m_CENTER_LAMBDA->Fill(-1.0);
+    if (true == gotMoment) m_CENTER_LAMBDA->Fill(moment_CENTER_LAMBDA,eventInfo.beamSpotWeight());
+    else m_CENTER_LAMBDA->Fill(-1.0,eventInfo.beamSpotWeight());
     
     double moment_FIRST_ENG_DENS = 0.0;
     gotMoment = cluster.retrieveMoment(xAOD::CaloCluster::FIRST_ENG_DENS,moment_FIRST_ENG_DENS);
-    if (true == gotMoment) m_FIRST_ENG_DENS->Fill(moment_FIRST_ENG_DENS);
-    else m_FIRST_ENG_DENS->Fill(-1.0);
+    if (true == gotMoment) m_FIRST_ENG_DENS->Fill(moment_FIRST_ENG_DENS,eventInfo.beamSpotWeight());
+    else m_FIRST_ENG_DENS->Fill(-1.0,eventInfo.beamSpotWeight());
 
     double moment_ENG_FRAC_MAX = 0.0;
     gotMoment = cluster.retrieveMoment(xAOD::CaloCluster::ENG_FRAC_MAX,moment_ENG_FRAC_MAX);
-    if (true == gotMoment) m_ENG_FRAC_MAX->Fill(moment_ENG_FRAC_MAX);
-    else m_ENG_FRAC_MAX->Fill(-1.0);
+    if (true == gotMoment) m_ENG_FRAC_MAX->Fill(moment_ENG_FRAC_MAX,eventInfo.beamSpotWeight());
+    else m_ENG_FRAC_MAX->Fill(-1.0,eventInfo.beamSpotWeight());
 
     double moment_ISOLATION = 0.0;
     gotMoment = cluster.retrieveMoment(xAOD::CaloCluster::ISOLATION,moment_ISOLATION);
-    if (true == gotMoment) m_ISOLATION->Fill(moment_ISOLATION);
-    else m_ISOLATION->Fill(-1.0);
+    if (true == gotMoment) m_ISOLATION->Fill(moment_ISOLATION,eventInfo.beamSpotWeight());
+    else m_ISOLATION->Fill(-1.0,eventInfo.beamSpotWeight());
 
     double moment_ENG_BAD_CELLS = 0.0;
     gotMoment = cluster.retrieveMoment(xAOD::CaloCluster::ENG_BAD_CELLS,moment_ENG_BAD_CELLS);
-    if (true == gotMoment) m_ENG_BAD_CELLS->Fill(moment_ENG_BAD_CELLS);
-    else m_ENG_BAD_CELLS->Fill(-1.0);
+    if (true == gotMoment) m_ENG_BAD_CELLS->Fill(moment_ENG_BAD_CELLS,eventInfo.beamSpotWeight());
+    else m_ENG_BAD_CELLS->Fill(-1.0,eventInfo.beamSpotWeight());
 
     double moment_N_BAD_CELLS = 0.0;
     gotMoment = cluster.retrieveMoment(xAOD::CaloCluster::N_BAD_CELLS,moment_N_BAD_CELLS);
-    if (true == gotMoment) m_N_BAD_CELLS->Fill(moment_N_BAD_CELLS);
-    else m_N_BAD_CELLS->Fill(-1.0);
+    if (true == gotMoment) m_N_BAD_CELLS->Fill(moment_N_BAD_CELLS,eventInfo.beamSpotWeight());
+    else m_N_BAD_CELLS->Fill(-1.0,eventInfo.beamSpotWeight());
 
     double moment_BADLARQ_FRAC = 0.0;
     gotMoment = cluster.retrieveMoment(xAOD::CaloCluster::BADLARQ_FRAC,moment_BADLARQ_FRAC);
-    if (true == gotMoment) m_BADLARQ_FRAC->Fill(moment_BADLARQ_FRAC);
-    else m_BADLARQ_FRAC->Fill(-1.0);
+    if (true == gotMoment) m_BADLARQ_FRAC->Fill(moment_BADLARQ_FRAC,eventInfo.beamSpotWeight());
+    else m_BADLARQ_FRAC->Fill(-1.0,eventInfo.beamSpotWeight());
 
     double moment_ENG_POS = 0.0;
     gotMoment = cluster.retrieveMoment(xAOD::CaloCluster::ENG_POS,moment_ENG_POS);
-    if (true == gotMoment) m_ENG_POS->Fill(moment_ENG_POS);
-    else m_ENG_POS->Fill(-1.0);
+    if (true == gotMoment) m_ENG_POS->Fill(moment_ENG_POS,eventInfo.beamSpotWeight());
+    else m_ENG_POS->Fill(-1.0,eventInfo.beamSpotWeight());
 
     double moment_SIGNIFICANCE = 0.0;
     gotMoment = cluster.retrieveMoment(xAOD::CaloCluster::SIGNIFICANCE,moment_SIGNIFICANCE);
-    if (true == gotMoment) m_SIGNIFICANCE->Fill(moment_SIGNIFICANCE);
-    else m_SIGNIFICANCE->Fill(-1.0);
+    if (true == gotMoment) m_SIGNIFICANCE->Fill(moment_SIGNIFICANCE,eventInfo.beamSpotWeight());
+    else m_SIGNIFICANCE->Fill(-1.0,eventInfo.beamSpotWeight());
 
     double moment_AVG_LAR_Q = 0.0;
     gotMoment = cluster.retrieveMoment(xAOD::CaloCluster::AVG_LAR_Q,moment_AVG_LAR_Q);
-    if (true == gotMoment) m_AVG_LAR_Q->Fill(moment_AVG_LAR_Q);
-    else m_AVG_LAR_Q->Fill(-1.0);
+    if (true == gotMoment) m_AVG_LAR_Q->Fill(moment_AVG_LAR_Q,eventInfo.beamSpotWeight());
+    else m_AVG_LAR_Q->Fill(-1.0,eventInfo.beamSpotWeight());
 
     double moment_AVG_TILE_Q = 0.0;
     gotMoment = cluster.retrieveMoment(xAOD::CaloCluster::AVG_TILE_Q,moment_AVG_TILE_Q);
-    if (true == gotMoment) m_AVG_TILE_Q->Fill(moment_AVG_TILE_Q);
-    else m_AVG_TILE_Q->Fill(-1.0);
+    if (true == gotMoment) m_AVG_TILE_Q->Fill(moment_AVG_TILE_Q,eventInfo.beamSpotWeight());
+    else m_AVG_TILE_Q->Fill(-1.0,eventInfo.beamSpotWeight());
 
     double moment_CELL_SIG_SAMPLING = 0;
     gotMoment = cluster.retrieveMoment(xAOD::CaloCluster::CELL_SIG_SAMPLING,moment_CELL_SIG_SAMPLING);
-    if (true == gotMoment) m_CELL_SIG_SAMPLING->Fill(moment_CELL_SIG_SAMPLING);
-    else m_CELL_SIG_SAMPLING->Fill(-1.0);
+    if (true == gotMoment) m_CELL_SIG_SAMPLING->Fill(moment_CELL_SIG_SAMPLING,eventInfo.beamSpotWeight());
+    else m_CELL_SIG_SAMPLING->Fill(-1.0,eventInfo.beamSpotWeight());
 
     double moment_ENG_BAD_HV_CELLS = 0.0;
     gotMoment = cluster.retrieveMoment(xAOD::CaloCluster::ENG_BAD_HV_CELLS,moment_ENG_BAD_HV_CELLS);
-    if (true == gotMoment) m_ENG_BAD_HV_CELLS->Fill(moment_ENG_BAD_HV_CELLS);
-    else m_ENG_BAD_HV_CELLS->Fill(-1.0);
+    if (true == gotMoment) m_ENG_BAD_HV_CELLS->Fill(moment_ENG_BAD_HV_CELLS,eventInfo.beamSpotWeight());
+    else m_ENG_BAD_HV_CELLS->Fill(-1.0,eventInfo.beamSpotWeight());
 
     double moment_N_BAD_HV_CELLS = 0.0;
     gotMoment = cluster.retrieveMoment(xAOD::CaloCluster::N_BAD_HV_CELLS,moment_N_BAD_HV_CELLS);
-    if (true == gotMoment) m_N_BAD_HV_CELLS->Fill(moment_N_BAD_HV_CELLS);
-    else m_N_BAD_HV_CELLS->Fill(-1.0);
+    if (true == gotMoment) m_N_BAD_HV_CELLS->Fill(moment_N_BAD_HV_CELLS,eventInfo.beamSpotWeight());
+    else m_N_BAD_HV_CELLS->Fill(-1.0,eventInfo.beamSpotWeight());
 
     double moment_EM_PROBABILITY = 0.0;
     gotMoment = cluster.retrieveMoment(xAOD::CaloCluster::EM_PROBABILITY,moment_EM_PROBABILITY);
-    if (true == gotMoment) m_EM_PROBABILITY->Fill(moment_EM_PROBABILITY);
-    else m_EM_PROBABILITY->Fill(-1.0);
+    if (true == gotMoment) m_EM_PROBABILITY->Fill(moment_EM_PROBABILITY,eventInfo.beamSpotWeight());
+    else m_EM_PROBABILITY->Fill(-1.0,eventInfo.beamSpotWeight());
 
   }
 
diff --git a/Reconstruction/PFlow/PFlowValidation/PFOHistUtils/src/ClusterPlots.cxx b/Reconstruction/PFlow/PFlowValidation/PFOHistUtils/src/ClusterPlots.cxx
index b6f5202340d5e3eb3a3e00c1123967cca6b4468a..a5de072cb644c270ba9c096605d8415545685dc4 100644
--- a/Reconstruction/PFlow/PFlowValidation/PFOHistUtils/src/ClusterPlots.cxx
+++ b/Reconstruction/PFlow/PFlowValidation/PFOHistUtils/src/ClusterPlots.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "PFOHistUtils/ClusterPlots.h"
@@ -7,61 +7,61 @@
 
 namespace PFO {
 
-  ClusterPlots::ClusterPlots(PlotBase* pParent, std::string sDir, std::string sClusterContainerName) : PlotBase(pParent, sDir), m_sClusterContainerName(sClusterContainerName){}
+  ClusterPlots::ClusterPlots(PlotBase* pParent, std::string sDir, SG::ReadHandleKey<xAOD::CaloClusterContainer>& sClusterContainerName) : PlotBase(pParent, sDir), m_sClusterContainerName(sClusterContainerName){}
 
   void ClusterPlots::initializePlots(){
 
-    m_Cluster_pt = Book1D("Cluster_Pt",m_sClusterContainerName + "_Pt (Entries/1 GeV)",300,-100.0,200.0);
-    m_Cluster_eta = Book1D("Cluster_Eta",m_sClusterContainerName + "_Eta (Entries/0.1)",100,-5.0,5.0);
-    m_Cluster_phi = Book1D("Cluster_Phi",m_sClusterContainerName + "_Phi (Entries/0.1)",64,-3.2,3.2);
-    m_Cluster_m = Book1D("Cluster_m",m_sClusterContainerName + "_m (Entries/100 MeV)",100,0.0,10.0);
+    m_Cluster_pt = Book1D("Cluster_Pt",m_sClusterContainerName.key() + "_Pt (Entries/1 GeV)",300,-100.0,200.0);
+    m_Cluster_eta = Book1D("Cluster_Eta",m_sClusterContainerName.key() + "_Eta (Entries/0.1)",100,-5.0,5.0);
+    m_Cluster_phi = Book1D("Cluster_Phi",m_sClusterContainerName.key() + "_Phi (Entries/0.1)",64,-3.2,3.2);
+    m_Cluster_m = Book1D("Cluster_m",m_sClusterContainerName.key() + "_m (Entries/100 MeV)",100,0.0,10.0);
 
-    m_Cluster_ptEM = Book1D("Cluster_PtEM",m_sClusterContainerName + "_PtEM (Entries/1 GeV)",300,-100.0,200.0);
-    m_Cluster_etaEM = Book1D("Cluster_EtaEM",m_sClusterContainerName + "_EtaEM (Entries/0.1)",100,-5.0,5.0);
-    m_Cluster_phiEM = Book1D("Cluster_PhiEM",m_sClusterContainerName + "_PhiEM (Entries/0.1)",64,-3.2,3.2);
-    m_Cluster_mEM = Book1D("Cluster_mEM",m_sClusterContainerName + "_mEM (Entries/100 MeV)",100,0.0,10.0);
+    m_Cluster_ptEM = Book1D("Cluster_PtEM",m_sClusterContainerName.key() + "_PtEM (Entries/1 GeV)",300,-100.0,200.0);
+    m_Cluster_etaEM = Book1D("Cluster_EtaEM",m_sClusterContainerName.key() + "_EtaEM (Entries/0.1)",100,-5.0,5.0);
+    m_Cluster_phiEM = Book1D("Cluster_PhiEM",m_sClusterContainerName.key() + "_PhiEM (Entries/0.1)",64,-3.2,3.2);
+    m_Cluster_mEM = Book1D("Cluster_mEM",m_sClusterContainerName.key() + "_mEM (Entries/100 MeV)",100,0.0,10.0);
 
-    m_Cluster_time = Book1D("Cluster_time",m_sClusterContainerName + "_time (Entries)",30,-200.0,100.0); 
-    m_Cluster_clusterSize = Book1D("Cluster_clusterSize",m_sClusterContainerName + "_clusterSize (Entries)",20,0.0,20.0);
+    m_Cluster_time = Book1D("Cluster_time",m_sClusterContainerName.key() + "_time (Entries)",30,-200.0,100.0); 
+    m_Cluster_clusterSize = Book1D("Cluster_clusterSize",m_sClusterContainerName.key() + "_clusterSize (Entries)",20,0.0,20.0);
 
-    m_Cluster_eta_lowpt = Book1D("Cluster_Eta_lowPt",m_sClusterContainerName + "_Eta_lowPt (Entries/0.1)",100,-5.0,5.0);
-    m_Cluster_pt_interval = Book1D("Cluster_Pt_interval",m_sClusterContainerName + "_Pt_interval (Entries/1 GeV)", 980, 20.0, 1000.0);
-    m_Cluster_pt_zoom = Book1D("Cluster_Pt_zoom",m_sClusterContainerName + "_Pt_zomm (Entries/0.1 GeV)",3000,-100.0,200.0);
+    m_Cluster_eta_lowpt = Book1D("Cluster_Eta_lowPt",m_sClusterContainerName.key() + "_Eta_lowPt (Entries/0.1)",100,-5.0,5.0);
+    m_Cluster_pt_interval = Book1D("Cluster_Pt_interval",m_sClusterContainerName.key() + "_Pt_interval (Entries/1 GeV)", 980, 20.0, 1000.0);
+    m_Cluster_pt_zoom = Book1D("Cluster_Pt_zoom",m_sClusterContainerName.key() + "_Pt_zomm (Entries/0.1 GeV)",3000,-100.0,200.0);
 
-    m_Cluster_eSample_EM = Book1D("Cluster_eSample_EM",m_sClusterContainerName +"_eSample_EM (Entries/1 GeV) ",300,-100.0,200.0);
-    m_Cluster_eSample_HAD = Book1D("Cluster_eSample_HAD",m_sClusterContainerName +"_eSample_HAD (Entries/1 GeV) ",300,-100.0,200.0);
+    m_Cluster_eSample_EM = Book1D("Cluster_eSample_EM",m_sClusterContainerName.key() +"_eSample_EM (Entries/1 GeV) ",300,-100.0,200.0);
+    m_Cluster_eSample_HAD = Book1D("Cluster_eSample_HAD",m_sClusterContainerName.key() +"_eSample_HAD (Entries/1 GeV) ",300,-100.0,200.0);
 
   }
 
-  void ClusterPlots::fill(const xAOD::CaloCluster& Cluster){
-    m_Cluster_pt->Fill(Cluster.pt()/1000.0);
-    m_Cluster_eta->Fill(Cluster.eta());
-    m_Cluster_phi->Fill(Cluster.phi());
-    m_Cluster_m->Fill(Cluster.m()/1000.0);
+  void ClusterPlots::fill(const xAOD::CaloCluster& Cluster, const xAOD::EventInfo& eventInfo){
+    m_Cluster_pt->Fill(Cluster.pt()/1000.0,eventInfo.beamSpotWeight());
+    m_Cluster_eta->Fill(Cluster.eta(),eventInfo.beamSpotWeight());
+    m_Cluster_phi->Fill(Cluster.phi(),eventInfo.beamSpotWeight());
+    m_Cluster_m->Fill(Cluster.m()/1000.0,eventInfo.beamSpotWeight());
 
-    m_Cluster_ptEM->Fill((Cluster.rawE()/cosh(Cluster.rawEta()))/1000.0);
-    m_Cluster_etaEM->Fill(Cluster.rawEta());
-    m_Cluster_phiEM->Fill(Cluster.rawPhi());
-    m_Cluster_mEM->Fill(Cluster.rawM()/1000.0);
+    m_Cluster_ptEM->Fill((Cluster.rawE()/cosh(Cluster.rawEta()))/1000.0,eventInfo.beamSpotWeight());
+    m_Cluster_etaEM->Fill(Cluster.rawEta(),eventInfo.beamSpotWeight());
+    m_Cluster_phiEM->Fill(Cluster.rawPhi(),eventInfo.beamSpotWeight());
+    m_Cluster_mEM->Fill(Cluster.rawM()/1000.0,eventInfo.beamSpotWeight());
 
-    m_Cluster_time->Fill(Cluster.time());
-    m_Cluster_clusterSize->Fill(Cluster.clusterSize());
+    m_Cluster_time->Fill(Cluster.time(),eventInfo.beamSpotWeight());
+    m_Cluster_clusterSize->Fill(Cluster.clusterSize(),eventInfo.beamSpotWeight());
 
     if (Cluster.pt()/1000.0 > -20 && Cluster.pt()/1000.0 < 20){
-        m_Cluster_eta_lowpt->Fill(Cluster.eta());
+        m_Cluster_eta_lowpt->Fill(Cluster.eta(),eventInfo.beamSpotWeight());
     }
-    m_Cluster_pt_interval->Fill(Cluster.pt()/1000.0);
-    m_Cluster_pt_zoom->Fill(Cluster.pt()/1000.0);
+    m_Cluster_pt_interval->Fill(Cluster.pt()/1000.0,eventInfo.beamSpotWeight());
+    m_Cluster_pt_zoom->Fill(Cluster.pt()/1000.0,eventInfo.beamSpotWeight());
 
     float eSample_EM;
    eSample_EM = Cluster.eSample(CaloSampling::PreSamplerB) + Cluster.eSample(CaloSampling::EMB1) + Cluster.eSample(CaloSampling::EMB2) + Cluster.eSample(CaloSampling::EMB3) + Cluster.eSample(CaloSampling::PreSamplerE) + Cluster.eSample(CaloSampling::EME1) + Cluster.eSample(CaloSampling::EME2) + Cluster.eSample(CaloSampling::EME3) + Cluster.eSample(CaloSampling::FCAL0);
-   m_Cluster_eSample_EM->Fill((double)eSample_EM/1000.0);
+   m_Cluster_eSample_EM->Fill((double)eSample_EM/1000.0,eventInfo.beamSpotWeight());
    
    
    
    float eSample_HAD;
    eSample_HAD = Cluster.eSample(CaloSampling::TileBar0) + Cluster.eSample(CaloSampling::TileBar1) + Cluster.eSample(CaloSampling::TileBar2) + Cluster.eSample(CaloSampling::HEC0) + Cluster.eSample(CaloSampling::HEC1) + Cluster.eSample(CaloSampling::HEC2) + Cluster.eSample(CaloSampling::HEC3) + Cluster.eSample(CaloSampling::FCAL1) + Cluster.eSample(CaloSampling::FCAL2);
-   m_Cluster_eSample_HAD->Fill((double)eSample_HAD/1000.0);
+   m_Cluster_eSample_HAD->Fill((double)eSample_HAD/1000.0,eventInfo.beamSpotWeight());
 
   }
 
diff --git a/Reconstruction/PFlow/PFlowValidation/PFOHistUtils/src/FlowElement_LinkerPlots.cxx b/Reconstruction/PFlow/PFlowValidation/PFOHistUtils/src/FlowElement_LinkerPlots.cxx
index c356dcf8452ea87bfa4945af1c89fecf594f9846..a01b3bbe4c4d162274eee107f1e5e406ebbdfb56 100644
--- a/Reconstruction/PFlow/PFlowValidation/PFOHistUtils/src/FlowElement_LinkerPlots.cxx
+++ b/Reconstruction/PFlow/PFlowValidation/PFOHistUtils/src/FlowElement_LinkerPlots.cxx
@@ -129,6 +129,7 @@ namespace PFO {
       }
             
       for (ElementLink<xAOD::MuonContainer> MuonLink: MuonLinks){
+
 	      //get Muon from link by de-referencing it
 	      const xAOD::Muon* muon = *MuonLink;
 	      TLorentzVector muon_fourvec=muon->p4();
@@ -146,7 +147,7 @@ namespace PFO {
 		      m_CFE_muon_largeDR_debug_type->Fill(type,eventInfo.beamSpotWeight());
 	      } 
 	    }// end of CFE fill block for muon_dR code	
-     }
+      }
     }// end of muon acc block
      
     // Electron block
diff --git a/Reconstruction/PFlow/PFlowValidation/PFOHistUtils/src/PFO_FE_Comparison_PlotMaker.cxx b/Reconstruction/PFlow/PFlowValidation/PFOHistUtils/src/PFO_FE_Comparison_PlotMaker.cxx
index eba5b090e1f56fd4561522040e480564cc53c6e4..9e40a0f9efab420753cffe5c4739abbebf6f2a19 100644
--- a/Reconstruction/PFlow/PFlowValidation/PFOHistUtils/src/PFO_FE_Comparison_PlotMaker.cxx
+++ b/Reconstruction/PFlow/PFlowValidation/PFOHistUtils/src/PFO_FE_Comparison_PlotMaker.cxx
@@ -5,6 +5,9 @@
 
 #include "PFOHistUtils/PFO_FE_Comparison_PlotMaker.h"
 #include <math.h>
+// some debug libraries for cluster moment floating point checks
+#include <bitset>
+#include <climits>
 namespace PFO {
   PFO_FE_Comparison_PlotMaker::PFO_FE_Comparison_PlotMaker(PlotBase* pParent,std::string sDir, std::string sPFOContainerName, std::string sFEContainerName, bool isNeutral): PlotBase(pParent,sDir), asg::AsgMessaging("PFO_FE_Comparison_PlotMaker"), m_sPFOContainerName(sPFOContainerName), m_sFEContainerName(sFEContainerName), m_isNeutral(isNeutral) {
     // init all hists as nullptrs
@@ -87,11 +90,11 @@ namespace PFO {
   
   void PFO_FE_Comparison_PlotMaker::Fill(const xAOD::PFO* pfo, const xAOD::FlowElement* fe){
     TLorentzVector fe_tlv=fe->p4();  
-    TLorentzVector pfo_tlv=pfo->p4();
+    TLorentzVector pfo_tlv=pfo->p4EM(); // default PFO is LC scale, switch to EM scale for comparison
  
     double pfo_pt=pfo_tlv.Pt();
     double pfo_eta=pfo_tlv.Eta();
-    double pfo_e=pfo_tlv.E();
+    double pfo_e=pfo_tlv.E(); // get correct scale
     
     double fe_pt=fe_tlv.Pt();
     double fe_eta=fe_tlv.Eta();
@@ -106,7 +109,26 @@ namespace PFO {
     double abs_dEta=std::abs(fe_eta-pfo_eta); 
     double dphi=fe_tlv.DeltaPhi(pfo_tlv);
     double dE=fe_e-pfo_e;
-    
+    double ERatio=-9999999999;
+    if(pfo_e!=0)
+	ERatio=fe_e/pfo_e;
+
+    if(m_isNeutral){
+	// debug of scale
+	double pfo_e_LC=pfo->p4().E(); // pfo LC scale energy
+	double pfo_eEM=pfo->eEM(); // pfo EM scale energy
+	ATH_MSG_DEBUG("PFO E(): "<<pfo_e_LC<<"PFO eEM()"<<pfo_eEM<<" FE E(): "<<fe_e);
+	if(ERatio>-999999999)
+	    ATH_MSG_INFO("Ratio (PFO_e/FE_e): "<<ERatio);
+	if(dE!=0)
+	    ATH_MSG_INFO("FE_e - PFO_e : "<<dE);
+	// assume all edge cases/nullptr catches for clusters were already vetoed
+	double fe_clus_e=(fe->otherObjects()).at(0)->p4().E();
+	double pfo_clus_e=pfo->cluster(0)->p4().E();
+		
+
+	ATH_MSG_INFO("PFO_clus E(): "<<pfo_clus_e<<" FE_clus E(): "<<fe_clus_e);
+    }
     // now fill the histos
     
     m_PFO_FE_dE->Fill(dE);
@@ -166,9 +188,22 @@ namespace PFO {
      if(acc_FE_moment_N_BAD_CELLS.isAvailable(*fe))
        FE_moment_N_BAD_CELLS=acc_FE_moment_N_BAD_CELLS(*fe);
      
-     if(acc_FE_moment_BADLARQ_FRAC.isAvailable(*fe))
+     if(acc_FE_moment_BADLARQ_FRAC.isAvailable(*fe)){
        FE_moment_BADLARQ_FRAC=acc_FE_moment_BADLARQ_FRAC(*fe);
-     
+       // this section is a debug of floating point compression
+       ATH_MSG_DEBUG("BADLARQ_FRAC "<<FE_moment_BADLARQ_FRAC);
+
+       union{ //using union and bitset to read the binary 
+	      //representation of the floating point number (to check compression effects)
+	   float input; // 
+	   int output;
+       } indata;
+       indata.input=FE_moment_BADLARQ_FRAC;
+       std::bitset<sizeof(float) * CHAR_BIT> bits(indata.output);
+       ATH_MSG_DEBUG("BADLARQ_FRAC bits (binary rep) "<<bits<<"");       
+
+
+     }
      if(acc_FE_moment_ENG_POS.isAvailable(*fe))
        FE_moment_ENG_POS=acc_FE_moment_ENG_POS(*fe);
      
diff --git a/Reconstruction/RecoAlgs/IsolationAlgs/python/IsoUpdatedTrackCones.py b/Reconstruction/RecoAlgs/IsolationAlgs/python/IsoUpdatedTrackCones.py
index cfc4bc46a83637c94508733d5536e915e43e9705..0949191709538418f0161faee6b56d5160a53a6e 100644
--- a/Reconstruction/RecoAlgs/IsolationAlgs/python/IsoUpdatedTrackCones.py
+++ b/Reconstruction/RecoAlgs/IsolationAlgs/python/IsoUpdatedTrackCones.py
@@ -19,6 +19,7 @@ def GetUpdatedIsoTrackCones(postfix="", object_types=("Electrons", "Photons", "M
     """
 
     import ROOT
+    from TrackVertexAssociationTool.getTTVAToolForReco import getTTVAToolForReco
     # This is a doubly nested list
     ptcone_list = [
         [ROOT.xAOD.Iso.IsolationType.ptcone40, ROOT.xAOD.Iso.IsolationType.ptcone30, ROOT.xAOD.Iso.IsolationType.ptcone20]
@@ -63,8 +64,8 @@ def GetUpdatedIsoTrackCones(postfix="", object_types=("Electrons", "Photons", "M
                         TrackSelectionTool=CfgMgr.InDet__InDetTrackSelectionTool(
                             minPt=track_pt, CutLevel="Loose"
                         ),
-                        TTVATool=CfgMgr.CP__TrackVertexAssociationTool(
-                            WorkingPoint="Loose",
+                        TTVATool=getTTVAToolForReco(
+                            WorkingPoint="Loose"
                         ),
                         CoreTrackEtaRange=0.01 if loose_cone else 0.0,
                         **toolkwargs,
diff --git a/Reconstruction/RecoTools/IsolationTool/IsolationTool/CaloIsolationTool.h b/Reconstruction/RecoTools/IsolationTool/IsolationTool/CaloIsolationTool.h
index 2efc26cae8eac6e9fbfabef7dc905ae4364c6673..0607053e3cb73e99ed78177c5740bd93e50d2b68 100644
--- a/Reconstruction/RecoTools/IsolationTool/IsolationTool/CaloIsolationTool.h
+++ b/Reconstruction/RecoTools/IsolationTool/IsolationTool/CaloIsolationTool.h
@@ -18,6 +18,7 @@
 #include "RecoToolInterfaces/IParticleCaloExtensionTool.h"
 #include "TrkParametersIdentificationHelpers/TrackParametersIdHelper.h"
 #include "CaloRec/CaloClusterProcessor.h"
+#include "TrkCaloExtension/CaloExtensionCollection.h"
 #endif // XAOD_ANALYSIS
 
 #include "IsolationCorrections/IIsolationCorrectionTool.h"
@@ -289,6 +290,10 @@ namespace xAOD {
       Gaudi::Property<bool> m_useCaloExtensionCaching {this, 
 	  "UseCaloExtensionCaching", true, 
 	  "Use cached caloExtension if avaliable."};
+
+      /** The input calorimeter extensions */
+      SG::ReadHandleKey<CaloExtensionCollection> m_caloExtensionKey{
+        this, "InputCaloExtension", "", "The calorimeter extensions of the tracks"};
 #endif // XAOD_ANALYSIS
 
       /** @brief Tool for pt-corrected isolation calculation (new)*/
diff --git a/Reconstruction/RecoTools/IsolationTool/Root/CaloIsolationTool.cxx b/Reconstruction/RecoTools/IsolationTool/Root/CaloIsolationTool.cxx
index 1ce9a2dc9f8a13a77c15ddfc01ebb411f34d16e2..06b3e77247eb6a57bdb9d69e979f251d4ed6b74e 100644
--- a/Reconstruction/RecoTools/IsolationTool/Root/CaloIsolationTool.cxx
+++ b/Reconstruction/RecoTools/IsolationTool/Root/CaloIsolationTool.cxx
@@ -104,6 +104,9 @@ namespace xAOD {
       } else
       	ATH_MSG_DEBUG("Select calorimeter " << m_HadCaloNums[index]);
     }
+
+    if (!m_caloExtensionKey.empty())
+      ATH_CHECK(m_caloExtensionKey.initialize());
 #endif // XAOD_ANALYSIS
 
     if (!m_IsoLeakCorrectionTool.empty())
@@ -537,7 +540,25 @@ namespace xAOD {
 #ifndef XAOD_ANALYSIS
     /// try the extention in athena if it's not obtained from muon yet.
     ATH_MSG_DEBUG("Geting calo extension caloExtension tool.");
-    std::unique_ptr<Trk::CaloExtension> caloExtension = m_caloExtTool->caloExtension(*tp);
+    // If we have an extension cache then it owns the extension, otherwise we own it
+    // Therefore we have to prepare both an owning and a non-owning pointer
+    std::unique_ptr<Trk::CaloExtension> caloExtensionUPtr;
+    const Trk::CaloExtension* caloExtension = nullptr;
+    if (m_caloExtensionKey.empty())
+    {
+      caloExtensionUPtr = m_caloExtTool->caloExtension(*tp);
+      caloExtension = caloExtensionUPtr.get();
+    }
+    else
+    {
+      auto cache = SG::makeHandle(m_caloExtensionKey);
+      if (!cache.isValid())
+      {
+        ATH_MSG_WARNING("Failed to retrieve calo extension cache " << m_caloExtensionKey);
+        return false;
+      }
+      caloExtension = m_caloExtTool->caloExtension(*tp, *cache);
+    }
     if(!caloExtension){
       ATH_MSG_WARNING("Can not get caloExtension.");
       return false;
diff --git a/Reconstruction/RecoTools/RecoToolInterfaces/RecoToolInterfaces/IParticleCaloCellAssociationTool.h b/Reconstruction/RecoTools/RecoToolInterfaces/RecoToolInterfaces/IParticleCaloCellAssociationTool.h
index 23739342ec6860d27f03386e258855987d9f2c14..770bf19cf7add0886b5c23904889860db6280553 100644
--- a/Reconstruction/RecoTools/RecoToolInterfaces/RecoToolInterfaces/IParticleCaloCellAssociationTool.h
+++ b/Reconstruction/RecoTools/RecoToolInterfaces/RecoToolInterfaces/IParticleCaloCellAssociationTool.h
@@ -11,10 +11,10 @@
 #include "GaudiKernel/IAlgTool.h"
 #include "xAODBase/IParticle.h"
 #include "ParticleCaloExtension/ParticleCellAssociation.h"
+#include "TrkCaloExtension/CaloExtensionCollection.h"
 #include <memory>
 class CaloCellContainer;
 
-
 namespace Rec 
 {
 
@@ -28,16 +28,19 @@ public:
    * @param particle       input particle
    * @param dr             cone size used for the association
    * @param container      cell container to be used if provided 
+   * @param extensionCache A calo extension cache to be used if provided
    * @return std::unique_ptr<ParticleCellAssociation>  
    */
   virtual std::unique_ptr< ParticleCellAssociation > particleCellAssociation( const xAOD::IParticle& particle, float dr, 
-                                                                              const CaloCellContainer* container = nullptr) const = 0;
+                                                                              const CaloCellContainer* container = nullptr,
+                                                                              const CaloExtensionCollection* extensionCache = nullptr) const = 0;
 
   /** Method to get the ParticleCellAssociation for a given Particle
    * @param particle       input particle
    * @param dr             cone size used for the association
    * @ param cache         cache for keeping previous results
    * @param container      cell container to be used if provided 
+   * @param extensionCache A calo extension cache to be used if provided
    * @return ParticleCellAssociation* (plain ptr cache has ownership)
    *
    * An alg looping over a single collection of IParticles  
@@ -52,7 +55,8 @@ public:
 
   typedef std::unordered_map<size_t,std::unique_ptr< ParticleCellAssociation >> Cache;
   virtual ParticleCellAssociation* particleCellAssociation( const xAOD::IParticle& particle, float dr, Cache& cache,
-                                                            const CaloCellContainer* container = nullptr) const = 0;
+                                                            const CaloCellContainer* container = nullptr,
+                                                            const CaloExtensionCollection* extensionCache = nullptr) const = 0;
   
 
   static const InterfaceID& interfaceID( ) ;
diff --git a/Reconstruction/RecoTools/TrackToCalo/src/ParticleCaloCellAssociationTool.cxx b/Reconstruction/RecoTools/TrackToCalo/src/ParticleCaloCellAssociationTool.cxx
index 9826352647464ced20e3e01ed7d12cdc3870cc52..ec78cfcdf1e45564412cd8d1dd9e9fd4fc75068d 100644
--- a/Reconstruction/RecoTools/TrackToCalo/src/ParticleCaloCellAssociationTool.cxx
+++ b/Reconstruction/RecoTools/TrackToCalo/src/ParticleCaloCellAssociationTool.cxx
@@ -14,6 +14,7 @@
 #include "CaloEvent/CaloCellContainer.h"
 #include "TrkCaloExtension/CaloExtension.h"
 #include "TrkCaloExtension/CaloExtensionHelpers.h"
+#include "TrkCaloExtension/CaloExtensionCollection.h"
 
 #include "xAODTracking/TrackingPrimitives.h"
 #include <cmath>
@@ -49,11 +50,19 @@ StatusCode ParticleCaloCellAssociationTool::finalize() {
 
 std::unique_ptr<ParticleCellAssociation> 
 ParticleCaloCellAssociationTool::particleCellAssociation( const xAOD::IParticle& particle, float dr, 
-                                                          const CaloCellContainer* container ) const{
+                                                          const CaloCellContainer* container,
+                                                          const CaloExtensionCollection* extensionCache ) const{
 
   ATH_MSG_DEBUG(" particleCellAssociation: ptr " << &particle << " dr " << dr );
   // get the extrapolation into the calo
-  std::unique_ptr<Trk::CaloExtension> caloExtension = m_caloExtensionTool->caloExtension(particle);
+  std::unique_ptr<const Trk::CaloExtension> caloExtensionUPtr;
+  const Trk::CaloExtension* caloExtension = nullptr;
+  if (extensionCache)
+    caloExtension = m_caloExtensionTool->caloExtension(particle, *extensionCache);
+  else {
+    caloExtensionUPtr = m_caloExtensionTool->caloExtension(particle);
+    caloExtension = caloExtensionUPtr.get();
+  }
   if( !caloExtension ) {
     ATH_MSG_DEBUG("Failed to get calo extension");      
     return nullptr;
@@ -81,21 +90,27 @@ ParticleCaloCellAssociationTool::particleCellAssociation( const xAOD::IParticle&
   // get cell intersections
   ParticleCellAssociation::CellIntersections cellIntersections;
   getCellIntersections(*caloExtension,cells,cellIntersections);
-
-  return std::make_unique<ParticleCellAssociation> ( caloExtension.release(), std::move(cells), dr, 
-                                                std::move(cellIntersections), container );
-
+  if (!caloExtensionUPtr)
+    // Have to manually copy the calo extension object. Clearly the class wants
+    // to be shared through a shared_ptr but this clearly is not an option
+    caloExtensionUPtr = std::make_unique<Trk::CaloExtension>(
+        caloExtension->caloEntryLayerIntersection() ? caloExtension->caloEntryLayerIntersection()->clone() : nullptr,
+        caloExtension->muonEntryLayerIntersection() ? caloExtension->muonEntryLayerIntersection()->clone() : nullptr,
+        std::vector<Trk::CurvilinearParameters>(caloExtension->caloLayerIntersections()));
+  return std::make_unique<ParticleCellAssociation> ( caloExtensionUPtr.release(), std::move(cells), dr, 
+      std::move(cellIntersections), container );
 }
 
 ParticleCellAssociation* 
 ParticleCaloCellAssociationTool::particleCellAssociation( const xAOD::IParticle& particle, float dr, 
                                                           IParticleCaloCellAssociationTool::Cache& cache,
-                                                          const CaloCellContainer* container) const {
+                                                          const CaloCellContainer* container,
+                                                          const CaloExtensionCollection* extensionCache) const {
 
   /*if not there , default ctor for unique_ptr (nullptr)*/
   std::unique_ptr<ParticleCellAssociation>& association= cache[particle.index()];
   if (association==nullptr){   
-    association=particleCellAssociation(particle,dr,container);
+    association=particleCellAssociation(particle,dr,container, extensionCache);
   }
   return association.get();
 }
diff --git a/Reconstruction/RecoTools/TrackToCalo/src/ParticleCaloCellAssociationTool.h b/Reconstruction/RecoTools/TrackToCalo/src/ParticleCaloCellAssociationTool.h
index caf0e41b72169ee772bd97ae8611143fba0193e0..53c7af05f12382a19269286a0effea19c3618231 100644
--- a/Reconstruction/RecoTools/TrackToCalo/src/ParticleCaloCellAssociationTool.h
+++ b/Reconstruction/RecoTools/TrackToCalo/src/ParticleCaloCellAssociationTool.h
@@ -46,7 +46,8 @@ public:
    * @return std::unique_ptr<ParticleCellAssociation>  
    */
   virtual std::unique_ptr< ParticleCellAssociation > particleCellAssociation( const xAOD::IParticle& particle, float dr, 
-                                                                              const CaloCellContainer* container = nullptr) const override final;
+                                                                              const CaloCellContainer* container = nullptr,
+                                                                              const CaloExtensionCollection* extensionCache = nullptr) const override final;
 
 
   /** Method to get the ParticleCellAssociation for a given Particle
@@ -68,7 +69,8 @@ public:
 
   virtual ParticleCellAssociation* particleCellAssociation( const xAOD::IParticle& particle, float dr, 
                                                             IParticleCaloCellAssociationTool::Cache& cache,
-                                                            const CaloCellContainer* container = nullptr) const override final;
+                                                            const CaloCellContainer* container = nullptr,
+                                                            const CaloExtensionCollection* extensionCache = nullptr) const override final;
 
 private:
 
diff --git a/Reconstruction/RecoTools/TrackToCalo/src/PreselCaloExtensionBuilderAlg.cxx b/Reconstruction/RecoTools/TrackToCalo/src/PreselCaloExtensionBuilderAlg.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..36642822b6263526cbe13db7b3fbef769ee7ecc5
--- /dev/null
+++ b/Reconstruction/RecoTools/TrackToCalo/src/PreselCaloExtensionBuilderAlg.cxx
@@ -0,0 +1,50 @@
+/*
+   Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+ */
+
+#include "PreselCaloExtensionBuilderAlg.h"
+#include "StoreGate/ReadHandle.h"
+#include "StoreGate/WriteHandle.h"
+#include <memory>
+
+namespace Trk {
+  PreselCaloExtensionBuilderAlg::PreselCaloExtensionBuilderAlg(const std::string& name, ISvcLocator* pSvcLocator)
+    : AthReentrantAlgorithm(name, pSvcLocator)
+  {}
+
+  PreselCaloExtensionBuilderAlg::~PreselCaloExtensionBuilderAlg() {}
+
+  StatusCode PreselCaloExtensionBuilderAlg::initialize()
+  {
+    ATH_CHECK(m_particleCaloExtensionTool.retrieve());
+    ATH_CHECK(m_inputTracksKey.initialize());
+    ATH_CHECK(m_outputCacheKey.initialize());
+    return StatusCode::SUCCESS;
+  }
+
+  StatusCode PreselCaloExtensionBuilderAlg::execute(const EventContext &ctx) const
+  {
+    auto tracks = SG::makeHandle(m_inputTracksKey, ctx);
+    if (!tracks.isValid())
+    {
+      ATH_MSG_ERROR("Failed to retrieve " << m_inputTracksKey);
+      return StatusCode::FAILURE;
+    }
+    auto cache = std::make_unique<CaloExtensionCollection>();
+    if (tracks->size() > 0)
+      // Use the index of the last track as a good guess of the largest index
+      // present in the container. This will be the right value if the view
+      // has not been sorted differently from the original container
+      cache->resize(tracks->back()->index() + 1);
+    for (const xAOD::TrackParticle* itrk : *tracks)
+    {
+      if (itrk->index() >= cache->size())
+        // Handle the case where the above assumption does not hold
+        cache->resize(itrk->index() + 1);
+      cache->at(itrk->index()) = std::move(m_particleCaloExtensionTool->caloExtension(ctx, *itrk));
+    }
+    auto outputHandle = SG::makeHandle(m_outputCacheKey, ctx);
+    ATH_CHECK(outputHandle.record(std::move(cache)));
+    return StatusCode::SUCCESS;
+  }
+} //> end namespace Trk
diff --git a/Reconstruction/RecoTools/TrackToCalo/src/PreselCaloExtensionBuilderAlg.h b/Reconstruction/RecoTools/TrackToCalo/src/PreselCaloExtensionBuilderAlg.h
new file mode 100644
index 0000000000000000000000000000000000000000..5bfad7dc63c03b77f9024cd4ee7f74782fba6068
--- /dev/null
+++ b/Reconstruction/RecoTools/TrackToCalo/src/PreselCaloExtensionBuilderAlg.h
@@ -0,0 +1,49 @@
+/*
+   Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+ */
+
+#ifndef TRACKTOCALO_PRESELCALOEXTENSIONBUILDERALG_H
+#define TRACKTOCALO_PRESELCALOEXTENSIONBUILDERALG_H
+
+#include "AthenaBaseComps/AthReentrantAlgorithm.h"
+#include "StoreGate/ReadHandleKey.h"
+#include "StoreGate/WriteHandleKey.h"
+#include "GaudiKernel/ToolHandle.h"
+#include "xAODTracking/TrackParticleContainer.h"
+#include "TrkCaloExtension/CaloExtensionCollection.h"
+#include "RecoToolInterfaces/IParticleCaloExtensionTool.h"
+
+namespace Trk {
+  /**
+   * @brief Build the calo extensions for a preselected collection of tracks
+   * @author Jon Burr
+   *
+   * This algorithm is designed to work correctly with a view container. The 
+   * indices used in the CaloExtensionCollection use the track's index function
+   * to key the correct extension (this is consistent with its use in the tool)
+   * so the produced extension collection can also safely be used with the
+   * original track collection from which the view was created.
+   *
+   * Note that this is not guaranteed to work if a view container is provided
+   * that was produced from more than one container, as the indices of the
+   * tracks are not guaranteed to be unique.
+   */
+  class PreselCaloExtensionBuilderAlg : public AthReentrantAlgorithm
+  {
+    public:
+      PreselCaloExtensionBuilderAlg(const std::string& name, ISvcLocator* pSvcLocator);
+      ~PreselCaloExtensionBuilderAlg();
+
+      virtual StatusCode initialize() override;
+      virtual StatusCode execute(const EventContext &ctx) const override;
+    private:
+      ToolHandle<Trk::IParticleCaloExtensionTool> m_particleCaloExtensionTool{
+        this, "ParticleCaloExtensionTool", "ParticleCaloExtensionTool"};
+      SG::ReadHandleKey<xAOD::TrackParticleContainer> m_inputTracksKey{
+        this, "InputTracks", "", "Input track container"};
+      SG::WriteHandleKey<CaloExtensionCollection> m_outputCacheKey{
+        this, "OutputCache", "", "Output extension cache"};
+  }; //> end class PreselCaloExtensionBuilderAlg
+} //> end namespace Trk
+
+#endif //> !TRACKTOCALO_PRESELCALOEXTENSIONBUILDERALG_H
diff --git a/Reconstruction/RecoTools/TrackToCalo/src/components/TrackToCalo_entries.cxx b/Reconstruction/RecoTools/TrackToCalo/src/components/TrackToCalo_entries.cxx
index 2795b9bb967093f64021f2341c584e10e6a5a7bc..23d7655c77109606c2a357743caa6eef29a6749f 100644
--- a/Reconstruction/RecoTools/TrackToCalo/src/components/TrackToCalo_entries.cxx
+++ b/Reconstruction/RecoTools/TrackToCalo/src/components/TrackToCalo_entries.cxx
@@ -2,6 +2,7 @@
 #include "../ParticleCaloCellAssociationTool.h"
 #include "../MuonCaloEnergyTool.h"
 #include "../CaloExtensionBuilderAlg.h"
+#include "../PreselCaloExtensionBuilderAlg.h"
 
 using namespace Trk;
 using namespace Rec;
@@ -9,3 +10,4 @@ DECLARE_COMPONENT( ParticleCaloExtensionTool )
 DECLARE_COMPONENT( ParticleCaloCellAssociationTool )
 DECLARE_COMPONENT( MuonCaloEnergyTool )
 DECLARE_COMPONENT( CaloExtensionBuilderAlg )
+DECLARE_COMPONENT( PreselCaloExtensionBuilderAlg )
diff --git a/Reconstruction/VKalVrt/NewVrtSecInclusiveTool/CMakeLists.txt b/Reconstruction/VKalVrt/NewVrtSecInclusiveTool/CMakeLists.txt
index 9e9b771c11ce38d95d778556e8883de81b65ddf6..0513d9e1da330439917884eb0d06614d890062b6 100644
--- a/Reconstruction/VKalVrt/NewVrtSecInclusiveTool/CMakeLists.txt
+++ b/Reconstruction/VKalVrt/NewVrtSecInclusiveTool/CMakeLists.txt
@@ -11,7 +11,7 @@ find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread TMVA )
 atlas_add_component( NewVrtSecInclusiveTool 
                      src/*.cxx src/components/*.cxx
                      INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} AnalysisUtilsLib AthenaBaseComps GaudiKernel GeoPrimitives InDetBeamSpotServiceLib MVAUtils PathResolver TrkExInterfaces TrkGeometry TrkNeutralParameters TrkTrackSummary TrkVKalVrtFitterLib VxSecVertex xAODTracking xAODTruth )
+                     LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} AnalysisUtilsLib AthenaBaseComps GaudiKernel GeoPrimitives BeamSpotConditionsData MVAUtils PathResolver TrkExInterfaces TrkGeometry TrkNeutralParameters TrkTrackSummary TrkVKalVrtFitterLib VxSecVertex xAODTracking xAODTruth )
 
 # Install files from the package:
 atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
diff --git a/Reconstruction/VKalVrt/NewVrtSecInclusiveTool/NewVrtSecInclusiveTool/NewVrtSecInclusiveTool.h b/Reconstruction/VKalVrt/NewVrtSecInclusiveTool/NewVrtSecInclusiveTool/NewVrtSecInclusiveTool.h
index 4b9c1dca06e19eb721b5bf0cd220ee250699220b..b0eb0ddce9a93d7873e1742abb72ed34aab55d36 100755
--- a/Reconstruction/VKalVrt/NewVrtSecInclusiveTool/NewVrtSecInclusiveTool/NewVrtSecInclusiveTool.h
+++ b/Reconstruction/VKalVrt/NewVrtSecInclusiveTool/NewVrtSecInclusiveTool/NewVrtSecInclusiveTool.h
@@ -35,7 +35,7 @@
 //
 #include "xAODTruth/TruthEventContainer.h"
 #include "TrkExInterfaces/IExtrapolator.h"
-//
+#include "BeamSpotConditionsData/BeamSpotData.h"
 #include "VxSecVertex/VxSecVertexInfo.h"
 #include "NewVrtSecInclusiveTool/IVrtInclusive.h"
 
@@ -44,7 +44,6 @@ class TH2D;
 class TH1F;
 class TProfile;
 class TTree;
-class IBeamCondSvc;
 
 namespace Trk{
   class TrkVKalVrtFitter;
@@ -165,8 +164,8 @@ namespace Rec {
 
       std::unique_ptr<MVAUtils::BDT> m_SV2T_BDT;
 
-      ServiceHandle< IBeamCondSvc > m_beamService; 
-      //ToolHandle<Trk::IVertexFitter>  m_fitterSvc;
+      SG::ReadCondHandleKey<InDet::BeamSpotData> m_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" };
+
       ToolHandle<Trk::IExtrapolator>  m_extrapolator{this,"ExtrapolatorName","Trk::Extrapolator/Extrapolator"};
       ToolHandle<Trk::TrkVKalVrtFitter>  m_fitSvc;
       //Trk::TrkVKalVrtFitter*   m_fitSvc{};
diff --git a/Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/NewVrtSecInclusiveTool.cxx b/Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/NewVrtSecInclusiveTool.cxx
index 1edd8d47d6a38ca7f13850fa22c82f250dba756d..d5a24b552e8b3d7be27ae9548eaa8514c81590b2 100644
--- a/Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/NewVrtSecInclusiveTool.cxx
+++ b/Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/NewVrtSecInclusiveTool.cxx
@@ -10,7 +10,6 @@
 #include "NewVrtSecInclusiveTool/NewVrtSecInclusiveTool.h"
 #include "VxSecVertex/VxSecVertexInfo.h"
 #include "TrkVKalVrtFitter/TrkVKalVrtFitter.h"
-#include "InDetBeamSpotService/IBeamCondSvc.h"
 #include "PathResolver/PathResolver.h"
  
 #include "GaudiKernel/ITHistSvc.h"
@@ -64,7 +63,6 @@ NewVrtSecInclusiveTool::NewVrtSecInclusiveTool(const std::string& type,
     m_multiWithOneTrkVrt(true),
     m_calibFileName("Fake2TrVertexReject.MVA.v01.root"),
     m_SV2T_BDT(nullptr),
-    m_beamService("BeamCondSvc",name),
     m_fitSvc("Trk::TrkVKalVrtFitter/VertexFitterTool",this)
    {
 //
@@ -117,7 +115,6 @@ NewVrtSecInclusiveTool::NewVrtSecInclusiveTool(const std::string& type,
 
     declareProperty("calibFileName", m_calibFileName, " MVA calibration file for 2-track fake vertices removal" );
 
-    declareProperty("BeamSpotSvc",         m_beamService, "Name of the BeamSpot service");
     declareProperty("VertexFitterTool",    m_fitSvc, "Name of the Vertex Fitter tool");
 //
     m_massPi  =  Trk::ParticleMasses().mass[Trk::pion];
@@ -139,10 +136,8 @@ NewVrtSecInclusiveTool::NewVrtSecInclusiveTool(const std::string& type,
    StatusCode NewVrtSecInclusiveTool::initialize(){
      ATH_MSG_DEBUG( "Initialising NewVrtSecInclusiveTool- Package version: " << PACKAGE_VERSION ); 
      m_compatibilityGraph = new boost::adjacency_list<boost::listS, boost::vecS, boost::undirectedS>();
-
-     ATH_CHECK( m_beamService.retrieve() );
      ATH_CHECK( m_extrapolator.retrieve() );
-
+     ATH_CHECK(m_beamSpotKey.initialize());
      ATH_CHECK( m_fitSvc.retrieve() );
      ATH_MSG_DEBUG("NewVrtSecInclusiveTool TrkVKalVrtFitter found");
 
@@ -324,11 +319,12 @@ NewVrtSecInclusiveTool::NewVrtSecInclusiveTool(const std::string& type,
     workVectorArrxAOD * tmpVectxAOD=new workVectorArrxAOD();
     tmpVectxAOD->inpTrk.resize(inpTrk.size());
     std::copy(inpTrk.begin(),inpTrk.end(), tmpVectxAOD->inpTrk.begin());
-    tmpVectxAOD->beamX=m_beamService->beamPos().x();
-    tmpVectxAOD->beamY=m_beamService->beamPos().y();
-    tmpVectxAOD->beamZ=m_beamService->beamPos().z();
-    tmpVectxAOD->tanBeamTiltX=tan(m_beamService->beamTilt(0));
-    tmpVectxAOD->tanBeamTiltY=tan(m_beamService->beamTilt(1));
+    SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey };
+    tmpVectxAOD->beamX=beamSpotHandle->beamPos().x();
+    tmpVectxAOD->beamY=beamSpotHandle->beamPos().y();
+    tmpVectxAOD->beamZ=beamSpotHandle->beamPos().z();
+    tmpVectxAOD->tanBeamTiltX=tan(beamSpotHandle->beamTilt(0));
+    tmpVectxAOD->tanBeamTiltY=tan(beamSpotHandle->beamTilt(1));
     
 
     listVrtSec = getVrtSecMulti(tmpVectxAOD,primVrt);
diff --git a/Reconstruction/VKalVrt/TrkToLeptonPVTool/CMakeLists.txt b/Reconstruction/VKalVrt/TrkToLeptonPVTool/CMakeLists.txt
index d0607d657fdf16cb7f601e739d6835e06fa47ba0..91a6764f18d5a75dfed9a90e9a048cd01f6dc4ae 100644
--- a/Reconstruction/VKalVrt/TrkToLeptonPVTool/CMakeLists.txt
+++ b/Reconstruction/VKalVrt/TrkToLeptonPVTool/CMakeLists.txt
@@ -15,7 +15,7 @@ atlas_add_library  ( TrkToLeptonPVToolLib
                      PUBLIC_HEADERS TrkToLeptonPVTool
                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} LINK_LIBRARIES ${ROOT_LIBRARIES} ${EIGEN_LIBRARIES} 
                      AthenaBaseComps xAODTracking xAODEventInfo GaudiKernel 
-                     TrkVKalVrtFitterLib TrkVertexFitterInterfaces InDetBeamSpotServiceLib)
+                     TrkVKalVrtFitterLib TrkVertexFitterInterfaces BeamSpotConditionsData)
 
 atlas_add_component  ( TrkToLeptonPVTool
                        src/components/*.cxx
diff --git a/Reconstruction/VKalVrt/TrkToLeptonPVTool/TrkToLeptonPVTool/TrkToLeptonPVTool.h b/Reconstruction/VKalVrt/TrkToLeptonPVTool/TrkToLeptonPVTool/TrkToLeptonPVTool.h
index 08808cccb980cf205be0ec5bdef104e6b33ce0e2..bcd2054c4f7d284917282cb5d5435e09c81be4f8 100644
--- a/Reconstruction/VKalVrt/TrkToLeptonPVTool/TrkToLeptonPVTool/TrkToLeptonPVTool.h
+++ b/Reconstruction/VKalVrt/TrkToLeptonPVTool/TrkToLeptonPVTool/TrkToLeptonPVTool.h
@@ -23,7 +23,7 @@
 #include "GaudiKernel/ServiceHandle.h"
 #include "TrkToLeptonPVTool/ITrkToLeptonPV.h"
 #include "TrkVertexFitterInterfaces/IVertexFitter.h"
-#include "InDetBeamSpotService/IBeamCondSvc.h"
+#include "BeamSpotConditionsData/BeamSpotData.h"
 //
 
 
@@ -47,7 +47,7 @@
 
    private:
 
-    ServiceHandle< IBeamCondSvc >       m_beamService{this,"BeamCondSvc","BeamCondSvc"};
+    SG::ReadCondHandleKey<InDet::BeamSpotData> m_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" };
     ToolHandle< Trk::IVertexFitter >    m_fitterSvc{this,"VertexFitter","Trk::TrkVKalVrtFitter/VertexFitterTool","Vertex Fitter tool instance"};
 
  };
diff --git a/Reconstruction/VKalVrt/TrkToLeptonPVTool/src/TrkToLeptonPVTool.cxx b/Reconstruction/VKalVrt/TrkToLeptonPVTool/src/TrkToLeptonPVTool.cxx
index a9d03c94b68a49c4d6ae54b5a4f70ea054e71159..2580b0b366b980e5a32d7c6472564dae87e73729 100644
--- a/Reconstruction/VKalVrt/TrkToLeptonPVTool/src/TrkToLeptonPVTool.cxx
+++ b/Reconstruction/VKalVrt/TrkToLeptonPVTool/src/TrkToLeptonPVTool.cxx
@@ -37,10 +37,7 @@ TrkToLeptonPVTool::TrkToLeptonPVTool(const std::string& type,
         ATH_MSG_DEBUG("TrkToLeptonPVTool TrkVKalVrtFitter found");
      }
      //-----
-     if(m_beamService.retrieve().isFailure()) {
-       ATH_MSG_DEBUG("Can't retrieve BeamService");
-       return StatusCode::FAILURE;
-     }
+     ATH_CHECK(m_beamSpotKey.initialize());
      //-----
      return StatusCode::SUCCESS;
    }
@@ -116,15 +113,17 @@ TrkToLeptonPVTool::TrkToLeptonPVTool(const std::string& type,
           BEAM.setCovariancePosition(beamcov);
           beamtiltX= eventINFO->beamTiltXZ();
           beamtiltY= eventINFO->beamTiltYZ();
-     }         
-     if(m_beamService && fullxAOD ){
+     }
+     SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey };
+     
+     if(beamSpotHandle.isValid() && fullxAOD ){
           ATH_MSG_DEBUG("Beam service is present");
-          BEAM.setPosition(m_beamService->beamVtx().position());
-          beamcov  = m_beamService->beamVtx().covariancePosition();
+          BEAM.setPosition(beamSpotHandle->beamVtx().position());
+          beamcov  = beamSpotHandle->beamVtx().covariancePosition();
           beamcov(2,2) *= 1.e6;  //Remove any constraint in Z direction
           BEAM.setCovariancePosition(beamcov);
-          beamtiltX= m_beamService->beamTilt(0);
-          beamtiltY= m_beamService->beamTilt(1);
+          beamtiltX= beamSpotHandle->beamTilt(0);
+          beamtiltY= beamSpotHandle->beamTilt(1);
      }         
      if(fullxAOD){ ATH_MSG_DEBUG("xAOD data"); }
      else        { ATH_MSG_DEBUG("DxAOD data");}
diff --git a/Reconstruction/eflowRec/CMakeLists.txt b/Reconstruction/eflowRec/CMakeLists.txt
index 2e71c364370e14b541e47ec45c5a7a26004fa8ca..5e8c3e5ecc451804d8623b21ebbbe919d31af161 100644
--- a/Reconstruction/eflowRec/CMakeLists.txt
+++ b/Reconstruction/eflowRec/CMakeLists.txt
@@ -11,7 +11,7 @@ atlas_add_component( eflowRec
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${ROOT_LIBRARIES} CaloEvent CaloIdentifier CaloRecLib AthContainers AthLinks AthenaBaseComps CxxUtils AthenaKernel GeoPrimitives Identifier xAODBase xAODCaloEvent xAODCore xAODEgamma xAODMuon xAODPFlow xAODTau xAODTracking GaudiKernel InDetReadoutGeometry TRT_ReadoutGeometry Particle RecoToolInterfaces TrkParameters CaloDetDescrLib CaloUtilsLib StoreGateLib FourMomUtils PathResolver TrkCaloExtension TrkParametersIdentificationHelpers InDetTrackSelectionToolLib AthenaMonitoringKernelLib)
+                     LINK_LIBRARIES ${ROOT_LIBRARIES} CaloEvent CaloIdentifier CaloRecLib AthContainers AthLinks AthenaBaseComps CxxUtils AthenaKernel GeoPrimitives Identifier xAODBase xAODCaloEvent xAODCore xAODEgamma xAODMuon xAODPFlow xAODTau xAODTracking GaudiKernel InDetReadoutGeometry TRT_ReadoutGeometry Particle RecoToolInterfaces TrkParameters CaloDetDescrLib CaloUtilsLib StoreGateLib FourMomUtils PathResolver TrkCaloExtension TrkParametersIdentificationHelpers InDetTrackSelectionToolLib AthenaMonitoringKernelLib ICaloTrkMuIdTools)
 
 # Install files from the package:
 atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
diff --git a/Reconstruction/eflowRec/python/PFHLTSequence.py b/Reconstruction/eflowRec/python/PFHLTSequence.py
index 956190f2b3404fae37d4d5e37ccaf57baf5c1849..1ea85c969e261fc0d090be46a62312541e600fc6 100644
--- a/Reconstruction/eflowRec/python/PFHLTSequence.py
+++ b/Reconstruction/eflowRec/python/PFHLTSequence.py
@@ -2,45 +2,137 @@
 
 from eflowRec import eflowRecConf
 from InDetTrackSelectionTool import InDetTrackSelectionToolConf
+from InDetTrigRecExample.InDetTrigConfigRecLoadTools import InDetTrigExtrapolator
 
 from AthenaCommon.Logging import logging
-log = logging.getLogger('PFHLTSequence')
+
+log = logging.getLogger("PFHLTSequence")
 
 # Use the appropriate containers based on what config is desired
 trackvtxcontainers = {
-    "offline":  ("InDetTrackParticles","PrimaryVertices"),
-    "ftf":      ("HLT_IDTrack_FS_FTF","HLT_IDVertex_FS"),
-    }
+    "offline": ("InDetTrackParticles", "PrimaryVertices"),
+    "ftf": ("HLT_IDTrack_FS_FTF", "HLT_IDVertex_FS"),
+}
+# Configure the extrapolator
+def getExtrapolator():
+    # Set up with trigger extrapolator instance
+    # FIXME: reconfigure for lower tolerance to speed up
+    # from TrkExTools.AtlasExtrapolator import AtlasExtrapolator
+    from TrackToCalo.TrackToCaloConf import Trk__ParticleCaloExtensionTool
+
+    return Trk__ParticleCaloExtensionTool(
+        "HLTPF_ParticleCaloExtension", Extrapolator=InDetTrigExtrapolator
+    )
+
+def PFTrackExtension(tracktype):
+    """ Get the track extension after a preselection
+
+    Returns the preselected track selection, the extension cache and the list of algorithms
+    """
+    tracksin, _ = trackvtxcontainers[tracktype]
+    from eflowRec.eflowRecConf import PFTrackPreselAlg
+    from TrackToCalo.TrackToCaloConf import Trk__PreselCaloExtensionBuilderAlg
+
+    presel_alg = PFTrackPreselAlg(
+        f"HLTPFTrackPresel_{tracktype}",
+        InputTracks=tracksin,
+        OutputTracks=f"HLTPFPreselTracks_{tracktype}",
+        TrackSelTool=InDetTrackSelectionToolConf.InDet__InDetTrackSelectionTool(
+            CutLevel="TightPrimary", minPt=500.0
+        ),
+    )
+
+    extension_alg = Trk__PreselCaloExtensionBuilderAlg(
+        f"HLTPFTrackExtension_{tracktype}",
+        ParticleCaloExtensionTool=getExtrapolator(),
+        InputTracks=presel_alg.OutputTracks,
+        OutputCache=f"HLTPFTrackExtensionCache_{tracktype}",
+    )
+
+    return (
+        presel_alg.OutputTracks,
+        extension_alg.OutputCache,
+        [presel_alg, extension_alg]
+    )
+
+def muonCaloTagSeq(flags, tracktype, tracksin, extcache, cellsin):
+    from eflowRec.eflowRecConf import PFTrackMuonCaloTaggingAlg
+    from TrackToCalo.TrackToCaloConf import Rec__ParticleCaloCellAssociationTool
+    from CaloTrkMuIdTools.CaloTrkMuIdToolsConf import (
+        CaloMuonScoreTool,
+        CaloMuonTag,
+        TrackDepositInCaloTool,
+    )
+    tag_alg = PFTrackMuonCaloTaggingAlg(
+        f"PFTrackMuonCaloTaggingAlg_{tracktype}",
+        InputTracks = tracksin,
+        InputCaloExtension = extcache,
+        InputCells = cellsin,
+        OutputTracks=f"PFMuonCaloTagTracks_{tracktype}",
+        MinPt = flags.Trigger.FSHad.PFOMuonRemovalMinPt,
+        MuonScoreTool=CaloMuonScoreTool(
+            CaloMuonEtaCut=3,
+            ParticleCaloCellAssociationTool=Rec__ParticleCaloCellAssociationTool(
+                ParticleCaloExtensionTool=getExtrapolator(),
+                CaloCellContainer=""
+            ),
+        ),
+        LooseTagTool=CaloMuonTag("LooseCaloMuonTag", TagMode="Loose"),
+        TightTagTool=CaloMuonTag("TightCaloMuonTag", TagMode="Tight"),
+        DepositInCaloTool=TrackDepositInCaloTool(
+            ExtrapolatorHandle=InDetTrigExtrapolator,
+            ParticleCaloCellAssociationTool=Rec__ParticleCaloCellAssociationTool(
+                ParticleCaloExtensionTool=getExtrapolator(),
+                CaloCellContainer=""
+            ),
+            ParticleCaloExtensionTool=getExtrapolator(),
+        ),
+    )
+    return tag_alg.OutputTracks, tag_alg
+
+def muonIsoTagSeq(flags, tracktype, tracksin, extcache, clustersin):
+    from eflowRec.eflowRecConf import PFTrackMuonIsoTaggingAlg
+    from IsolationTool.IsolationToolConf import xAOD__CaloIsolationTool, xAOD__TrackIsolationTool
+
+    tag_alg = PFTrackMuonIsoTaggingAlg(
+        f"PFTrackMuonIsoTaggingAlg_{tracktype}",
+        InputTracks = tracksin,
+        InputClusters = clustersin,
+        InputVertices = trackvtxcontainers[tracktype][1],
+        OutputTracks = f"PFMuonIsoTagTracks_{tracktype}",
+        MinPt = flags.Trigger.FSHad.PFOMuonRemovalMinPt,
+        TrackIsoTool = xAOD__TrackIsolationTool(TrackParticleLocation=tracksin),
+        CaloIsoTool = xAOD__CaloIsolationTool(
+            ParticleCaloExtensionTool=getExtrapolator(),
+            InputCaloExtension=extcache,
+            ParticleCaloCellAssociationTool="",
+            saveOnlyRequestedCorrections=True,
+        ),
+    )
+    return tag_alg.OutputTracks, tag_alg
 
 # PFTrackSelector
 # This handles the track selection (including lepton veto)
 # and extrapolation into the calorimeter.
 # Parameters: track & vertex container names (offline, HLT, FTK)
-def getPFTrackSel(tracktype):
-    tracksin,verticesin = trackvtxcontainers[tracktype]
-
-    # Configure the extrapolator
-    def getExtrapolator():
-        # Set up with trigger extrapolator instance
-        # FIXME: reconfigure for lower tolerance to speed up
-        # from TrkExTools.AtlasExtrapolator import AtlasExtrapolator
-        from TrackToCalo.TrackToCaloConf import Trk__ParticleCaloExtensionTool
-        from InDetTrigRecExample.InDetTrigConfigRecLoadTools import InDetTrigExtrapolator
-        return Trk__ParticleCaloExtensionTool("HLTPF_ParticleCaloExtension",Extrapolator = InDetTrigExtrapolator)
-
-    TrackCaloExtensionTool = eflowRecConf.eflowTrackCaloExtensionTool("HLTPF_eflowTrkCaloExt",TrackCaloExtensionTool=getExtrapolator())
-    # Don't assume the existence of a pre-built cache
-    # We expect to run PF at most once per event, and not overlap with
-    # other use cases like taus
-    TrackCaloExtensionTool.PFParticleCache = ""
+def getPFTrackSel(tracktype, extensionCache="", trackname=None):
+    tracksin, verticesin = trackvtxcontainers[tracktype]
+    if trackname is not None:
+        tracksin = trackname
+
+    TrackCaloExtensionTool = eflowRecConf.eflowTrackCaloExtensionTool(
+        "HLTPF_eflowTrkCaloExt", TrackCaloExtensionTool=getExtrapolator()
+    )
+    # Set the extension cache - if this is "" then the tool will run the extension
+    TrackCaloExtensionTool.PFParticleCache = extensionCache
 
     # Configure the track selector
-    PFTrackSelector = eflowRecConf.PFTrackSelector("PFTrackSelector_"+tracktype)
+    PFTrackSelector = eflowRecConf.PFTrackSelector("PFTrackSelector_" + tracktype)
     PFTrackSelector.trackExtrapolatorTool = TrackCaloExtensionTool
 
     TrackSelectionTool = InDetTrackSelectionToolConf.InDet__InDetTrackSelectionTool(
-        CutLevel = "TightPrimary",
-        minPt = 500.0)
+        CutLevel="TightPrimary", minPt=500.0
+    )
     PFTrackSelector.trackSelectionTool = TrackSelectionTool
 
     # Disable lepton veto as not reconstructed for hadronic triggers
@@ -51,11 +143,13 @@ def getPFTrackSel(tracktype):
     PFTrackSelector.VertexContainer = verticesin
 
     from eflowRec import PFOnlineMon
+
     monTool = PFOnlineMon.getMonTool_PFTrackSelector()
     PFTrackSelector.MonTool = monTool
 
     return PFTrackSelector
 
+
 # PFAlgorithm
 # This runs the cell-level subtraction:
 #   1. Match clusters to tracks
@@ -64,96 +158,135 @@ def getPFTrackSel(tracktype):
 # For HLT purposes, no LC calibration is applied and only
 # one essential moment (CENTER_MAG) is computed. This is
 # needed for origin corrections.
-def getPFAlg(clustersin,tracktype):
+def getPFAlg(clustersin, tracktype):
 
     # The tool to handle cell-level subtraction, default parameters
     CellEOverPTool = eflowRecConf.eflowCellEOverPTool_mc12_JetETMiss()
 
     # Need a few instances of PFTrackClusterMatchingTool with different distance cuts
-    def getPFMatchingTool(name,matchcut):
+    def getPFMatchingTool(name, matchcut):
         matchingtool = eflowRecConf.PFTrackClusterMatchingTool(name)
-        matchingtool.TrackPositionType   = 'EM2EtaPhi' # str
-        matchingtool.ClusterPositionType = 'PlainEtaPhi' # str
-        matchingtool.DistanceType        = 'EtaPhiSquareDistance' # str
-        matchingtool.MatchCut = matchcut*matchcut
+        matchingtool.TrackPositionType = "EM2EtaPhi"  # str
+        matchingtool.ClusterPositionType = "PlainEtaPhi"  # str
+        matchingtool.DistanceType = "EtaPhiSquareDistance"  # str
+        matchingtool.MatchCut = matchcut * matchcut
         return matchingtool
 
     # Default energy subtraction where a single cluster satisfies the expected
     # track calo energy
-    PFCellLevelSubtractionTool = eflowRecConf.PFCellLevelSubtractionTool("PFCellLevelSubtractionTool",
-        eflowCellEOverPTool        = CellEOverPTool,
+    PFCellLevelSubtractionTool = eflowRecConf.PFCellLevelSubtractionTool(
+        "PFCellLevelSubtractionTool",
+        eflowCellEOverPTool=CellEOverPTool,
         # Uses a deltaR' cut (deltaR corrected for cluster width in eta/phi) to
         # match clusters to tracks
-        PFTrackClusterMatchingTool = eflowRecConf.PFTrackClusterMatchingTool("CalObjBldMatchingTool"),
+        PFTrackClusterMatchingTool=eflowRecConf.PFTrackClusterMatchingTool(
+            "CalObjBldMatchingTool"
+        ),
         # Additional matching tools used to determine cluster weights
         # These deal with dense environments in which subtraction is difficult.
-        PFTrackClusterMatchingTool_015 = getPFMatchingTool(name="MatchingTool_Pull_015",matchcut=0.15),
-        PFTrackClusterMatchingTool_02  = getPFMatchingTool(name="MatchingTool_Pull_02",  matchcut=0.2)
-        )
+        PFTrackClusterMatchingTool_015=getPFMatchingTool(
+            name="MatchingTool_Pull_015", matchcut=0.15
+        ),
+        PFTrackClusterMatchingTool_02=getPFMatchingTool(
+            name="MatchingTool_Pull_02", matchcut=0.2
+        ),
+    )
 
     # A second cell-level subtraction tool that handles cases where more than one
     # cluster is needed to recover the full track expected energy
     # Reuse the default E/P subtraction tool
-    PFRecoverSplitShowersTool = eflowRecConf.PFRecoverSplitShowersTool("PFRecoverSplitShowersTool",
-        eflowCellEOverPTool = CellEOverPTool
-        )
+    PFRecoverSplitShowersTool = eflowRecConf.PFRecoverSplitShowersTool(
+        "PFRecoverSplitShowersTool", eflowCellEOverPTool=CellEOverPTool
+    )
 
     # Configure moment calculation using topocluster moment calculator
-    PFMomentCalculatorTool = eflowRecConf.PFMomentCalculatorTool("PFMomentCalculatorTool")
+    PFMomentCalculatorTool = eflowRecConf.PFMomentCalculatorTool(
+        "PFMomentCalculatorTool"
+    )
     # Only need CENTER_MAG (depth in calo) for origin corrections
     from CaloRec import CaloRecConf
-    PFMomentCalculatorTool.CaloClusterMomentsMaker = CaloRecConf.CaloClusterMomentsMaker("PFClusterMomentsMaker",
+
+    PFMomentCalculatorTool.CaloClusterMomentsMaker = CaloRecConf.CaloClusterMomentsMaker(
+        "PFClusterMomentsMaker",
         # Originally from CaloTopoClusterFlags
-        TwoGaussianNoise = True,
+        TwoGaussianNoise=True,
         # Needed for origin correction
-        MomentsNames = ["CENTER_MAG"]
-        )
+        MomentsNames=["CENTER_MAG"],
+    )
     # Makes a temporary cluster collection for moment calculation
-    PFMomentCalculatorTool.PFClusterCollectionTool = eflowRecConf.PFClusterCollectionTool()
+    PFMomentCalculatorTool.PFClusterCollectionTool = (
+        eflowRecConf.PFClusterCollectionTool()
+    )
 
-    pfClusterSel = eflowRecConf.PFClusterSelectorTool("PFClusterSelectorTool",
-        clustersName=clustersin,
-        calClustersName="")
-    PFAlgorithm = eflowRecConf.PFAlgorithm("PFAlgorithm_"+tracktype,
-        PFClusterSelectorTool = pfClusterSel,
-        SubtractionToolList = [PFCellLevelSubtractionTool,PFRecoverSplitShowersTool],
-        BaseToolList = [PFMomentCalculatorTool]
-        )
+    pfClusterSel = eflowRecConf.PFClusterSelectorTool(
+        "PFClusterSelectorTool", clustersName=clustersin, calClustersName=""
+    )
+    PFAlgorithm = eflowRecConf.PFAlgorithm(
+        "PFAlgorithm_" + tracktype,
+        PFClusterSelectorTool=pfClusterSel,
+        SubtractionToolList=[PFCellLevelSubtractionTool, PFRecoverSplitShowersTool],
+        BaseToolList=[PFMomentCalculatorTool],
+    )
 
     from eflowRec import PFOnlineMon
+
     monTool = PFOnlineMon.getMonTool_PFAlgorithm()
     PFAlgorithm.MonTool = monTool
-    
+
     return PFAlgorithm
 
+
 # Convert internal eflowRec track/cluster objects into xAOD neutral/charged
 # particle flow objects
 def getPFOCreators(tracktype):
     PFOChargedCreatorAlgorithm = eflowRecConf.PFOChargedCreatorAlgorithm(
-        "PFOChargedCreatorAlgorithm_"+tracktype,
-        PFOOutputName="HLT_{}ChargedParticleFlowObjects".format(tracktype)
-        )
+        "PFOChargedCreatorAlgorithm_" + tracktype,
+        PFOOutputName="HLT_{}ChargedParticleFlowObjects".format(tracktype),
+    )
 
-    PFONeutralCreatorAlgorithm =  eflowRecConf.PFONeutralCreatorAlgorithm(
-        "PFONeutralCreatorAlgorithm_"+tracktype,
+    PFONeutralCreatorAlgorithm = eflowRecConf.PFONeutralCreatorAlgorithm(
+        "PFONeutralCreatorAlgorithm_" + tracktype,
         PFOOutputName="HLT_{}NeutralParticleFlowObjects".format(tracktype),
-        DoClusterMoments=False # Only CENTER_MAG
-        )
+        DoClusterMoments=False,  # Only CENTER_MAG
+    )
     return PFOChargedCreatorAlgorithm, PFONeutralCreatorAlgorithm
 
+
 # Generate the full PF reco sequence, assuming tracks, vertices, clusters
 # will be created upstream
-def PFHLTSequence(dummyflags,clustersin,tracktype):
+def PFHLTSequence(flags, clustersin, tracktype, cellsin=None):
+    if flags is None:
+        from AthenaConfiguration.AllConfigFlags import ConfigFlags as flags
 
-    PFTrkSel = getPFTrackSel(tracktype)
-    PFAlg = getPFAlg(clustersin,tracktype)
+    muon_mode = flags.Trigger.FSHad.PFOMuonRemoval
+    if muon_mode == "None":
+        tracks = trackvtxcontainers[tracktype][0]
+        algs = []
+        extension = ""
+    else:
+        pretracks, extension, algs = PFTrackExtension(tracktype)
+        if muon_mode == "Calo":
+            if cellsin is None:
+                raise ValueError("Cells must be provided for the 'Calo' muon mode!")
+            tracks, tag_alg = muonCaloTagSeq(flags, tracktype, pretracks, extension, cellsin)
+        elif muon_mode == "Iso":
+            tracks, tag_alg = muonIsoTagSeq(flags, tracktype, pretracks, extension, clustersin)
+        else:
+            raise ValueError(f"Invalid muon removal mode '{muon_mode}'")
+        algs.append(tag_alg)
+    
+    PFTrkSel = getPFTrackSel(tracktype, extension, tracks)
+    PFAlg = getPFAlg(clustersin, tracktype)
     PFCCreator, PFNCreator = getPFOCreators(tracktype)
 
     # Create HLT "parallel OR" sequence holding the PF algs
     # Can be inserted into the jet building sequence
     from AthenaCommon.CFElements import parOR
-    pfSequence = parOR("HLTPFlow_"+tracktype, [PFTrkSel,PFAlg,PFCCreator,PFNCreator])
-    pfoPrefix = "HLT_"+tracktype
+
+    pfSequence = parOR(
+        "HLTPFlow_" + tracktype, algs + [PFTrkSel, PFAlg, PFCCreator, PFNCreator]
+    )
+    pfoPrefix = "HLT_" + tracktype
 
     log.debug("Created sequence:\n%s", pfSequence)
 
diff --git a/Reconstruction/eflowRec/src/PFTrackMuonCaloTaggingAlg.cxx b/Reconstruction/eflowRec/src/PFTrackMuonCaloTaggingAlg.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..0c6ae655e2f0bf2e412333efd47d1162529a9bcb
--- /dev/null
+++ b/Reconstruction/eflowRec/src/PFTrackMuonCaloTaggingAlg.cxx
@@ -0,0 +1,65 @@
+#include "PFTrackMuonCaloTaggingAlg.h"
+#include "StoreGate/ReadHandle.h"
+#include "StoreGate/WriteHandle.h"
+#include "AthContainers/ConstDataVector.h"
+
+PFTrackMuonCaloTaggingAlg::PFTrackMuonCaloTaggingAlg(const std::string &name, ISvcLocator *pSvcLocator)
+    : AthReentrantAlgorithm(name, pSvcLocator)
+{
+}
+
+PFTrackMuonCaloTaggingAlg::~PFTrackMuonCaloTaggingAlg() {}
+
+StatusCode PFTrackMuonCaloTaggingAlg::initialize()
+{
+  ATH_CHECK(m_inputTracksKey.initialize());
+  ATH_CHECK(m_caloExtensionKey.initialize());
+  ATH_CHECK(m_inputCellsKey.initialize());
+  ATH_CHECK(m_outputTracksKey.initialize());
+  ATH_CHECK(m_looseMuonTagTool.retrieve());
+  ATH_CHECK(m_tightMuonTagTool.retrieve());
+  ATH_CHECK(m_muonScoreTool.retrieve());
+  ATH_CHECK(m_depositInCaloTool.retrieve());
+  return StatusCode::SUCCESS;
+}
+
+StatusCode PFTrackMuonCaloTaggingAlg::execute(const EventContext &ctx) const
+{
+  auto inputTracks = SG::makeHandle(m_inputTracksKey, ctx);
+  if (!inputTracks.isValid())
+  {
+    ATH_MSG_ERROR("Failed to retrieve " << m_inputTracksKey);
+    return StatusCode::FAILURE;
+  }
+  auto inputCells = SG::makeHandle(m_inputCellsKey, ctx);
+  if (!inputCells.isValid())
+  {
+    ATH_MSG_ERROR("Failed to retrieve " << m_inputCellsKey);
+    return StatusCode::FAILURE;
+  }
+  auto inputCaloExtensions = SG::makeHandle(m_caloExtensionKey, ctx);
+  if (!inputCaloExtensions.isValid())
+  {
+    ATH_MSG_ERROR("Failed to retrieve " << m_caloExtensionKey);
+    return StatusCode::FAILURE;
+  }
+  auto outputHandle = SG::makeHandle(m_outputTracksKey, ctx);
+
+  auto outputTracks = std::make_unique<ConstDataVector<xAOD::TrackParticleContainer>>(SG::VIEW_ELEMENTS);
+  for (const xAOD::TrackParticle *itrk : *inputTracks)
+  {
+    if (itrk->pt() > m_minPt)
+    {
+      std::vector<DepositInCalo> deposits = m_depositInCaloTool->getDeposits(itrk, inputCells.ptr(), inputCaloExtensions.ptr());
+      int looseTag = m_looseMuonTagTool->caloMuonTag(deposits, itrk->eta(), itrk->pt());
+      int tightTag = m_tightMuonTagTool->caloMuonTag(deposits, itrk->eta(), itrk->pt());
+      float score = m_muonScoreTool->getMuonScore(itrk, inputCells.ptr(), inputCaloExtensions.ptr());
+      if (tightTag || (score > m_caloMuonScoreCut && looseTag))
+        // This means that the track is tagged as a muon, so don't output it
+        continue;
+    }
+    outputTracks->push_back(itrk);
+  }
+  ATH_CHECK(outputHandle.put(ctx, std::move(outputTracks)) != nullptr);
+  return StatusCode::SUCCESS;
+}
\ No newline at end of file
diff --git a/Reconstruction/eflowRec/src/PFTrackMuonCaloTaggingAlg.h b/Reconstruction/eflowRec/src/PFTrackMuonCaloTaggingAlg.h
new file mode 100644
index 0000000000000000000000000000000000000000..088205eef07dce46d3f921f0f0bad69c34d63d9c
--- /dev/null
+++ b/Reconstruction/eflowRec/src/PFTrackMuonCaloTaggingAlg.h
@@ -0,0 +1,62 @@
+/*
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef EFLOWREC_PFTRACKMUONCALOTAGGINGALG_H
+#define EFLOWREC_PFTRACKMUONCALOTAGGINGALG_H
+
+#include "AthenaBaseComps/AthReentrantAlgorithm.h"
+#include "StoreGate/ReadHandleKey.h"
+#include "StoreGate/WriteHandleKey.h"
+#include "xAODTracking/TrackParticleContainer.h"
+#include "CaloEvent/CaloCellContainer.h"
+#include "GaudiKernel/ToolHandle.h"
+#include "ICaloTrkMuIdTools/ICaloMuonScoreTool.h"
+#include "ICaloTrkMuIdTools/ICaloMuonTag.h"
+#include "ICaloTrkMuIdTools/ITrackDepositInCaloTool.h"
+#include "TrkCaloExtension/CaloExtensionCollection.h"
+#include "GaudiKernel/SystemOfUnits.h"
+
+/**
+ * @brief Algorithm to use calorimeter information to remove potential muons
+ * 
+ * Outputs a reduced set of tracks, containing only those not tagged as muons
+ */
+class PFTrackMuonCaloTaggingAlg : public AthReentrantAlgorithm
+{
+public:
+    PFTrackMuonCaloTaggingAlg(const std::string &name, ISvcLocator *pSvcLocator);
+    virtual ~PFTrackMuonCaloTaggingAlg() override;
+
+    virtual StatusCode initialize() override;
+    virtual StatusCode execute(const EventContext &ctx) const override;
+
+private:
+    /// The input track collection
+    SG::ReadHandleKey<xAOD::TrackParticleContainer> m_inputTracksKey{
+        this, "InputTracks", "", "Input track collection"};
+    /// The input calorimeter extension
+    SG::ReadHandleKey<CaloExtensionCollection> m_caloExtensionKey{
+        this, "InputCaloExtension", "", "The calorimeter extensions of the tracks"};
+    /// Input cells. It's generally more efficient to pass these in this way
+    SG::ReadHandleKey<CaloCellContainer> m_inputCellsKey{
+        this, "InputCells", "", "Cell container to pass to the other tools"};
+    /// The output tracks, excluding those identified as muons
+    SG::WriteHandleKey<xAOD::TrackParticleContainer> m_outputTracksKey{
+        this, "OutputTracks", "", "Output tracks, excluding those tagged as muons"};
+    ToolHandle<ICaloMuonTag> m_looseMuonTagTool{
+        this, "LooseTagTool", "", "Loose muon tag tool"};
+    ToolHandle<ICaloMuonTag> m_tightMuonTagTool{
+        this, "TightTagTool", "", "Tight muon tag tool"};
+    ToolHandle<ICaloMuonScoreTool> m_muonScoreTool{
+        this, "MuonScoreTool", "", "Calo muon score tool"};
+    ToolHandle<ITrackDepositInCaloTool> m_depositInCaloTool{
+        this, "DepositInCaloTool", "", "Deposit in calo tool"};
+    Gaudi::Property<float> m_minPt{
+        this, "MinPt", 10 * Gaudi::Units::GeV, "Only consider tracks above this value for muon selection (all below go into the output)"};
+    Gaudi::Property<float> m_caloMuonScoreCut{
+        this, "MuonScoreCut", 0.4, "Below this value, require a tight calo tag"};
+
+}; //> end class PFTrackMuonCaloTaggingAlg
+
+#endif //> !EFLOWREC_PFTRACKMUONCALOTAGGINGALG_H
\ No newline at end of file
diff --git a/Reconstruction/eflowRec/src/PFTrackMuonIsoTaggingAlg.cxx b/Reconstruction/eflowRec/src/PFTrackMuonIsoTaggingAlg.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..ae827293650e914dbccb15d1d5467e1bda67d68a
--- /dev/null
+++ b/Reconstruction/eflowRec/src/PFTrackMuonIsoTaggingAlg.cxx
@@ -0,0 +1,107 @@
+/*
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "PFTrackMuonIsoTaggingAlg.h"
+#include "StoreGate/ReadHandle.h"
+#include "StoreGate/WriteHandle.h"
+#include "AthContainers/ConstDataVector.h"
+#include <memory>
+#include "EventPrimitives/EventPrimitivesHelpers.h"
+
+PFTrackMuonIsoTaggingAlg::PFTrackMuonIsoTaggingAlg(const std::string &name, ISvcLocator *pSvcLocator)
+    : AthReentrantAlgorithm(name, pSvcLocator)
+{
+}
+
+PFTrackMuonIsoTaggingAlg::~PFTrackMuonIsoTaggingAlg() {}
+
+StatusCode PFTrackMuonIsoTaggingAlg::initialize()
+{
+  ATH_CHECK(m_inputTracksKey.initialize());
+  ATH_CHECK(m_inputClustersKey.initialize());
+  ATH_CHECK(m_inputVerticesKey.initialize());
+  ATH_CHECK(m_outputTracksKey.initialize());
+  ATH_CHECK(m_trkIsoTool.retrieve());
+  ATH_CHECK(m_caloIsoTool.retrieve());
+  return StatusCode::SUCCESS;
+}
+
+StatusCode PFTrackMuonIsoTaggingAlg::execute(const EventContext &ctx) const
+{
+  auto inputTracks = SG::makeHandle(m_inputTracksKey, ctx);
+  if (!inputTracks.isValid())
+  {
+    ATH_MSG_ERROR("Failed to retrieve " << m_inputTracksKey);
+    return StatusCode::FAILURE;
+  }
+  auto inputClusters = SG::makeHandle(m_inputClustersKey, ctx);
+  if (!inputClusters.isValid())
+  {
+    ATH_MSG_ERROR("Failed to retrieve " << m_inputClustersKey);
+    return StatusCode::FAILURE;
+  }
+  auto inputVertices = SG::makeHandle(m_inputVerticesKey, ctx);
+  if (!inputVertices.isValid())
+  {
+    ATH_MSG_ERROR("Failed to retrieve " << m_inputVerticesKey);
+    return StatusCode::FAILURE;
+  }
+  auto outputHandle = SG::makeHandle(m_outputTracksKey, ctx);
+  const xAOD::Vertex *primaryVtx = nullptr;
+  for (const xAOD::Vertex *ivtx : *inputVertices)
+  {
+    if (ivtx->vertexType() == xAOD::VxType::PriVtx)
+    {
+      primaryVtx = ivtx;
+      break;
+    }
+  }
+
+  auto outputTracks = std::make_unique<ConstDataVector<xAOD::TrackParticleContainer>>(SG::VIEW_ELEMENTS);
+  for (const xAOD::TrackParticle *itrk : *inputTracks)
+  {
+    if (itrk->pt() > m_minPt)
+    {
+      xAOD::TrackIsolation trackIsoResult;
+      std::vector<xAOD::Iso::IsolationType> trackIsoTypes{xAOD::Iso::ptcone20};
+      xAOD::TrackCorrection trackIsoCorr;
+      trackIsoCorr.trackbitset.set(xAOD::Iso::IsolationTrackCorrection::coreTrackPtr);
+      m_trkIsoTool->trackIsolation(trackIsoResult, *itrk, trackIsoTypes, trackIsoCorr, primaryVtx, nullptr, inputTracks.ptr());
+      float ptCone20 = trackIsoResult.ptcones[0];
+      xAOD::CaloIsolation caloIsoResult;
+      xAOD::CaloCorrection caloIsoCorr;
+      caloIsoCorr.calobitset.set(xAOD::Iso::IsolationCaloCorrection::coreCone);
+      m_caloIsoTool->caloTopoClusterIsolation(caloIsoResult, *itrk, {xAOD::Iso::IsolationType::etcone20}, caloIsoCorr, inputClusters.ptr());
+      float etConeCore = caloIsoResult.coreCorrections[xAOD::Iso::IsolationCaloCorrection::coreCone][xAOD::Iso::IsolationCorrectionParameter::coreEnergy];
+      float rerr = Amg::error(itrk->definingParametersCovMatrix(), 4) / fabs(itrk->qOverP());
+      float eOverP = etConeCore / itrk->pt();
+      float trackIso = ptCone20 / itrk->pt();
+      float ptsum = itrk->pt() + ptCone20;
+      float caloIso = etConeCore / ptsum;
+      float trkPtFraction = itrk->pt() / ptsum;
+
+      bool fakeTrack = false;
+      bool muonTrack = false;
+      if (trackIso < m_hltTrkIsoThresh)
+      {
+        if (rerr > m_hltFakeTrkRErr)
+          fakeTrack = true;
+        else if (eOverP < m_hltIsoMuonEOverP)
+          muonTrack = true;
+        else if (rerr > 0.1 || (eOverP > 0.1 && rerr > 0.05))
+          fakeTrack = true;
+      }
+      else
+      {
+        muonTrack = caloIso < m_hltNonIsoMuonEOverP && trkPtFraction > m_hltNonIsoMuonTrkPtFraction;
+      }
+      if (muonTrack || fakeTrack)
+        continue;
+    }
+    outputTracks->push_back(itrk);
+  }
+  ATH_CHECK(outputHandle.put(ctx, std::move(outputTracks)) != nullptr);
+
+  return StatusCode::SUCCESS;
+}
\ No newline at end of file
diff --git a/Reconstruction/eflowRec/src/PFTrackMuonIsoTaggingAlg.h b/Reconstruction/eflowRec/src/PFTrackMuonIsoTaggingAlg.h
new file mode 100644
index 0000000000000000000000000000000000000000..52089587966c45fcbc72b1ab3d240bca75df74d1
--- /dev/null
+++ b/Reconstruction/eflowRec/src/PFTrackMuonIsoTaggingAlg.h
@@ -0,0 +1,68 @@
+/*
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef EFLOWREC_PFTRACKMUONISOTAGGINGALG_H
+#define EFLOWREC_PFTRACKMUONISOTAGGINGALG_H
+
+#include "AthenaBaseComps/AthReentrantAlgorithm.h"
+#include "StoreGate/ReadHandleKey.h"
+#include "StoreGate/WriteHandleKey.h"
+#include "xAODTracking/TrackParticleContainer.h"
+#include "xAODTracking/VertexContainer.h"
+#include "xAODCaloEvent/CaloClusterContainer.h"
+#include "GaudiKernel/ToolHandle.h"
+#include "RecoToolInterfaces/ITrackIsolationTool.h"
+#include "RecoToolInterfaces/ICaloTopoClusterIsolationTool.h"
+
+class PFTrackMuonIsoTaggingAlg : public AthReentrantAlgorithm
+{
+public:
+    PFTrackMuonIsoTaggingAlg(const std::string &name, ISvcLocator *pSvcLocator);
+    virtual ~PFTrackMuonIsoTaggingAlg() override;
+
+    virtual StatusCode initialize() override;
+    virtual StatusCode execute(const EventContext &ctx) const override;
+
+private:
+    /// The input track collection
+    SG::ReadHandleKey<xAOD::TrackParticleContainer> m_inputTracksKey{
+        this, "InputTracks", "", "Input track collection"};
+    /// Input cluster collection
+    SG::ReadHandleKey<xAOD::CaloClusterContainer> m_inputClustersKey{
+        this, "InputClusters", "", "Input cluster collection"};
+    /// Input vertex collection
+    SG::ReadHandleKey<xAOD::VertexContainer> m_inputVerticesKey{
+        this, "InputVertices", "", "Input vertex collection"};
+    /// The output tracks, excluding those identified as muons
+    SG::WriteHandleKey<xAOD::TrackParticleContainer> m_outputTracksKey{
+        this, "OutputTracks", "", "Output tracks, excluding those tagged as muons"};
+
+    ToolHandle<xAOD::ITrackIsolationTool> m_trkIsoTool{
+        this, "TrackIsoTool", "", "The track isolation tool"};
+
+    ToolHandle<xAOD::ICaloTopoClusterIsolationTool> m_caloIsoTool{
+        this, "CaloIsoTool", "", "The calorimeter isolation tool"};
+    /** HLT track isolation threshold **/
+    Gaudi::Property<float> m_hltTrkIsoThresh{this, "HLTTrackIsoThreshold", 0.1, "The HLT threshold to consider tracks as isolated"};
+
+    /** HLT fake track relative error threshold **/
+    Gaudi::Property<float> m_hltFakeTrkRErr{this, "HLTFakeTrackRErr", 0.4, "The relative error threshold for rejecting fake tracks"};
+
+    /** HLT E over P selection for isolated muon tracks **/
+    Gaudi::Property<float> m_hltIsoMuonEOverP{this, "HLTIsoMuonEOverP", 0.65, "The upper limit on E over P for identifying isolated HLT muon tracks"};
+
+    /** HLT E over P selection for non-isolated muon tracks **/
+    Gaudi::Property<float> m_hltNonIsoMuonEOverP{
+        this, "HLTNonIsoMuonEOverP", 0.6, "The upper limit on E over P for identifying non-isolated HLT muon tracks"};
+
+    /** HLT track pt fraction for non-isolated muon tracks **/
+    Gaudi::Property<float> m_hltNonIsoMuonTrkPtFraction{
+        this, "HLTNonIsoMuonTrkPtFraction", 0.6, "The lower limit on the track pt fraction in the central track for HLT muons"};
+
+    Gaudi::Property<float> m_minPt{
+        this, "MinPt", 10 * Gaudi::Units::GeV, "Only consider tracks above this value for muon selection (all below go into the output)"};
+
+}; //> end class PFTrackMuonIsoTaggingAlg
+
+#endif //> !EFLOWREC_PFTRACKMUONISOTAGGINGALG_H
\ No newline at end of file
diff --git a/Reconstruction/eflowRec/src/PFTrackPreselAlg.cxx b/Reconstruction/eflowRec/src/PFTrackPreselAlg.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..a26e64f7e1caa00b0a5a02be47b23df46e04db20
--- /dev/null
+++ b/Reconstruction/eflowRec/src/PFTrackPreselAlg.cxx
@@ -0,0 +1,52 @@
+/*
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "PFTrackPreselAlg.h"
+#include "StoreGate/ReadHandle.h"
+#include "StoreGate/WriteHandle.h"
+#include "AthContainers/ConstDataVector.h"
+#include <memory>
+
+namespace {
+  const static SG::AuxElement::Decorator<char> decPass("passPFTrackPresel");
+}
+
+PFTrackPreselAlg::PFTrackPreselAlg(const std::string& name, ISvcLocator* pSvcLocator)
+  : AthReentrantAlgorithm(name, pSvcLocator)
+{
+}
+
+PFTrackPreselAlg::~PFTrackPreselAlg() {}
+
+StatusCode PFTrackPreselAlg::initialize()
+{
+  ATH_CHECK( m_inputTracksKey.initialize() );
+  ATH_CHECK( m_outputTracksKey.initialize() );
+  ATH_CHECK( m_trackSelTool.retrieve() );
+  return StatusCode::SUCCESS;
+}
+
+StatusCode PFTrackPreselAlg::execute(const EventContext &ctx) const
+{
+  auto input = SG::makeHandle(m_inputTracksKey, ctx);
+  if (!input.isValid())
+  {
+    ATH_MSG_ERROR("Failed to retrieve " << m_inputTracksKey);
+    return StatusCode::FAILURE;
+  }
+  auto output = std::make_unique<ConstDataVector<xAOD::TrackParticleContainer>>(SG::VIEW_ELEMENTS);
+  for (const xAOD::TrackParticle* itrk : *input)
+  {
+    if (itrk->pt() > m_upperPtCut || !m_trackSelTool->accept(*itrk))
+    {
+      decPass(*itrk) = false;
+      continue;
+    }
+    decPass(*itrk) = true;
+    output->push_back(itrk);
+  }
+  auto outputHandle = SG::makeHandle(m_outputTracksKey, ctx);
+  ATH_CHECK(outputHandle.put(std::move(output)) != nullptr);
+  return StatusCode::SUCCESS;
+}
diff --git a/Reconstruction/eflowRec/src/PFTrackPreselAlg.h b/Reconstruction/eflowRec/src/PFTrackPreselAlg.h
new file mode 100644
index 0000000000000000000000000000000000000000..732ae2f0fb62973901a7f3915ebc2366d1fcd665
--- /dev/null
+++ b/Reconstruction/eflowRec/src/PFTrackPreselAlg.h
@@ -0,0 +1,42 @@
+/*
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+*/
+#ifndef EFLOWREC_PFTRACKPRESELALG_H
+#define EFLOWREC_PFTRACKPRESELALG_H
+
+#include "AthenaBaseComps/AthReentrantAlgorithm.h"
+#include "StoreGate/ReadHandleKey.h"
+#include "StoreGate/WriteHandleKey.h"
+#include "xAODTracking/TrackParticleContainer.h"
+#include "GaudiKernel/ToolHandle.h"
+#include "InDetTrackSelectionTool/IInDetTrackSelectionTool.h"
+#include "GaudiKernel/SystemOfUnits.h"
+
+/**
+ * @brief Algorithm producing a preselected set of tracks
+ *
+ * The tracks output by this algorithm are the only ones that will be extended
+ * through the calorimeter and used in later steps of the PFO creation.
+ * Selections which do not depend on the extrapolation belong here
+ */
+class PFTrackPreselAlg : public AthReentrantAlgorithm {
+  public:
+    PFTrackPreselAlg(const std::string& name, ISvcLocator* pSvcLocator);
+    ~PFTrackPreselAlg();
+
+    virtual StatusCode initialize() override;
+    virtual StatusCode execute(const EventContext& ctx) const override;
+  private:
+    SG::ReadHandleKey<xAOD::TrackParticleContainer> m_inputTracksKey{
+      this, "InputTracks", "", "The input track selection"};
+    SG::WriteHandleKey<xAOD::TrackParticleContainer> m_outputTracksKey{
+      this, "OutputTracks", "", "The output preselected track collection"};
+    ToolHandle<InDet::IInDetTrackSelectionTool> m_trackSelTool{
+      this, "TrackSelTool", "", "The track selection tool"};
+    Gaudi::Property<float> m_upperPtCut{
+      this, "UpperPtCut", 100 * Gaudi::Units::GeV, "Upper limit on track pT"};
+
+}; //> end PFTrackPreselAlg
+
+
+#endif //> !EFLOWREC_PFTRACKPRESELALG_H
diff --git a/Reconstruction/eflowRec/src/components/eflowRec_entries.cxx b/Reconstruction/eflowRec/src/components/eflowRec_entries.cxx
index a399ea6da1f2b4bb42dac6ad40ea474bc1a31415..6932211306b67e7182da663b58ff0b087efcde01 100644
--- a/Reconstruction/eflowRec/src/components/eflowRec_entries.cxx
+++ b/Reconstruction/eflowRec/src/components/eflowRec_entries.cxx
@@ -27,6 +27,9 @@
 #include "eflowRec/PFMuonFlowElementAssoc.h"
 #include "eflowRec/PFEGamFlowElementAssoc.h"
 #include "eflowRec/PFTauFlowElementAssoc.h"
+#include "../PFTrackPreselAlg.h"
+#include "../PFTrackMuonCaloTaggingAlg.h"
+#include "../PFTrackMuonIsoTaggingAlg.h"
 
 DECLARE_COMPONENT( eflowOverlapRemoval )
 DECLARE_COMPONENT( PFLeptonSelector )
@@ -53,3 +56,6 @@ DECLARE_COMPONENT( eflowCellEOverPTool_mc12_LC)
 DECLARE_COMPONENT( PFMuonFlowElementAssoc )
 DECLARE_COMPONENT( PFEGamFlowElementAssoc )
 DECLARE_COMPONENT( PFTauFlowElementAssoc )
+DECLARE_COMPONENT( PFTrackPreselAlg )
+DECLARE_COMPONENT( PFTrackMuonCaloTaggingAlg )
+DECLARE_COMPONENT( PFTrackMuonIsoTaggingAlg )
diff --git a/Reconstruction/egamma/egammaAlgs/src/egammaSuperClusterBuilder.h b/Reconstruction/egamma/egammaAlgs/src/egammaSuperClusterBuilder.h
index 2d463c313b769f550ffbdec6745d785ce7ceb8e5..c99e8801281c336800b2fc9d7108c45faecde9a7 100644
--- a/Reconstruction/egamma/egammaAlgs/src/egammaSuperClusterBuilder.h
+++ b/Reconstruction/egamma/egammaAlgs/src/egammaSuperClusterBuilder.h
@@ -15,7 +15,7 @@
 #include "CaloDetDescr/CaloDetDescrManager.h"
 #include "CaloUtils/CaloCellDetPos.h"
 #include "egammaInterfaces/IegammaCheckEnergyDepositTool.h"
-#include "egammaInterfaces/IegammaMVASvc.h"
+#include "EgammaAnalysisInterfaces/IegammaMVASvc.h"
 #include "egammaInterfaces/IegammaSwTool.h"
 #include "egammaRecEvent/egammaRecContainer.h"
 #include "xAODCaloEvent/CaloClusterFwd.h"
diff --git a/Reconstruction/egamma/egammaInterfaces/egammaInterfaces/egammaInterfacesDict.h b/Reconstruction/egamma/egammaInterfaces/egammaInterfaces/egammaInterfacesDict.h
index 5edb3297dbc582b82ea737bdd10a7715b6d27e29..e3897bbfd04fa84298dc2a63c9bfa82697a01635 100644
--- a/Reconstruction/egamma/egammaInterfaces/egammaInterfaces/egammaInterfacesDict.h
+++ b/Reconstruction/egamma/egammaInterfaces/egammaInterfaces/egammaInterfacesDict.h
@@ -29,7 +29,6 @@
 #include "egammaInterfaces/IegammaShowerShape.h"
 #include "egammaInterfaces/IegammaStripsShape.h"
 #include "egammaInterfaces/IegammaSwTool.h"
-#include "egammaInterfaces/IegammaMVASvc.h"
 #include "egammaInterfaces/IegammaOQFlagsBuilder.h"
 #ifndef XAOD_ANALYSIS
 #   include "egammaInterfaces/IEMExtrapolationTools.h"
diff --git a/Reconstruction/egamma/egammaInterfaces/egammaInterfaces/selection.xml b/Reconstruction/egamma/egammaInterfaces/egammaInterfaces/selection.xml
index 1969394b3f9918c86191b6bd27d781c177b9c00b..e52f5e1ad698ee21e214aa04fb2cab9d8deafcdc 100644
--- a/Reconstruction/egamma/egammaInterfaces/egammaInterfaces/selection.xml
+++ b/Reconstruction/egamma/egammaInterfaces/egammaInterfaces/selection.xml
@@ -16,7 +16,6 @@
   <class name="IegammaStripsShape" />
   <class name="IegammaSwTool" />
   <class name="IegammaTrkRefitterTool" />
-  <class name="IegammaMVASvc" />
   <class name="IegammaOQFlagsBuilder" />
 </lcgdict>
 
diff --git a/Reconstruction/egamma/egammaMVACalib/CMakeLists.txt b/Reconstruction/egamma/egammaMVACalib/CMakeLists.txt
index 4897240610632899c0dce3e77319f8e229c6f2a4..8155feb9d49601602f4915bfe112f86690cba922 100644
--- a/Reconstruction/egamma/egammaMVACalib/CMakeLists.txt
+++ b/Reconstruction/egamma/egammaMVACalib/CMakeLists.txt
@@ -17,14 +17,20 @@ atlas_add_library( egammaMVACalibLib
    egammaMVACalib/*.h Root/*.cxx
    PUBLIC_HEADERS egammaMVACalib
    INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-   LINK_LIBRARIES ${ROOT_LIBRARIES} AsgMessagingLib xAODCaloEvent xAODEgamma
+   LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools AsgServicesLib AsgMessagingLib 
+   xAODCaloEvent xAODEgamma  xAODTracking MVAUtils PathResolver EgammaAnalysisInterfacesLib
    ${extra_libs} )
 
+atlas_add_dictionary( egammaMVACalibDict
+	egammaMVACalib/egammaMVACalibDict.h
+	egammaMVACalib/selection.xml
+	LINK_LIBRARIES egammaMVACalibLib )
+
 if( NOT XAOD_STANDALONE )
 atlas_add_component( egammaMVACalib
 	src/*.cxx src/components/*.cxx
 	INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-	LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaBaseComps GaudiKernel MVAUtils PathResolver egammaInterfacesLib egammaMVACalibLib xAODCaloEvent xAODEgamma xAODTracking )
+	LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaBaseComps GaudiKernel egammaMVACalibLib)
 endif()
 
 # Install files from the package:
diff --git a/Reconstruction/egamma/egammaMVACalib/src/egammaMVACalibTool.cxx b/Reconstruction/egamma/egammaMVACalib/Root/egammaMVACalibTool.cxx
similarity index 97%
rename from Reconstruction/egamma/egammaMVACalib/src/egammaMVACalibTool.cxx
rename to Reconstruction/egamma/egammaMVACalib/Root/egammaMVACalibTool.cxx
index 0de9e373dec21feff4a2a78125e36a6f05050e7a..d9d09f4f9908983bcca982daafaab4b6093c985c 100644
--- a/Reconstruction/egamma/egammaMVACalib/src/egammaMVACalibTool.cxx
+++ b/Reconstruction/egamma/egammaMVACalib/Root/egammaMVACalibTool.cxx
@@ -2,7 +2,7 @@
   Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
-#include "egammaMVACalibTool.h"
+#include "egammaMVACalib/egammaMVACalibTool.h"
 
 #include "xAODEgamma/Egamma.h"
 #include "xAODCaloEvent/CaloCluster.h"
@@ -23,8 +23,8 @@ using Gaudi::Units::GeV;
 #define GeV 1000
 #endif
 
-egammaMVACalibTool::egammaMVACalibTool(const std::string& type, const std::string& name, const IInterface* parent) :
-  base_class(type, name, parent)
+egammaMVACalibTool::egammaMVACalibTool(const std::string& name) :
+  asg::AsgTool(name)
 {
 }
 
@@ -81,11 +81,6 @@ StatusCode egammaMVACalibTool::initialize()
   return StatusCode::SUCCESS;
 }
 
-StatusCode egammaMVACalibTool::finalize()
-{
-  return StatusCode::SUCCESS;
-}
-
 StatusCode egammaMVACalibTool::setupBDT(const egammaMVAFunctions::funcMap_t& funcLibrary,
                                         const std::string& fileName)
 {
diff --git a/Reconstruction/egamma/egammaMVACalib/src/egammaMVASvc.cxx b/Reconstruction/egamma/egammaMVACalib/Root/egammaMVASvc.cxx
similarity index 88%
rename from Reconstruction/egamma/egammaMVACalib/src/egammaMVASvc.cxx
rename to Reconstruction/egamma/egammaMVACalib/Root/egammaMVASvc.cxx
index af640151cf0651cb6ec88b8ce23723ecb8e22499..136ee2d1220a50e57f2c5cac7e586822188c04b8 100644
--- a/Reconstruction/egamma/egammaMVACalib/src/egammaMVASvc.cxx
+++ b/Reconstruction/egamma/egammaMVACalib/Root/egammaMVASvc.cxx
@@ -2,7 +2,7 @@
   Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
-#include "egammaMVASvc.h"
+#include "egammaMVACalib/egammaMVASvc.h"
 #include "xAODEgamma/Egamma.h"
 #include "xAODCaloEvent/CaloCluster.h"
 #include "xAODEgamma/EgammaDefs.h"
@@ -12,7 +12,7 @@
 
 
 egammaMVASvc::egammaMVASvc(const std::string& name, ISvcLocator* svc) :
-  base_class( name, svc )
+  asg::AsgService( name, svc )
 {
 }
 
@@ -20,7 +20,7 @@ StatusCode egammaMVASvc::initialize()
 {
   ATH_MSG_DEBUG("In initialize of " << name() << "..." );
 
-  if (m_mvaElectron.isEnabled()) {
+  if (!m_mvaElectron.empty()) {
     ATH_MSG_DEBUG("Retrieving mvaElectron");
     ATH_CHECK(m_mvaElectron.retrieve());
   } else {
@@ -28,7 +28,7 @@ StatusCode egammaMVASvc::initialize()
     m_mvaElectron.disable();
   }
 
-  if (m_mvaUnconvertedPhoton.isEnabled()) {
+  if (!m_mvaUnconvertedPhoton.empty()) {
     ATH_MSG_DEBUG("Retrieving mvaUnconvertedPhoton");
     ATH_CHECK(m_mvaUnconvertedPhoton.retrieve());
   } else {
@@ -36,7 +36,7 @@ StatusCode egammaMVASvc::initialize()
     m_mvaUnconvertedPhoton.disable();
   }
 
-  if (m_mvaConvertedPhoton.isEnabled()) {
+  if (!m_mvaConvertedPhoton.empty()) {
     ATH_MSG_DEBUG("Retrieving mvaConvertedPhoton");
     ATH_CHECK(m_mvaConvertedPhoton.retrieve());
   } else {
@@ -47,12 +47,6 @@ StatusCode egammaMVASvc::initialize()
   return StatusCode::SUCCESS;
 }
 
-
-StatusCode egammaMVASvc::finalize(){
-  ATH_MSG_DEBUG( "in finalize" );
-  return StatusCode::SUCCESS;
-}
-
 StatusCode egammaMVASvc::execute(xAOD::CaloCluster& cluster,
                                  const xAOD::Egamma& eg) const
 {
@@ -62,7 +56,7 @@ StatusCode egammaMVASvc::execute(xAOD::CaloCluster& cluster,
   float mvaE = 0.0;
 
   if (xAOD::EgammaHelpers::isElectron(&eg)) {
-    if (m_mvaElectron.isEnabled()) {
+    if (!m_mvaElectron.empty()) {
       mvaE = m_mvaElectron->getEnergy(cluster, &eg);
     } else {
       ATH_MSG_FATAL("Trying to calibrate an electron, but disabled");
@@ -70,14 +64,14 @@ StatusCode egammaMVASvc::execute(xAOD::CaloCluster& cluster,
     }
   } else if (xAOD::EgammaHelpers::isConvertedPhoton(&eg) &&
              xAOD::EgammaHelpers::conversionRadius(static_cast<const xAOD::Photon*>(&eg)) < m_maxConvR) {
-    if (m_mvaConvertedPhoton.isEnabled()) {
+    if (!m_mvaConvertedPhoton.empty()) {
       mvaE = m_mvaConvertedPhoton->getEnergy(cluster, &eg);
     } else {
       ATH_MSG_FATAL("Trying to calibrate a converted photon, but disabled");
       return StatusCode::FAILURE;
     }
   } else if (xAOD::EgammaHelpers::isPhoton(&eg)) {
-    if (m_mvaUnconvertedPhoton.isEnabled()) {
+    if (!m_mvaUnconvertedPhoton.empty()) {
       mvaE = m_mvaUnconvertedPhoton->getEnergy(cluster, &eg);
     } else {
       ATH_MSG_FATAL("Trying to calibrate an unconverted photon, but disabled");
@@ -109,7 +103,7 @@ StatusCode egammaMVASvc::execute(xAOD::CaloCluster& cluster,
   float mvaE = 0.0;
   switch (egType) {
   case xAOD::EgammaParameters::electron:
-    if (m_mvaElectron.isEnabled()) {
+    if (!m_mvaElectron.empty()) {
       mvaE = m_mvaElectron->getEnergy(cluster,nullptr);
     } else {
       ATH_MSG_FATAL("Trying to calibrate an electron, but disabled");
@@ -119,7 +113,7 @@ StatusCode egammaMVASvc::execute(xAOD::CaloCluster& cluster,
   case xAOD::EgammaParameters::convertedPhoton:
   case xAOD::EgammaParameters::unconvertedPhoton:
     // treat converted photons like unconverted photons since don't have access to vertex
-    if (m_mvaUnconvertedPhoton.isEnabled()) {
+    if (!m_mvaUnconvertedPhoton.empty()) {
       mvaE = m_mvaUnconvertedPhoton->getEnergy(cluster,nullptr);
     } else {
       ATH_MSG_FATAL("Trying to calibrate an unconverted photon, but disabled");
diff --git a/Reconstruction/egamma/egammaMVACalib/egammaMVACalib/egammaMVACalibDict.h b/Reconstruction/egamma/egammaMVACalib/egammaMVACalib/egammaMVACalibDict.h
new file mode 100644
index 0000000000000000000000000000000000000000..53ac086d84630dba236af0b753c02b38fd8a57a1
--- /dev/null
+++ b/Reconstruction/egamma/egammaMVACalib/egammaMVACalib/egammaMVACalibDict.h
@@ -0,0 +1,10 @@
+/*
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+ */
+
+ #ifndef EGAMMAMVACALIB_EGAMMAMVACALIBDICT_H
+ #define EGAMMAMVACALIB_EGAMMAMVACALIBDICT_H
+ #include "egammaMVACalib/egammaMVACalibTool.h"
+ #include "egammaMVACalib/egammaMVASvc.h"
+
+ #endif // EGAMMAMVACALIB_EGAMMAMVACALIBDICT_H
diff --git a/Reconstruction/egamma/egammaMVACalib/src/egammaMVACalibTool.h b/Reconstruction/egamma/egammaMVACalib/egammaMVACalib/egammaMVACalibTool.h
similarity index 93%
rename from Reconstruction/egamma/egammaMVACalib/src/egammaMVACalibTool.h
rename to Reconstruction/egamma/egammaMVACalib/egammaMVACalib/egammaMVACalibTool.h
index d1bd04a1ad67c49a22acf87b60573a03402cd321..89d5ced20c62126478924859e31611029a94d1d8 100644
--- a/Reconstruction/egamma/egammaMVACalib/src/egammaMVACalibTool.h
+++ b/Reconstruction/egamma/egammaMVACalib/egammaMVACalib/egammaMVACalibTool.h
@@ -6,13 +6,16 @@
 #define EGAMMAMVACALIB_EGAMMAMVACALIBTOOL_H
 
 // Package includes
-#include "egammaInterfaces/IegammaMVACalibTool.h"
+#include "EgammaAnalysisInterfaces/IegammaMVACalibTool.h"
 #include "xAODEgamma/EgammaEnums.h"
 #include "MVAUtils/BDT.h"
 #include "egammaMVACalib/egammaMVAFunctions.h"
 
 // Framework includes
-#include "AthenaBaseComps/AthAlgTool.h"
+#include "AsgTools/AsgTool.h"
+#include "AsgTools/PropertyWrapper.h"
+
+//Root includes
 #include "TH2Poly.h"
 #include "TObject.h"
 #include "TString.h"
@@ -52,21 +55,21 @@
  *   Each TObjString is a string which represent the formula to compute the shift
  *   (used to construct a TFormula). The variables is the Et in GeV after the calibration.
  *   The value of the shift is divided by the energy calibrated by the BDT.
- *   
- * 
+ *
+ *
  * On data the property use_layer_corrected should be set to true. In reconstruction
  * this flag is always false. In PhysicsAnalysis it should be set appropriately.
  * When set to true when using the layer energies as input the data-driver-corrected
  * version are used.
  **/
 
-class egammaMVACalibTool : public extends<AthAlgTool, IegammaMVACalibTool> {
+class egammaMVACalibTool : public asg::AsgTool, virtual public IegammaMVACalibTool{
+  ASG_TOOL_CLASS(egammaMVACalibTool, IegammaMVACalibTool)
 public:
-  egammaMVACalibTool(const std::string& type, const std::string& name, const IInterface* parent);
+  egammaMVACalibTool(const std::string& type);
   virtual ~egammaMVACalibTool() override;
 
   virtual StatusCode initialize() override;
-  virtual StatusCode finalize() override;
 
   /** how the output of the BDT is used
    * correctEaccordion: energy = raw energy * BDT
diff --git a/Reconstruction/egamma/egammaMVACalib/src/egammaMVASvc.h b/Reconstruction/egamma/egammaMVACalib/egammaMVACalib/egammaMVASvc.h
similarity index 82%
rename from Reconstruction/egamma/egammaMVACalib/src/egammaMVASvc.h
rename to Reconstruction/egamma/egammaMVACalib/egammaMVACalib/egammaMVASvc.h
index e7d8941f8ac31524430a1676737e56bb7b2918ab..b9e6f2b13fb5b2d0ccac72f0d161f3b46ff94b2a 100644
--- a/Reconstruction/egamma/egammaMVACalib/src/egammaMVASvc.h
+++ b/Reconstruction/egamma/egammaMVACalib/egammaMVACalib/egammaMVASvc.h
@@ -8,29 +8,27 @@
 #define EGAMMAMVACALIB_EGAMMAMVASVC_H
 
 #include "xAODEgamma/EgammaEnums.h"
-#include "egammaInterfaces/IegammaMVASvc.h"
-#include "egammaInterfaces/IegammaMVACalibTool.h"
-#include "AthenaBaseComps/AthService.h"
+#include "EgammaAnalysisInterfaces/IegammaMVASvc.h"
+#include "EgammaAnalysisInterfaces/IegammaMVACalibTool.h"
+// Framework includes
+#include "AsgServices/AsgService.h"
+#include "AsgTools/PropertyWrapper.h"
 
 #include <string>
 
-class egammaMVASvc : public extends1<AthService, IegammaMVASvc>
+class egammaMVASvc : public asg::AsgService, virtual public IegammaMVASvc
 {
 public:
   egammaMVASvc( const std::string& name, ISvcLocator* svc );
-
+  ASG_SERVICE_CLASS1(egammaMVASvc, IegammaMVASvc)
   virtual ~egammaMVASvc() override {};
-
   virtual StatusCode initialize() override;
 
-  virtual StatusCode finalize() override;
-
   /** Main execute. We need to calibrate the cluster.
       Use full egamma object instead of Type
       As we employ further variables than the ones present in the cluster
       This method needs to be valid also for reconstruction
   */
-
   StatusCode execute(xAOD::CaloCluster& cluster,
                      const xAOD::Egamma& eg) const override final;
 
diff --git a/Reconstruction/egamma/egammaMVACalib/egammaMVACalib/selection.xml b/Reconstruction/egamma/egammaMVACalib/egammaMVACalib/selection.xml
new file mode 100644
index 0000000000000000000000000000000000000000..4947f6e051f02ba42057219942957dd3049dbb88
--- /dev/null
+++ b/Reconstruction/egamma/egammaMVACalib/egammaMVACalib/selection.xml
@@ -0,0 +1,4 @@
+ <lcgdict>
+   <class name="egammaMVACalibTool" />
+   <class name="egammaMVASvc" />
+ </lcgdict>
diff --git a/Reconstruction/egamma/egammaMVACalib/src/components/egammaMVACalib_entries.cxx b/Reconstruction/egamma/egammaMVACalib/src/components/egammaMVACalib_entries.cxx
index f0c0dad2190c3a4ebe4b950611290c01ddb164b4..2d5bd19872d02c1f7a9bcd98b962516e207790ed 100644
--- a/Reconstruction/egamma/egammaMVACalib/src/components/egammaMVACalib_entries.cxx
+++ b/Reconstruction/egamma/egammaMVACalib/src/components/egammaMVACalib_entries.cxx
@@ -1,5 +1,5 @@
-#include "../egammaMVASvc.h"
-#include "../egammaMVACalibTool.h"
+#include "egammaMVACalib/egammaMVASvc.h"
+#include "egammaMVACalib/egammaMVACalibTool.h"
 
 DECLARE_COMPONENT( egammaMVASvc )
 DECLARE_COMPONENT( egammaMVACalibTool )
diff --git a/Reconstruction/egamma/egammaTools/src/EMClusterTool.h b/Reconstruction/egamma/egammaTools/src/EMClusterTool.h
index 0e67e6dc1941c4ac42fc81946372bc86b7d95d1b..787aad9030dc831a2f13ee3a83c24493bf6bcdc7 100644
--- a/Reconstruction/egamma/egammaTools/src/EMClusterTool.h
+++ b/Reconstruction/egamma/egammaTools/src/EMClusterTool.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef EGAMMATOOLS_EMCLUSTERTOOL_H
@@ -11,7 +11,7 @@
 #include "egammaBaseTool.h"
 #include "egammaInterfaces/IEMClusterTool.h"
 
-#include "egammaInterfaces/IegammaMVASvc.h"
+#include "EgammaAnalysisInterfaces/IegammaMVASvc.h"
 #include "egammaInterfaces/IegammaSwTool.h"
 
 #include "StoreGate/WriteHandleKey.h"
diff --git a/Reconstruction/egamma/egammaValidation/CMakeLists.txt b/Reconstruction/egamma/egammaValidation/CMakeLists.txt
index 6f704d797d16c1f56921a99e4be2fb2819d4c61d..4e3005d8c98300678e597343bf3718cca8ab8e96 100644
--- a/Reconstruction/egamma/egammaValidation/CMakeLists.txt
+++ b/Reconstruction/egamma/egammaValidation/CMakeLists.txt
@@ -8,7 +8,7 @@ atlas_add_component ( egammmaValidation
 	src/*.cxx 
 	src/components/*.cxx 
 	LINK_LIBRARIES AsgTools AthenaBaseComps EgammaAnalysisInterfacesLib GaudiKernel IsolationSelectionLib 
-	MCTruthClassifierLib PATCoreAcceptLib xAODBase xAODEgamma xAODEventInfo 
+	MCTruthClassifierLib PATCoreAcceptLib xAODBase xAODEgamma xAODEventInfo ElectronPhotonSelectorToolsLib
 	xAODTracking xAODTruth )
 
 atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
diff --git a/Reconstruction/egamma/egammaValidation/src/EgammaMonitoring.cxx b/Reconstruction/egamma/egammaValidation/src/EgammaMonitoring.cxx
index e448427b46f643be0d18668f5833a20479c8111c..69c561fc18ce00abaa2c11562910a3fe0cc2da49 100644
--- a/Reconstruction/egamma/egammaValidation/src/EgammaMonitoring.cxx
+++ b/Reconstruction/egamma/egammaValidation/src/EgammaMonitoring.cxx
@@ -17,6 +17,8 @@ EgammaMonitoring::EgammaMonitoring(const std::string &name, ISvcLocator *pSvcLoc
   m_LooseLH("AsgElectronLikelihoodTool/LooseLH"),
   m_MediumLH("AsgElectronLikelihoodTool/MediumLH"),
   m_TightLH("AsgElectronLikelihoodTool/TightLH"),
+  m_LooseLH_Photon("AsgPhotonIsEMSelector/photonLooseIsEMSelector"),
+  m_TightLH_Photon("AsgPhotonIsEMSelector/photonTightIsEMSelector"),
   m_IsoFixedCutTight("CP::IsolationSelectionTool/IsoFixedCutTight"),
   m_IsoFixedCutTightTrackOnly("CP::IsolationSelectionTool/IsoFixedCutTightTrackOnly"),
   m_IsoFixedCutTightCaloOnly("CP::IsolationSelectionTool/IsoFixedCutTightCaloOnly"),
@@ -201,6 +203,18 @@ StatusCode EgammaMonitoring::initialize() {
     truthPhotonUnconvRecoUnconv = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthPhotonHistograms(
         "truthUnconvRecoUnconv","truthUnconvRecoUnconv", "/MONITORING/truthUnconvRecoUnconv/", rootHistSvc));
 
+    recoPhotonUnconvLooseLH = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthPhotonHistograms(
+      "recoPhotonUnconvLooseLH","LLH Photons Reco Photon", "/MONITORING/recoPhotonUnconvLooseLH/", rootHistSvc));
+
+    recoPhotonUnconvTightLH = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthPhotonHistograms(
+      "recoPhotonUnconvTightLH","TLH Photons Reco Photon", "/MONITORING/recoPhotonUnconvTightLH/", rootHistSvc));
+
+    recoPhotonConvLooseLH = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthPhotonHistograms(
+      "recoPhotonConvLooseLH","LLH Photons Reco Photon", "/MONITORING/recoPhotonConvLooseLH/", rootHistSvc));
+
+    recoPhotonConvTightLH = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthPhotonHistograms(
+      "recoPhotonConvTightLH","LLH Photons Reco Photon", "/MONITORING/recoPhotonConvTightLH/", rootHistSvc));
+
     recoPhotonUnconvIsoFixedCutTight = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthPhotonHistograms(
     "recoPhotonUnconvIsoFixedCutTight","Isolation Fixed Cut Tight Photons Reco Photon", "/MONITORING/recoPhotonUnconvIsoFixedCutTight/", rootHistSvc));
 
@@ -302,6 +316,10 @@ StatusCode EgammaMonitoring::initialize() {
     ATH_CHECK(truthPhotonUnconvRecoConv2TRT->initializePlots());
     ATH_CHECK(truthPhotonUnconvRecoConv2SiTRT->initializePlots());
     ATH_CHECK(truthPhotonUnconvRecoUnconv->initializePlots());
+    ATH_CHECK(recoPhotonUnconvLooseLH->initializePlots());
+    ATH_CHECK(recoPhotonUnconvTightLH->initializePlots());
+    ATH_CHECK(recoPhotonConvLooseLH->initializePlots());
+    ATH_CHECK(recoPhotonConvTightLH->initializePlots());
     ATH_CHECK(recoPhotonUnconvIsoFixedCutTight->initializePlots());
     ATH_CHECK(recoPhotonUnconvIsoFixedCutTightCaloOnly->initializePlots());
     ATH_CHECK(recoPhotonUnconvIsoFixedCutLoose->initializePlots());
@@ -353,6 +371,14 @@ StatusCode EgammaMonitoring::initialize() {
   ATH_CHECK(m_TightLH.setProperty("WorkingPoint", "TightLHElectron"));
   ATH_CHECK(m_TightLH.initialize());
 
+  //*****************LLH Requirement********************
+  ANA_CHECK(m_LooseLH_Photon.setProperty("WorkingPoint", "LoosePhoton"));
+  ANA_CHECK(m_LooseLH_Photon.initialize());
+  //*****************TLH Requirement********************
+  ANA_CHECK(m_TightLH_Photon.setProperty("WorkingPoint", "TightPhoton"));
+  ANA_CHECK(m_TightLH_Photon.initialize());
+
+
   //*****************Iso Requirements********************
   ATH_CHECK(m_IsoFixedCutTight.setProperty("PhotonWP", "FixedCutTight"));
   ATH_CHECK(m_IsoFixedCutTight.initialize());
@@ -755,6 +781,8 @@ StatusCode EgammaMonitoring::execute() {
           if (m_IsoFixedCutTight->accept(*photon)) recoPhotonConvIsoFixedCutTight->fill(*egtruth, mu);
           if (m_IsoFixedCutTightCaloOnly->accept(*photon)) recoPhotonConvIsoFixedCutTightCaloOnly->fill(*egtruth, mu);
           if (m_IsoFixedCutLoose->accept(*photon)) recoPhotonConvIsoFixedCutLoose->fill(*egtruth, mu);
+          if (m_LooseLH_Photon->accept(photon)) recoPhotonConvLooseLH->fill(*egtruth, mu);
+          if (m_TightLH_Photon->accept(photon)) recoPhotonConvTightLH->fill(*egtruth, mu);
         } // isRecoConv
         else {
           truthPhotonConvRecoUnconv->fill(*egtruth, mu);
@@ -791,6 +819,8 @@ StatusCode EgammaMonitoring::execute() {
         if (m_IsoFixedCutTight->accept(*photon)) recoPhotonUnconvIsoFixedCutTight->fill(*egtruth, mu);
         if (m_IsoFixedCutTightCaloOnly->accept(*photon)) recoPhotonUnconvIsoFixedCutTightCaloOnly->fill(*egtruth, mu);
         if (m_IsoFixedCutLoose->accept(*photon)) recoPhotonUnconvIsoFixedCutLoose->fill(*egtruth, mu);
+        if (m_LooseLH_Photon->accept(photon)) recoPhotonUnconvLooseLH->fill(*egtruth, mu);
+        if (m_TightLH_Photon->accept(photon)) recoPhotonUnconvTightLH->fill(*egtruth, mu);
       } // !isTrueLateConv
     } //egtruth Loop
 
@@ -919,6 +949,16 @@ StatusCode EgammaMonitoring::finalize() {
     egammaMonitoring::EfficiencyPlot recoPhotonConvIsoFixedCutLooseEfficiency("recoPhotonConvIsoFixedCutLooseEfficiency", "/MONITORING/recoPhotonConvIsoFixedCutLooseEfficiency/", rootHistSvc );
     ATH_CHECK(recoPhotonConvIsoFixedCutLooseEfficiency.divide( recoPhotonConvIsoFixedCutLoose.get(), truthPhotonConvRecoConv.get()));
   
+    egammaMonitoring::EfficiencyPlot recoPhotonConvLooseLHEfficiency("recoPhotonConvLooseLHEfficiency", "/MONITORING/recoPhotonConvLooseLHEfficiency/", rootHistSvc );
+    ATH_CHECK(recoPhotonConvLooseLHEfficiency.divide( recoPhotonConvLooseLH.get(), truthPhotonConvRecoConv.get()));
+    egammaMonitoring::EfficiencyPlot recoPhotonConvTightLHEfficiency("recoPhotonConvTightLHEfficiency", "/MONITORING/recoPhotonConvTightLHEfficiency/", rootHistSvc );
+    ATH_CHECK(recoPhotonConvTightLHEfficiency.divide( recoPhotonConvTightLH.get(), truthPhotonConvRecoConv.get()));
+    egammaMonitoring::EfficiencyPlot recoPhotonUnconvLooseLHEfficiency("recoPhotonUnconvLooseLHEfficiency", "/MONITORING/recoPhotonUnconvLooseLHEfficiency/", rootHistSvc );
+    ATH_CHECK(recoPhotonUnconvLooseLHEfficiency.divide( recoPhotonUnconvLooseLH.get(), truthPhotonUnconvRecoUnconv.get()));
+    egammaMonitoring::EfficiencyPlot recoPhotonUnconvTightLHEfficiency("recoPhotonUnconvTightLHEfficiency", "/MONITORING/recoPhotonUnconvTightLHEfficiency/", rootHistSvc );
+    ATH_CHECK(recoPhotonUnconvTightLHEfficiency.divide( recoPhotonUnconvTightLH.get(), truthPhotonUnconvRecoUnconv.get()));
+
+
     egammaMonitoring::WidthPlot truthPhotonRecoPhotonWidth("truthPhotonRecoPhotonWidth", "/MONITORING/truthPhotonRecoPhotonWidth/", rootHistSvc);
     ATH_CHECK(truthPhotonRecoPhotonWidth.fill(truthPhotonRecoPhoton.get()));
     egammaMonitoring::WidthPlot truthPhotonConvPhotonWidth("truthPhotonConvPhotonWidth", "/MONITORING/truthPhotonConvPhotonWidth/", rootHistSvc);
diff --git a/Reconstruction/egamma/egammaValidation/src/EgammaMonitoring.h b/Reconstruction/egamma/egammaValidation/src/EgammaMonitoring.h
index 16256c4e6bcb55e44f0ca90026591a502c2ec2d4..095fb3b1dc324e8429401c398487bed7cd6ed875 100644
--- a/Reconstruction/egamma/egammaValidation/src/EgammaMonitoring.h
+++ b/Reconstruction/egamma/egammaValidation/src/EgammaMonitoring.h
@@ -31,6 +31,7 @@
 #include "AthenaBaseComps/AthAlgorithm.h"
 #include "AsgTools/AnaToolHandle.h"
 #include "EgammaAnalysisInterfaces/IAsgElectronLikelihoodTool.h"
+#include "EgammaAnalysisInterfaces/IAsgPhotonIsEMSelector.h"
 #include "PATCore/AcceptData.h"
 
 
@@ -119,6 +120,10 @@ class EgammaMonitoring : public AthAlgorithm
   std::unique_ptr<egammaMonitoring::IHistograms> truthPhotonUnconvRecoConv2TRT  ;
   std::unique_ptr<egammaMonitoring::IHistograms> truthPhotonUnconvRecoConv2SiTRT;
   std::unique_ptr<egammaMonitoring::IHistograms> truthPhotonUnconvRecoUnconv    ;
+  std::unique_ptr<egammaMonitoring::IHistograms> recoPhotonUnconvLooseLH;
+  std::unique_ptr<egammaMonitoring::IHistograms> recoPhotonUnconvTightLH;
+  std::unique_ptr<egammaMonitoring::IHistograms> recoPhotonConvLooseLH;
+  std::unique_ptr<egammaMonitoring::IHistograms> recoPhotonConvTightLH;
   std::unique_ptr<egammaMonitoring::IHistograms> recoPhotonUnconvIsoFixedCutTight;
   std::unique_ptr<egammaMonitoring::IHistograms> recoPhotonUnconvIsoFixedCutTightCaloOnly;
   std::unique_ptr<egammaMonitoring::IHistograms> recoPhotonUnconvIsoFixedCutLoose;
@@ -173,6 +178,8 @@ private:
   asg::AnaToolHandle<IAsgElectronLikelihoodTool> m_LooseLH ; //!
   asg::AnaToolHandle<IAsgElectronLikelihoodTool> m_MediumLH; //!
   asg::AnaToolHandle<IAsgElectronLikelihoodTool> m_TightLH ; //!
+  asg::AnaToolHandle<IAsgPhotonIsEMSelector> m_LooseLH_Photon; //!
+  asg::AnaToolHandle<IAsgPhotonIsEMSelector> m_TightLH_Photon; //!
   asg::AnaToolHandle<CP::IIsolationSelectionTool> m_IsoFixedCutTight; //!
   asg::AnaToolHandle<CP::IIsolationSelectionTool> m_IsoFixedCutTightTrackOnly; //!
   asg::AnaToolHandle<CP::IIsolationSelectionTool> m_IsoFixedCutTightCaloOnly; //!
diff --git a/Reconstruction/tauRec/python/TauAlgorithmsHolder.py b/Reconstruction/tauRec/python/TauAlgorithmsHolder.py
index 69cd22f29db76a8070d76da9e961bbd67957f6ae..7af55b94742e9727e4d52a10df597d317df78a38 100644
--- a/Reconstruction/tauRec/python/TauAlgorithmsHolder.py
+++ b/Reconstruction/tauRec/python/TauAlgorithmsHolder.py
@@ -821,9 +821,11 @@ def getTVATool():
     if _name in cached_instances:
         return cached_instances[_name]
 
-    from TrackVertexAssociationTool.TrackVertexAssociationToolConf import CP__TrackVertexAssociationTool
-    TVATool = CP__TrackVertexAssociationTool(name = _name,
-                                             WorkingPoint = "Nonprompt_Hard_MaxWeight")
+    from TrackVertexAssociationTool.getTTVAToolForReco import getTTVAToolForReco
+    TVATool = getTTVAToolForReco(name = _name,
+                                 WorkingPoint = "Nonprompt_Hard_MaxWeight",
+                                 TrackContName = _DefaultTrackContainer,
+                                 VertexContName= _DefaultVertexContainer)
 
     from AthenaCommon.AppMgr import ToolSvc
     ToolSvc += TVATool
diff --git a/Reconstruction/tauRec/share/tauRec_RTT_topOptions.py b/Reconstruction/tauRec/share/tauRec_RTT_topOptions.py
deleted file mode 100644
index e0bd3f1054e781e91b4cf532a223b44d093a5721..0000000000000000000000000000000000000000
--- a/Reconstruction/tauRec/share/tauRec_RTT_topOptions.py
+++ /dev/null
@@ -1,62 +0,0 @@
-
-DetDescrVersion="ATLAS-CSC-01-02-00"
-
-
-doESD = True # if false, all algorithms are switched off by defaults 
-###########################
-donewTracking=True
-doxKalman=True
-doiPatRec=True
-doEmCluster=True
-doCaloCluster=True
-doCaloTopoCluster=True
-
-doMoore=False
-doMuonboy=False
-doConversion=False
-doBtagging=False
-doEgamma=True
-doJetRec=True
-doTauRec=True
-doMuonIDStandAlone=False
-doMuonIDCombined=False
-doMuidLowPt=False
-doMuGirl=False
-doStaco=False
-doMuTag=False
-doTileMuID=False
-doMissingET=False
-doObjMissingET=False
-doEFlow=False
-doEFlowJet= False
-doTrigger=False
-doAtlfast=False
-############################
-doWriteESD = False
-doWriteTAG = False
-doWriteAOD = True
-doTrigger = False
-doHist = False
-doAOD = True
-doCBNT=True
-
-# number of event to process
-#EvtMax= 5 
-EvtMax=-1
-
-if not 'BTaggingFlags' in dir():
-    from BTagging.BTaggingFlags import BTaggingFlags
-    BTaggingFlags.JetFitterTag=False
-    #BTaggingFlags.OutputLevel=INFO
-
-#disable atlfast
-from ParticleBuilderOptions.AODFlags import AODFlags
-AODFlags.FastSimulation=False
-
-include ("RecExCommon/RecExCommon_flags.py")
-#DetFlags.Calo_setOff()
-DetFlags.Muon_setOff()
-
-include ("RecExCommon/RecExCommon_topOptions.py")
-#CBNT_TruthParticle.NMaxTruthParticles = 3000
-
diff --git a/Simulation/Digitization/python/DigitizationSteering.py b/Simulation/Digitization/python/DigitizationSteering.py
index dcbea0c8af95dde71f6c085343e48f5109d65d9b..c64c604a1e1193576c350b15162f9e802723cdfe 100644
--- a/Simulation/Digitization/python/DigitizationSteering.py
+++ b/Simulation/Digitization/python/DigitizationSteering.py
@@ -22,10 +22,16 @@ from SCT_Digitization.SCT_DigitizationConfigNew import SCT_DigitizationCfg
 from TileSimAlgs.TileDigitizationConfig import TileDigitizationCfg, TileTriggerDigitizationCfg
 from TRT_Digitization.TRT_DigitizationConfigNew import TRT_DigitizationCfg
 
+from AthenaCommon.Logging import logging
+logDigiSteering = logging.getLogger('DigitizationSteering')
 
 def DigitizationMainServicesCfg(flags):
     """Configure main digitization services"""
     if flags.Digitization.PileUp:
+        if flags.Concurrency.NumThreads > 0:
+            logDigiSteering.error("DigitizationMainServicesCfg: Attempting to run pile-up digitization AthenaMT using %s threads!", str(flags.Concurrency.NumThreads))
+            logDigiSteering.error("DigitizationMainServicesCfg: Running pile-up digitization with AthenaMT is not supported. Please update your configuration. The job will fail now.")
+            raise RuntimeError("DigitizationSteering.DigitizationMainServicesCfg: Running pile-up digitization with AthenaMT is not supported. Please update your configuration.")
         from Digitization.PileUpConfigNew import PileUpEventLoopMgrCfg
         acc = MainServicesCfg(flags, LoopMgr="PileUpEventLoopMgr")
         acc.merge(PileUpEventLoopMgrCfg(flags))
diff --git a/Simulation/Digitization/share/ConfigDigitization.py b/Simulation/Digitization/share/ConfigDigitization.py
index 91e8abea8f1d324f39f322ebe28ca24cbcd281a6..6f62b7ccdf29064853daa909a66677ffe97ae337 100755
--- a/Simulation/Digitization/share/ConfigDigitization.py
+++ b/Simulation/Digitization/share/ConfigDigitization.py
@@ -75,6 +75,11 @@ if DetFlags.pileup.any_on() or digitizationFlags.doXingByXingPileUp():
     # protection for SteppingCache usage - currently incompatible with PileUpTools
     if digitizationFlags.SignalPatternForSteppingCache.statusOn and digitizationFlags.doXingByXingPileUp():
         raise RuntimeError("SteppingCache is incompatible with PileUpTools. Please switch off either digitizationFlags.SignalPatternForSteppingCache or digitizationFlags.doXingByXingPileUp.")
+    from AthenaCommon.ConcurrencyFlags import jobproperties as jp
+    if jp.ConcurrencyFlags.NumThreads() > 0:
+        logConfigDigitization.error("Attempting to run pile-up digitization AthenaMT using %s threads!", str(jp.ConcurrencyFlags.NumThreads()))
+        logConfigDigitization.error("Running pile-up digitization with AthenaMT is not supported. Please update your configuration. The job will fail now.")
+        raise RuntimeError("Running pile-up digitization with AthenaMT is not supported. Please update your configuration.")
     include( "Digitization/ConfigPileUpEventLoopMgr.py" )
 if DetFlags.pileup.any_on():
     logConfigDigitization.info("PILEUP CONFIGURATION:")
diff --git a/Simulation/ISF/ISF_Acts/ISF_ActsServices/CMakeLists.txt b/Simulation/ISF/ISF_Acts/ISF_ActsServices/CMakeLists.txt
deleted file mode 100644
index f325c83aa3d1d43ab7913c5fd34d02fd32fb25b2..0000000000000000000000000000000000000000
--- a/Simulation/ISF/ISF_Acts/ISF_ActsServices/CMakeLists.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-################################################################################
-# Package: ISF_ActsServices
-################################################################################
-
-# Declare the package name:
-atlas_subdir( ISF_ActsServices )
-
-find_package( Acts COMPONENTS Core PluginJson )
-
-# Component(s) in the package:
-atlas_add_component( ISF_ActsServices
-                     src/*.cxx
-                     src/components/*.cxx
-                     LINK_LIBRARIES AthenaBaseComps AtlasDetDescr GaudiKernel
-                     ISF_InterfacesLib TrkTrack ISF_Event ActsCore
-                     ActsPluginJson)
-
-# Install files from the package:
-atlas_install_python_modules( python/*.py )
-
diff --git a/Simulation/ISF/ISF_Acts/ISF_ActsServices/python/ISF_ActsServicesConfig.py b/Simulation/ISF/ISF_Acts/ISF_ActsServices/python/ISF_ActsServicesConfig.py
deleted file mode 100644
index 29e3540ccbdf4219cb69f033e5c7bd8afd6c7943..0000000000000000000000000000000000000000
--- a/Simulation/ISF/ISF_Acts/ISF_ActsServices/python/ISF_ActsServicesConfig.py
+++ /dev/null
@@ -1,22 +0,0 @@
-# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
-
-from AthenaCommon.CfgGetter import getPublicTool
-
-
-def getActsSimServiceID(name="ISF_ActsSimSvc", **kwargs):
-    kwargs.setdefault("Identifier",     "Fatras")
-    kwargs.setdefault("SimulatorTool",  "ISF_ActsSimulatorToolST")
-    from AthenaCommon import CfgMgr
-    return CfgMgr.ISF__LegacySimSvc(name, **kwargs )
-
-
-def getActsSimulatorToolST(name="ISF_ActsSimulatorToolST", **kwargs):
-    kwargs.setdefault("IDSimulationTool", getPublicTool('ISF_ActsFatrasSimTool'))
-    kwargs.setdefault("SimulationTool",   getPublicTool('ISF_ActsFatrasSimTool'))
-    # register Fatras random number stream if not already registered
-    from G4AtlasApps.SimFlags import simFlags
-    if not simFlags.RandomSeedList.checkForExistingSeed( "FatrasRnd" ):
-      simFlags.RandomSeedList.addSeed( "FatrasRnd", 81234740, 23474923 )
-    from AthenaCommon import CfgMgr
-    return CfgMgr.ISF__ActsSimTool(name, **kwargs )
-
diff --git a/Simulation/ISF/ISF_Acts/ISF_ActsServices/python/ISF_ActsServicesConfigDb.py b/Simulation/ISF/ISF_Acts/ISF_ActsServices/python/ISF_ActsServicesConfigDb.py
deleted file mode 100644
index 05a49efa619f2b121eb6b264a1490d9c320160ae..0000000000000000000000000000000000000000
--- a/Simulation/ISF/ISF_Acts/ISF_ActsServices/python/ISF_ActsServicesConfigDb.py
+++ /dev/null
@@ -1,7 +0,0 @@
-# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
-
-
-from AthenaCommon.CfgGetter import addTool
-
-addTool("ISF_ActsServices.ISF_ActsServicesConfig.getActsSimServiceID",  "ISF_ActsSimSvc")
-addTool("ISF_ActsServices.ISF_ActsServicesConfig.getActsSimulatorToolST", "ISF_ActsSimulatorToolST")
diff --git a/Simulation/ISF/ISF_Acts/ISF_ActsServices/src/ActsSimTool.cxx b/Simulation/ISF/ISF_Acts/ISF_ActsServices/src/ActsSimTool.cxx
deleted file mode 100644
index 5b4fc8927db944b092b85a516abda241eeb887c7..0000000000000000000000000000000000000000
--- a/Simulation/ISF/ISF_Acts/ISF_ActsServices/src/ActsSimTool.cxx
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
-  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "./ActsSimTool.h"
-
-ISF::ActsSimTool::ActsSimTool(const std::string& type, const std::string& name,
-                              const IInterface* parent)
-    : BaseSimulatorTool(type, name, parent) {
-  declareProperty("UseSimulationTool", m_useExtrapolator);
-}
-
-ISF::ActsSimTool::~ActsSimTool() {}
-
-StatusCode ISF::ActsSimTool::initialize() {
-  ATH_CHECK(BaseSimulatorTool::initialize());
-
-  // retrieve simulation tool
-  ATH_CHECK(m_IDsimulationTool.retrieve());
-
-  // retrieve simulation tool
-  if (m_useExtrapolator) {
-    ATH_CHECK(m_simulationTool.retrieve());
-  } else {
-    m_simulationTool.disable();
-    ATH_MSG_INFO("Using only Extrapolation Engine Tools...");
-  }
-
-  // retrieve particle filter
-  if (!m_particleFilter.empty()) {
-    ATH_CHECK(m_particleFilter.retrieve());
-  }
-  return StatusCode::SUCCESS;
-}
-
-StatusCode ISF::ActsSimTool::simulate(const ISFParticle& isp,
-                                      ISFParticleContainer& secondaries,
-                                      McEventCollection*) const {
-  // same step as Fatras sim tool
-  // give a screen output that you entered ActsSimSvc
-  ATH_MSG_VERBOSE("Particle " << isp << " received for simulation.");
-
-  // now decide what to do with the particle
-  if (!m_particleFilter.empty() && !m_particleFilter->passFilter(isp)) {
-    ATH_MSG_VERBOSE("YIFEI ISFParticle "
-                    << isp << " does not pass selection. Ignore.");
-    return StatusCode::SUCCESS;
-  }
-  /** Process Particle from particle broker */
-  ISF::ISFParticle* newIsp = (isp.nextGeoID() == AtlasDetDescr::fAtlasID ||
-                              isp.nextGeoID() == AtlasDetDescr::fAtlasForward)
-                                 ? m_IDsimulationTool->process(isp)
-                                 : m_simulationTool->process(isp);
-  ATH_MSG_VERBOSE("Simulation created : " << (newIsp ? "" : "no")
-                                          << " new particle");
-
-  if (newIsp) {
-    // new particle into the stack
-    secondaries.push_back(newIsp);
-  }
-
-  // Acts call done
-  return StatusCode::SUCCESS;
-}
diff --git a/Simulation/ISF/ISF_Acts/ISF_ActsServices/src/ActsSimTool.h b/Simulation/ISF/ISF_Acts/ISF_ActsServices/src/ActsSimTool.h
deleted file mode 100644
index 65a5fb2274e44604b12c839d76a159184ca21116..0000000000000000000000000000000000000000
--- a/Simulation/ISF/ISF_Acts/ISF_ActsServices/src/ActsSimTool.h
+++ /dev/null
@@ -1,56 +0,0 @@
-// -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef ISF_ACTSSIMTOOL_h
-#define ISF_ACTSSIMTOOL_h
-
-// Gaudi
-#include "GaudiKernel/ServiceHandle.h"
-#include "GaudiKernel/ToolHandle.h"  // for ToolHandleArray
-
-// ISF
-#include "ISF_Interfaces/BaseSimulatorTool.h"
-#include "ISF_Interfaces/IParticleFilter.h"
-#include "ISF_Interfaces/IParticleProcessor.h"
-
-namespace ISF {
-
-class ActsSimTool : public BaseSimulatorTool {
- public:
-  ActsSimTool(const std::string& type, const std::string& name,
-              const IInterface* parent);
-
-  ~ActsSimTool();
-
-  virtual StatusCode initialize() override;
-
-  virtual StatusCode simulate(const ISFParticle& isp, ISFParticleContainer&,
-                              McEventCollection*) const override;
-
-  virtual StatusCode setupEvent() override { return StatusCode::SUCCESS; };
-
-  virtual StatusCode releaseEvent() override { return StatusCode::SUCCESS; };
-
-  virtual ISF::SimulationFlavor simFlavor() const override {
-    return ISF::Fatras;
-  };
-
- private:
-  /** Track Creation & transport */
-  PublicToolHandle<ISF::IParticleProcessor> m_IDsimulationTool{
-      this, "IDSimulationTool", "", ""};  //!< Pointer to the transport AlgTool
-  bool m_useExtrapolator{
-      true};  //!< Boolean used to run with the old extrapolator setup
-  PublicToolHandle<ISF::IParticleProcessor> m_simulationTool{
-      this, "SimulationTool", "", ""};  //!< Pointer to the transport AlgTool
-  PublicToolHandle<ISF::IParticleFilter> m_particleFilter{
-      this, "ParticleFilter", "",
-      ""};  //!< the particle filter concerning kinematic cuts, etc.
-};
-
-}  // namespace ISF
-
-#endif
diff --git a/Simulation/ISF/ISF_Acts/ISF_ActsServices/src/components/ISF_ActsServices_entries.cxx b/Simulation/ISF/ISF_Acts/ISF_ActsServices/src/components/ISF_ActsServices_entries.cxx
deleted file mode 100644
index 652baee1f6dd75a7147d55abe37211cfe5986d29..0000000000000000000000000000000000000000
--- a/Simulation/ISF/ISF_Acts/ISF_ActsServices/src/components/ISF_ActsServices_entries.cxx
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "../ActsSimTool.h"
-
-DECLARE_COMPONENT(ISF::ActsSimTool)
\ No newline at end of file
diff --git a/Simulation/ISF/ISF_Acts/ISF_ActsTools/src/ActsFatrasSimTool.cxx b/Simulation/ISF/ISF_Acts/ISF_ActsTools/src/ActsFatrasSimTool.cxx
index 654c6c48a966b80bdb512e2c6e32e9f4943aac93..1832b3e44ff1b5102d9110a9f5684d082d485661 100644
--- a/Simulation/ISF/ISF_Acts/ISF_ActsTools/src/ActsFatrasSimTool.cxx
+++ b/Simulation/ISF/ISF_Acts/ISF_ActsTools/src/ActsFatrasSimTool.cxx
@@ -10,8 +10,6 @@
 #include "ActsGeometry/ActsTrackingGeometryTool.h"
 #include "ActsGeometryInterfaces/IActsTrackingGeometryTool.h"
 #include "ActsInterop/Logger.h"
-#include "ISF_Event/ISFParticle.h"
-#include "ISF_FatrasInterfaces/ISimHitCreator.h"
 
 // ACTS
 #include "Acts/EventData/SingleCurvilinearTrackParameters.hpp"
@@ -36,17 +34,30 @@ using namespace Acts::UnitLiterals;
 ISF::ActsFatrasSimTool::ActsFatrasSimTool(const std::string& type,
                                           const std::string& name,
                                           const IInterface* parent)
-    : base_class(type, name, parent) {
+    : BaseSimulatorTool(type, name, parent) {
   //  declareProperty("TrackingGeometryTool", m_trackingGeometryTool);
   //  declareProperty("ActsExtrapolationTool", m_actsExtrapolationTool);
-  // hit creation tools
   declareProperty("SimHitCreatorID", m_simHitCreatorID);
-  //  declareProperty( "SimHitCreatorMS", m_simHitCreatorMS);
 }
 
 ISF::ActsFatrasSimTool::~ActsFatrasSimTool() {}
 
 StatusCode ISF::ActsFatrasSimTool::initialize() {
+  ATH_CHECK(BaseSimulatorTool::initialize());
+
+  // retrieve simulation tool
+  // if (m_useExtrapolator) {
+  //   ATH_CHECK(m_simulationTool.retrieve());
+  // } else {
+  //   m_simulationTool.disable();
+  //   ATH_MSG_INFO("Using only Extrapolation Engine Tools...");
+  // }
+
+  // retrieve particle filter
+  if (!m_particleFilter.empty()) {
+    ATH_CHECK(m_particleFilter.retrieve());
+  }
+  
   ATH_CHECK(m_trackingGeometryTool.retrieve());
   ATH_CHECK(m_actsExtrapolationTool.retrieve());
 
@@ -55,17 +66,42 @@ StatusCode ISF::ActsFatrasSimTool::initialize() {
   m_logger =
       makeActsAthenaLogger(this, "ActsFatrasSimTool", "ActsFatrasSimTool");
 
-  // retreive hit creators
+  // retreive HitCreators
   if (retrieveTool<iFatras::ISimHitCreator>(m_simHitCreatorID).isFailure())
     return StatusCode::FAILURE;
 
   return StatusCode::SUCCESS;
 }
 
-StatusCode ISF::ActsFatrasSimTool::finalize() { return StatusCode::SUCCESS; }
+StatusCode ISF::ActsFatrasSimTool::simulate(const ISFParticle& isp,
+                                      ISFParticleContainer& secondaries,
+                                      McEventCollection*) const {
+  // same step as Fatras sim tool
+  // give a screen output that you entered ActsSimSvc
+  ATH_MSG_VERBOSE("Particle " << isp << " received for simulation.");
+
+  // now decide what to do with the particle
+  if (!m_particleFilter.empty() && !m_particleFilter->passFilter(isp)) {
+    ATH_MSG_VERBOSE("ISFParticle "
+                    << isp << " does not pass selection. Ignoring.");
+    return StatusCode::SUCCESS;
+  }
+  /** Process Particle from particle broker */
+  ISF::ISFParticle* newIsp = this->process(isp);
+  ATH_MSG_VERBOSE("ISFParicle created : " << (newIsp ? "" : "no")
+                                          << " new particle");
+
+  if (newIsp) {
+    // new particle into the stack
+    secondaries.push_back(newIsp);
+  }
+
+  // Acts call done
+  return StatusCode::SUCCESS;
+}
 
 ISF::ISFParticle* ISF::ActsFatrasSimTool::process(
-    const ISFParticle& isp, CLHEP::HepRandomEngine*) const {
+    const ISFParticle& isp) const {
   // copy the current particle onto the particle clipboard
   // ISF::ParticleClipboard::getInstance().setParticle(isp);
 
@@ -78,8 +114,8 @@ ISF::ISFParticle* ISF::ActsFatrasSimTool::process(
   Generator generator;
   // input/ output particle and hits containers
   std::vector<ActsFatras::Particle> input;
-  std::vector<ActsFatras::Particle> simulatedInitial;
-  std::vector<ActsFatras::Particle> simulatedFinal;
+  // std::vector<ActsFatras::Particle> simulatedInitial;
+  // std::vector<ActsFatras::Particle> simulatedFinal;
   std::vector<ActsFatras::Hit> hits;
 
   // create input particles. particle number should ne non-zero.
diff --git a/Simulation/ISF/ISF_Acts/ISF_ActsTools/src/ActsFatrasSimTool.h b/Simulation/ISF/ISF_Acts/ISF_ActsTools/src/ActsFatrasSimTool.h
index f1633dfcb5d76482cf79ebd97773b1914893d640..12c5719c7ef76a4cfe556e586b27b3eb237e6474 100644
--- a/Simulation/ISF/ISF_Acts/ISF_ActsTools/src/ActsFatrasSimTool.h
+++ b/Simulation/ISF/ISF_Acts/ISF_ActsTools/src/ActsFatrasSimTool.h
@@ -11,12 +11,13 @@
 
 // Gaudi
 #include "GaudiKernel/ServiceHandle.h"
-#include "GaudiKernel/ToolHandle.h"  // for ToolHandleArray
+#include "GaudiKernel/ToolHandle.h"
 
 // ISF
+#include "ISF_Event/ISFParticle.h"
+#include "ISF_FatrasInterfaces/ISimHitCreator.h"
 #include "ISF_Interfaces/BaseSimulatorTool.h"
 #include "ISF_Interfaces/IParticleFilter.h"
-#include "ISF_Interfaces/IParticleProcessor.h"
 
 // ACTS
 #include "Acts/EventData/NeutralTrackParameters.hpp"
@@ -30,7 +31,6 @@
 #include "ActsGeometry/ActsTrackingGeometryTool.h"
 #include "ActsGeometryInterfaces/IActsExtrapolationTool.h"
 #include "ActsGeometryInterfaces/IActsTrackingGeometryTool.h"
-//#include "Acts/Tests/CommonHelpers/CylindricalTrackingGeometry.hpp"
 #include "Acts/Utilities/UnitVectors.hpp"
 #include "ActsFatras/Kernel/PhysicsList.hpp"
 #include "ActsFatras/Kernel/Simulator.hpp"
@@ -39,7 +39,6 @@
 #include "ActsFatras/Selectors/SurfaceSelectors.hpp"
 #include "ActsFatras/Utilities/ParticleData.hpp"
 #include "ActsInterop/Logger.h"
-//#include "Acts/Utilities/Logger.hpp"
 
 class AtlasDetectorID;
 using namespace Acts::UnitLiterals;
@@ -47,8 +46,7 @@ namespace iFatras {
 class ISimHitCreator;
 }
 
-namespace ISF {  // use fatras namespace for now, to be replaced to ACTS
-                 // namespace TODO
+namespace ISF {
 
 struct SplitEnergyLoss {
   double splitMomentumMin = 5_GeV;
@@ -71,13 +69,13 @@ struct SplitEnergyLoss {
 /**
    @class ACTSFATRASSIMTOOL
 
-   Standard ATLAS hit creator, with ACTS-fatras simulation
+   Standard ATLAS hit creator, with Acts-fatras simulation
 
    @author yi.fei.han at cern.ch
    @author vrpascuzzi at lbl.gov
 */
 
-class ActsFatrasSimTool : public extends<AthAlgTool, ISF::IParticleProcessor> {
+class ActsFatrasSimTool : public BaseSimulatorTool {
  public:
   using Navigator = Acts::Navigator;
   using MagneticField = Acts::ConstantBField;
@@ -102,28 +100,19 @@ class ActsFatrasSimTool : public extends<AthAlgTool, ISF::IParticleProcessor> {
   using Simulator = ActsFatras::Simulator<ChargedSelector, ChargedSimulator,
                                           NeutralSelector, NeutralSimulator>;
 
-  /**Constructor */
-  ActsFatrasSimTool(const std::string&, const std::string&, const IInterface*);
-  /**Destructor*/
+  ActsFatrasSimTool(const std::string& type, const std::string& name,
+                    const IInterface* parent);
   virtual ~ActsFatrasSimTool();
 
-  /** AlgTool initailize method.*/
+  // Interface methods
   virtual StatusCode initialize() override;
-  /** AlgTool finalize method */
-  virtual StatusCode finalize() override;
+  virtual StatusCode simulate(const ISFParticle& isp, ISFParticleContainer&,
+                              McEventCollection*) const override;
+  virtual StatusCode setupEvent() { return StatusCode::SUCCESS; };
+  virtual StatusCode releaseEvent() { return StatusCode::SUCCESS; };
+  virtual ISF::SimulationFlavor simFlavor() const override { return ISF::Fatras; };
 
-  virtual ISF::ISFParticle* process(const ISFParticle& isp,
-                                    CLHEP::HepRandomEngine*) const override;
-
-  virtual StatusCode setupEvent() { return StatusCode::SUCCESS; };  // override
-
-  virtual StatusCode releaseEvent() {
-    return StatusCode::SUCCESS;
-  };  // override
-
-  virtual ISF::SimulationFlavor simFlavor() const {
-    return ISF::Fatras;
-  };  // override
+  virtual ISF::ISFParticle* process(const ISFParticle& isp) const;
 
  private:
   /** templated Tool retrieval - gives unique handling & look and feel */
@@ -138,9 +127,11 @@ class ActsFatrasSimTool : public extends<AthAlgTool, ISF::IParticleProcessor> {
     return StatusCode::SUCCESS;
   }
 
-  std::string m_idHelperName;
+  // Tracking geometry tools
   ToolHandle<IActsTrackingGeometryTool> m_trackingGeometryTool{
       this, "ActsTrackingGeometryTool", "ActsTrackingGeometryTool"};
+  std::shared_ptr<const Acts::TrackingGeometry> m_trackingGeometry;
+  // Acts extrapolator
   ToolHandle<IActsExtrapolationTool> m_actsExtrapolationTool{
       this, "ActsExtrapolationTool", "ActsExtrapolationTool"};
 
@@ -148,17 +139,15 @@ class ActsFatrasSimTool : public extends<AthAlgTool, ISF::IParticleProcessor> {
   Acts::MagneticFieldContext m_magCtx;
 
   std::unique_ptr<const Acts::Logger> m_logger{nullptr};
-  // construct the example detector
-  std::shared_ptr<const Acts::TrackingGeometry> m_trackingGeometry;
 
-  // construct the propagators
+  // Acts propagators
   Navigator m_navigator{std::move(m_trackingGeometry)};
   ChargedStepper m_chargedStepper{Acts::ConstantBField(0, 0, 1_T)};
   ChargedPropagator m_chargedPropagator{std::move(m_chargedStepper),
                                         m_navigator};
   NeutralPropagator m_neutralPropagator{NeutralStepper(), m_navigator};
 
-  // construct the simulator
+  // Acts simulators
   ChargedSimulator m_chargedSimulator{std::move(m_chargedPropagator),
                                       Acts::Logging::Level::VERBOSE};
   NeutralSimulator m_neutralSimulator{std::move(m_neutralPropagator),
@@ -166,18 +155,14 @@ class ActsFatrasSimTool : public extends<AthAlgTool, ISF::IParticleProcessor> {
   Simulator m_simulator{std::move(m_chargedSimulator),
                         std::move(m_neutralSimulator)};
 
-  // Sim Hit Creators
+  // SimHit creator for Inner Detector
   ToolHandle<iFatras::ISimHitCreator> m_simHitCreatorID;
-  //    ToolHandle<ISimHitCreator>          m_simHitCreatorMS;
-  Gaudi::Property<double> m_ptLoopers{
-      this, "PtLoopers", 300,
-      "pT loop protection threshold, converted to Acts MeV unit"};
-  Gaudi::Property<double> m_maxStepSize{this, "MaxStepSize", 10,
-                                        "Max step size in Acts m unit"};
-  Gaudi::Property<double> m_maxStep{this, "MaxSteps", 4000,
-                                    "Max number of steps"};
+  
+  // Particle filtering
+  PublicToolHandle<ISF::IParticleFilter> m_particleFilter{
+    this, "ParticleFilter", "", "Particle filter kinematic cuts, etc."};
 
-  // Material inteaction option
+  // Properties
   Gaudi::Property<bool> m_interactionMultiScatering{
       this, "InteractionMultiScatering", false,
       "Whether to consider multiple scattering in the interactor"};
@@ -187,7 +172,15 @@ class ActsFatrasSimTool : public extends<AthAlgTool, ISF::IParticleProcessor> {
   Gaudi::Property<bool> m_interactionRecord{
       this, "InteractionRecord", false,
       "Whether to record all material interactions"};
+  Gaudi::Property<double> m_maxStepSize{this, "MaxStepSize", 10,
+                                        "Max step size in Acts m unit"};
+  Gaudi::Property<double> m_maxStep{this, "MaxSteps", 4000,
+                                    "Max number of steps"};
+  Gaudi::Property<double> m_ptLoopers{
+      this, "PtLoopers", 300,
+      "pT loop protection threshold, converted to Acts MeV unit"};
 };
-}  // namespace ISF
+
+} // namespace ISF
 
 #endif
diff --git a/Simulation/ISF/ISF_Config/python/ISF_MainConfig.py b/Simulation/ISF/ISF_Config/python/ISF_MainConfig.py
index fea89b136dfe6aaf7725dea2e4379ad806b21e1a..7874d6331189f74a2dc45d287a63c42eb835c2ec 100644
--- a/Simulation/ISF/ISF_Config/python/ISF_MainConfig.py
+++ b/Simulation/ISF/ISF_Config/python/ISF_MainConfig.py
@@ -548,17 +548,23 @@ def getKernel_ATLFASTIIF_G4MS(name="ISF_Kernel_ATLFASTIIF_G4MS", **kwargs):
 
 ############## Simulator: ATLFASTIIF_ACTS ###############
 def getKernel_ATLFASTIIF_ACTS(name="ISF_Kernel_ATLFASTIIF_ACTS", **kwargs):
-    kwargs.setdefault("BeamPipeSimulationSelectors" , [ 'ISF_DefaultParticleKillerSelector' ]       )
-    kwargs.setdefault("IDSimulationSelectors"       , [ 'ISF_DefaultActsSelector' ]               )
+    kwargs.setdefault("SimulationTools", ["ISF_ParticleKillerTool",
+                                          "ISF_FastCaloTool",
+                                          "ISF_ActsFatrasSimTool",
+                                          "ISF_AFIIGeant4Tool"])
+    kwargs.setdefault("ParticleOrderingTool"        , 'ISF_ParticleOrderingTool')
+    kwargs.setdefault('EntryLayerTool'              , 'ISF_AFIIEntryLayerToolMT')
+    kwargs.setdefault("BeamPipeSimulationSelectors" , [ 'ISF_DefaultParticleKillerSelector' ])
+    kwargs.setdefault("IDSimulationSelectors"       , [ 'ISF_DefaultActsSelector', 'ISF_DefaultParticleKillerSelector' ])
     kwargs.setdefault("CaloSimulationSelectors"     , [ 'ISF_MuonAFIIGeant4Selector',
                                                         'ISF_EtaGreater5ParticleKillerSimSelector',
-                                                        'ISF_DefaultFastCaloSimSelector'  ]         )
-    kwargs.setdefault("MSSimulationSelectors"       , [ 'ISF_DefaultAFIIGeant4Selector' ]               )
-    kwargs.setdefault("CavernSimulationSelectors"   , [ 'ISF_DefaultParticleKillerSelector' ]       )
+                                                        'ISF_DefaultFastCaloSimSelector' ])
+    kwargs.setdefault("MSSimulationSelectors"       , [ 'ISF_DefaultAFIIGeant4Selector' ])
+    kwargs.setdefault("CavernSimulationSelectors"   , [ 'ISF_DefaultParticleKillerSelector' ])
     # set the simFlags accordingly (TODO: is this even needed?)
     from G4AtlasApps.SimFlags import simFlags
     simFlags.SimulationFlavour = "ATLFASTIIF_ACTS"
-    return getKernel_GenericSimulator(name, **kwargs)
+    return getKernel_GenericSimulatorMT(name, **kwargs)
 
 ############## Simulator: ATLFASTIIFMT ###############
 def getKernel_ATLFASTIIFMT(name="ISF_Kernel_ATLFASTIIFMT", **kwargs):
diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/python/ISF_Geant4ToolsConfig.py b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/python/ISF_Geant4ToolsConfig.py
index c6e444e14f17c8c52cd4bbc299c5c6e9af3d8a93..43bd7d3cde97ff82fb626c6ed305d8c9efc02aba 100644
--- a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/python/ISF_Geant4ToolsConfig.py
+++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/python/ISF_Geant4ToolsConfig.py
@@ -47,7 +47,7 @@ def getPassBackG4TrackProcessorUserActionTool(name='PassBackG4TrackProcessorUser
 
 def getAFII_G4TrackProcessorUserActionTool(name='AFII_G4TrackProcessorUserActionTool', **kwargs):
     from ISF_Config.ISF_jobProperties import ISF_Flags
-    if ISF_Flags.Simulator.get_Value() in ['PassBackG4MT', 'ATLFASTIIMT', 'G4FastCaloMT', 'G4FastCaloMTEnergyOrdered']:
+    if ISF_Flags.Simulator.get_Value() in ['PassBackG4MT', 'ATLFASTIIMT', 'G4FastCaloMT', 'G4FastCaloMTEnergyOrdered', 'ATLFASTIIF_ACTS']:
         kwargs.setdefault('ParticleBroker', '')
     from AthenaCommon.SystemOfUnits import MeV
     kwargs.setdefault('GeoIDSvc'                           , 'ISF_AFIIGeoIDSvc'         )
@@ -80,7 +80,7 @@ def getGeant4Tool(name="ISF_Geant4Tool", **kwargs):
     kwargs.setdefault('FastSimMasterTool', 'FastSimulationMasterTool')
     from AthenaCommon import CfgMgr
     # Workaround to keep other simulation flavours working while we migrate everything to be AthenaMT-compatible.
-    if ISF_Flags.Simulator.get_Value() in ['FullG4', 'FullG4MT', 'PassBackG4', 'PassBackG4MT', 'G4FastCalo', 'G4FastCaloMT', 'G4FastCaloEnergyOrdered', 'G4FastCaloMTEnergyOrdered']:
+    if ISF_Flags.Simulator.get_Value() in ['FullG4', 'FullG4MT', 'PassBackG4', 'PassBackG4MT', 'G4FastCalo', 'G4FastCaloMT', 'G4FastCaloEnergyOrdered', 'G4FastCaloMTEnergyOrdered', 'ATLFASTIIF_ACTS']:
         return CfgMgr.iGeant4__G4TransportTool(name, **kwargs)
     else:
         return CfgMgr.iGeant4__G4LegacyTransportTool(name, **kwargs)
diff --git a/Simulation/ISF/ISF_SimulationSelectors/python/ISF_SimulationSelectorsConfig.py b/Simulation/ISF/ISF_SimulationSelectors/python/ISF_SimulationSelectorsConfig.py
index d51da26170a54f7bf09f9a8f8406ceeabe438180..332fdc918a4d658e379a0036ebab1eb4cad6f395 100644
--- a/Simulation/ISF/ISF_SimulationSelectors/python/ISF_SimulationSelectorsConfig.py
+++ b/Simulation/ISF/ISF_SimulationSelectors/python/ISF_SimulationSelectorsConfig.py
@@ -10,7 +10,7 @@ from ISF_SimulationSelectors import SimulationFlavor
 
 def usesSimKernelMT():
     from ISF_Config.ISF_jobProperties import ISF_Flags
-    return (ISF_Flags.Simulator.get_Value() in ['FullG4MT', 'PassBackG4MT', 'ATLFASTIIMT', 'G4FastCaloMT', 'FullG4MT_LongLived'])
+    return (ISF_Flags.Simulator.get_Value() in ['FullG4MT', 'PassBackG4MT', 'ATLFASTIIMT', 'G4FastCaloMT', 'FullG4MT_LongLived', 'ATLFASTIIF_ACTS'])
 
 def getDefaultSimSelector(name="ISF_DefaultSimSelector", **kwargs):
     return CfgMgr.ISF__DefaultSimSelector(name, **kwargs )
@@ -125,7 +125,8 @@ def getDefaultFatrasNewExtrapolationSelector(name="ISF_DefaultFatrasNewExtrapola
     return getDefaultSimSelector(name, **kwargs )
 
 def getDefaultActsSelector(name="ISF_DefaultActsSelector", **kwargs):
-    kwargs.setdefault("Simulator"   , 'ISF_ActsSimSvc')
+    if not usesSimKernelMT():
+        raise RuntimeError("SimulationSelector '%s' does not support running with SimKernel." % name)
     kwargs.setdefault('SimulationFlavor', SimulationFlavor.Fatras) 
     return getDefaultSimSelector(name, **kwargs)
 
diff --git a/TileCalorimeter/TileExample/TileRecEx/share/jobOptions_TileCalibRec.py b/TileCalorimeter/TileExample/TileRecEx/share/jobOptions_TileCalibRec.py
index 72bc0cb26a08fd4addd701264fff65259e9712cc..6bead701c74341e6bf38f4d4b524fba52e52b119 100644
--- a/TileCalorimeter/TileExample/TileRecEx/share/jobOptions_TileCalibRec.py
+++ b/TileCalorimeter/TileExample/TileRecEx/share/jobOptions_TileCalibRec.py
@@ -1766,9 +1766,6 @@ if not 'db' in dir():
     svcMgr += DBReplicaSvc(UseCOOLSQLite=False)
 
 
-if hasattr (svcMgr.ToolSvc, 'CaloNoiseToolDefault'):
-    ToolSvc.CaloNoiseToolDefault.RescaleForHV = False
-
 # Needed during maintanance campaign
 # if doTileMon and doTileMonDigi: ToolSvc.TileDigitsMon.FillPedestalDifference = False
 
diff --git a/TileCalorimeter/TileMonitoring/share/TileMonTopoCluster_jobOptions.py b/TileCalorimeter/TileMonitoring/share/TileMonTopoCluster_jobOptions.py
index 0c3c6d4aa3c8cce6f2c479faf51d6aaa73659205..58322c2e8550986240f4a1b55adcc0913d90854a 100644
--- a/TileCalorimeter/TileMonitoring/share/TileMonTopoCluster_jobOptions.py
+++ b/TileCalorimeter/TileMonitoring/share/TileMonTopoCluster_jobOptions.py
@@ -32,7 +32,6 @@ from CaloTools.CaloNoiseCondAlg import CaloNoiseCondAlg
 CaloNoiseCondAlg()
 
 from AthenaCommon.AppMgr import ToolSvc
-#ToolSvc += theCaloNoiseTool
 
 doTopoClusterLocalCalib=False
 
@@ -129,7 +128,6 @@ TileTopoMaker.ClusterEtorAbsEtCut            = 0.0*MeV
 #Double gaussian noise
 #TileTopoMaker.TwoGaussianNoise = True
 #TileTopoMaker.OutputLevel=1
-#theCaloNoiseTool.OutputLevel=1
 TileTopoMaker.TwoGaussianNoise = jobproperties.CaloTopoClusterFlags.doTwoGaussianNoise()
 
 
diff --git a/TileCalorimeter/TileMonitoring/share/TileRec_topOptions.py b/TileCalorimeter/TileMonitoring/share/TileRec_topOptions.py
index 72156ccc9624011c762c74829012fb3f87e5321b..d6b647469d941d41034393df9b59ce641db1e0cc 100644
--- a/TileCalorimeter/TileMonitoring/share/TileRec_topOptions.py
+++ b/TileCalorimeter/TileMonitoring/share/TileRec_topOptions.py
@@ -1,5 +1,5 @@
 #
-#  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+#  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 #
 
 #*****************************************************************
@@ -455,6 +455,4 @@ if TileUseCOOL:
 #if hasattr (svcMgr.ToolSvc, 'TileCellBuilder'):
 #    ToolSvc.TileCellBuilder.OutputLevel = DEBUG
 
-if hasattr (svcMgr.ToolSvc, 'CaloNoiseToolDefault'):
-    ToolSvc.CaloNoiseToolDefault.RescaleForHV = False
 
diff --git a/Tools/PROCTools/python/RunTier0TestsTools.py b/Tools/PROCTools/python/RunTier0TestsTools.py
index 796037059eedde17ee248c85593df21a70e1e43d..45d7900b2ecb8df05a9a7faafbe401a7f9fa0a56 100644
--- a/Tools/PROCTools/python/RunTier0TestsTools.py
+++ b/Tools/PROCTools/python/RunTier0TestsTools.py
@@ -27,7 +27,7 @@ ciRefFileMap = {
                 's3505-21.0'           : 'v2',
                 's3505-21.3'           : 'v1',
                 's3505-21.9'           : 'v1',
-                's3505-22.0'           : 'v8',
+                's3505-22.0'           : 'v9',
                 # OverlayTier0Test_required-test
                 'overlay-d1498-21.0'   : 'v2',
                 'overlay-d1498-22.0'   : 'v38',
diff --git a/Tools/TrfTestsART/test/test_trf_data18_11k_mt.sh b/Tools/TrfTestsART/test/test_trf_data18_11k_mt.sh
index d5bf1b1630da8120df56026004fb69f71a8e1755..28f6fddedd09e7470475d3280f1f822a9c28564e 100755
--- a/Tools/TrfTestsART/test/test_trf_data18_11k_mt.sh
+++ b/Tools/TrfTestsART/test/test_trf_data18_11k_mt.sh
@@ -7,7 +7,10 @@
 
 timeout 64800 Reco_tf.py \
   --inputBSFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/data18_13TeV.00357750.physics_Main.daq.RAW/data18_13TeV.00357750.physics_Main.daq.RAW._lb0083._SFO-1._0001.data,/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/data18_13TeV.00357750.physics_Main.daq.RAW/data18_13TeV.00357750.physics_Main.daq.RAW._lb0083._SFO-1._0002.data,/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/data18_13TeV.00357750.physics_Main.daq.RAW/data18_13TeV.00357750.physics_Main.daq.RAW._lb0083._SFO-1._0003.data,/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/data18_13TeV.00357750.physics_Main.daq.RAW/data18_13TeV.00357750.physics_Main.daq.RAW._lb0083._SFO-1._0004.data,/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/data18_13TeV.00357750.physics_Main.daq.RAW/data18_13TeV.00357750.physics_Main.daq.RAW._lb0083._SFO-1._0005.data,/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/data18_13TeV.00357750.physics_Main.daq.RAW/data18_13TeV.00357750.physics_Main.daq.RAW._lb0083._SFO-1._0006.data \
-  --outputAODFile=aod.pool.root --outputHISTFile=hist.root \
+  --outputAODFile=myAOD.pool.root \
+  --outputHISTFile=myHIST.root \
+  --outputDESDM_MCPFile=myDESDM_MCP.pool.root \
+  --outputDRAW_ZMUMUFile=myDRAW_ZMUMU.data \
   --multithreaded='True' \
   --preExec 'all:from AthenaMonitoring.DQMonFlags import DQMonFlags; DQMonFlags.doMonitoring=True; DQMonFlags.doNewMonitoring=True' \
   --postExec 'FPEAuditor.NStacktracesOnFPE=10' \
diff --git a/Tools/TrfTestsART/test/test_trf_data18_mp.sh b/Tools/TrfTestsART/test/test_trf_data18_mp.sh
new file mode 100755
index 0000000000000000000000000000000000000000..8b030dd2d4b41ae8478668d8f10ab639d5fd8801
--- /dev/null
+++ b/Tools/TrfTestsART/test/test_trf_data18_mp.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+#
+# art-description: Reco_tf.py q431 RAWtoALL in MP mode
+# art-type: grid
+# art-include: master/Athena
+# art-athena-mt: 8
+
+timeout 43200 Reco_tf.py \
+  --inputBSFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/data18_13TeV.00357750.physics_Main.daq.RAW/data18_13TeV.00357750.physics_Main.daq.RAW._lb0114._SFO-5._0003.data \
+  --outputAODFile=myAOD.pool.root \
+  --outputHISTFile=myHIST.root \
+  --outputDESDM_MCPFile=myDESDM_MCP.pool.root \
+  --outputDRAW_ZMUMUFile=myDRAW_ZMUMU.data \
+  --multiprocess='True' \
+  --preExec 'all:from AthenaMonitoring.DQMonFlags import DQMonFlags; DQMonFlags.doMonitoring=True; DQMonFlags.doNewMonitoring=True' \
+  --postExec 'FPEAuditor.NStacktracesOnFPE=10' \
+  --autoConfiguration='everything' \
+  --conditionsTag 'all:CONDBR2-BLKPA-RUN2-03' --geometryVersion='default:ATLAS-R2-2016-01-00-01' \
+  --runNumber='357750' --steering='doRAWtoALL' --maxEvents='-1'
+
+echo "art-result: $? Reco_tf_data18_mp"
diff --git a/Tools/TrfTestsART/test/test_trf_data18_mt.sh b/Tools/TrfTestsART/test/test_trf_data18_mt.sh
index b2cd9096b398a6c9e5d9f7d7e965e682cfe0636e..83a15977c69ccf48ce8a38b5626f2a492b43bde1 100755
--- a/Tools/TrfTestsART/test/test_trf_data18_mt.sh
+++ b/Tools/TrfTestsART/test/test_trf_data18_mt.sh
@@ -7,7 +7,10 @@
 
 timeout 43200 Reco_tf.py \
   --inputBSFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/data18_13TeV.00357750.physics_Main.daq.RAW/data18_13TeV.00357750.physics_Main.daq.RAW._lb0114._SFO-5._0003.data \
-  --outputAODFile=aod.pool.root --outputHISTFile=hist.root \
+  --outputAODFile=myAOD.pool.root \
+  --outputHISTFile=myHIST.root \
+  --outputDESDM_MCPFile=myDESDM_MCP.pool.root \
+  --outputDRAW_ZMUMUFile=myDRAW_ZMUMU.data \
   --multithreaded='True' \
   --preExec 'all:from AthenaMonitoring.DQMonFlags import DQMonFlags; DQMonFlags.doMonitoring=True; DQMonFlags.doNewMonitoring=True' \
   --postExec 'FPEAuditor.NStacktracesOnFPE=10' \
diff --git a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/ConeSurface.h b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/ConeSurface.h
index 084539784bc22ab1d8f8bd98d2d5c7dba66aa5c3..12d04e90de9fc94465c40b26da23e1ff78b186eb 100644
--- a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/ConeSurface.h
+++ b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/ConeSurface.h
@@ -184,8 +184,7 @@ public:
 
   /**Return method for surface normal information
      at a given local point, overwrites the normal() from base class.*/
-  virtual const Amg::Vector3D* normal(
-    const Amg::Vector2D& locpo) const override;
+  virtual Amg::Vector3D normal(const Amg::Vector2D& locpo) const override final;
 
   /**Return method for the rotational symmetry axis - the z-Axis of the
    * HepTransform */
diff --git a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/ConeSurface.icc b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/ConeSurface.icc
index 3d1d13d619c569e495854148133e5c9233b7060a..40495a72f3039680c9c8d3f29164728d67859ad6 100644
--- a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/ConeSurface.icc
+++ b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/ConeSurface.icc
@@ -119,7 +119,7 @@ ConeSurface::clone() const
   return new ConeSurface(*this);
 }
 
-inline const Amg::Vector3D*
+inline Amg::Vector3D
 ConeSurface::normal(const Amg::Vector2D& lp) const
 {
   // (cos phi cos alpha, sin phi cos alpha, sgn z sin alpha)
@@ -128,7 +128,7 @@ ConeSurface::normal(const Amg::Vector2D& lp) const
   Amg::Vector3D localNormal(cos(phi) * bounds().cosAlpha(),
                             sin(phi) * bounds().cosAlpha(),
                             sgn * bounds().sinAlpha());
-  return new Amg::Vector3D(transform().rotation() * localNormal);
+  return Amg::Vector3D(transform().rotation() * localNormal);
 }
 
 inline const ConeBounds&
diff --git a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/CylinderSurface.h b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/CylinderSurface.h
index a1284a9bffe4a2f633ae177cdd2b96e485a1d044..a5116a52f7c11df7c6e988d428b468befcf6365c 100644
--- a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/CylinderSurface.h
+++ b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/CylinderSurface.h
@@ -203,8 +203,7 @@ public:
   using Trk::Surface::normal;
   /**Return method for surface normal information
      at a given local point, overwrites the normal() from base class.*/
-  virtual const Amg::Vector3D* normal(
-    const Amg::Vector2D& locpo) const override;
+  virtual Amg::Vector3D normal(const Amg::Vector2D& locpo) const override final;
 
   /**Return method for the rotational symmetry axis - the z-Axis of the
    * HepTransform */
diff --git a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/CylinderSurface.icc b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/CylinderSurface.icc
index 34d40fd4300f9afa857da31665d0b9962e989bb7..a7a94dff0238dbf5231568f485f6dd976789aecb 100644
--- a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/CylinderSurface.icc
+++ b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/CylinderSurface.icc
@@ -121,12 +121,12 @@ CylinderSurface::clone() const
   return new CylinderSurface(*this);
 }
 
-inline const Amg::Vector3D*
+inline Amg::Vector3D
 CylinderSurface::normal(const Amg::Vector2D& lp) const
 {
   double phi = lp[Trk::locRPhi] / (bounds().r());
   Amg::Vector3D localNormal(cos(phi), sin(phi), 0.);
-  return new Amg::Vector3D(transform().rotation() * localNormal);
+  return Amg::Vector3D(transform().rotation() * localNormal);
 }
 
 inline double
@@ -138,7 +138,7 @@ CylinderSurface::pathCorrection(const Amg::Vector3D& pos,
   Amg::Vector3D pcT(pos.x() - center().x(), pos.y() - center().y(), 0.);
   Amg::Vector3D normalT(pcT.unit()); // transverse normal
   double cosAlpha = normalT.dot(mom.unit());
-  return (cosAlpha != 0 ? fabs(1. / cosAlpha)
+  return (cosAlpha != 0 ? std::abs(1. / cosAlpha)
                         : 1.); // ST undefined for cosAlpha=0
 }
 
diff --git a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/PerigeeSurface.h b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/PerigeeSurface.h
index 63461bbd4b98eaaa901247859dc3b8796175e614..55869d9d8e5b7c00306d48eb895921088146b2b7 100644
--- a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/PerigeeSurface.h
+++ b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/PerigeeSurface.h
@@ -154,7 +154,7 @@ public:
   virtual const Amg::Vector3D& normal() const override final;
 
   /**Returns a normal vector at a specific localPosition*/
-  virtual const Amg::Vector3D* normal(const Amg::Vector2D& lp) const override final;
+  virtual Amg::Vector3D normal(const Amg::Vector2D& lp) const override final;
 
   /** Return the measurement frame - this is needed for alignment, in particular
      for StraightLine and Perigee Surface
diff --git a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/PerigeeSurface.icc b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/PerigeeSurface.icc
index 288e9787802a04bbaa6cd14ece1c7a68a2f992dd..aef32c2c4d574f9005c03ac5c66d2a2ab9a7ae9b 100644
--- a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/PerigeeSurface.icc
+++ b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/PerigeeSurface.icc
@@ -126,10 +126,10 @@ PerigeeSurface::normal() const
 }
 
 
-inline const Amg::Vector3D*
+inline Amg::Vector3D
 PerigeeSurface::normal(const Amg::Vector2D&) const
 {
-  return new Amg::Vector3D(normal());
+  return Amg::Vector3D(normal());
 }
 
 inline bool
diff --git a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/StraightLineSurface.icc b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/StraightLineSurface.icc
index 2598522e2ae872e2abd5219c046571ef4c5dd9fe..de8fed7a8b1c85809bb914182ff656f62e427b0e 100644
--- a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/StraightLineSurface.icc
+++ b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/StraightLineSurface.icc
@@ -139,7 +139,7 @@ StraightLineSurface::insideBounds(const Amg::Vector2D& locpos,
 {
   if (!(m_bounds.get()) && !Surface::m_associatedDetElement)
     return true;
-  return (fabs(locpos[locR]) < bounds().r() + tol1 &&
+  return (std::abs(locpos[locR]) < bounds().r() + tol1 &&
           bounds().insideLoc2(locpos, tol2));
 }
 
diff --git a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h
index ec30928d5d05207d1c6ed830164adf65f3d57d0c..acddadc7bc39ddb2fb69d002fe8563dae246ed77 100644
--- a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h
+++ b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h
@@ -161,7 +161,7 @@ public:
 
   /** Returns a normal vector at a specific local position
    */
-  virtual const Amg::Vector3D* normal(const Amg::Vector2D& lp) const;
+  virtual Amg::Vector3D normal(const Amg::Vector2D& lp) const;
 
   /** Returns a global reference point on the surface,
      for PlaneSurface, StraightLineSurface, PerigeeSurface this is equal to
diff --git a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.icc b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.icc
index f6f95384f4857f6d447ce6ef74821bdae765f187..ecf85d970a1eef0720265e428f1cea04222c30d1 100644
--- a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.icc
+++ b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.icc
@@ -84,7 +84,7 @@ Surface::pathCorrection(const Amg::Vector3D&, const Amg::Vector3D& mom) const
 {
   Amg::Vector3D dir(mom.unit());
   double cosAlpha = dir.dot(normal());
-  return (cosAlpha != 0 ? fabs(1. / cosAlpha)
+  return (cosAlpha != 0 ? std::abs(1. / cosAlpha)
                         : 1.); // ST undefined for cosAlpha=0
 }
 
@@ -195,10 +195,10 @@ Surface::globalToLocal(const Amg::Vector3D& glopos,
 }
 
 // take local position and return global direction
-inline const Amg::Vector3D*
+inline Amg::Vector3D
 Surface::normal(const Amg::Vector2D&) const
 {
-  return new Amg::Vector3D(normal());
+  return Amg::Vector3D(normal());
 }
 
 inline const Amg::Vector3D&
diff --git a/Tracking/TrkDetDescr/TrkVolumes/TrkVolumes/BoundaryCylinderSurface.h b/Tracking/TrkDetDescr/TrkVolumes/TrkVolumes/BoundaryCylinderSurface.h
index 2fa158ef532e0da71d0b77dc126b0a6ee6b375b7..f1cadb688d86b7e6a0514b0518045b34420a9189 100755
--- a/Tracking/TrkDetDescr/TrkVolumes/TrkVolumes/BoundaryCylinderSurface.h
+++ b/Tracking/TrkDetDescr/TrkVolumes/TrkVolumes/BoundaryCylinderSurface.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -21,56 +21,51 @@ namespace Trk {
 //class TrackParameters;
 class Volume;
 
-  /** 
+  /**
    @class BoundaryCylinderSurface
 
    BoundaryCylinderSurface description inside the tracking realm,
    it extends the Surface description to make a surface being a boundary of a
    Trk::Volume
-    
+
    @author Andreas.Salzburger@cern.ch
    */
-      
-  template <class Tvol> class BoundaryCylinderSurface final: 
+
+  template <class Tvol> class BoundaryCylinderSurface final:
                               virtual public BoundarySurface<Tvol>, public CylinderSurface {
-  
+
     /** typedef the BinnedArray */
-    typedef BinnedArray<Tvol> VolumeArray;                            
+    typedef BinnedArray<Tvol> VolumeArray;
 
 
     public:
      /** Default Constructor - needed for pool and inherited classes */
-     BoundaryCylinderSurface():
-      BoundarySurface<Tvol>(),
-      CylinderSurface()
-     {}
-     
-     /** Copy constructor */                            
-     BoundaryCylinderSurface(const BoundaryCylinderSurface<Tvol>& bcs) :
-       BoundarySurface<Tvol>(bcs),
-       CylinderSurface(bcs)
-     {}
-     
+     BoundaryCylinderSurface() = default;
+     /** Copy constructor */
+     BoundaryCylinderSurface(const BoundaryCylinderSurface<Tvol>& bcs) =default;
+     /** Assignment operator*/
+     BoundaryCylinderSurface& operator=(const BoundaryCylinderSurface& vol) = default;
+     /**Virtual Destructor*/
+     virtual ~BoundaryCylinderSurface() = default;
+
      /** Constructor for a Boundary with exact two Volumes attached to it*/
      BoundaryCylinderSurface(const Tvol* inside, const Tvol* outside, const CylinderSurface& csf) :
        BoundarySurface<Tvol>(inside, outside),
        CylinderSurface(csf)
      {}
-       
+
      /** Constructor for a Boundary with two VolumeArrays attached to it*/
      BoundaryCylinderSurface(SharedObject<VolumeArray> insideArray, SharedObject<VolumeArray> outsideArray, const CylinderSurface& csf) :
        BoundarySurface<Tvol>(insideArray, outsideArray),
        CylinderSurface(csf)
-     {}       
-          
+     {}
+
      /** Copy constructor with a shift */
      BoundaryCylinderSurface(const Tvol* inside, const Tvol* outside, const CylinderSurface& csf, const Amg::Transform3D& tr) :
        BoundarySurface<Tvol>(inside,outside),
        CylinderSurface(csf,tr)
      {}
 
-     /**Virtual Destructor*/
-     virtual ~BoundaryCylinderSurface() = default;
 
      /** Get the next Volume depending on the TrackParameters and the requested
         direction, gives back 0 if there's no volume attached to the requested
@@ -90,19 +85,14 @@ class Volume;
      /** The Surface Representation of this */
      virtual const Surface& surfaceRepresentation() const override final;
 
-     /**Assignment operator*/
-     BoundaryCylinderSurface& operator=(const BoundaryCylinderSurface& vol);
-     
-   protected:
-                             
+
   };
 
-template <class Tvol> inline const Surface& BoundaryCylinderSurface<Tvol>::surfaceRepresentation() const { return *this; }
 
 // Hash include the inline functions
 #include "TrkVolumes/BoundaryCylinderSurface.icc"
 
-  
+
 } // end of namespace Trk
 
 #endif // TRKVOLUMES_BOUNDARYCYLIMDERSURFACE_H
diff --git a/Tracking/TrkDetDescr/TrkVolumes/TrkVolumes/BoundaryCylinderSurface.icc b/Tracking/TrkDetDescr/TrkVolumes/TrkVolumes/BoundaryCylinderSurface.icc
index d75dcf25c57214df33027426663d6cfbb2929dde..1a47a9924d83ea282d6b12cf13c00568f3496d29 100755
--- a/Tracking/TrkDetDescr/TrkVolumes/TrkVolumes/BoundaryCylinderSurface.icc
+++ b/Tracking/TrkDetDescr/TrkVolumes/TrkVolumes/BoundaryCylinderSurface.icc
@@ -1,94 +1,79 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
-///////////////////////////////////////////////////////////////////
-// BoundaryCylinderSurface.icc, (c) ATLAS Detector software
-///////////////////////////////////////////////////////////////////
-
-template <class Tvol> inline BoundaryCylinderSurface<Tvol>&
-   BoundaryCylinderSurface<Tvol>::operator=(const BoundaryCylinderSurface<Tvol>& bcs)
-{
-  if (this!=&bcs){
-    delete BoundarySurface<Tvol>::m_insideVolume;
-    delete BoundarySurface<Tvol>::m_outsideVolume;
-    delete Surface::m_transform;
-    delete Surface::m_center;
-    delete Surface::m_normal;
-    delete CylinderSurface::m_bounds;
-    BoundarySurface<Tvol>::m_insideVolume        = bcs.m_insideVolume;
-    BoundarySurface<Tvol>::m_outsideVolume       = bcs.m_outsideVolume;
-    BoundarySurface<Tvol>::m_insideVolumeArray   = bcs.m_insideVolumeArray ;
-    BoundarySurface<Tvol>::m_outsideVolumeArray  = bcs.m_outsideVolumeArray ;
-    Surface::m_transform  = (bcs.m_transform) ? new Amg::Transform3D(*bcs.m_transform) : nullptr;
-    Surface::m_center     = (bcs.m_center)    ? new Amg::Vector3D(*bcs.m_center) : nullptr;
-    Surface::m_normal     = (bcs.m_normal)    ? new Amg::Vector3D(*bcs.m_normal) : nullptr ;
-    Surface::m_associatedDetElement   = bcs.m_associatedDetElement;   // copy by pointer as CylinderSurface does not have ownership 
-    Surface::m_associatedDetElementId = bcs.m_associatedDetElementId;
-    m_bounds =  bcs.m_bounds;
-  }
-  return *this;
-
-}
-
-template <class Tvol> inline const Tvol* BoundaryCylinderSurface<Tvol>::attachedVolume(const TrackParameters& parms,
-                                                                       PropDirection dir) const
-{
-  const Tvol* attVolume = nullptr;
-  // (ST) buggy line - assumes the parms are at this boundary surface ! 
-  // const HepGeom::Vector3D<double>* localNormal = this->surfaceRepresentation().normal(parms.localPosition());
-  // replacing with
-  const Amg::Vector2D* locPos = this->surfaceRepresentation().globalToLocal(parms.position());
-  const Amg::Vector3D* localNormal = nullptr;
-  if (locPos) {
-    localNormal = this->surfaceRepresentation().normal(*locPos);
-    delete locPos;
-  }	
-  if (!localNormal) return attVolume;
-  // (ST) end patch
-
-  if ( (*localNormal).dot(dir*parms.momentum()) > 0.){ 
-    attVolume = BoundarySurface<Tvol>::m_outsideVolume;
-    if (BoundarySurface<Tvol>::m_outsideVolumeArray.get()){
-      attVolume = BoundarySurface<Tvol>::m_outsideVolumeArray.get()->object(parms.position());
-    }
-  } else {
-    attVolume = BoundarySurface<Tvol>::m_insideVolume;
-    if (BoundarySurface<Tvol>::m_insideVolumeArray.get()){
-      attVolume = BoundarySurface<Tvol>::m_insideVolumeArray.get()->object(parms.position());
-    }
-  }
- delete localNormal;
- return attVolume;  
-}
-
-template <class Tvol> inline const Tvol* BoundaryCylinderSurface<Tvol>::attachedVolume(const Amg::Vector3D& pos,
-                                                                       const Amg::Vector3D& mom,
-                                                                       PropDirection dir) const
-{
-  const Tvol* attVolume = nullptr;
-  //const Amg::Vector2D* lp = CylinderSurface::globalToLocal(pos, 2.*Gaudi::Units::mm); // FIXME: previous call with 2mm hard coded tolerance, new interface doesn't allow setting tolerance
-  Amg::Vector2D* lp = new Amg::Vector2D;                                                // FIXME: call without tolerance, check if still ok
-  CylinderSurface::globalToLocal(pos, pos, *lp);                                        // FIXME: call without tolerance, check if still ok
-  
-  if (lp) 
-  { const Amg::Vector3D* localNormal = CylinderSurface::normal(*lp);
-    delete lp;
-    if ( (*localNormal).dot(dir*mom) > 0.){
-      attVolume = BoundarySurface<Tvol>::m_outsideVolume;
-      if (BoundarySurface<Tvol>::m_outsideVolumeArray.get()){
-        attVolume = BoundarySurface<Tvol>::m_outsideVolumeArray.get()->object(pos);
-      }
-    } else {
-      attVolume = BoundarySurface<Tvol>::m_insideVolume;
-      if (BoundarySurface<Tvol>::m_insideVolumeArray.get()){
-        attVolume = BoundarySurface<Tvol>::m_insideVolumeArray.get()->object(pos);
-      }
-    }
-      delete localNormal;      
-   }
-
-   return attVolume;  
-}
-
-
+///////////////////////////////////////////////////////////////////
+// BoundaryCylinderSurface.icc, (c) ATLAS Detector software
+///////////////////////////////////////////////////////////////////
+
+template<class Tvol>
+inline const Surface&
+BoundaryCylinderSurface<Tvol>::surfaceRepresentation() const
+{
+  return *this;
+}
+template<class Tvol>
+inline const Tvol*
+BoundaryCylinderSurface<Tvol>::attachedVolume(const TrackParameters& parms,
+                                              PropDirection dir) const
+{
+  const Tvol* attVolume = nullptr;
+  auto locPos = std::unique_ptr<const Amg::Vector2D>(
+    this->surfaceRepresentation().globalToLocal(parms.position()));
+  Amg::Vector3D localNormal{};
+  if (locPos) {
+    localNormal = this->surfaceRepresentation().normal(*locPos);
+  } else {
+    return attVolume;
+  }
+
+  if (localNormal.dot(dir * parms.momentum()) > 0.) {
+    attVolume = BoundarySurface<Tvol>::m_outsideVolume;
+    if (BoundarySurface<Tvol>::m_outsideVolumeArray.get()) {
+      attVolume = BoundarySurface<Tvol>::m_outsideVolumeArray.get()->object(
+        parms.position());
+    }
+  } else {
+    attVolume = BoundarySurface<Tvol>::m_insideVolume;
+    if (BoundarySurface<Tvol>::m_insideVolumeArray.get()) {
+      attVolume = BoundarySurface<Tvol>::m_insideVolumeArray.get()->object(
+        parms.position());
+    }
+  }
+  return attVolume;
+}
+
+template<class Tvol>
+inline const Tvol*
+BoundaryCylinderSurface<Tvol>::attachedVolume(const Amg::Vector3D& pos,
+                                              const Amg::Vector3D& mom,
+                                              PropDirection dir) const
+{
+  const Tvol* attVolume = nullptr;
+  // const Amg::Vector2D* lp =
+  // CylinderSurface::globalToLocal(pos, 2.*Gaudi::Units::mm);
+  Amg::Vector2D lp{};
+  // The new interface returns true or false , based on internal tolerance
+  // there is not nullptr to check.
+  const bool intol = CylinderSurface::globalToLocal(pos, pos, lp);
+
+  if (intol) {
+    Amg::Vector3D localNormal = CylinderSurface::normal(lp);
+    if (localNormal.dot(dir * mom) > 0.) {
+      attVolume = BoundarySurface<Tvol>::m_outsideVolume;
+      if (BoundarySurface<Tvol>::m_outsideVolumeArray.get()) {
+        attVolume =
+          BoundarySurface<Tvol>::m_outsideVolumeArray.get()->object(pos);
+      }
+    } else {
+      attVolume = BoundarySurface<Tvol>::m_insideVolume;
+      if (BoundarySurface<Tvol>::m_insideVolumeArray.get()) {
+        attVolume =
+          BoundarySurface<Tvol>::m_insideVolumeArray.get()->object(pos);
+      }
+    }
+  }
+
+  return attVolume;
+}
+
diff --git a/Tracking/TrkDetDescr/TrkVolumes/TrkVolumes/BoundaryDiscSurface.h b/Tracking/TrkDetDescr/TrkVolumes/TrkVolumes/BoundaryDiscSurface.h
index 2e4e32b35fc1c5cb16394c661d238025f0ae78ce..48bd6de49c418f35a304890fda4091ef6b8a78b7 100755
--- a/Tracking/TrkDetDescr/TrkVolumes/TrkVolumes/BoundaryDiscSurface.h
+++ b/Tracking/TrkDetDescr/TrkVolumes/TrkVolumes/BoundaryDiscSurface.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -24,48 +24,49 @@ namespace Trk {
 //class TrackParameters;
 class Volume;
 
-  /** 
+  /**
     @class BoundaryDiscSurface
 
     BoundaryDiscSurface description inside the tracking realm,
     it extends the DiscSurface description to make a surface being a boundary of a
-    Trk::Volume (used for cylindrical shape). 
-    It inherits from BoundarySurface to get the interface of boundaries. 
-    
-    @author Andreas.Salzburger@cern.ch 
+    Trk::Volume (used for cylindrical shape).
+    It inherits from BoundarySurface to get the interface of boundaries.
+
+    @author Andreas.Salzburger@cern.ch
    */
-  
-  template <class Tvol> class BoundaryDiscSurface final: 
+
+  template <class Tvol> class BoundaryDiscSurface final:
                        virtual public BoundarySurface<Tvol>, public DiscSurface {
-                           
+
     /** typedef the BinnedArray */
-    typedef BinnedArray<Tvol> VolumeArray;                            
+    typedef BinnedArray<Tvol> VolumeArray;
 
     public:
      /** Default Constructor - needed for pool and inherited classes */
-     BoundaryDiscSurface():
-      BoundarySurface<Tvol>(),
-      DiscSurface()
-     {}
-     
-     /** Copy constructor */                            
-     BoundaryDiscSurface(const BoundaryDiscSurface<Tvol>& bds) :
-       BoundarySurface<Tvol>(bds),
-       DiscSurface(bds)
-     {}
-     
+     BoundaryDiscSurface() = default;
+
+     /** Copy constructor */
+     BoundaryDiscSurface(const BoundaryDiscSurface<Tvol>& bds)  = default;
+
+     /**Assignment operator*/
+     BoundaryDiscSurface& operator=(const BoundaryDiscSurface& vol) = default;
+
+     /**Virtual Destructor*/
+     virtual ~BoundaryDiscSurface() = default;
+
+
      /** Constructor for a Boundary with exact two Volumes attached to it*/
      BoundaryDiscSurface(const Tvol* inside, const Tvol* outside, const DiscSurface& dsf) :
        BoundarySurface<Tvol>(inside, outside),
        DiscSurface(dsf)
      {}
-     
+
      /** Constructor for a Boundary with two VolumeArrays attached to it*/
      BoundaryDiscSurface(SharedObject<VolumeArray> insideArray, SharedObject<VolumeArray> outsideArray, const DiscSurface& dsf) :
        BoundarySurface<Tvol>(insideArray, outsideArray),
        DiscSurface(dsf)
      {}
-     
+
      /** Copy constructor with a shift */
      BoundaryDiscSurface(const Tvol* inside, const Tvol* outside, const DiscSurface& dsf, const Amg::Transform3D& tr) :
        BoundarySurface<Tvol>(inside,outside),
@@ -90,21 +91,12 @@ class Volume;
      /** The Surface Representation of this */
      virtual const Surface& surfaceRepresentation() const override final;
 
-     /**Virtual Destructor*/
-     virtual ~BoundaryDiscSurface() = default;
-
-     /**Assignment operator*/
-     BoundaryDiscSurface& operator=(const BoundaryDiscSurface& vol);
-             
-   protected:
-                             
   };
 
-template <class Tvol> inline const Surface& BoundaryDiscSurface<Tvol>::surfaceRepresentation() const { return *this; }
 
 // Hash include inline functions
 #include "TrkVolumes/BoundaryDiscSurface.icc"
-  
+
 } // end of namespace Trk
 
 #endif // TRKVOLUMES_BOUNDARYDISCSURFACE_H
diff --git a/Tracking/TrkDetDescr/TrkVolumes/TrkVolumes/BoundaryDiscSurface.icc b/Tracking/TrkDetDescr/TrkVolumes/TrkVolumes/BoundaryDiscSurface.icc
index 453f9da8e630925ebea2554dea5e1a11146adda5..ab320c4ffb191fa47640c5373982ae596e656cd2 100755
--- a/Tracking/TrkDetDescr/TrkVolumes/TrkVolumes/BoundaryDiscSurface.icc
+++ b/Tracking/TrkDetDescr/TrkVolumes/TrkVolumes/BoundaryDiscSurface.icc
@@ -1,72 +1,59 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
-///////////////////////////////////////////////////////////////////
-// BoundaryDiscSurface.icc, (c) ATLAS Detector software
-///////////////////////////////////////////////////////////////////
-
-
-template <class Tvol> inline BoundaryDiscSurface<Tvol>& 
-          BoundaryDiscSurface<Tvol>::operator=(const BoundaryDiscSurface& bds)
-{
-  if (this!=&bds){
-    delete BoundarySurface<Tvol>::m_insideVolume;
-    delete BoundarySurface<Tvol>::m_outsideVolume;
-    delete Surface::m_transform;
-    delete Surface::m_center;
-    delete Surface::m_normal;
-    delete DiscSurface::m_bounds;
-    BoundarySurface<Tvol>::m_insideVolume = bds.m_insideVolume;
-    BoundarySurface<Tvol>::m_outsideVolume = bds.m_outsideVolume;
-    BoundarySurface<Tvol>::m_insideVolumeArray = bds.m_insideVolumeArray;
-    BoundarySurface<Tvol>::m_outsideVolumeArray  = bds.m_outsideVolumeArray;
-    Surface::m_transform = (bds.m_transform) ? new Amg::Transform3D(*bds.m_transform) : nullptr;
-    Surface::m_center     = (bds.m_center)    ? new Amg::Vector3D(*bds.m_center) : nullptr;
-    Surface::m_normal    = (bds.m_normal)    ? new Amg::Vector3D(*bds.m_normal) : nullptr ;
-    Surface::m_associatedDetElement = bds.m_associatedDetElement;        // copy by pointer as DiscSurface does not have ownership 
-    Surface::m_associatedDetElementId = bds.m_associatedDetElementId;
-    m_bounds =  bds.m_bounds;
-  }
-  return *this;
-
-}
-
-template <class Tvol> inline const Tvol* BoundaryDiscSurface<Tvol>::attachedVolume(const TrackParameters& parms,
-                                                            PropDirection dir) const
-{  
-  const Tvol* attVolume = nullptr;
-  if ((this->surfaceRepresentation().normal()).dot(dir*parms.momentum()) > 0.){
-    attVolume = BoundarySurface<Tvol>::m_outsideVolume;
-    if (BoundarySurface<Tvol>::m_outsideVolumeArray.get()){
-      attVolume = BoundarySurface<Tvol>::m_outsideVolumeArray.get()->object(parms.position());
-    } 
-  } else {
-    attVolume = BoundarySurface<Tvol>::m_insideVolume;
-    if (BoundarySurface<Tvol>::m_insideVolumeArray.get()){
-      attVolume = BoundarySurface<Tvol>::m_insideVolumeArray.get()->object(parms.position());
-    }
-  }   
- return attVolume;  
-}
-
-template <class Tvol> inline const Tvol* BoundaryDiscSurface<Tvol>::attachedVolume(const Amg::Vector3D& pos,
-                                                              const Amg::Vector3D& mom,
-                                                              PropDirection dir) const
-{  
-  const Tvol* attVolume = nullptr;
-  if ( (this->surfaceRepresentation().normal()).dot(dir*mom) > 0.){
-    attVolume = BoundarySurface<Tvol>::m_outsideVolume;
-    if (BoundarySurface<Tvol>::m_outsideVolumeArray.get()){
-      attVolume = BoundarySurface<Tvol>::m_outsideVolumeArray.get()->object(pos);
-    } 
-  } else {
-    attVolume = BoundarySurface<Tvol>::m_insideVolume;
-    if (BoundarySurface<Tvol>::m_insideVolumeArray.get()){
-      attVolume = BoundarySurface<Tvol>::m_insideVolumeArray.get()->object(pos);
-    }
-  }   
- return attVolume;  
-}
-
-
+///////////////////////////////////////////////////////////////////
+// BoundaryDiscSurface.icc, (c) ATLAS Detector software
+///////////////////////////////////////////////////////////////////
+
+template<class Tvol>
+inline const Surface&
+BoundaryDiscSurface<Tvol>::surfaceRepresentation() const
+{
+  return *this;
+}
+template<class Tvol>
+inline const Tvol*
+BoundaryDiscSurface<Tvol>::attachedVolume(const TrackParameters& parms,
+                                          PropDirection dir) const
+{
+  const Tvol* attVolume = nullptr;
+  if ((this->surfaceRepresentation().normal()).dot(dir * parms.momentum()) >
+      0.) {
+    attVolume = BoundarySurface<Tvol>::m_outsideVolume;
+    if (BoundarySurface<Tvol>::m_outsideVolumeArray.get()) {
+      attVolume = BoundarySurface<Tvol>::m_outsideVolumeArray.get()->object(
+        parms.position());
+    }
+  } else {
+    attVolume = BoundarySurface<Tvol>::m_insideVolume;
+    if (BoundarySurface<Tvol>::m_insideVolumeArray.get()) {
+      attVolume = BoundarySurface<Tvol>::m_insideVolumeArray.get()->object(
+        parms.position());
+    }
+  }
+  return attVolume;
+}
+
+template<class Tvol>
+inline const Tvol*
+BoundaryDiscSurface<Tvol>::attachedVolume(const Amg::Vector3D& pos,
+                                          const Amg::Vector3D& mom,
+                                          PropDirection dir) const
+{
+  const Tvol* attVolume = nullptr;
+  if ((this->surfaceRepresentation().normal()).dot(dir * mom) > 0.) {
+    attVolume = BoundarySurface<Tvol>::m_outsideVolume;
+    if (BoundarySurface<Tvol>::m_outsideVolumeArray.get()) {
+      attVolume =
+        BoundarySurface<Tvol>::m_outsideVolumeArray.get()->object(pos);
+    }
+  } else {
+    attVolume = BoundarySurface<Tvol>::m_insideVolume;
+    if (BoundarySurface<Tvol>::m_insideVolumeArray.get()) {
+      attVolume = BoundarySurface<Tvol>::m_insideVolumeArray.get()->object(pos);
+    }
+  }
+  return attVolume;
+}
+
diff --git a/Tracking/TrkDetDescr/TrkVolumes/TrkVolumes/BoundaryPlaneSurface.h b/Tracking/TrkDetDescr/TrkVolumes/TrkVolumes/BoundaryPlaneSurface.h
index c56d5f389a69d2fac569c4bacd6f8eb4aa3bdb24..4b53f34c24f8a7da0b91fc4b768c2f4b09ee0c3e 100755
--- a/Tracking/TrkDetDescr/TrkVolumes/TrkVolumes/BoundaryPlaneSurface.h
+++ b/Tracking/TrkDetDescr/TrkVolumes/TrkVolumes/BoundaryPlaneSurface.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -23,36 +23,36 @@ namespace Trk {
 //class TrackParameters;
 class Volume;
 
-  /** 
+  /**
    @class BoundaryPlaneSurface
 
    BoundaryPlaneSurface description inside the tracking realm,
    it extends the PlaneSurface description to make a surface being a boundary of a
    Trk::Volume (used for all volume shapes).
-   It inherits from BoundarySurface to get the interface of boundaries. 
-    
-   @author Andreas.Salzburger@cern.ch 
+   It inherits from BoundarySurface to get the interface of boundaries.
+
+   @author Andreas.Salzburger@cern.ch
   */
-  
-  template <class Tvol> class BoundaryPlaneSurface final: 
+
+  template <class Tvol> class BoundaryPlaneSurface final:
                                virtual public BoundarySurface<Tvol>, public PlaneSurface {
 
     /** typedef the BinnedArray */
-    typedef BinnedArray<Tvol> VolumeArray;                            
+    typedef BinnedArray<Tvol> VolumeArray;
 
     public:
      /** Default Constructor - needed for pool and inherited classes */
-     BoundaryPlaneSurface() :
-       BoundarySurface<Tvol>(),
-       PlaneSurface()
-     {}
-     
-     /** Copy constructor */                            
-     BoundaryPlaneSurface(const BoundaryPlaneSurface<Tvol>& bps) :
-       BoundarySurface<Tvol>(bps),
-       PlaneSurface(bps)
-     {}
-     
+     BoundaryPlaneSurface()  = default;
+
+     /** Copy constructor */
+     BoundaryPlaneSurface(const BoundaryPlaneSurface<Tvol>& bps)  = default;
+
+     /**Assignment operator*/
+     BoundaryPlaneSurface& operator=(const BoundaryPlaneSurface& vol) = default;
+
+     /**Virtual Destructor*/
+     virtual ~BoundaryPlaneSurface() = default;
+
      /** Constructor for a Boundary with exact two Volumes attached to it*/
      BoundaryPlaneSurface(const Tvol* inside, const Tvol* outside, const PlaneSurface& psf) :
        BoundarySurface<Tvol>(inside, outside),
@@ -64,7 +64,7 @@ class Volume;
        BoundarySurface<Tvol>(insideArray, outsideArray),
        PlaneSurface(psf)
      {}
-     
+
      /** Copy constructor with a shift */
      BoundaryPlaneSurface(const Tvol* inside, const Tvol* outside, const PlaneSurface& psf, const Amg::Transform3D& tr) :
        BoundarySurface<Tvol>(inside,outside),
@@ -87,21 +87,13 @@ class Volume;
      /** The Surface Representation of this */
      virtual const Surface& surfaceRepresentation() const override final;
 
-     /**Virtual Destructor*/
-     virtual ~BoundaryPlaneSurface() = default;
 
-     /**Assignment operator*/
-     BoundaryPlaneSurface& operator=(const BoundaryPlaneSurface& vol);
-         
-   protected:
-                             
   };
 
-template <class Tvol> inline const Surface& BoundaryPlaneSurface<Tvol>::surfaceRepresentation() const { return *this; }
 
 // Hash include inline functions
 #include "TrkVolumes/BoundaryPlaneSurface.icc"
-  
+
 } // end of namespace Trk
 
 #endif // TRKVOLUMES_BOUNDARYPLANESURFACE_H
diff --git a/Tracking/TrkDetDescr/TrkVolumes/TrkVolumes/BoundaryPlaneSurface.icc b/Tracking/TrkDetDescr/TrkVolumes/TrkVolumes/BoundaryPlaneSurface.icc
index fe0b8461c6c247ea3eef0dda53865fe4f72b84e2..a050722ff3a32afd5297d30e189fcce6eaddbc03 100755
--- a/Tracking/TrkDetDescr/TrkVolumes/TrkVolumes/BoundaryPlaneSurface.icc
+++ b/Tracking/TrkDetDescr/TrkVolumes/TrkVolumes/BoundaryPlaneSurface.icc
@@ -1,70 +1,59 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
-///////////////////////////////////////////////////////////////////
-// BoundaryPlaneSurface.icc, (c) ATLAS Detector software
-///////////////////////////////////////////////////////////////////
-
-
-template <class Tvol> inline BoundaryPlaneSurface<Tvol>& 
-      BoundaryPlaneSurface<Tvol>::operator=(const BoundaryPlaneSurface<Tvol>& bps)
-{
-  if (this!=&bps){
-    delete BoundarySurface<Tvol>::m_insideVolume;
-    delete BoundarySurface<Tvol>::m_outsideVolume;
-    delete Surface::m_transform;
-    delete Surface::m_center;
-    delete Surface::m_normal;
-    delete PlaneSurface::m_bounds;
-    BoundarySurface<Tvol>::m_insideVolume = bps.m_insideVolume;
-    BoundarySurface<Tvol>::m_outsideVolume = bps.m_outsideVolume;
-    BoundarySurface<Tvol>::m_insideVolumeArray = bps.m_insideVolumeArray;
-    BoundarySurface<Tvol>::m_outsideVolumeArray  = bps.m_outsideVolumeArray;
-    Surface::m_transform = (bps.m_transform) ? new Amg::Transform3D(*bps.m_transform) : nullptr;
-    Surface::m_center     = (bps.m_center)    ? new Amg::Vector3D(*bps.m_center) : nullptr;
-    Surface::m_normal    = (bps.m_normal)    ? new Amg::Vector3D(*bps.m_normal) : nullptr ;
-    Surface::m_associatedDetElement = bps.m_associatedDetElement;        // copy by pointer as PlaneSurface does not have ownership 
-    Surface::m_associatedDetElementId = bps.m_associatedDetElementId;
-    m_bounds =  bps.m_bounds;
-  }
-  return *this;
-
-}
-
-template <class Tvol> inline const Tvol* BoundaryPlaneSurface<Tvol>::attachedVolume(const TrackParameters& parms, PropDirection dir) const
-{
-  const Tvol* attVolume = nullptr;
-  if ( (this->surfaceRepresentation().normal()).dot(dir*parms.momentum()) > 0.){ 
-    attVolume = BoundarySurface<Tvol>::m_outsideVolume;
-    if (BoundarySurface<Tvol>::m_outsideVolumeArray.get()){
-      attVolume = BoundarySurface<Tvol>::m_outsideVolumeArray.get()->object(parms.localPosition());
-    } 
-  } else {
-    attVolume = BoundarySurface<Tvol>::m_insideVolume;
-    if (BoundarySurface<Tvol>::m_insideVolumeArray.get()){
-      attVolume = BoundarySurface<Tvol>::m_insideVolumeArray.get()->object(parms.localPosition());
-    }
-  }
- return attVolume;  
-}
-
-template <class Tvol> inline const Tvol* BoundaryPlaneSurface<Tvol>::attachedVolume(const Amg::Vector3D& pos,
-                                                                    const Amg::Vector3D& mom,
-                                                                    PropDirection dir) const
-{
-  const Tvol* attVolume = nullptr;
-  if ( (this->surfaceRepresentation().normal()).dot(dir*mom) > 0.){
-    attVolume = BoundarySurface<Tvol>::m_outsideVolume;
-    if (BoundarySurface<Tvol>::m_outsideVolumeArray.get()){
-      attVolume = BoundarySurface<Tvol>::m_outsideVolumeArray.get()->object(pos);
-    } 
-  } else {
-    attVolume = BoundarySurface<Tvol>::m_insideVolume;
-    if (BoundarySurface<Tvol>::m_insideVolumeArray.get()){
-      attVolume = BoundarySurface<Tvol>::m_insideVolumeArray.get()->object(pos);
-    }
-  }
- return attVolume;  
-}
-
+///////////////////////////////////////////////////////////////////
+// BoundaryPlaneSurface.icc, (c) ATLAS Detector software
+///////////////////////////////////////////////////////////////////
+
+template<class Tvol>
+inline const Surface&
+BoundaryPlaneSurface<Tvol>::surfaceRepresentation() const
+{
+  return *this;
+}
+template<class Tvol>
+inline const Tvol*
+BoundaryPlaneSurface<Tvol>::attachedVolume(const TrackParameters& parms,
+                                           PropDirection dir) const
+{
+  const Tvol* attVolume = nullptr;
+  if ((this->surfaceRepresentation().normal()).dot(dir * parms.momentum()) >
+      0.) {
+    attVolume = BoundarySurface<Tvol>::m_outsideVolume;
+    if (BoundarySurface<Tvol>::m_outsideVolumeArray.get()) {
+      attVolume = BoundarySurface<Tvol>::m_outsideVolumeArray.get()->object(
+        parms.localPosition());
+    }
+  } else {
+    attVolume = BoundarySurface<Tvol>::m_insideVolume;
+    if (BoundarySurface<Tvol>::m_insideVolumeArray.get()) {
+      attVolume = BoundarySurface<Tvol>::m_insideVolumeArray.get()->object(
+        parms.localPosition());
+    }
+  }
+  return attVolume;
+}
+
+template<class Tvol>
+inline const Tvol*
+BoundaryPlaneSurface<Tvol>::attachedVolume(const Amg::Vector3D& pos,
+                                           const Amg::Vector3D& mom,
+                                           PropDirection dir) const
+{
+  const Tvol* attVolume = nullptr;
+  if ((this->surfaceRepresentation().normal()).dot(dir * mom) > 0.) {
+    attVolume = BoundarySurface<Tvol>::m_outsideVolume;
+    if (BoundarySurface<Tvol>::m_outsideVolumeArray.get()) {
+      attVolume =
+        BoundarySurface<Tvol>::m_outsideVolumeArray.get()->object(pos);
+    }
+  } else {
+    attVolume = BoundarySurface<Tvol>::m_insideVolume;
+    if (BoundarySurface<Tvol>::m_insideVolumeArray.get()) {
+      attVolume = BoundarySurface<Tvol>::m_insideVolumeArray.get()->object(pos);
+    }
+  }
+  return attVolume;
+}
+
diff --git a/Tracking/TrkDetDescr/TrkVolumes/TrkVolumes/BoundarySubtractedCylinderSurface.h b/Tracking/TrkDetDescr/TrkVolumes/TrkVolumes/BoundarySubtractedCylinderSurface.h
index c4dc325cd426977b7a4828d5f3552eccb0df906e..932e135091cf97ffcd23400337c3c6cbe5e9d0e9 100755
--- a/Tracking/TrkDetDescr/TrkVolumes/TrkVolumes/BoundarySubtractedCylinderSurface.h
+++ b/Tracking/TrkDetDescr/TrkVolumes/TrkVolumes/BoundarySubtractedCylinderSurface.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -22,56 +22,54 @@ namespace Trk {
 //class TrackParameters;
 class Volume;
 
-  /** 
+  /**
    @class BoundarySubtractedCylinderSurface
 
    BoundarySubtractedCylinderSurface description inside the tracking realm,
    it extends the Surface description to make a surface being a boundary of a
    Trk::Volume
-    
+
    @author Andreas.Salzburger@cern.ch
    */
-      
-  template <class Tvol> class BoundarySubtractedCylinderSurface final: 
+
+  template <class Tvol> class BoundarySubtractedCylinderSurface final:
                               virtual public BoundarySurface<Tvol>, public SubtractedCylinderSurface {
-  
+
     /** typedef the BinnedArray */
-    typedef BinnedArray<Tvol> VolumeArray;                            
+    typedef BinnedArray<Tvol> VolumeArray;
 
     public:
      /** Default Constructor - needed for pool and inherited classes */
-     BoundarySubtractedCylinderSurface():
-      BoundarySurface<Tvol>(),
-      SubtractedCylinderSurface()
-     {}
-     
-     /** Copy constructor */                            
-     BoundarySubtractedCylinderSurface(const BoundarySubtractedCylinderSurface<Tvol>& bcs) :
-       BoundarySurface<Tvol>(bcs),
-       SubtractedCylinderSurface(bcs)
-     {}
-     
+     BoundarySubtractedCylinderSurface() = default;
+
+     /** Copy constructor */
+     BoundarySubtractedCylinderSurface(const BoundarySubtractedCylinderSurface<Tvol>& bcs) = default;
+
+     /**Virtual Destructor*/
+     virtual ~BoundarySubtractedCylinderSurface() = default;
+
+     /**Assignment operator*/
+     BoundarySubtractedCylinderSurface& operator=(const BoundarySubtractedCylinderSurface& vol) = default;
+
      /** Constructor for a Boundary with exact two Volumes attached to it*/
      BoundarySubtractedCylinderSurface(const Tvol* inside, const Tvol* outside, const SubtractedCylinderSurface& csf) :
        BoundarySurface<Tvol>(inside, outside),
        SubtractedCylinderSurface(csf)
-     {}     
-     
+     {}
+
      /** Constructor for a Boundary with two VolumeArrays attached to it*/
      BoundarySubtractedCylinderSurface(SharedObject<VolumeArray> insideArray, SharedObject<VolumeArray> outsideArray, const SubtractedCylinderSurface& csf) :
        BoundarySurface<Tvol>(insideArray, outsideArray),
        SubtractedCylinderSurface(csf)
-     {}         
-     
+     {}
+
      /** Copy constructor with a shift */
      BoundarySubtractedCylinderSurface(const Tvol* inside, const Tvol* outside, const SubtractedCylinderSurface& csf, const Amg::Transform3D& tr) :
        BoundarySurface<Tvol>(inside,outside),
        SubtractedCylinderSurface(csf,tr)
-     {}     
-     
-     /**Virtual Destructor*/
-     virtual ~BoundarySubtractedCylinderSurface() = default;
-     
+     {}
+
+
      /** Get the next Volume depending on the TrackParameters and the requested direction,
          gives back 0 if there's no volume attached to the requested direction
          - this is speed optimized as it doesn't invoke a local to global transformation
@@ -88,19 +86,13 @@ class Volume;
      /** The Surface Representation of this */
      virtual const Surface& surfaceRepresentation() const override final;
 
-     /**Assignment operator*/
-     BoundarySubtractedCylinderSurface& operator=(const BoundarySubtractedCylinderSurface& vol);
-     
-   protected:
-                             
   };
 
-template <class Tvol> inline const Surface& BoundarySubtractedCylinderSurface<Tvol>::surfaceRepresentation() const { return *this; }
 
 // Hash include the inline functions
 #include "TrkVolumes/BoundarySubtractedCylinderSurface.icc"
 
-  
+
 } // end of namespace Trk
 
 #endif // TRKVOLUMES_BOUNDARYSUBTRACTEDCYLINDERSURFACE_H
diff --git a/Tracking/TrkDetDescr/TrkVolumes/TrkVolumes/BoundarySubtractedCylinderSurface.icc b/Tracking/TrkDetDescr/TrkVolumes/TrkVolumes/BoundarySubtractedCylinderSurface.icc
index c2372c1e88c351737dee5d8281a8748a9beb908c..6ad218443dc94c17345d7ff91ebaa561d0ceda7a 100755
--- a/Tracking/TrkDetDescr/TrkVolumes/TrkVolumes/BoundarySubtractedCylinderSurface.icc
+++ b/Tracking/TrkDetDescr/TrkVolumes/TrkVolumes/BoundarySubtractedCylinderSurface.icc
@@ -1,93 +1,79 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
-///////////////////////////////////////////////////////////////////
-// BoundarySubtractedCylinderSurface.icc, (c) ATLAS Detector software
-///////////////////////////////////////////////////////////////////
-
-template <class Tvol> inline BoundarySubtractedCylinderSurface<Tvol>&
-   BoundarySubtractedCylinderSurface<Tvol>::operator=(const BoundarySubtractedCylinderSurface<Tvol>& bcs)
-{
-  if (this!=&bcs){
-    delete BoundarySurface<Tvol>::m_insideVolume;
-    delete BoundarySurface<Tvol>::m_outsideVolume;
-    BoundarySurface<Tvol>::m_insideVolumeArray.remRef();
-    BoundarySurface<Tvol>::m_outsideVolumeArray.remRef();
-    delete Surface::m_transform;
-    delete Surface::m_center;
-    delete Surface::m_normal;
-    delete SubtractedCylinderSurface::m_bounds;
-    BoundarySurface<Tvol>::m_insideVolume        = bcs.m_insideVolume;
-    BoundarySurface<Tvol>::m_outsideVolume       = bcs.m_outsideVolume;
-    BoundarySurface<Tvol>::m_insideVolumeArray   = bcs.m_insideVolumeArray;
-    BoundarySurface<Tvol>::m_outsideVolumeArray  = bcs.m_outsideVolumeArray;
-    Surface::m_transform  = (bcs.m_transform) ? new Amg::Transform3D(*bcs.m_transform) : nullptr;
-    Surface::m_center     = (bcs.m_center)    ? new Amg::Vector3D(*bcs.m_center) : nullptr;
-    Surface::m_normal     = (bcs.m_normal)    ? new Amg::Vector3D(*bcs.m_normal) : nullptr ;
-    Surface::m_associatedDetElement   = bcs.m_associatedDetElement;   // copy by pointer as CylinderSurface does not have ownership 
-    Surface::m_associatedDetElementId = bcs.m_associatedDetElementId;
-    m_bounds =  bcs.m_bounds->clone();
-  }
-  return *this;
-
-}
-
-template <class Tvol> inline const Tvol* BoundarySubtractedCylinderSurface<Tvol>::attachedVolume(const TrackParameters& parms,
-                                                                       PropDirection dir) const
-{
-  const Tvol* attVolume = nullptr;
-  // (ST) buggy line - assumes the parms are at this boundary surface ! 
-  // const HepGeom::Vector3D<double>* localNormal = this->surfaceRepresentation().normal(parms.localPosition());
-  // replacing with
-  const Amg::Vector2D* locPos = this->surfaceRepresentation().globalToLocal(parms.position());
-  const Amg::Vector3D* localNormal = nullptr;
-  if (locPos) {
-    localNormal = this->surfaceRepresentation().normal(*locPos);
-    delete locPos;	
-  } 
-  if (!localNormal) return attVolume;
-  // (ST) end patch
-
-  if ( (*localNormal).dot(dir*parms.momentum()) > 0.){
-    attVolume = BoundarySurface<Tvol>::m_outsideVolume;
-    if (BoundarySurface<Tvol>::m_outsideVolumeArray.get()){
-      attVolume = BoundarySurface<Tvol>::m_outsideVolumeArray.get()->object(parms.position());
-    }
-  } else {
-    attVolume = BoundarySurface<Tvol>::m_insideVolume;
-    if (BoundarySurface<Tvol>::m_insideVolumeArray.get()){
-      attVolume = BoundarySurface<Tvol>::m_insideVolumeArray.get()->object(parms.position());
-    }
-  }
- delete localNormal;
- return attVolume;  
-}
-
-template <class Tvol> inline const Tvol* BoundarySubtractedCylinderSurface<Tvol>::attachedVolume(const Amg::Vector3D& pos,
-                                                                       const Amg::Vector3D& mom,
-                                                                       PropDirection dir) const
-{
-  const Tvol* attVolume = nullptr;
-  const Amg::Vector2D* lp = Surface::globalToLocal(pos, 2.);
-  if (lp) 
-  { const Amg::Vector3D* localNormal = CylinderSurface::normal(*lp);
-    delete lp;
-    if ( (*localNormal).dot(dir*mom) > 0.){
-      attVolume = BoundarySurface<Tvol>::m_outsideVolume;
-      if (BoundarySurface<Tvol>::m_outsideVolumeArray.get()){
-        attVolume = BoundarySurface<Tvol>::m_outsideVolumeArray.get()->object(pos);
-      }
-    } else {
-      attVolume = BoundarySurface<Tvol>::m_insideVolume;
-      if (BoundarySurface<Tvol>::m_insideVolumeArray.get()){
-        attVolume = BoundarySurface<Tvol>::m_insideVolumeArray.get()->object(pos);
-      }
-    }
-      delete localNormal;      
-   }
-
-   return attVolume;  
-}
-
-
+///////////////////////////////////////////////////////////////////
+// BoundarySubtractedCylinderSurface.icc, (c) ATLAS Detector software
+///////////////////////////////////////////////////////////////////
+
+template<class Tvol>
+inline const Surface&
+BoundarySubtractedCylinderSurface<Tvol>::surfaceRepresentation() const
+{
+  return *this;
+}
+template<class Tvol>
+inline const Tvol*
+BoundarySubtractedCylinderSurface<Tvol>::attachedVolume(
+  const TrackParameters& parms,
+  PropDirection dir) const
+{
+  const Tvol* attVolume = nullptr;
+  // (ST) buggy line - assumes the parms are at this boundary surface !
+  // const HepGeom::Vector3D<double>* localNormal =
+  // this->surfaceRepresentation().normal(parms.localPosition()); replacing with
+  auto locPos = std::unique_ptr<const Amg::Vector2D>(
+    this->surfaceRepresentation().globalToLocal(parms.position()));
+  Amg::Vector3D localNormal{};
+  if (locPos) {
+    localNormal = this->surfaceRepresentation().normal(*locPos);
+  } else {
+    return attVolume;
+  }
+  // (ST) end patch
+
+  if (localNormal.dot(dir * parms.momentum()) > 0.) {
+    attVolume = BoundarySurface<Tvol>::m_outsideVolume;
+    if (BoundarySurface<Tvol>::m_outsideVolumeArray.get()) {
+      attVolume = BoundarySurface<Tvol>::m_outsideVolumeArray.get()->object(
+        parms.position());
+    }
+  } else {
+    attVolume = BoundarySurface<Tvol>::m_insideVolume;
+    if (BoundarySurface<Tvol>::m_insideVolumeArray.get()) {
+      attVolume = BoundarySurface<Tvol>::m_insideVolumeArray.get()->object(
+        parms.position());
+    }
+  }
+  return attVolume;
+}
+
+template<class Tvol>
+inline const Tvol*
+BoundarySubtractedCylinderSurface<Tvol>::attachedVolume(
+  const Amg::Vector3D& pos,
+  const Amg::Vector3D& mom,
+  PropDirection dir) const
+{
+  const Tvol* attVolume = nullptr;
+  auto lp =
+    std::unique_ptr<const Amg::Vector2D>(Surface::globalToLocal(pos, 2.));
+  if (lp) {
+    const Amg::Vector3D localNormal = CylinderSurface::normal(*lp);
+    if (localNormal.dot(dir * mom) > 0.) {
+      attVolume = BoundarySurface<Tvol>::m_outsideVolume;
+      if (BoundarySurface<Tvol>::m_outsideVolumeArray.get()) {
+        attVolume =
+          BoundarySurface<Tvol>::m_outsideVolumeArray.get()->object(pos);
+      }
+    } else {
+      attVolume = BoundarySurface<Tvol>::m_insideVolume;
+      if (BoundarySurface<Tvol>::m_insideVolumeArray.get()) {
+        attVolume =
+          BoundarySurface<Tvol>::m_insideVolumeArray.get()->object(pos);
+      }
+    }
+  }
+  return attVolume;
+}
+
diff --git a/Tracking/TrkDetDescr/TrkVolumes/TrkVolumes/BoundarySubtractedPlaneSurface.h b/Tracking/TrkDetDescr/TrkVolumes/TrkVolumes/BoundarySubtractedPlaneSurface.h
index c4b4993d67156c1a6902444b299d1b8b31fe0683..93ac25a12e26125a976cc42d4ed7656e0e4987f8 100755
--- a/Tracking/TrkDetDescr/TrkVolumes/TrkVolumes/BoundarySubtractedPlaneSurface.h
+++ b/Tracking/TrkDetDescr/TrkVolumes/TrkVolumes/BoundarySubtractedPlaneSurface.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -22,48 +22,47 @@ namespace Trk {
 //class TrackParameters;
 class Volume;
 
-  /** 
+  /**
    @class BoundarySubtractedPlaneSurface
 
    BoundarySubtractedPlaneSurface description inside the tracking realm,
    it extends the SubtractedPlaneSurface description to make a surface being a boundary of a
    Trk::Volume (used for all volume shapes).
-   It inherits from BoundarySurface to get the interface of boundaries. 
-    
-   @author Sarka.Todorova@cern.ch 
+   It inherits from BoundarySurface to get the interface of boundaries.
+
+   @author Sarka.Todorova@cern.ch
   */
-  
-  template <class Tvol> class BoundarySubtractedPlaneSurface final: 
+
+  template <class Tvol> class BoundarySubtractedPlaneSurface final:
                                virtual public BoundarySurface<Tvol>, public SubtractedPlaneSurface {
 
     /** typedef the BinnedArray */
-    typedef BinnedArray<Tvol> VolumeArray;                            
+    typedef BinnedArray<Tvol> VolumeArray;
 
     public:
      /** Default Constructor - needed for pool and inherited classes */
-     BoundarySubtractedPlaneSurface() :
-       BoundarySurface<Tvol>(),
-       SubtractedPlaneSurface()
-     {}
-     
-     /** Copy constructor */                            
-     BoundarySubtractedPlaneSurface(const BoundarySubtractedPlaneSurface<Tvol>& bps) :
-       BoundarySurface<Tvol>(bps),
-       SubtractedPlaneSurface(bps)
-     {}
-     
+     BoundarySubtractedPlaneSurface()  = default;
+
+     /** Copy constructor */
+     BoundarySubtractedPlaneSurface(const BoundarySubtractedPlaneSurface<Tvol>& bps)  = default;
+
+     /**Assignment operator*/
+     BoundarySubtractedPlaneSurface& operator=(const BoundarySubtractedPlaneSurface& vol) = default;
+
+     virtual ~BoundarySubtractedPlaneSurface() = default;
+
      /** Constructor for a Boundary with exact two Volumes attached to it*/
      BoundarySubtractedPlaneSurface(const Tvol* inside, const Tvol* outside, const SubtractedPlaneSurface& psf) :
        BoundarySurface<Tvol>(inside, outside),
        SubtractedPlaneSurface(psf)
      {}
-     
+
      /** Constructor for a Boundary with two VolumeArrays attached to it*/
      BoundarySubtractedPlaneSurface(SharedObject<VolumeArray> insideArray, SharedObject<VolumeArray> outsideArray, const SubtractedPlaneSurface& psf) :
        BoundarySurface<Tvol>(insideArray, outsideArray),
        SubtractedPlaneSurface(psf)
-     {}        
-     
+     {}
+
      /** Copy constructor with a shift */
      BoundarySubtractedPlaneSurface(const Tvol* inside, const Tvol* outside, const SubtractedPlaneSurface& psf, const Amg::Transform3D& tr) :
        BoundarySurface<Tvol>(inside,outside),
@@ -86,21 +85,13 @@ class Volume;
      /** The Surface Representation of this */
      virtual const Surface& surfaceRepresentation() const override final;
 
-     /**Virtual Destructor*/
-     virtual ~BoundarySubtractedPlaneSurface() = default;
 
-     /**Assignment operator*/
-     BoundarySubtractedPlaneSurface& operator=(const BoundarySubtractedPlaneSurface& vol);
-         
-   protected:
-                             
   };
 
-template <class Tvol> inline const Surface& BoundarySubtractedPlaneSurface<Tvol>::surfaceRepresentation() const { return *this; }
 
 // Hash include inline functions
 #include "TrkVolumes/BoundarySubtractedPlaneSurface.icc"
-  
+
 } // end of namespace Trk
 
 #endif // TRKVOLUMES_BOUNDARYSUBTRACTEDPLANESURFACE_H
diff --git a/Tracking/TrkDetDescr/TrkVolumes/TrkVolumes/BoundarySubtractedPlaneSurface.icc b/Tracking/TrkDetDescr/TrkVolumes/TrkVolumes/BoundarySubtractedPlaneSurface.icc
index 185390b478d742f426d658b1aece1bea3b9d4122..8ae63354e77991fd786603080e3428936bea28e3 100755
--- a/Tracking/TrkDetDescr/TrkVolumes/TrkVolumes/BoundarySubtractedPlaneSurface.icc
+++ b/Tracking/TrkDetDescr/TrkVolumes/TrkVolumes/BoundarySubtractedPlaneSurface.icc
@@ -1,70 +1,60 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
-///////////////////////////////////////////////////////////////////
-// BoundarySubtractedPlaneSurface.icc, (c) ATLAS Detector software
-///////////////////////////////////////////////////////////////////
-
-
-template <class Tvol> inline BoundarySubtractedPlaneSurface<Tvol>& 
-      BoundarySubtractedPlaneSurface<Tvol>::operator=(const BoundarySubtractedPlaneSurface<Tvol>& bps)
-{
-  if (this!=&bps){
-    delete BoundarySurface<Tvol>::m_insideVolume;
-    delete BoundarySurface<Tvol>::m_outsideVolume;
-    delete Surface::m_transform;
-    delete Surface::m_center;
-    delete Surface::m_normal;
-    delete SubtractedPlaneSurface::m_bounds;
-    BoundarySurface<Tvol>::m_insideVolume = bps.m_insideVolume;
-    BoundarySurface<Tvol>::m_outsideVolume = bps.m_outsideVolume;
-    BoundarySurface<Tvol>::m_insideVolumeArray = bps.m_insideVolumeArray;
-    BoundarySurface<Tvol>::m_outsideVolumeArray  = bps.m_outsideVolumeArray;
-    Surface::m_transform = (bps.m_transform) ? new Amg::Transform3D(*bps.m_transform) : nullptr;
-    Surface::m_center     = (bps.m_center)    ? new Amg::Vector3D(*bps.m_center) : nullptr;
-    Surface::m_normal    = (bps.m_normal)    ? new Amg::Vector3D(*bps.m_normal) : nullptr ;
-    Surface::m_associatedDetElement = bps.m_associatedDetElement;        // copy by pointer as PlaneSurface does not have ownership 
-    Surface::m_associatedDetElementId = bps.m_associatedDetElementId;
-    m_bounds =  bps.m_bounds->clone();
-  }
-  return *this;
-
-}
-
-template <class Tvol> inline const Tvol* BoundarySubtractedPlaneSurface<Tvol>::attachedVolume(const TrackParameters& parms, PropDirection dir) const
-{
-  const Tvol* attVolume = nullptr;
-  if ( (this->surfaceRepresentation().normal()).dot(dir*parms.momentum()) > 0.){
-    attVolume = BoundarySurface<Tvol>::m_outsideVolume;
-    if (BoundarySurface<Tvol>::m_outsideVolumeArray.get()){
-      attVolume = BoundarySurface<Tvol>::m_outsideVolumeArray.get()->object(parms.localPosition());
-    } 
-  } else {
-    attVolume = BoundarySurface<Tvol>::m_insideVolume;
-    if (BoundarySurface<Tvol>::m_insideVolumeArray.get()){
-      attVolume = BoundarySurface<Tvol>::m_insideVolumeArray.get()->object(parms.localPosition());
-    }
-  }
- return attVolume;  
-}
-
-template <class Tvol> inline const Tvol* BoundarySubtractedPlaneSurface<Tvol>::attachedVolume(const Amg::Vector3D& pos,
-                                                                    const Amg::Vector3D& mom,
-                                                                    PropDirection dir) const
-{
-  const Tvol* attVolume = nullptr;
-  if ( (this->surfaceRepresentation().normal()).dot(dir*mom) > 0.){
-    attVolume = BoundarySurface<Tvol>::m_outsideVolume;
-    if (BoundarySurface<Tvol>::m_outsideVolumeArray.get()){
-      attVolume = BoundarySurface<Tvol>::m_outsideVolumeArray.get()->object(pos);
-    } 
-  } else {
-    attVolume = BoundarySurface<Tvol>::m_insideVolume;
-    if (BoundarySurface<Tvol>::m_insideVolumeArray.get()){
-      attVolume = BoundarySurface<Tvol>::m_insideVolumeArray.get()->object(pos);
-    }
-  }
- return attVolume;  
-}
-
+///////////////////////////////////////////////////////////////////
+// BoundarySubtractedPlaneSurface.icc, (c) ATLAS Detector software
+///////////////////////////////////////////////////////////////////
+
+template<class Tvol>
+inline const Surface&
+BoundarySubtractedPlaneSurface<Tvol>::surfaceRepresentation() const
+{
+  return *this;
+}
+template<class Tvol>
+inline const Tvol*
+BoundarySubtractedPlaneSurface<Tvol>::attachedVolume(
+  const TrackParameters& parms,
+  PropDirection dir) const
+{
+  const Tvol* attVolume = nullptr;
+  if ((this->surfaceRepresentation().normal()).dot(dir * parms.momentum()) >
+      0.) {
+    attVolume = BoundarySurface<Tvol>::m_outsideVolume;
+    if (BoundarySurface<Tvol>::m_outsideVolumeArray.get()) {
+      attVolume = BoundarySurface<Tvol>::m_outsideVolumeArray.get()->object(
+        parms.localPosition());
+    }
+  } else {
+    attVolume = BoundarySurface<Tvol>::m_insideVolume;
+    if (BoundarySurface<Tvol>::m_insideVolumeArray.get()) {
+      attVolume = BoundarySurface<Tvol>::m_insideVolumeArray.get()->object(
+        parms.localPosition());
+    }
+  }
+  return attVolume;
+}
+
+template<class Tvol>
+inline const Tvol*
+BoundarySubtractedPlaneSurface<Tvol>::attachedVolume(const Amg::Vector3D& pos,
+                                                     const Amg::Vector3D& mom,
+                                                     PropDirection dir) const
+{
+  const Tvol* attVolume = nullptr;
+  if ((this->surfaceRepresentation().normal()).dot(dir * mom) > 0.) {
+    attVolume = BoundarySurface<Tvol>::m_outsideVolume;
+    if (BoundarySurface<Tvol>::m_outsideVolumeArray.get()) {
+      attVolume =
+        BoundarySurface<Tvol>::m_outsideVolumeArray.get()->object(pos);
+    }
+  } else {
+    attVolume = BoundarySurface<Tvol>::m_insideVolume;
+    if (BoundarySurface<Tvol>::m_insideVolumeArray.get()) {
+      attVolume = BoundarySurface<Tvol>::m_insideVolumeArray.get()->object(pos);
+    }
+  }
+  return attVolume;
+}
+
diff --git a/Tracking/TrkFitter/TrkGlobalChi2Fitter/src/GlobalChi2Fitter.cxx b/Tracking/TrkFitter/TrkGlobalChi2Fitter/src/GlobalChi2Fitter.cxx
index 5f74c6f3208f689439d5cc88deb2ef5e0c3b6939..f0aaea724bc26ebfba4e18dd73cf52e32433e7fd 100644
--- a/Tracking/TrkFitter/TrkGlobalChi2Fitter/src/GlobalChi2Fitter.cxx
+++ b/Tracking/TrkFitter/TrkGlobalChi2Fitter/src/GlobalChi2Fitter.cxx
@@ -1003,7 +1003,7 @@ namespace Trk {
 
       if (cylsurf != nullptr) {
         double length = 2 * M_PI * cylsurf->bounds().r();
-        if (fabs(fabs(dloc1) - length) < fabs(dloc1)) {
+        if (std::abs(std::abs(dloc1) - length) < std::abs(dloc1)) {
           if (dloc1 > 0) {
             dloc1 -= length;
           } else {
@@ -1013,7 +1013,7 @@ namespace Trk {
       }
       
       if (discsurf != nullptr) {
-        if (fabs(fabs(dloc2) - 2 * M_PI) < fabs(dloc2)) {
+        if (std::abs(std::abs(dloc2) - 2 * M_PI) < std::abs(dloc2)) {
           if (dloc2 > 0) {
             dloc2 -= 2 * M_PI;
           } else {
@@ -1109,8 +1109,8 @@ namespace Trk {
     std::unique_ptr<GXFMaterialEffects> elossmeff = std::make_unique<GXFMaterialEffects>(&calomeots[1]);
     std::unique_ptr<GXFMaterialEffects> secondscatmeff = std::make_unique<GXFMaterialEffects>(&calomeots[2]);
 
-    double pull1 = fabs(firstscatphi / firstscatmeff->sigmaDeltaPhi());
-    double pull2 = fabs(secondscatphi / secondscatmeff->sigmaDeltaPhi());
+    double pull1 = std::abs(firstscatphi / firstscatmeff->sigmaDeltaPhi());
+    double pull2 = std::abs(secondscatphi / secondscatmeff->sigmaDeltaPhi());
 
     if (firstismuon) {
       for (auto & i : tmp_matvec) {
@@ -2102,14 +2102,10 @@ namespace Trk {
           double p = 1. / std::abs(layerpars->parameters()[Trk::qOverP] - .0005 * meff->delta_p());
           
           std::unique_ptr<const Amg::Vector2D> locpos(state->surface()->globalToLocal(layerpars->position()));
-          std::unique_ptr<const Amg::Vector3D> layerNormal(state->surface()->normal(*locpos));
+          const Amg::Vector3D layerNormal(state->surface()->normal(*locpos));
           double costracksurf = 1.;
           
-          if (layerNormal != nullptr) {
-            costracksurf = fabs(layerNormal->dot(layerpars->momentum().unit()));
-          } else {
-            ATH_MSG_WARNING("No normal on surface found!");
-          }
+          costracksurf = std::abs(layerNormal.dot(layerpars->momentum().unit()));
           
           double oldde = meff->deltaE();
           
@@ -3176,8 +3172,8 @@ namespace Trk {
     double z0 = parforextrap.position().z();
     double delta_s = (surf.center().z() - z0) / costheta;
     double delta_phi = delta_s * sintheta / r;
-    double x = xc + fabs(r) * cos(phi0 + delta_phi);
-    double y = yc + fabs(r) * sin(phi0 + delta_phi);
+    double x = xc + std::abs(r) * cos(phi0 + delta_phi);
+    double y = yc + std::abs(r) * sin(phi0 + delta_phi);
     Amg::Vector3D intersect = Amg::Vector3D(x, y, surf.center().z());
     double perp = intersect.perp();
     const DiscBounds *discbounds = (const DiscBounds *) (&surf.bounds());
@@ -3186,7 +3182,7 @@ namespace Trk {
       return {};
     }
     
-    double costracksurf = fabs(costheta);
+    double costracksurf = std::abs(costheta);
     
     return std::make_pair(intersect, costracksurf);
   }
@@ -3266,7 +3262,7 @@ namespace Trk {
 
     Amg::Vector3D intersect = Amg::Vector3D(x, y, z);
 
-    if (fabs(z - surf.center().z()) > surf.bounds().halflengthZ()) {
+    if (std::abs(z - surf.center().z()) > surf.bounds().halflengthZ()) {
       return {};
     }
     
@@ -3282,7 +3278,7 @@ namespace Trk {
     
     Amg::Vector3D trackdir(cos(phidir) * sintheta, sin(phidir) * sintheta, costheta);
     
-    double costracksurf = fabs(normal.unit().dot(trackdir));
+    double costracksurf = std::abs(normal.unit().dot(trackdir));
     
     return std::make_pair(intersect, costracksurf);
   }
@@ -3353,7 +3349,7 @@ namespace Trk {
            */
           if (oldstates[i]->trackParameters() != nullptr) {
             double rlayer = cylsurf->bounds().r();
-            if (fabs(rmeas - rlayer) < fabs(parforextrap->position().perp() - rlayer)) {
+            if (std::abs(rmeas - rlayer) < std::abs(parforextrap->position().perp() - rlayer)) {
               parforextrap = oldstates[i]->trackParameters();
             }
           }
@@ -3382,7 +3378,7 @@ namespace Trk {
           
           if (oldstates[i]->trackParameters() != nullptr) {
             double zlayer = discsurf->center().z();
-            if (fabs(zmeas - zlayer) < fabs(parforextrap->position().z() - zlayer)) {
+            if (std::abs(zmeas - zlayer) < std::abs(parforextrap->position().z() - zlayer)) {
               parforextrap = oldstates[i]->trackParameters();
             }
           }
@@ -3394,7 +3390,7 @@ namespace Trk {
             continue;
           }
           
-          if (fabs(discsurf->center().z()) > fabs(zmeas)) break;
+          if (std::abs(discsurf->center().z()) > std::abs(zmeas)) break;
         } else {
           throw std::logic_error("Unhandled surface.");
         }
@@ -3416,9 +3412,9 @@ namespace Trk {
         double X0 = matprop->thicknessInX0();
         double currentqoverp = (matEffects != Trk::electron) ? parforextrap->parameters()[Trk::qOverP] : refpar2->parameters()[Trk::qOverP];
         double actualx0 = X0 / costracksurf;
-        double de = -fabs((matprop->thickness() / costracksurf) * m_elosstool->dEdX(*matprop, (m_p != 0.0 ? fabs(m_p) : fabs(1. / currentqoverp)), matEffects));
+        double de = -std::abs((matprop->thickness() / costracksurf) * m_elosstool->dEdX(*matprop, (m_p != 0.0 ? std::abs(m_p) : std::abs(1. / currentqoverp)), matEffects));
         double sintheta = sin(parforextrap->parameters()[Trk::theta]);
-        double sigmascat = sqrt(m_scattool->sigmaSquare(*matprop, (m_p != 0.0 ? fabs(m_p) : fabs(1. / currentqoverp)), 1. / costracksurf, matEffects));
+        double sigmascat = sqrt(m_scattool->sigmaSquare(*matprop, (m_p != 0.0 ? std::abs(m_p) : std::abs(1. / currentqoverp)), 1. / costracksurf, matEffects));
         
         std::unique_ptr<GXFMaterialEffects> meff = std::make_unique<GXFMaterialEffects>();
         meff->setDeltaE(de);
@@ -3436,7 +3432,7 @@ namespace Trk {
         if (cache.m_fiteloss || (matEffects == electron && cache.m_asymeloss)) {
           eloss.reset(m_elosstool->energyLoss(
             *matprop,
-            (m_p != 0.0 ? fabs(m_p) : fabs(1. / currentqoverp)),
+            (m_p != 0.0 ? std::abs(m_p) : std::abs(1. / currentqoverp)),
             1. / costracksurf, 
             alongMomentum,
             matEffects
@@ -3557,7 +3553,7 @@ namespace Trk {
          * If we've overshot the last hit in our track, we don't need to look
          * at any further layers. We're done!
          */
-        if (fabs((*it)->surfaceRepresentation().center().z()) > fabs(lastz)) {
+        if (std::abs((*it)->surfaceRepresentation().center().z()) > std::abs(lastz)) {
           break;
         }
         
@@ -3600,7 +3596,7 @@ namespace Trk {
          * the convention. Discs to right, cylinders go left.
          */
         if (
-          fabs((*it)->surfaceRepresentation().center().z()) < fabs(firstz) || 
+          std::abs((*it)->surfaceRepresentation().center().z()) < std::abs(firstz) || 
           (*it) == startlayer
         ) {
           upstreamlayers.emplace_back((Layer *) nullptr, (*it));
@@ -3611,7 +3607,7 @@ namespace Trk {
          */
         if (
           (*it) != startlayer &&
-          (fabs((*it)->surfaceRepresentation().center().z()) > fabs(firstz2) || 
+          (std::abs((*it)->surfaceRepresentation().center().z()) > std::abs(firstz2) || 
           (*it) == startlayer2)
         ) {
           layers.emplace_back((Layer *) nullptr, (*it));
@@ -3639,7 +3635,7 @@ namespace Trk {
        */
       double zintersect = firstz + ((*it)->surfaceRepresentation().bounds().r() - firstr) * slope;
       
-      if (fabs(zintersect - (*it)->surfaceRepresentation().center().z()) > ((const CylinderSurface *) (&(*it)->surfaceRepresentation()))->bounds().halflengthZ() + 50) {
+      if (std::abs(zintersect - (*it)->surfaceRepresentation().center().z()) > ((const CylinderSurface *) (&(*it)->surfaceRepresentation()))->bounds().halflengthZ() + 50) {
         continue;
       }
       
@@ -4271,7 +4267,7 @@ namespace Trk {
             if (
               npseudomuon2 < 2 && 
               (firstmuonpar != nullptr) && 
-              fabs(firstmuonpar->parameters()[Trk::qOverP]) > 1.e-9
+              std::abs(firstmuonpar->parameters()[Trk::qOverP]) > 1.e-9
             ) {
               qoverpbrem = firstmuonpar->parameters()[Trk::qOverP];
             } else {
@@ -4331,7 +4327,7 @@ namespace Trk {
             if (
               npseudomuon1 < 2 && 
               (lastmuonpar != nullptr) && 
-              fabs(lastmuonpar->parameters()[Trk::qOverP]) > 1.e-9
+              std::abs(lastmuonpar->parameters()[Trk::qOverP]) > 1.e-9
             ) {
               qoverp = lastmuonpar->parameters()[Trk::qOverP];
             } else {
@@ -5565,7 +5561,7 @@ namespace Trk {
     if (
       trajectory.prefit() > 0 && (
         (newredchi2 < 2 && it != 0) || 
-        (newredchi2 < oldredchi2 + .1 && fabs(newredchi2 - oldredchi2) < 1 && it != 1)
+        (newredchi2 < oldredchi2 + .1 && std::abs(newredchi2 - oldredchi2) < 1 && it != 1)
       )
     ) {
       trajectory.setConverged(true);
@@ -5579,7 +5575,7 @@ namespace Trk {
       miniter = cache.m_miniter;
     }
     
-    if (it >= miniter && fabs(oldchi2 - chi2) < maxdiff) {
+    if (it >= miniter && std::abs(oldchi2 - chi2) < maxdiff) {
       trajectory.setConverged(true);
     }
 
@@ -6221,7 +6217,7 @@ namespace Trk {
         if (hittype == TrackState::TRT) {
           if (
             runOutlier &&
-            fabs(state->trackParameters()->parameters()[Trk::driftRadius]) > 1.05 * state->surface()->bounds().r()
+            std::abs(state->trackParameters()->parameters()[Trk::driftRadius]) > 1.05 * state->surface()->bounds().r()
           ) {
             ATH_MSG_DEBUG("Removing TRT hit #" << hitno);
             
@@ -6987,7 +6983,7 @@ namespace Trk {
         double distance = getDistance(distsol);
 
         if (distsol.numberOfSolutions() == 2) {
-          if (fabs(distance) < 0.01) {
+          if (std::abs(distance) < 0.01) {
             continue;
           }
           
@@ -8377,7 +8373,7 @@ namespace Trk {
           newparminuseps->parameters()[paraccessor.pardef[j]];
         if (cylsurf && j == 0) {
           double length = 2 * M_PI * surf->bounds().r();
-          if (fabs(fabs(diff) - length) < fabs(diff)) {
+          if (std::abs(std::abs(diff) - length) < std::abs(diff)) {
             if (diff > 0) {
               diff -= length;
             } else {
@@ -8386,7 +8382,7 @@ namespace Trk {
           }
         }
         if (discsurf && j == 1) {
-          if (fabs(fabs(diff) - 2 * M_PI) < fabs(diff)) {
+          if (std::abs(std::abs(diff) - 2 * M_PI) < std::abs(diff)) {
             if (diff > 0) {
               diff -= 2 * M_PI;
             } else {
diff --git a/Tracking/TrkTools/TrkMaterialProvider/src/TrkMaterialProviderTool.cxx b/Tracking/TrkTools/TrkMaterialProvider/src/TrkMaterialProviderTool.cxx
index 442784abce9bf32a56d8f126ed8e00682555f800..9e8bd09870f5092da45abf1a1804fbf027264d30 100644
--- a/Tracking/TrkTools/TrkMaterialProvider/src/TrkMaterialProviderTool.cxx
+++ b/Tracking/TrkTools/TrkMaterialProvider/src/TrkMaterialProviderTool.cxx
@@ -488,7 +488,7 @@ void Trk::TrkMaterialProviderTool::getCaloMEOT(const Trk::Track& idTrack, const
 
     if (!caloTSOS || caloTSOS->size() != 3)
     {
-      double idqOverP = fabs(idTrack.perigeeParameters()->parameters()[Trk::qOverP]);
+      double idqOverP = std::abs(idTrack.perigeeParameters()->parameters()[Trk::qOverP]);
       double msqOverP = msTrack.perigeeParameters() ? msTrack.perigeeParameters()->parameters()[Trk::qOverP] : (*firstMS)->trackParameters()->parameters()[Trk::qOverP] ;
 
       if ((!fieldCache.toroidOn() && idqOverP * 4000. < 1) || (fieldCache.toroidOn() && msqOverP != 1 / 100000. && msqOverP != 0))
@@ -526,7 +526,7 @@ void Trk::TrkMaterialProviderTool::getCaloMEOT(const Trk::Track& idTrack, const
     if (eloss) neweloss = new CaloEnergy(*eloss);
     else{
       Trk::MaterialProperties matprop(meot->thicknessInX0(),1.,0.,0.,0.,0.);
-      double sigmascat = fabs(qoverp)>0.0 ? std::sqrt(m_scattool->sigmaSquare(matprop,std::abs(1./qoverp),1.,Trk::muon)) : 0.0;
+      double sigmascat = std::abs(qoverp)>0.0 ? std::sqrt(m_scattool->sigmaSquare(matprop,std::abs(1./qoverp),1.,Trk::muon)) : 0.0;
       newsa=new Trk::ScatteringAngles(0,0,sigmascat/sintheta,sigmascat);
     }
     Trk::MaterialEffectsOnTrack newmeot(meot->thicknessInX0(),newsa,neweloss,(*caloTSOS)[i]->trackParameters()->associatedSurface());
@@ -750,10 +750,10 @@ Trk::TrkMaterialProviderTool::getCaloTSOS (const Trk::TrackParameters&	parm,
         } else {
           ATH_MSG_DEBUG(" volume " << this->getVolumeByGeo(m) << " Eloss from extrapolateM TG " << energyLoss->deltaE());
         }
-          Eloss += fabs(energyLoss->deltaE());
-          if(this->getVolumeByGeo(m)==1) ElossID   += fabs(energyLoss->deltaE());
-          if(this->getVolumeByGeo(m)==2) ElossCalo += fabs(energyLoss->deltaE());
-          if(this->getVolumeByGeo(m)==3) ElossMS   += fabs(energyLoss->deltaE());
+          Eloss += std::abs(energyLoss->deltaE());
+          if(this->getVolumeByGeo(m)==1) ElossID   += std::abs(energyLoss->deltaE());
+          if(this->getVolumeByGeo(m)==2) ElossCalo += std::abs(energyLoss->deltaE());
+          if(this->getVolumeByGeo(m)==3) ElossMS   += std::abs(energyLoss->deltaE());
         }
       }
     }
@@ -820,7 +820,7 @@ Trk::TrkMaterialProviderTool::getCaloTSOS (const Trk::TrackParameters&	parm,
   // Note that for SA fit i'm taking the pAtCaloEntry from the perigee parameters
   double pAtCaloEntry = 0;
   if(dir == Trk::alongMomentum) {
-    double OneOverP = fabs(parm.parameters()[Trk::qOverP]);
+    double OneOverP = std::abs(parm.parameters()[Trk::qOverP]);
     if (OneOverP > 0.0)
       pAtCaloEntry = 1./OneOverP;
     else
@@ -830,7 +830,7 @@ Trk::TrkMaterialProviderTool::getCaloTSOS (const Trk::TrackParameters&	parm,
     if(!tsosAtCaloEntry) {
       ATH_MSG_WARNING( name() << " Unable to find Calorimeter Entry TSOS with TrackParameters! Momentum at Calo Entry not available!" );
     }else{
-      double OneOverP = fabs(tsosAtCaloEntry->trackParameters()->parameters()[Trk::qOverP]);
+      double OneOverP = std::abs(tsosAtCaloEntry->trackParameters()->parameters()[Trk::qOverP]);
       if (OneOverP > 0.0)
 	pAtCaloEntry = 1./OneOverP;
       else
@@ -853,9 +853,9 @@ Trk::TrkMaterialProviderTool::getCaloTSOS (const Trk::TrackParameters&	parm,
   // Get momentum error in muon spectrometer
   double pAtMuonEntryError = 0.0;
   if(parms) {
-    if( fabs(parms->parameters()[Trk::qOverP]) > 0.0 ) {
-      double pAtMuonEntry = fabs(1./parms->parameters()[Trk::qOverP]);
-      if(!parms->covariance()) {
+    if( std::abs(parms->parameters()[Trk::qOverP]) > 0.0 ) {
+      double pAtMuonEntry = std::abs(1./parms->parameters()[Trk::qOverP]);
+      if(!parms->covariance() || !Amg::valid_cov(*parms->covariance())) {
 	ATH_MSG_DEBUG("MS track parameters without covariance, using 10% relative error!" );
 	pAtMuonEntryError = pAtMuonEntry*0.1;
       }else{
@@ -1463,20 +1463,20 @@ Trk::TrkMaterialProviderTool::modifyTSOSvector(const std::vector<const Trk::Trac
       ATH_MSG_VERBOSE(" ");
       ATH_MSG_VERBOSE(" original TSOS type " << m->dumpType() << " TSOS surface " << m->trackParameters()->associatedSurface() << " position x " << m->trackParameters()->position().x() << " y " << m->trackParameters()->position().y() << " z " << m->trackParameters()->position().z()   << " direction x " << m->trackParameters()->momentum().unit().x() << " y " << m->trackParameters()->momentum().unit().y() << " z " << m->trackParameters()->momentum().unit().z() << " p " << m->trackParameters()->momentum().mag() << " X0 " << X0 << " deltaE " << energyLoss->deltaE() << " meanIoni " << energyLoss->meanIoni() << " sigmaIoni " << energyLoss->sigmaIoni() << " sigma deltaTheta " <<  scat->sigmaDeltaTheta() << " depth " << depth  << " dotprod " << dotprod );
 
-      X0_tot += fabs(scaleX0*X0);
+      X0_tot += std::abs(scaleX0*X0);
 
       sigmaDeltaTheta2_tot += scaleX0*scat->sigmaDeltaTheta()*scat->sigmaDeltaTheta();
       sigmaDeltaPhi2_tot   += scaleX0*scat->sigmaDeltaPhi()*scat->sigmaDeltaPhi();
 
       // Eloss sigma values add up linearly for Landau and exponential distributions
-      deltaE_tot           += fabs(scaleEloss*energyLoss->deltaE());
-      sigmaDeltaE_tot      += fabs(scaleEloss*energyLoss->sigmaDeltaE());
-      sigmaPlusDeltaE_tot  += fabs(scaleEloss*energyLoss->sigmaPlusDeltaE());
-      sigmaMinusDeltaE_tot += fabs(scaleEloss*energyLoss->sigmaMinusDeltaE());
-      deltaE_ioni_tot      += fabs(scaleEloss*energyLoss->meanIoni());
-      sigmaDeltaE_ioni_tot += fabs(scaleEloss*energyLoss->sigmaIoni());
-      deltaE_rad_tot       += fabs(scaleEloss*energyLoss->meanRad());
-      sigmaDeltaE_rad_tot  += fabs(scaleEloss*energyLoss->sigmaRad());
+      deltaE_tot           += std::abs(scaleEloss*energyLoss->deltaE());
+      sigmaDeltaE_tot      += std::abs(scaleEloss*energyLoss->sigmaDeltaE());
+      sigmaPlusDeltaE_tot  += std::abs(scaleEloss*energyLoss->sigmaPlusDeltaE());
+      sigmaMinusDeltaE_tot += std::abs(scaleEloss*energyLoss->sigmaMinusDeltaE());
+      deltaE_ioni_tot      += std::abs(scaleEloss*energyLoss->meanIoni());
+      sigmaDeltaE_ioni_tot += std::abs(scaleEloss*energyLoss->sigmaIoni());
+      deltaE_rad_tot       += std::abs(scaleEloss*energyLoss->meanRad());
+      sigmaDeltaE_rad_tot  += std::abs(scaleEloss*energyLoss->sigmaRad());
 
       depth_tot += depth;
       n_tot++;
@@ -1505,7 +1505,7 @@ Trk::TrkMaterialProviderTool::modifyTSOSvector(const std::vector<const Trk::Trac
       //bool use_eweight = false;
       double w = scat->sigmaDeltaTheta()*scat->sigmaDeltaTheta();
       // use_eweight s false, so the following never executes
-      //if(use_eweight) w = fabs(scaleEloss*energyLoss->deltaE());
+      //if(use_eweight) w = std::abs(scaleEloss*energyLoss->deltaE());
       w_tot += w;
       wpos += w*pos0/2.;
       wpos += w*posNew/2.;
@@ -1548,7 +1548,7 @@ Trk::TrkMaterialProviderTool::modifyTSOSvector(const std::vector<const Trk::Trac
 
       } else if(!aggregate&&reposition) {
 
-        if(fabs(depth)<10.) {
+        if(std::abs(depth)<10.) {
 
 	  //        Thin scatterer: make only one TSOS
 
@@ -1606,7 +1606,7 @@ Trk::TrkMaterialProviderTool::modifyTSOSvector(const std::vector<const Trk::Trac
           const Trk::MaterialEffectsOnTrack*  meotLast =  new Trk::MaterialEffectsOnTrack(X0_tot/2., scatNew, caloEnergyNew, *surfLast, meotPattern);
 
 	  //        calculate TrackParameters at first surface
-          double qOverP0 = m->trackParameters()->charge()/ (m->trackParameters()->momentum().mag()-fabs(energyLoss->deltaE()));
+          double qOverP0 = m->trackParameters()->charge()/ (m->trackParameters()->momentum().mag()-std::abs(energyLoss->deltaE()));
           if(mprevious) qOverP0 = mprevious->trackParameters()->charge()/mprevious->trackParameters()->momentum().mag();
 
           std::unique_ptr<Trk::TrackParameters> parsFirst =
@@ -1691,8 +1691,8 @@ Trk::TrkMaterialProviderTool::modifyTSOSvector(const std::vector<const Trk::Trac
       //
       Amg::Vector3D pos = wpos/w_tot;
       bool threePlanes = false;
-      //if(fabs(X0_tot)>50 && fabs(pos.z())<6700 && pos.perp()<4200) threePlanes = true;
-      if(fabs(pos.z())<6700 && pos.perp()<4200) threePlanes = true; // always 3 planes in calo
+      //if(std::abs(X0_tot)>50 && std::abs(pos.z())<6700 && pos.perp()<4200) threePlanes = true;
+      if(std::abs(pos.z())<6700 && pos.perp()<4200) threePlanes = true; // always 3 planes in calo
       //
       const Trk::ScatteringAngles* scatFirst = new ScatteringAngles(deltaPhi,deltaTheta,sqrt(sigmaDeltaPhi2_tot/2.),sqrt(sigmaDeltaTheta2_tot/2.));
       const Trk::ScatteringAngles* scatNew = new ScatteringAngles(deltaPhi,deltaTheta,sqrt(sigmaDeltaPhi2_tot/2.),sqrt(sigmaDeltaTheta2_tot/2.));
@@ -1753,13 +1753,13 @@ Trk::TrkMaterialProviderTool::modifyTSOSvector(const std::vector<const Trk::Trac
 // force the planes to be inside the Calorimeter
 //
       double scaleCalo = 1.;
-      double scaleCaloNew = fabs(pos0.z())/6700;
+      double scaleCaloNew = std::abs(pos0.z())/6700;
       if(scaleCaloNew>scaleCalo) scaleCalo = scaleCaloNew;
-      scaleCaloNew = fabs(posNew.z())/6700;
+      scaleCaloNew = std::abs(posNew.z())/6700;
       if(scaleCaloNew>scaleCalo) scaleCalo = scaleCaloNew;
-      scaleCaloNew = fabs(pos0.perp())/4200;
+      scaleCaloNew = std::abs(pos0.perp())/4200;
       if(scaleCaloNew>scaleCalo) scaleCalo = scaleCaloNew;
-      scaleCaloNew = fabs(posNew.perp())/4200;
+      scaleCaloNew = std::abs(posNew.perp())/4200;
       if(scaleCaloNew>scaleCalo) scaleCalo = scaleCaloNew;
 
       if(scaleCalo>1.) {
@@ -1779,7 +1779,7 @@ Trk::TrkMaterialProviderTool::modifyTSOSvector(const std::vector<const Trk::Trac
       Trk::PlaneSurface* surfFirst = new Trk::PlaneSurface( surfaceTransformFirst );
       Trk::PlaneSurface* surfLast = new Trk::PlaneSurface( surfaceTransformLast );
       //        calculate TrackParameters at first surface
-      double qOverP0 = mfirst->trackParameters()->charge()/(mfirst->trackParameters()->momentum().mag()+fabs(deltaEFirst));
+      double qOverP0 = mfirst->trackParameters()->charge()/(mfirst->trackParameters()->momentum().mag()+std::abs(deltaEFirst));
       //        calculate TrackParameters at last surface
       double qOverPNew = mlast->trackParameters()->charge()/mlast->trackParameters()->momentum().mag();
       std::unique_ptr<Trk::TrackParameters> parsFirst =
@@ -1964,14 +1964,14 @@ void Trk::TrkMaterialProviderTool::getMopAndIoniEnergyLoss(const std::vector<con
         ATH_MSG_WARNING("No materialEffectsOnTrack on TrackStateOnSurface ");
         continue;
       }
-      deltaE_tot           += fabs(scaleEloss*energyLoss->deltaE());
-      sigmaDeltaE_tot      += fabs(scaleEloss*energyLoss->sigmaDeltaE());
-      sigmaPlusDeltaE_tot  += fabs(scaleEloss*energyLoss->sigmaPlusDeltaE());
-      sigmaMinusDeltaE_tot += fabs(scaleEloss*energyLoss->sigmaMinusDeltaE());
-      deltaE_ioni_tot      += fabs(scaleEloss*energyLoss->meanIoni());
-      sigmaDeltaE_ioni_tot += fabs(scaleEloss*energyLoss->sigmaIoni());
-      deltaE_rad_tot       += fabs(scaleEloss*energyLoss->meanRad());
-      sigmaDeltaE_rad_tot  += fabs(scaleEloss*energyLoss->sigmaRad());
+      deltaE_tot           += std::abs(scaleEloss*energyLoss->deltaE());
+      sigmaDeltaE_tot      += std::abs(scaleEloss*energyLoss->sigmaDeltaE());
+      sigmaPlusDeltaE_tot  += std::abs(scaleEloss*energyLoss->sigmaPlusDeltaE());
+      sigmaMinusDeltaE_tot += std::abs(scaleEloss*energyLoss->sigmaMinusDeltaE());
+      deltaE_ioni_tot      += std::abs(scaleEloss*energyLoss->meanIoni());
+      sigmaDeltaE_ioni_tot += std::abs(scaleEloss*energyLoss->sigmaIoni());
+      deltaE_rad_tot       += std::abs(scaleEloss*energyLoss->meanRad());
+      sigmaDeltaE_rad_tot  += std::abs(scaleEloss*energyLoss->sigmaRad());
 
       ATH_MSG_DEBUG(" position x " <<  m->trackParameters()->position().x() << " y " <<  m->trackParameters()->position().y()  << " perp " << m->trackParameters()->position().perp() << " z " <<  m->trackParameters()->position().z() );
       ATH_MSG_DEBUG(" deltaE " << (scaleEloss*energyLoss->deltaE())  << " deltaE_ioni " << (scaleEloss*energyLoss->meanIoni()) << " sigmaDeltaE_ioni " << (scaleEloss*energyLoss->sigmaIoni()));
@@ -2068,7 +2068,7 @@ double Trk::TrkMaterialProviderTool::getFinalMeasuredEnergy(Rec::CaloMeas* caloM
 
   // Correction for forward calorimetry
   double ForwardHECCorrection	= 0.;
-  if (fabs(eta)>2. && caloMeas->LArHEC_EnergyMeasured()>100.)
+  if (std::abs(eta)>2. && caloMeas->LArHEC_EnergyMeasured()>100.)
     ForwardHECCorrection	= (1. - LArHECMeasurementMaterial) * HECMaterial * MopLossCorrected;
   const double LArHECEnergy	= caloMeas->LArHEC_EnergyMeasured() + ForwardHECCorrection;	// Measured energy deposition in LArHEC
 
@@ -2085,10 +2085,10 @@ double Trk::TrkMaterialProviderTool::getFinalMeasuredEnergy(Rec::CaloMeas* caloM
   bool bEM	= false; // performed Em measurement?
 
   // If muon isolated, and no significant measurement is made then use the mop parameterization, else the mean
-  if (fabs(eta)<1.4) {
+  if (std::abs(eta)<1.4) {
     if (LArHECEnergy + TileEnergy > 0.1 * MopLoss * HECMaterial)	bHEC= true;
   }
-  else if (fabs(eta)>1.8) {
+  else if (std::abs(eta)>1.8) {
     if (LArHECEnergy + TileEnergy > 0.2 * MopLoss * HECMaterial)	bHEC= true;
   }else{
     if (LArHECEnergy + TileEnergy > 0.25 * MopLoss * HECMaterial)	bHEC= true;
@@ -2135,7 +2135,7 @@ double Trk::TrkMaterialProviderTool::getFinalMeasuredEnergy(Rec::CaloMeas* caloM
   // 				    -0.317111 , -0.428393 , -0.524839 , -0.599547 , -0.464013 ,
   // 				    -0.159663 , -0.140879 , -0.0975618,  0.0225352,  0.0701925,
   // 				    -0.24778 };
-  // int ieta			=  static_cast<int> (fabs(eta)/0.10);
+  // int ieta			=  static_cast<int> (std::abs(eta)/0.10);
   // if (ieta > 25) ieta		=  25;
 
   double FinalMeasuredEnergy	= MeasCorrected + eOverMipCorrection;// + (fix1FromPeter[ieta] + fix2FromPeter[ieta])*CLHEP::GeV;
diff --git a/Trigger/TrigAlgorithms/TrigTauRec/python/TrigTauAlgorithmsHolder.py b/Trigger/TrigAlgorithms/TrigTauRec/python/TrigTauAlgorithmsHolder.py
index e68a07385825bbddbbda494d2cfef5af11464051..c7619266e06fa2426052aed624a50d1f6ea12dfe 100644
--- a/Trigger/TrigAlgorithms/TrigTauRec/python/TrigTauAlgorithmsHolder.py
+++ b/Trigger/TrigAlgorithms/TrigTauRec/python/TrigTauAlgorithmsHolder.py
@@ -844,16 +844,18 @@ def getTVATool():
     if _name in cached_instances:
         return cached_instances[_name]
 
-    from TrackVertexAssociationTool.TrackVertexAssociationToolConf import CP__TrackVertexAssociationTool
-    TVATool = CP__TrackVertexAssociationTool(name = _name,
-                                             WorkingPoint = "Custom",
-                                             d0_cut = 2.5*mm,
-                                             use_d0sig = False,
-                                             d0sig_cut = -1,
-                                             dzSinTheta_cut = 3.0*mm,
-                                             doUsedInFit = False,
-                                             requirePriVtx=False
-                                             )
+    from TrackVertexAssociationTool.getTTVAToolForReco import getTTVAToolForReco
+    TVATool = getTTVAToolForReco(name = _name,
+                                 WorkingPoint = "Custom",
+                                 d0_cut = 2.5*mm,
+                                 use_d0sig = False,
+                                 d0sig_cut = -1,
+                                 dzSinTheta_cut = 3.0*mm,
+                                 doUsedInFit = False,
+                                 requirePriVtx=False,
+                                 TrackContName=_DefaultTrackContainer,
+                                 VertexContName=_DefaultVertexContainer
+                                 )
 
     from AthenaCommon.AppMgr import ToolSvc
     ToolSvc += TVATool
@@ -889,44 +891,6 @@ def getTauCellCorrection():
     cached_instances[_name] = TauCellCorrectionTool         
     return TauCellCorrectionTool
 
-#########################################################################
-# CaloNoiseTool
-def getCaloNoiseTool():
-    _name = 'CaloNoiseTool'
-    
-    if _name in cached_instances:
-        return cached_instances[_name]
-    
-    from CaloTools.CaloNoiseToolDefault import CaloNoiseToolDefault
-    theCaloNoiseTool = CaloNoiseToolDefault()
-    
-    from AthenaCommon.AppMgr import ToolSvc
-    ToolSvc += theCaloNoiseTool
-    
-    cached_instances[_name] = theCaloNoiseTool
-    return theCaloNoiseTool
-
-#########################################################################
-# tau1p3p track match cells
-def getTauEflowTrackMatchCells():
-    _name = sPrefix + 'EflowTrackMatchCells'
-    
-    if _name in cached_instances:
-        return cached_instances[_name]
-    
-    from tauRec.tauRecConf import TauEflowTrackMatchCells
-    TauEflowTrackMatchCells = TauEflowTrackMatchCells(name = _name,
-                detRIsolCaloCut   = 0.4,
-                useNoiseSigma     = 1,
-                AbsNoiseSigma_cut = 2,
-                CaloNoiseTool     = getCaloNoiseTool(),
-                selectConeSize    = 0.45, #not used anymore
-                CellCorrection = True,
-                OriginCorrectionTool = getTauCellCorrection()) 
-    
-    cached_instances[_name] = TauEflowTrackMatchCells         
-    return TauEflowTrackMatchCells
-
 #########################################################################
 # tau1p3p AddCaloInfo
 def getTauEflowAddCaloInfo():
@@ -1001,35 +965,6 @@ def getPi0CreatorChooser():
     cached_instances[_name] = TauPi0CreatorChooser
     return TauPi0CreatorChooser 
 
-#########################################################################
-# Crakow Pi0/eflow algorithm
-# Cluster/Cellfinder for Pi0/Eflow algos
-def getPi0EflowCreateROI():
-    _name = sPrefix + 'TauPi0EflowCreateROI'
-    
-    if _name in cached_instances:
-        return cached_instances[_name]
-    
-    from tauRec.tauRecConf import TauPi0EflowCreateROI
-    TauPi0EflowCreateROI = TauPi0EflowCreateROI( name = _name,
-                detRIsolCaloCut   = 0.4,
-                detRCoreCaloCut   = 0.2,
-                useNoiseSigma     = 0,
-                AbsNoiseSigma_cut = 2,
-                removeChrgEM01    = 1,
-                removeChrgEM2     = 1,
-                detRChrgEMCut     = 0.0375,
-                # Added by SL
-                fillCellContainer = TRUE,
-                CellsOutputContainerName = "TauCells",
-                CaloNoiseTool     = getCaloNoiseTool(),
-                CaloCellMakerToolNames = ["CaloCellContainerFinalizerTool/cellfinalizerForTaus","CaloCellContainerCheckerTool/cellcheckForTaus"],
-                CellCorrection = True,
-                OriginCorrectionTool = getTauCellCorrection())   
-    
-    cached_instances[_name] = TauPi0EflowCreateROI
-    return TauPi0EflowCreateROI
-
 ################
 # Pi0 Clustering
 def getCrakowPi0ClusterCreator():
diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/ConfVtxAnalysis.cxx b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/ConfVtxAnalysis.cxx
index ea02e982719e42b07fec6db8c71286c3a006a84a..0ad11562ed6802ab64c6bf606bc38a04d587eef2 100644
--- a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/ConfVtxAnalysis.cxx
+++ b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/ConfVtxAnalysis.cxx
@@ -184,13 +184,14 @@ void ConfVtxAnalysis::execute( const std::vector<TIDA::Vertex*>& vtx0,
 
     for ( unsigned i=0 ; i<vtx0.size() ; i++ ) { 
 
-      //      if ( i>0 ) break;
+      /// reject vertices with no tracks in the Roi ...
+      if ( vtx0[i]->Ntracks() == 0 ) continue;
 
-      //      std::cout << i << "\tref z " << vtx0[i]->z();
 
       hzed->Fill( vtx0[i]->z() );
       hntrax->Fill( vtx0[i]->Ntracks() );
 
+
       hlb->Fill( lb );
       hmu->Fill( mu );
       
diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/rmain.cxx b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/rmain.cxx
index 4afcdbf561ccc9405d3203dac368dcc29ef93a2f..1627b36fc9da9cf1b5b0dd8ff0e2609431fe2282 100644
--- a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/rmain.cxx
+++ b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/rmain.cxx
@@ -1877,7 +1877,7 @@ int main(int argc, char** argv)
         else if ( vtxind_rec!=-1 ) {
           if ( unsigned(vtxind_rec)<mvt.size() )       vertices_test.push_back( mvt[vtxind] );
         }
-        else { 
+        else {  
           for ( unsigned iv=0 ; iv<mvt.size() ; iv++ ) vertices_test.push_back( mvt[iv] );
         }
 
@@ -2085,9 +2085,10 @@ int main(int argc, char** argv)
 
         std::vector<TIDA::Vertex> vertices_roi;
 
+	/// do for all vertices now ...
+	//        if ( chain.name().find("SuperRoi") ) { 
+	{          
 
-        if ( chain.name().find("SuperRoi") ) { 
-          
           /// select the reference offline vertices
           
           vertices_roi.clear();
@@ -2100,6 +2101,20 @@ int main(int argc, char** argv)
 
             const TIDA::Vertex& vx = mv[iv];
 
+	    // reject all vertices that are not in the roi
+
+	    bool accept_vertex = false;
+	    if ( roi.composite() ) { 
+	      for ( size_t ir=0 ; ir<roi.size() ; ir++ ) { 
+		if ( roi[ir]->zedMinus()<=vx.z() && roi[ir]->zedPlus()>=vx.z() ) accept_vertex = true;  
+	      }
+	    }
+	    else { 
+	      if ( roi.zedMinus()<=vx.z() && roi.zedPlus()>=vx.z() ) accept_vertex = true;  
+	    }
+
+	    if ( !accept_vertex ) continue;
+	    
             //      std::cout << "\t" << iv << "\t" << vx << std::endl;
 
             int trackcount = 0;
@@ -2114,7 +2129,7 @@ int main(int argc, char** argv)
             /// don't add vertices with no matching tracks - remember the 
             /// tracks are filtered by Roi already so some vertices may have 
             /// no tracks in the Roi - ntracks set to 0 by default
-            if ( trackcount>=ntracks ) { 
+            if ( trackcount>=ntracks && trackcount>0 ) { 
               vertices_roi.push_back( TIDA::Vertex( vx.x(), vx.y(), vx.z(),  
                                                     vx.dx(), vx.dy(), vx.dz(),
                                                     trackcount, 
@@ -2125,7 +2140,7 @@ int main(int argc, char** argv)
           }
           
         }
-        else vertices_roi = vertices;
+        // else vertices_roi = vertices;
 	
        	if ( rotate_testtracks ) for ( size_t i=testp.size() ; i-- ; ) testp[i]->rotate();
 	
diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-chains-run3.dat b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-chains-run3.dat
index b302f3ff97eeea090f26f2413eff518a364ed7a7..33b791e0f90189c68c02adbbfe7d6c5b6e91a36c 100644
--- a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-chains-run3.dat
+++ b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-chains-run3.dat
@@ -31,6 +31,7 @@ testChains = {
     "HLT_tau25_idperf_tracktwo_L1TAU12IM:HLT_IDTrack_TauCore_FTF:HLT_Roi_TauCore",
     "HLT_tau25_idperf_tracktwo_L1TAU12IM:HLT_IDTrack_TauIso_FTF:HLT_Roi_TauIso",
     "HLT_tau25_idperf_tracktwo_L1TAU12IM:HLT_IDTrack_Tau_IDTrig:HLT_Roi_TauIso",
+    "HLT_tau25_idperf_tracktwo_L1TAU12IM:HLT_IDTrack_Tau_IDTrig:HLT_Roi_TauIso:HLT_IDVertex_Tau:post:rvtx=HLT_IDVertex_Tau",
 
     "HLT_j45_subjesgscIS_ftf_boffperf_split_L1J20:HLT_IDTrack_Bjet_FTF",
     "HLT_j45_subjesgscIS_ftf_boffperf_split_L1J20:HLT_IDTrack_Bjet_IDTrig",
diff --git a/Trigger/TrigMonitoring/TrigBjetMonitoring/python/TrigBjetMonitorAlgorithm.py b/Trigger/TrigMonitoring/TrigBjetMonitoring/python/TrigBjetMonitorAlgorithm.py
index 37667c79c59b90cd6986c35c8126f49eab97051b..d1753fd8c77766d357ef15cffa50110db4e272d5 100644
--- a/Trigger/TrigMonitoring/TrigBjetMonitoring/python/TrigBjetMonitorAlgorithm.py
+++ b/Trigger/TrigMonitoring/TrigBjetMonitoring/python/TrigBjetMonitorAlgorithm.py
@@ -1,5 +1,5 @@
 #
-#  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+#  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 #
 
 '''@file TrigBjetMonitorAlgorithm.py
@@ -76,15 +76,7 @@ def TrigBjetMonConfig(inputFlags):
     # Add some tools. N.B. Do not use your own trigger decion tool. Use the
     # standard one that is included with AthMonitorAlgorithm.
 
-    # # First, add a tool that's set up by a different configuration function. 
-    # # In this case, CaloNoiseToolCfg returns its own component accumulator, 
-    # # which must be merged with the one from this function.
-    # from CaloTools.CaloNoiseToolConfig import CaloNoiseToolCfg
-    # caloNoiseAcc, caloNoiseTool = CaloNoiseToolCfg(inputFlags)
-    # result.merge(caloNoiseAcc)
-    # trigBjetMonAlg.CaloNoiseTool = caloNoiseTool
-
-    # # Then, add a tool that doesn't have its own configuration function. In
+    # # Add a tool that doesn't have its own configuration function. In
     # # this example, no accumulator is returned, so no merge is necessary.
     # from MyDomainPackage.MyDomainPackageConf import MyDomainTool
     # trigBjetMonAlg.MyDomainTool = MyDomainTool()
diff --git a/Trigger/TrigMonitoring/TrigBjetMonitoring/python/TrigBjetMonitorAlgorithm_2alg.py b/Trigger/TrigMonitoring/TrigBjetMonitoring/python/TrigBjetMonitorAlgorithm_2alg.py
index 97264033f3eff2f9ef7d2e4858f856baba817b01..372cb6f4a769a75c15b9b6067b2ce0511de72af8 100644
--- a/Trigger/TrigMonitoring/TrigBjetMonitoring/python/TrigBjetMonitorAlgorithm_2alg.py
+++ b/Trigger/TrigMonitoring/TrigBjetMonitoring/python/TrigBjetMonitorAlgorithm_2alg.py
@@ -1,5 +1,5 @@
 #
-#  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+#  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 #
 
 '''@file TrigBjetMonitorAlgorithm.py
@@ -71,15 +71,7 @@ def TrigBjetMonConfig(inputFlags):
     # Add some tools. N.B. Do not use your own trigger decion tool. Use the
     # standard one that is included with AthMonitorAlgorithm.
 
-    # # First, add a tool that's set up by a different configuration function. 
-    # # In this case, CaloNoiseToolCfg returns its own component accumulator, 
-    # # which must be merged with the one from this function.
-    # from CaloTools.CaloNoiseToolConfig import CaloNoiseToolCfg
-    # caloNoiseAcc, caloNoiseTool = CaloNoiseToolCfg(inputFlags)
-    # result.merge(caloNoiseAcc)
-    # trigBjetMonAlg.CaloNoiseTool = caloNoiseTool
-
-    # # Then, add a tool that doesn't have its own configuration function. In
+    # # Add a tool that doesn't have its own configuration function. In
     # # this example, no accumulator is returned, so no merge is necessary.
     # from MyDomainPackage.MyDomainPackageConf import MyDomainTool
     # trigBjetMonAlg.MyDomainTool = MyDomainTool()
diff --git a/Trigger/TrigMonitoring/TrigBphysMonitoring/python/TrigBphysMonitorAlgorithm.py b/Trigger/TrigMonitoring/TrigBphysMonitoring/python/TrigBphysMonitorAlgorithm.py
index b0b5b30958f1e27f3ed3f281eeae35037998cb1a..35a1986c59a1716a79148edcfff67797f1de9f3c 100644
--- a/Trigger/TrigMonitoring/TrigBphysMonitoring/python/TrigBphysMonitorAlgorithm.py
+++ b/Trigger/TrigMonitoring/TrigBphysMonitoring/python/TrigBphysMonitorAlgorithm.py
@@ -1,5 +1,5 @@
 #
-#  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+#  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 #
 
 '''@file TrigBphysMonitorAlgorithm.py
@@ -64,16 +64,7 @@ def TrigBphysMonConfig(inputFlags):
     # Add some tools. N.B. Do not use your own trigger decision tool. Use the
     # standard one that is included with AthMonitorAlgorithm.
 
-    # # First, add a tool that's set up by a different configuration function. 
-    # # In this case, CaloNoiseToolCfg returns its own component accumulator, 
-    # # which must be merged with the one from this function.
-    # from CaloTools.CaloNoiseToolConfig import CaloNoiseToolCfg
-    # caloNoiseAcc, caloNoiseTool = CaloNoiseToolCfg(inputFlags)
-    # result.merge(caloNoiseAcc)
-    # trigBphysMonAlg.CaloNoiseTool = caloNoiseTool
-    
-
-    # # Then, add a tool that doesn't have its own configuration function. In
+    # # Add a tool that doesn't have its own configuration function. In
     # # this example, no accumulator is returned, so no merge is necessary.
     # from MyDomainPackage.MyDomainPackageConf import MyDomainTool
     # trigBphysMonAlg.MyDomainTool = MyDomainTool()
diff --git a/Trigger/TrigMonitoring/TrigIDtrkMonitoring/python/TrigIDPhysValMonitoringConfig.py b/Trigger/TrigMonitoring/TrigIDtrkMonitoring/python/TrigIDPhysValMonitoringConfig.py
index 5c5e33a2c9b1c13cb3a4896a9606947e038c9568..c4609722ad957ee3bc23cadcbfb5054c8cf52ab7 100644
--- a/Trigger/TrigMonitoring/TrigIDtrkMonitoring/python/TrigIDPhysValMonitoringConfig.py
+++ b/Trigger/TrigMonitoring/TrigIDtrkMonitoring/python/TrigIDPhysValMonitoringConfig.py
@@ -120,7 +120,8 @@ def TrigIDPhysValMonitoringTool( legacy_monitoring=False ):
         "HLT_mu.*idperf.*:key=HLT_IDTrack_Muon_FTF:roi=HLT_Roi_L2SAMuon",
         "HLT_mu.*idperf.*:key=HLT_IDTrack_Muon_IDTrig:roi=HLT_Roi_L2SAMuonForEF",
         "HLT_mu.*i.*:key=HLT_IDTrack_MuonIso_FTF:roi=HLT_Roi_MuonIso",
-        "HLT_mu.*i.*:key=HLT_IDTrack_MuonIso_IDTrig:roi=HLT_Roi_MuonIso"
+        "HLT_mu.*i.*:key=HLT_IDTrack_MuonIso_IDTrig:roi=HLT_Roi_MuonIso",
+        "HLT_mu.*LRT.*:HLT_IDTrack_MuonLRT_FTF:HLT_Roi_L2SAMuon_LRT"
       ]
     else:
       chainnames = [
diff --git a/Trigger/TrigMonitoring/TrigIDtrkMonitoring/python/TrigIDtrkMonitoringConfig.py b/Trigger/TrigMonitoring/TrigIDtrkMonitoring/python/TrigIDtrkMonitoringConfig.py
index 796900d9f57c4f4015a4a5d87fb232ff30d511f6..e683b54490a50de303ccd14fb19de9de2b8e6803 100644
--- a/Trigger/TrigMonitoring/TrigIDtrkMonitoring/python/TrigIDtrkMonitoringConfig.py
+++ b/Trigger/TrigMonitoring/TrigIDtrkMonitoring/python/TrigIDtrkMonitoringConfig.py
@@ -180,7 +180,8 @@ def TrigIDtrkMonitoringTool( legacy_monitoring=False ):
                                 "HLT_mu.*idperf.*:key=HLT_IDTrack_Muon_FTF:roi=HLT_Roi_L2SAMuon",
                                 "HLT_mu.*idperf.*:key=HLT_IDTrack_Muon_IDTrig:roi=HLT_Roi_L2SAMuonForEF",
                                 "HLT_mu.*ivar.*:key=HLT_IDTrack_MuonIso_FTF:roi=HLT_Roi_MuonIso",
-                                "HLT_mu.*ivar.*:key=HLT_IDTrack_MuonIso_IDTrig:roi=HLT_Roi_MuonIso"
+                                "HLT_mu.*ivar.*:key=HLT_IDTrack_MuonIso_IDTrig:roi=HLT_Roi_MuonIso",
+                                "HLT_mu.*LRT.*:HLT_IDTrack_MuonLRT_FTF:HLT_Roi_L2SAMuon_LRT"
                         ]
                 else:
                         tidamuon.ntupleChainNames += [
diff --git a/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitCategory.py b/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitCategory.py
index e58ef2be8b62ea604229a20c87b5b8cb548db19f..4a21402f606f4bfd2383a6d061973d5dd7f261d0 100644
--- a/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitCategory.py
+++ b/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitCategory.py
@@ -2,33 +2,34 @@
 
 # l1 trigger to monitor: 
 met_triggers_l1_shifter = [
-    "L1_XE10",
     "L1_XE50",
+    "L1_XE55",
 ]
 
 met_triggers_l1_expert = [
-    "L1_XE55",
+    "L1_XE10",
     "L1_XE60",
 ]
 
 # hlt triggers to monitor
 met_triggers_hlt_shifter = [
-    "HLT_xe30_cell_L1XE10",
-    "HLT_xe30_cell_xe30_tcpufit_L1XE10",
-    "HLT_xe30_tcpufit_L1XE10",
-    "HLT_xe65_cell_L1XE50",
+    "HLT_xe70_mht",    
+    "HLT_xe90_mht_L1XE50",    
+    "HLT_xe100_mht_L1XE50",    
+    "HLT_xe110_mht_L1XE50",
+    "HLT_xe90_pufit_L1XE50",
+    "HLT_xe100_pufit_L1XE50",
+    "HLT_xe100_pufit_L1XE55",
+    "HLT_xe110_pufit_L1XE50",
+    "HLT_xe110_pufit_L1XE55",
+    "HLT_xe110_pufit_xe70_L1XE50",
     "HLT_xe110_pufit_xe65_L1XE50",
 ] 
 
 met_triggers_hlt_expert = [
-    "HLT_xe110_pufit_xe70_L1XE60",
-    "HLT_xe110_pufit_L1XE50",
-    "HLT_xe110_pufit_L1XE55",
-    "HLT_xe100_pufit_L1XE55",
+    "HLT_xe30_cell_L1XE10",
     "HLT_xe90_pufit_L1XE50",
-    "HLT_xe110_mht_L1XE50",
-    "HLT_xe90_mht_L1XE50",    
-    "HLT_xe70_mht_L1XE50",    
+    "HLT_xe100_pufit_L1XE55",
 ]
 
 
diff --git a/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py b/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py
index 83fab2f277f7cc1cad24eee4e933f34701785978..372666c54e78c48b9477748c56cc888046d23890 100644
--- a/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py
+++ b/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py
@@ -1,5 +1,5 @@
 #
-#  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+#  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 #
 
 '''@file TrigMETMonitoringAlgorithm.py
@@ -39,6 +39,12 @@ def TrigMETMonConfig(inputFlags):
     # # yourself, the AddAlgorithm method will still configure the base 
     # # properties and add the algorithm to the monitoring sequence.
     # helper.AddAlgorithm(myExistingAlg)
+    
+
+    ### check Run2 or Run3 MT
+    mt_chains = True
+    if ( inputFlags.Trigger.EDMVersion < 3 ) :
+      mt_chains = False
 
 
     ### STEP 3 ###
@@ -48,12 +54,11 @@ def TrigMETMonConfig(inputFlags):
     # to enable a trigger filter, for example:
     # TrigMETMonAlg.TriggerChain = 'HLT_xe30_cell_L1XE10'
     # without filters, all events are processed.
-    TrigMETMonChain1Alg.TriggerChain = 'HLT_xe65_cell_L1XE50'
+    if mt_chains:
+      TrigMETMonChain1Alg.TriggerChain = 'HLT_xe65_cell_L1XE50'
+    else:
+      TrigMETMonChain1Alg.TriggerChain = 'HLT_xe110_pufit_xe65_L1XE50'
     
-    ### check Run2 or Run3 MT
-    mt_chains = True
-    if ( inputFlags.Trigger.EDMVersion < 3 ) :
-      mt_chains = False
 
     ### container name selection
     if mt_chains: # these are temporary, needs to be changed
@@ -72,7 +77,7 @@ def TrigMETMonConfig(inputFlags):
       TrigMETMonAlg.l1_gjwoj_key = 'LVL1EnergySumRoI'
       TrigMETMonAlg.l1_gpufit_key = 'LVL1EnergySumRoI'
       TrigMETMonAlg.hlt_cell_key = 'HLT_xAOD__TrigMissingETContainer_TrigEFMissingET'
-      TrigMETMonAlg.hlt_mt_key = 'HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_mht'
+      TrigMETMonAlg.hlt_mht_key = 'HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_mht'
       TrigMETMonAlg.hlt_tc_key = 'HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_topocl'
       TrigMETMonAlg.hlt_tc_em_key = 'HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_topocl'
       TrigMETMonAlg.hlt_tcpufit_key = 'HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_topocl_PUC'
@@ -112,8 +117,9 @@ def TrigMETMonConfig(inputFlags):
       TrigMETMonAlg.HLTChain02 = 'HLT_xe110_mht_L1XE50'
       TrigMETMonAlg.HLTChain03 = 'HLT_xe110_tcpufit_L1XE50'
       TrigMETMonAlg.HLTChain05 = 'HLT_xe110_pfsum_L1XE50'
-      TrigMETMonAlg.HLTChain10 = 'HLT_xe110_pfsum_cssk_L1XE50'
-      TrigMETMonAlg.HLTChain11 = 'HLT_xe110_pfsum_vssk_L1XE50'
+      TrigMETMonAlg.HLTChain11 = 'HLT_xe110_pfsum_cssk_L1XE50'
+      TrigMETMonAlg.HLTChain12 = 'HLT_xe110_pfsum_vssk_L1XE50'
+      TrigMETMonAlg.HLTChain13 = 'HLT_xe100_pfopufit_L1XE50'
     else: 
       TrigMETMonAlg.L1Chain02 = 'L1_XE10'
       TrigMETMonAlg.L1Chain03 = 'L1_XE30'
@@ -121,25 +127,24 @@ def TrigMETMonConfig(inputFlags):
       TrigMETMonAlg.L1Chain05 = 'L1_XE60'
       TrigMETMonAlg.L1Chain06 = 'L1_XE70'
       TrigMETMonAlg.L1Chain07 = 'L1_XE75'
-      TrigMETMonAlg.HLTChain01 = 'HLT_xe70_mht_L1XE50'
+      TrigMETMonAlg.HLTChain01 = 'HLT_xe70_mht'
       TrigMETMonAlg.HLTChain02 = 'HLT_xe90_mht_L1XE50'
-      TrigMETMonAlg.HLTChain03 = 'HLT_xe110_mht_L1XE50'
-      TrigMETMonAlg.HLTChain04 = 'HLT_xe90_pufit_L1XE50'
-      TrigMETMonAlg.HLTChain05 = 'HLT_xe100_pufit_L1XE50'
-      TrigMETMonAlg.HLTChain06 = 'HLT_xe110_pufit_L1XE50'
-      TrigMETMonAlg.HLTChain07 = 'HLT_xe110_pufit_xe65_L1XE50'
-      TrigMETMonAlg.HLTChain08 = 'HLT_xe110_pufit_xe70_L1XE50'
+      TrigMETMonAlg.HLTChain03 = 'HLT_xe100_mht_L1XE50'
+      TrigMETMonAlg.HLTChain04 = 'HLT_xe110_mht_L1XE50'
+      TrigMETMonAlg.HLTChain05 = 'HLT_xe90_pufit_L1XE50'
+      TrigMETMonAlg.HLTChain06 = 'HLT_xe100_pufit_L1XE50'
+      TrigMETMonAlg.HLTChain07 = 'HLT_xe100_pufit_L1XE55'
+      TrigMETMonAlg.HLTChain08 = 'HLT_xe110_pufit_L1XE50'
+      TrigMETMonAlg.HLTChain09 = 'HLT_xe110_pufit_L1XE55'
+      TrigMETMonAlg.HLTChain11 = 'HLT_xe110_pufit_xe65_L1XE50'
+      TrigMETMonAlg.HLTChain12 = 'HLT_xe110_pufit_xe70_L1XE50'
 
 
     ### STEP 4 ###
     # Add some tools. N.B. Do not use your own trigger decion tool. Use the
     # standard one that is included with AthMonitorAlgorithm.
 
-    # # First, add a tool that's set up by a different configuration function. 
-    # # In this case, CaloNoiseToolCfg returns its own component accumulator, 
-    # # which must be merged with the one from this function.
-
-    # # Then, add a tool that doesn't have its own configuration function. In
+    # # Add a tool that doesn't have its own configuration function. In
     # # this example, no accumulator is returned, so no merge is necessary.
     # from MyDomainPackage.MyDomainPackageConf import MyDomainTool
     # expertTrigMETMonAlg.MyDomainTool = MyDomainTool()
diff --git a/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx b/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx
index 5d3a89716dddfa0b9379965b5e22b11387d80454..70cecadb6682ed15e3e8a0687981ec6db937ef99 100644
--- a/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx
+++ b/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx
@@ -7,54 +7,31 @@
 
 TrigMETMonitorAlgorithm::TrigMETMonitorAlgorithm( const std::string& name, ISvcLocator* pSvcLocator )
   : AthMonitorAlgorithm(name,pSvcLocator)
-  , m_offline_met_key("MET_Reference_AntiKt4EMPFlow")
-  , m_hlt_electron_key("HLT_egamma_Electrons_GSF")
-  , m_hlt_muon_key("HLT_MuonsCB_FS")
-  , m_lvl1_roi_key("LVL1EnergySumRoI")
-  , m_lvl1_jnc_key("jNOISECUT_MET")
-  , m_lvl1_jrho_key("jXERHO_MET")
-  , m_lvl1_gnc_key("gXENOISECUT_MET")
-  , m_lvl1_grho_key("gXERHO_MET")
-  , m_lvl1_gjwoj_key("gXEJWOJ_MET")
-  , m_lvl1_gpufit_key("gXEPUFIT_MET")
-  , m_hlt_cell_met_key("HLT_MET_cell")
-  , m_hlt_mht_met_key("HLT_MET_mht")
-  , m_hlt_tc_met_key("HLT_MET_tc")
-  , m_hlt_tc_em_met_key("HLT_MET_tc_em")
-  , m_hlt_tcpufit_met_key("HLT_MET_tcpufit")
-  , m_hlt_trkmht_met_key("HLT_MET_trkmht")
-  , m_hlt_pfsum_met_key("HLT_MET_pfsum")
-  , m_hlt_pfsum_cssk_met_key("HLT_MET_pfsum_cssk")
-  , m_hlt_pfsum_vssk_met_key("HLT_MET_pfsum_vssk")
-  , m_hlt_pfopufit_met_key("HLT_MET_pfopufit")
-  , m_hlt_cvfpufit_met_key("HLT_MET_cvfpufit")
-  , m_hlt_mhtpufit_pf_met_key("HLT_MET_mhtpufit_pf_subjesgscIS")
-  , m_hlt_mhtpufit_em_met_key("HLT_MET_mhtpufit_em_subjesgscIS")
   , m_trigDecTool("Trig::TrigDecisionTool/TrigDecisionTool")
 {
-  declareProperty("offline_met_key", m_offline_met_key);
-  declareProperty("hlt_electron_key", m_hlt_electron_key);
-  declareProperty("hlt_muon_key", m_hlt_muon_key);
-  declareProperty("l1_roi_key", m_lvl1_roi_key);
-  declareProperty("l1_jnc_key", m_lvl1_jnc_key);
-  declareProperty("l1_jrho_key", m_lvl1_jrho_key);
-  declareProperty("l1_gnc_key", m_lvl1_gnc_key);
-  declareProperty("l1_grho_key", m_lvl1_grho_key);
-  declareProperty("l1_gjwoj_key", m_lvl1_gjwoj_key);
-  declareProperty("l1_gpufit_key", m_lvl1_gpufit_key);
-  declareProperty("hlt_cell_key", m_hlt_cell_met_key);
-  declareProperty("hlt_mht_key", m_hlt_mht_met_key);
-  declareProperty("hlt_tc_key", m_hlt_tc_met_key);
-  declareProperty("hlt_tc_em_key", m_hlt_tc_em_met_key);
-  declareProperty("hlt_tcpufit_key", m_hlt_tcpufit_met_key);
-  declareProperty("hlt_trkmht_key", m_hlt_trkmht_met_key);
-  declareProperty("hlt_pfsum_key", m_hlt_pfsum_met_key);
-  declareProperty("hlt_pfsum_cssk_key", m_hlt_pfsum_cssk_met_key);
-  declareProperty("hlt_pfsum_vssk_key", m_hlt_pfsum_vssk_met_key);
-  declareProperty("hlt_pfopufit_key", m_hlt_pfopufit_met_key);
-  declareProperty("hlt_cvfpufit_key", m_hlt_cvfpufit_met_key);
-  declareProperty("hlt_mhtpufit_pf_key", m_hlt_mhtpufit_pf_met_key);
-  declareProperty("hlt_mhtpufit_em_key", m_hlt_mhtpufit_em_met_key);
+  declareProperty("offline_met_key", m_offline_met_key = "MET_Reference_AntiKt4EMPFlow");
+  declareProperty("hlt_electron_key", m_hlt_electron_key = "HLT_egamma_Electrons_GSF");
+  declareProperty("hlt_muon_key", m_hlt_muon_key = "HLT_MuonsCB_FS");
+  declareProperty("l1_roi_key", m_lvl1_roi_key = "LVL1EnergySumRoI");
+  declareProperty("l1_jnc_key", m_lvl1_jnc_key = "jNOISECUT_MET");
+  declareProperty("l1_jrho_key", m_lvl1_jrho_key = "jXERHO_MET");
+  declareProperty("l1_gnc_key", m_lvl1_gnc_key = "gXENOISECUT_MET");
+  declareProperty("l1_grho_key", m_lvl1_grho_key = "gXERHO_MET");
+  declareProperty("l1_gjwoj_key", m_lvl1_gjwoj_key = "gXEJWOJ_MET");
+  declareProperty("l1_gpufit_key", m_lvl1_gpufit_key = "gXEPUFIT_MET");
+  declareProperty("hlt_cell_key", m_hlt_cell_met_key = "HLT_MET_cell");
+  declareProperty("hlt_mht_key", m_hlt_mht_met_key = "HLT_MET_mht");
+  declareProperty("hlt_tc_key", m_hlt_tc_met_key = "HLT_MET_tc");
+  declareProperty("hlt_tc_em_key", m_hlt_tc_em_met_key = "HLT_MET_tc_em");
+  declareProperty("hlt_tcpufit_key", m_hlt_tcpufit_met_key = "HLT_MET_tcpufit");
+  declareProperty("hlt_trkmht_key", m_hlt_trkmht_met_key = "HLT_MET_trkmht");
+  declareProperty("hlt_pfsum_key", m_hlt_pfsum_met_key = "HLT_MET_pfsum");
+  declareProperty("hlt_pfsum_cssk_key", m_hlt_pfsum_cssk_met_key = "HLT_MET_pfsum_cssk");
+  declareProperty("hlt_pfsum_vssk_key", m_hlt_pfsum_vssk_met_key = "HLT_MET_pfsum_vssk");
+  declareProperty("hlt_pfopufit_key", m_hlt_pfopufit_met_key = "HLT_MET_pfopufit");
+  declareProperty("hlt_cvfpufit_key", m_hlt_cvfpufit_met_key = "HLT_MET_cvfpufit");
+  declareProperty("hlt_mhtpufit_pf_key", m_hlt_mhtpufit_pf_met_key = "HLT_MET_mhtpufit_pf_subjesgscIS");
+  declareProperty("hlt_mhtpufit_em_key", m_hlt_mhtpufit_em_met_key = "HLT_MET_mhtpufit_em_subjesgscIS");
 
   declareProperty("L1Chain01", m_L1Chain01="L1_XE50");
   declareProperty("L1Chain02", m_L1Chain02="L1_jXENC50");
diff --git a/Trigger/TrigMonitoring/TrigMinBiasMonitoring/python/TrigSPTRKMonitoringMT.py b/Trigger/TrigMonitoring/TrigMinBiasMonitoring/python/TrigSPTRKMonitoringMT.py
index 0132da1640ec8f8afd242002ffcbc2b3196429a2..56229d6fda9724486ac4a03c0b5152265442350a 100644
--- a/Trigger/TrigMonitoring/TrigMinBiasMonitoring/python/TrigSPTRKMonitoringMT.py
+++ b/Trigger/TrigMonitoring/TrigMinBiasMonitoring/python/TrigSPTRKMonitoringMT.py
@@ -11,11 +11,11 @@ def TrigSPTRK(configFlags):
 
     from AthenaMonitoring import AthMonitorCfgHelper
 
-    monConfig = AthMonitorCfgHelper(configFlags, "HLTMinBiasTrkMonAlg")
+    monConfig = AthMonitorCfgHelper(configFlags, "HLTMBSPTRKMonAlg")
 
     from AthenaConfiguration.ComponentFactory import CompFactory
 
-    alg = monConfig.addAlgorithm(CompFactory.HLTMinBiasTrkMonAlg, "HLTMinBiasTrkMonAlg")
+    alg = monConfig.addAlgorithm(CompFactory.HLTMinBiasTrkMonAlg, "HLTMBSPTRKMonAlg")
     trkSel = CompFactory.InDet.InDetTrackSelectionTool(
         "InDetTrackSelectionTool_TightPrimary", CutLevel="TightPrimary"
     )
@@ -26,191 +26,46 @@ def TrigSPTRK(configFlags):
 
     mbEffAllGroup = monConfig.addGroup(alg, "EffAll", topPath="HLT/MinBiasMon/")
     length = len(alg.triggerList)
-    mbEffAllGroup.defineHistogram(
-        "PurityPassed,whichTrigger",
-        type="TH2D",
-        title=";Purity;trigger passed",
-        xbins=2,
-        xmin=0,
-        xmax=2,
-        xlabels=["0 track", ">0 tracks"],
-        ybins=length,
-        ymin=0,
-        ymax=length,
-        ylabels=list(alg.triggerList),
-    )
-    mbEffAllGroup.defineHistogram(
-        "whichTrigger",
-        title="count of triggers;HLT",
-        xbins=length,
-        xmin=0,
-        xmax=length,
-        xlabels=list(alg.triggerList),
-    )
+    mbEffAllGroup.defineHistogram( "PurityPassed,whichTrigger", type="TH2D", title=";Purity;trigger passed", xbins=2, xmin=0, xmax=2, xlabels=["0 track", ">0 tracks"], 
+                                    ybins=length, ymin=0, ymax=length, ylabels=list(alg.triggerList) )
+    mbEffAllGroup.defineHistogram( "whichTrigger", title="count of triggers;HLT", xbins=length, xmin=0, xmax=length, xlabels=list(alg.triggerList) )
 
     for chain in alg.triggerList:
 
         mbEffGroup = monConfig.addGroup(
             alg, chain + "_Tracking", topPath="HLT/MinBiasMon/Tracking/" + chain + "/"
         )
-        mbEffGroup.defineHistogram(
-            "decision,nTrkOffline",
-            type="TEfficiency",
-            title="Efficiency;Offline Good nTrk",
-            xbins=100,
-            xmin=0,
-            xmax=1000,
-        )
-        mbEffGroup.defineHistogram(
-            "decision,nTrkOffline;efficiency_low_mult",
-            type="TEfficiency",
-            title="Efficiency;Offline Good nTrk",
-            xbins=50,
-            xmin=0,
-            xmax=50,
-        )
-        mbEffGroup.defineHistogram(
-            "nTrkRatio",
-            title="Number of tracks reconstructed online/offline;track counts online/offline",
-            xbins=100,
-            xmin=-1,
-            xmax=4,
-        )
-        mbEffGroup.defineHistogram(
-            "decision,nTrk",
-            type="TEfficiency",
-            title="Efficiency (step curve);Online nTrk",
-            xbins=1000,
-            xmin=0,
-            xmax=1000,
-        )
-        # expert plots
-        mbEffGroup.defineHistogram(
-            "trkSelOfflineRatio",
-            path="Expert",
-            title="Number of tracks reconstructed offline(selected)/offline; N sel/all",
-            xbins=100,
-            xmin=-1,
-            xmax=4,
-        )
-        mbEffGroup.defineHistogram(
-            "nTrkOnline,nTrkOffline",
-            type="TH2F",
-            path="Expert",
-            title=";N online tracks;N oflfine tracks",
-            xbins=20,
-            xmin=0,
-            xmax=2000,
-            ybins=20,
-            ymin=0,
-            ymax=2000,
-        )
+
+        mbEffGroup.defineHistogram( "decision,nTrkOffline;efficiencyAnyMult", type="TEfficiency", title="Efficiency;Offline Good nTrk", xbins=100, xmin=0, xmax=400 )
+        mbEffGroup.defineHistogram( "decision,nTrkOffline;efficiencyLowMult", type="TEfficiency", title="Efficiency;Offline Good nTrk", xbins=50, xmin=0, xmax=50 )
+        mbEffGroup.defineHistogram( "nTrkOffline;nTrkOfflineLowMult", title="Number of tracks reconstructed offline;track counts", xbins=50, xmin=-1, xmax=50 )
+
+        mbEffGroup.defineHistogram( "nTrkOffline", title="Number of tracks reconstructed offline;track counts", xbins=100, xmin=-1, xmax=400 )
+        mbEffGroup.defineHistogram( "nTrkOnline;nTrkOnlineLowMult", title="Number of tracks reconstructed online;track counts", xbins=50, xmin=-1, xmax=50 )
+        mbEffGroup.defineHistogram( "nTrkOnline", title="Number of tracks reconstructed online;track counts", xbins=100, xmin=-1, xmax=400 )
+        mbEffGroup.defineHistogram( "nTrkRatio", title="Number of tracks reconstructed online/offline;track counts online/offline", xbins=100, xmin=-1, xmax=4 ) 
+        mbEffGroup.defineHistogram( "decision,nTrkOnline", type="TEfficiency", title="Efficiency (step curve);Online nTrk", xbins=1000, xmin=0, xmax=1000 ) # expert plots
+        mbEffGroup.defineHistogram( "trkSelOfflineRatio", path="Expert", title="Number of tracks reconstructed offline(selected)/offline; N sel/all", xbins=100, xmin=0.1, xmax=1.9 ) 
+        mbEffGroup.defineHistogram( "nTrkOnline,nTrkOffline", type="TH2F", path="Expert", title=";N online tracks;N offline tracks", xbins=20, xmin=0, xmax=400, ybins=20, ymin=0, ymax=400 )
 
         mbSpGroup = monConfig.addGroup(
             alg,
             chain + "_SpacePoints",
-            topPath="HLT/MinBiasMon/SPacePoints/" + chain + "/",
-        )
-        mbSpGroup.defineHistogram(
-            "PixelCL;PixelCLNarrowRange",
-            title="Number of SP in whole Pixels detector for all events",
-            xbins=100,
-            xmin=0,
-            xmax=100,
-        )
-        mbSpGroup.defineHistogram(
-            "PixelCL;PixelCLWideRange",
-            title="Number of SP in whole Pixels detector for all events",
-            xbins=100,
-            xmin=0,
-            xmax=30000,
-        )
-        mbSpGroup.defineHistogram(
-            "PixBarr_SP",
-            title="Number of SP for all events in Barrel",
-            xbins=100,
-            xmin=0,
-            xmax=30000,
-        )
-        mbSpGroup.defineHistogram(
-            "PixECA_SP",
-            title="Number of SP for all events in ECA",
-            xbins=100,
-            xmin=0,
-            xmax=30000,
-        )
-        mbSpGroup.defineHistogram(
-            "PixECC_SP",
-            title="Number of SP for all events in ECC",
-            xbins=100,
-            xmin=0,
-            xmax=30000,
-        )
-        mbSpGroup.defineHistogram(
-            "SctTot",
-            title="Number of SP in whole SCT detector for all events",
-            xbins=100,
-            xmin=0,
-            xmax=120000,
-        )
-        mbSpGroup.defineHistogram(
-            "SctBarr_SP",
-            title="Number of SCT_SP for all events in Barrel",
-            xbins=100,
-            xmin=0,
-            xmax=50000,
-        )
-        mbSpGroup.defineHistogram(
-            "SctECA_SP",
-            title="Number of SCT_SP for all events in ECA",
-            xbins=100,
-            xmin=0,
-            xmax=50000,
-        )
-        mbSpGroup.defineHistogram(
-            "SctECC_SP",
-            title="Number of SCT_SP for all events in ECC",
-            xbins=100,
-            xmin=0,
-            xmax=50000,
-        )
+            topPath="HLT/MinBiasMon/SpacePoints/" + chain + "/",
+        )
+        mbSpGroup.defineHistogram( "PixelCL;PixelCLNarrowRange", title="Number of SP in whole Pixels detector for all events", xbins=100, xmin=0, xmax=100 )
+        mbSpGroup.defineHistogram( "PixelCL;PixelCLWideRange", title="Number of SP in whole Pixels detector for all events", xbins=100, xmin=0, xmax=30000 )
+        mbSpGroup.defineHistogram( "PixBarr_SP", title="Number of SP for all events in Barrel", xbins=100, xmin=0, xmax=30000 )
+        mbSpGroup.defineHistogram( "PixECA_SP", title="Number of SP for all events in ECA", xbins=100, xmin=0, xmax=30000 )
+        mbSpGroup.defineHistogram( "PixECC_SP", title="Number of SP for all events in ECC", xbins=100, xmin=0, xmax=30000 )
+        mbSpGroup.defineHistogram( "SctTot", title="Number of SP in whole SCT detector for all events", xbins=100, xmin=0, xmax=120000 )
+        mbSpGroup.defineHistogram( "SctBarr_SP", title="Number of SCT_SP for all events in Barrel", xbins=100, xmin=0, xmax=50000 )
+        mbSpGroup.defineHistogram( "SctECA_SP", title="Number of SCT_SP for all events in ECA", xbins=100, xmin=0, xmax=50000 )
+        mbSpGroup.defineHistogram( "SctECC_SP", title="Number of SCT_SP for all events in ECC", xbins=100, xmin=0, xmax=50000 )
         # expert plots
-        mbSpGroup.defineHistogram(
-            "SctECA_SP,SctECC_SP",
-            type="TH2F",
-            path="Expert",
-            title="SctECA_SP;SctECC_SP",
-            xbins=100,
-            xmin=0,
-            xmax=100,
-            ybins=100,
-            ymin=0,
-            ymax=100,
-        )
-        mbSpGroup.defineHistogram(
-            "PixECA_SP,PixECC_SP",
-            type="TH2F",
-            path="Expert",
-            title="PixECA_SP;PixECC_SP",
-            xbins=100,
-            xmin=0,
-            xmax=100,
-            ybins=100,
-            ymin=0,
-            ymax=100,
-        )
-        mbSpGroup.defineHistogram(
-            "SctBarr_SP,PixBarr_SP",
-            type="TH2F",
-            path="Expert",
-            title="SctBarr_SP;PixBarr_SP",
-            xbins=100,
-            xmin=0,
-            xmax=100,
-            ybins=100,
-            ymin=0,
-            ymax=100,
-        )
+        mbSpGroup.defineHistogram( "SctECA_SP,SctECC_SP", type="TH2F", title="SctECA_SP;SctECC_SP", xbins=100, xmin=0, xmax=100, ybins=100, ymin=0, ymax=100 )
+        mbSpGroup.defineHistogram( "PixECA_SP,PixECC_SP", type="TH2F", title="PixECA_SP;PixECC_SP", xbins=100, xmin=0, xmax=100, ybins=100, ymin=0, ymax=100 )
+        mbSpGroup.defineHistogram( "SctBarr_SP,PixBarr_SP", type="TH2F", title="SctBarr_SP;PixBarr_SP", xbins=100, xmin=0, xmax=100, ybins=100, ymin=0, ymax=100 )
 
     return monConfig.result()
 
@@ -221,8 +76,6 @@ if __name__ == "__main__":
 
     Configurable.configurableRun3Behavior = 1
 
-    # Setup logs
-    from AthenaCommon.Constants import DEBUG
 
     # Set the Athena configuration flags
     from AthenaConfiguration.AllConfigFlags import ConfigFlags
@@ -232,9 +85,7 @@ if __name__ == "__main__":
     # ConfigFlags.Input.Files = ['/afs/cern.ch/user/s/somadutt/public/testUPC2.AOD.pool.root'] #Local HI-UPC file
 
     # data AOD file
-
-    # ConfigFlags.Input.Files = ['/eos/atlas/atlascerngroupdisk/data-art/build-output/master/Athena/x86_64-centos7-gcc8-opt/2020-05-22T2142/TrigAnalysisTest/test_trigAna_RDOtoT0Mon_mt1_build/AOD.pool.root']
-    ConfigFlags.Input.Files = ["myAOD.pool.root"]
+#    ConfigFlags.Input.Files = ["myAOD.pool.root"]
     # ConfigFlags.Input.isMC = True  #un-Comment this line for MC AOD files, comment for data-AOD files
     ConfigFlags.Output.HISTFileName = "TestMonitorOutput.root"
 
@@ -250,8 +101,8 @@ if __name__ == "__main__":
     cfg.merge(TrigSPTRK(ConfigFlags))
 
     # If you want to turn on more detailed messages ...
-    # cfg.getEventAlgo('HLTMinBiasTrkMonAlg').OutputLevel = 2 # DEBUG #either this line or the next works!!
-    cfg.getEventAlgo("HLTMinBiasTrkMonAlg").OutputLevel = DEBUG  # DEBUG
+    from AthenaCommon.Constants import DEBUG
+    cfg.getEventAlgo("HLTMBSPTRKMonAlg").OutputLevel = DEBUG 
     cfg.printConfig(withDetails=True)  # set True for exhaustive info
     with open("cfg.pkl", "wb") as f:
         cfg.store(f)
diff --git a/Trigger/TrigMonitoring/TrigMinBiasMonitoring/src/HLTMinBiasTrkMonAlg.cxx b/Trigger/TrigMonitoring/TrigMinBiasMonitoring/src/HLTMinBiasTrkMonAlg.cxx
index d378bda3d199e716e03df265aa5fea51adb24c47..5c0d26ebbea5a102179a491aa292a50fdb6f34e2 100644
--- a/Trigger/TrigMonitoring/TrigMinBiasMonitoring/src/HLTMinBiasTrkMonAlg.cxx
+++ b/Trigger/TrigMonitoring/TrigMinBiasMonitoring/src/HLTMinBiasTrkMonAlg.cxx
@@ -131,12 +131,12 @@ StatusCode HLTMinBiasTrkMonAlg::monitorTrkCounts(const EventContext &context) co
     if ( ! (passBits & TrigDefs::EF_prescaled) )
     {
       auto decision = Scalar<int>("decision", trigDecTool->isPassed(trig, TrigDefs::requireDecision) ? 1 : 0);
-      auto nTrk = Scalar("nTrkOnline", trkCountsHandle->at(0)->getDetail<int>("ntrks"));
+      auto nTrkOnline = Scalar("nTrkOnline", trkCountsHandle->at(0)->getDetail<int>("ntrks"));
       auto whichtrigger = Scalar<std::string>("whichTrigger", trig);
 
       double nTrkRatio = offlineTrkHandle->size() > 0 ? static_cast<double>(offlineTrkHandle->size()) / static_cast<double>(trkCountsHandle->at(0)->getDetail<int>("ntrks")) : -1.0;
       auto trkRatio = Scalar("nTrkRatio", nTrkRatio);
-      fill(trig + "_Tracking", nTrkOffline, nAllTrkOffline, decision, whichtrigger, trkRatio, nMBTrkTrkOfflineRatio);
+      fill(trig + "_Tracking", nTrkOffline, nAllTrkOffline, nTrkOnline, decision, whichtrigger, trkRatio, nMBTrkTrkOfflineRatio);
       fill("EffAll", decision, whichtrigger);
     }
 
diff --git a/Trigger/TrigMonitoring/TrigTauMonitoring/python/TrigTauMonitCategory.py b/Trigger/TrigMonitoring/TrigTauMonitoring/python/TrigTauMonitCategory.py
index 607538445c4935ec5aed9ec833041e67a240fa97..1db745a39111dd6cbdc7d698f0335ec184fed513 100644
--- a/Trigger/TrigMonitoring/TrigTauMonitoring/python/TrigTauMonitCategory.py
+++ b/Trigger/TrigMonitoring/TrigTauMonitoring/python/TrigTauMonitCategory.py
@@ -5,8 +5,8 @@ monitoring_singleTau = [
 ]
 
 monitoring_tau = [
-    'tau0_perf_ptonly_L1TAU12',
-    'tau0_perf_ptonly_L1TAU60',
+    'tau0_ptonly_L1TAU8',
+    'tau0_ptonly_L1TAU60',
     'tau25_idperf_track',
     'tau25_idperf_tracktwo',
     'tau25_perf_tracktwo',
diff --git a/Trigger/TrigMonitoring/TrigTauMonitoring/python/TrigTauMonitoringConfig.py b/Trigger/TrigMonitoring/TrigTauMonitoring/python/TrigTauMonitoringConfig.py
index 261714ee6722bef36950cd3f904a392cbeb14920..3173ee194ca4785349a038d5f0b5f263e26e3431 100644
--- a/Trigger/TrigMonitoring/TrigTauMonitoring/python/TrigTauMonitoringConfig.py
+++ b/Trigger/TrigMonitoring/TrigTauMonitoring/python/TrigTauMonitoringConfig.py
@@ -52,8 +52,6 @@ def TrigTauMonitoringTool():
               'tau25_mediumRNN_tracktwoMVABDT_L1TAU12IM',
               'tau25_tightRNN_tracktwoMVA_L1TAU12IM',
               'tau25_tightRNN_tracktwoMVABDT_L1TAU12IM',
-              'tau25_medium1_tracktwoMVA_L1TAU12IM',
-              'tau25_medium1_tracktwoMVABDT_L1TAU12IM',
               'tau35_idperf_tracktwoMVA_L1TAU12IM',
               'tau35_idperf_tracktwoMVABDT_L1TAU12IM',
               'tau35_perf_tracktwoMVA_L1TAU12IM',
@@ -70,8 +68,6 @@ def TrigTauMonitoringTool():
               'tau160_perf_tracktwoMVABDT_L1TAU100',
               'tau160_mediumRNN_tracktwoMVA_L1TAU100',
               'tau160_mediumRNN_tracktwoMVABDT_L1TAU100',
-              'tau160_medium1_tracktwoMVA_L1TAU100',
-              'tau160_medium1_tracktwoMVABDT_L1TAU100',
         ]
 
         RNN_chains = [
@@ -94,8 +90,8 @@ def TrigTauMonitoringTool():
         BDTRNN_chains = [
              'tau0_idperf_tracktwoMVA_L1eTAU12',
              'tau0_idperf_tracktwoMVA_L1eTAU5',
-             'tau0_perf_ptonly_L1TAU12',
-             'tau0_perf_ptonly_L1TAU60',
+             'tau0_ptonly_L1TAU8',
+             'tau0_ptonly_L1TAU60',
              'tau25_ptonly_L1TAU12IM',
              'tau25_idperf_track_L1TAU12IM',
              'tau25_idperf_tracktwo_L1TAU12IM',
diff --git a/Trigger/TrigMonitoring/TrigTauMonitoring/src/HLTTauMonTool.cxx b/Trigger/TrigMonitoring/TrigTauMonitoring/src/HLTTauMonTool.cxx
index 86d609a8e073911d1c7d27d937ddce9661532147..0e68f3a2cc096507a2ce54eb888527c679f46523 100644
--- a/Trigger/TrigMonitoring/TrigTauMonitoring/src/HLTTauMonTool.cxx
+++ b/Trigger/TrigMonitoring/TrigTauMonitoring/src/HLTTauMonTool.cxx
@@ -1003,8 +1003,25 @@ StatusCode HLTTauMonTool::fillHistogramsForItem(const std::string & trigItem, co
           ATH_CHECK(fillPreselTau(*tauJetEL));
           setCurrentMonGroup("HLT/TauMon/Expert/"+trigItemShort+"/PrecisionVsOffline");
           ATH_CHECK(fillPreselTauVsOffline(*tauJetEL,goodTauRefType));
+
+          if(*tauJetEL) sc = fillEFTau(*tauJetEL, trigItem, "basicVars", monRNN, monBDT);
+          if (monBDT) {
+            if(*tauJetEL) sc = fillEFTau(*tauJetEL, trigItem, "1p_NonCorr", monRNN, monBDT);
+            if(*tauJetEL) sc = fillEFTau(*tauJetEL, trigItem, "mp_NonCorr", monRNN, monBDT);
+          }
+          if(!sc.isSuccess()){ ATH_MSG_WARNING("Failed to Fill BDT input histograms for fillEFTau(). Exiting!"); return sc;}
+
+          if(m_truth) if(*tauJetEL) sc = fillEFTauVsTruth(*tauJetEL, trigItem);
+          if(*tauJetEL) sc = fillEFTauVsOffline(*tauJetEL, trigItem, "basicVars", goodTauRefType);
+          if (monBDT) {
+            if(*tauJetEL) sc = fillEFTauVsOffline(*tauJetEL, trigItem, "1p_NonCorr", goodTauRefType);
+            if(*tauJetEL) sc = fillEFTauVsOffline(*tauJetEL, trigItem, "mp_NonCorr", goodTauRefType);
+          }
+          if(!sc.isSuccess()){ ATH_MSG_WARNING("Failed to Fill histograms for fillEFTauVsOffline(). Exiting!"); return sc;}
+
         } // end comb loop
 
+
         const std::vector< TrigCompositeUtils::LinkInfo<xAOD::TauJetContainer> > featuresMerged
            = getTDT()->features<xAOD::TauJetContainer>( trig_item_EF, m_HLTTriggerCondition, "HLT_TrigTauRecMerged_MVA");    
 
@@ -1020,12 +1037,13 @@ StatusCode HLTTauMonTool::fillHistogramsForItem(const std::string & trigItem, co
           }
           const ElementLink<xAOD::TauJetContainer> tauJetEL = tauJetLinkInfo.link;
           if(!Selection(*tauJetEL)) continue;
+
+          setCurrentMonGroup("HLT/TauMon/Expert/"+trigItemShort+"/PrecisionTau");
+          ATH_CHECK(fillPreselTau(*tauJetEL));
+          setCurrentMonGroup("HLT/TauMon/Expert/"+trigItemShort+"/PrecisionVsOffline");
+          ATH_CHECK(fillPreselTauVsOffline(*tauJetEL,goodTauRefType));
+
 	  if(*tauJetEL) sc = fillEFTau(*tauJetEL, trigItem, "basicVars", monRNN, monBDT);
-	  if (monBDT) {
-	    if(*tauJetEL) sc = fillEFTau(*tauJetEL, trigItem, "1p_NonCorr", monRNN, monBDT);
-	    if(*tauJetEL) sc = fillEFTau(*tauJetEL, trigItem, "mp_NonCorr", monRNN, monBDT);
-	  }
-	  if(!sc.isSuccess()){ ATH_MSG_WARNING("Failed to Fill BDT input histograms for fillEFTau(). Exiting!"); return sc;}
 	  if(monRNN) {
 	    if(*tauJetEL) sc = fillEFTau(*tauJetEL, trigItem, "RNN_inScalar_1P", monRNN, monBDT);
 	    if(*tauJetEL) sc = fillEFTau(*tauJetEL, trigItem, "RNN_inScalar_3P", monRNN, monBDT);
@@ -1036,10 +1054,6 @@ StatusCode HLTTauMonTool::fillHistogramsForItem(const std::string & trigItem, co
 	  }
 	  if(m_truth) if(*tauJetEL) sc = fillEFTauVsTruth(*tauJetEL, trigItem);
 	  if(*tauJetEL) sc = fillEFTauVsOffline(*tauJetEL, trigItem, "basicVars", goodTauRefType);
-	  if (monBDT) {
-	    if(*tauJetEL) sc = fillEFTauVsOffline(*tauJetEL, trigItem, "1p_NonCorr", goodTauRefType);
-	    if(*tauJetEL) sc = fillEFTauVsOffline(*tauJetEL, trigItem, "mp_NonCorr", goodTauRefType);
-	  }
 	  if(!sc.isSuccess()){ ATH_MSG_WARNING("Failed to Fill histograms for fillEFTauVsOffline(). Exiting!"); return sc;}
 	  
         } // end comb loop
diff --git a/Trigger/TrigMonitoring/TrigTauMonitoring/src/HLTTauMonTool_bookHistograms.cxx b/Trigger/TrigMonitoring/TrigTauMonitoring/src/HLTTauMonTool_bookHistograms.cxx
index c909317ce337771642728399318579cfbebb30de..b4ce756e433d6bf4582437eb1f075c0e313092ca 100644
--- a/Trigger/TrigMonitoring/TrigTauMonitoring/src/HLTTauMonTool_bookHistograms.cxx
+++ b/Trigger/TrigMonitoring/TrigTauMonitoring/src/HLTTauMonTool_bookHistograms.cxx
@@ -105,23 +105,21 @@ void HLTTauMonTool::bookHistogramsForItem(const std::string & trigItem){
   //  Precision Tau
   //--------------------
 
-  if(trigItem.find("tracktwoMVA")==string::npos && trigItem.find("tracktwoEF")==string::npos) {
-    addMonGroup(new MonGroup(this,"HLT/TauMon/Expert/"+trigItemShort+"/PrecisionTau",run));
-    setCurrentMonGroup("HLT/TauMon/Expert/"+trigItemShort+"/PrecisionTau");
-    addHistogram(new TH1F("hEFEt","EF Et;E_{T}[GeV];Nevents",40,0.0,100.0));
-    addHistogram(new TH1F("hEFEt2","EF Et;E_{T}[GeV];Nevents",100,0.0,1000.0));
-    addHistogram(new TH1F("hFTFnTrack","EF number of tracks;number of tracks;Nevents",10,0,10));
-    addHistogram(new TH1F("hEta","EF TrigCaloCluster Eta; #eta ; Nevents",26,-2.6,2.6));
-    addHistogram(new TH1F("hPhi","EF TrigCaloCluster Phi; #phi ; Nevents",32,-3.2,3.2));
-    addHistogram(new TH2F("hEFEtaVsPhi","EF TrigCaloCluster Eta vs Phi; #eta ; #phi ; Nevents",
+  addMonGroup(new MonGroup(this,"HLT/TauMon/Expert/"+trigItemShort+"/PrecisionTau",run));
+  setCurrentMonGroup("HLT/TauMon/Expert/"+trigItemShort+"/PrecisionTau");
+  addHistogram(new TH1F("hEFEt","EF Et;E_{T}[GeV];Nevents",40,0.0,100.0));
+  addHistogram(new TH1F("hEFEt2","EF Et;E_{T}[GeV];Nevents",100,0.0,1000.0));
+  addHistogram(new TH1F("hFTFnTrack","EF number of tracks;number of tracks;Nevents",10,0,10));
+  addHistogram(new TH1F("hEta","EF TrigCaloCluster Eta; #eta ; Nevents",26,-2.6,2.6));
+  addHistogram(new TH1F("hPhi","EF TrigCaloCluster Phi; #phi ; Nevents",32,-3.2,3.2));
+  addHistogram(new TH2F("hEFEtaVsPhi","EF TrigCaloCluster Eta vs Phi; #eta ; #phi ; Nevents",
                           26,-2.6,2.6,32,-3.2,3.2));
-    addHistogram(new TH2F("hEtVsEta","Et from tau Jet vs #eta; #eta^{EF}; Raw E_{T}[GeV]",
+  addHistogram(new TH2F("hEtVsEta","Et from tau Jet vs #eta; #eta^{EF}; Raw E_{T}[GeV]",
                           26,-2.6,2.6,40,0.0,100.0));
-    addHistogram(new TH2F("hEtVsPhi","Et from tau Jet vs #phi; #phi^{EF}; Raw E_{T} [GeV]",
+  addHistogram(new TH2F("hEtVsPhi","Et from tau Jet vs #phi; #phi^{EF}; Raw E_{T} [GeV]",
                           32,-3.2,3.2,40,0.0,100.0));
-    addHistogram(new TH1F("hFTFnWideTrack","EF number of wide tracks;number of tracks;Nevents",10,0,10));
-  }
-
+  addHistogram(new TH1F("hFTFnWideTrack","EF number of wide tracks;number of tracks;Nevents",10,0,10));
+  
   //--------------------
   // EF
   //--------------------
@@ -330,15 +328,13 @@ void HLTTauMonTool::bookHistogramsForItem(const std::string & trigItem){
   //--------------------
   //  Precision vs Offline
   //--------------------
-  if(trigItem.find("tracktwoMVA")==string::npos && trigItem.find("tracktwoEF")==string::npos) {  
-    addMonGroup(new MonGroup(this,"HLT/TauMon/Expert/"+trigItemShort+"/PrecisionVsOffline",run));
-    setCurrentMonGroup("HLT/TauMon/Expert/"+trigItemShort+"/PrecisionVsOffline");
-    addHistogram(new TH2F("hPreselvsOffnTrks","nTrks at FTF vs Off; nTrks off; nTrks FTF",10,0,10,10,0,10));
-    addHistogram(new TH2F("hPreselvsOffnWideTrks","nWideTrks at FTF vs Off; nWideTrks off; nWideTrks FTF",10,0,10,10,0,10));
-    addHistogram(new TH1F("hEFEtRatio","FTF-Offline Et Relative difference; Et relative diff; Et relative diff",50,-0.3,0.3));
-    addHistogram(new TH1F("hEtaRatio","FTF-Offline Eta Relative difference; Eta relative diff; Eta relative diff",50,-0.3,0.3));
-    addHistogram(new TH1F("hPhiRatio","FTF-Offline Phi Relative difference; Phi relative diff; Phi relative diff",50,-0.05,0.05));
-  }
+  addMonGroup(new MonGroup(this,"HLT/TauMon/Expert/"+trigItemShort+"/PrecisionVsOffline",run));
+  setCurrentMonGroup("HLT/TauMon/Expert/"+trigItemShort+"/PrecisionVsOffline");
+  addHistogram(new TH2F("hPreselvsOffnTrks","nTrks at FTF vs Off; nTrks off; nTrks FTF",10,0,10,10,0,10));
+  addHistogram(new TH2F("hPreselvsOffnWideTrks","nWideTrks at FTF vs Off; nWideTrks off; nWideTrks FTF",10,0,10,10,0,10));
+  addHistogram(new TH1F("hEFEtRatio","FTF-Offline Et Relative difference; Et relative diff; Et relative diff",50,-0.3,0.3));
+  addHistogram(new TH1F("hEtaRatio","FTF-Offline Eta Relative difference; Eta relative diff; Eta relative diff",50,-0.3,0.3));
+  addHistogram(new TH1F("hPhiRatio","FTF-Offline Phi Relative difference; Phi relative diff; Phi relative diff",50,-0.05,0.05));
 
   if(m_truth){
     //----------------
diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/ExclusiveJets.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/ExclusiveJets.cxx
index f58d5d7486e51948e8117bbdb9c882b231bdf71b..d9f40ed0e019653a9f93c2c9ed5b900cfee47dad 100644
--- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/ExclusiveJets.cxx
+++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/ExclusiveJets.cxx
@@ -20,6 +20,7 @@
 #include "L1TopoAlgorithms/ExclusiveJets.h"
 #include "L1TopoCommon/Exception.h"
 #include "L1TopoInterfaces/Decision.h"
+#include "L1TopoSimulationUtils/Kinematics.h"
 
 REGISTER_ALG_TCS(ExclusiveJets)
 
@@ -113,8 +114,8 @@ TCS::ExclusiveJets::processBitCorrect( const std::vector<TCS::TOBArray const *>
 	      
 	      //In the ticket ATR-17320, pT_offline were defined as A*pT_L1+B, where A=1.4 and B=20 for run2
 	      //A and B definition might change according to run3 configuration.               
-	      double xi_1 = (1.4*parType_t((*tob1)->Et())+20.)*exp((*tob1)->etaDouble())+(1.4*parType_t((*tob2)->Et())+20.)*exp((*tob2)->etaDouble());
-	      double xi_2 = (1.4*parType_t((*tob1)->Et())+20.)*exp(-1.*(*tob1)->etaDouble())+(1.4*parType_t((*tob2)->Et())+20.)*exp(-1.*(*tob2)->etaDouble());
+	      unsigned int xi_1 = TSU::Kinematics::calcXi1(*tob1,*tob2);
+	      unsigned int xi_2 = TSU::Kinematics::calcXi2(*tob1,*tob2);
 	      
 	      const int eta1 = (*tob1)->eta();
 	      const int eta2 = (*tob2)->eta();
diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/KalmanMETCorrection.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/KalmanMETCorrection.cxx
index 8e45d09f06f0922ab49e4bfd05d9a55f17e92511..300ab4ea8ad870245a5e6547f2cfce2e531869b9 100644
--- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/KalmanMETCorrection.cxx
+++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/KalmanMETCorrection.cxx
@@ -16,6 +16,7 @@
 #include "L1TopoCommon/Exception.h"
 #include "L1TopoInterfaces/Decision.h"
 #include "L1TopoSimulationUtils/KFLUT.h"
+#include "L1TopoSimulationUtils/Kinematics.h"
 // Bitwise implementation utils
 #include "L1TopoSimulationUtils/L1TopoDataTypes.h"
 #include "L1TopoSimulationUtils/Trigo.h"
@@ -24,8 +25,6 @@
 
 REGISTER_ALG_TCS(KalmanMETCorrection)
 
-using namespace std;
-
 TCS::KalmanMETCorrection::KalmanMETCorrection(const std::string & name) : DecisionAlg(name)
 {
    defineParameter("InputWidth", 9);
@@ -107,11 +106,19 @@ TCS::KalmanMETCorrection::processBitCorrect( const std::vector<TCS::TOBArray con
        corrfactor = LUTobj.getcorrKF(ipt,jeta);   
 
        // This part of the code has to be reviewed again for phase1 BW simulation
-       auto cosphi = TSU::L1TopoDataTypes<9,7>(TSU::Trigo::Cos.at(/*abs*/(parType_t((*tob)->phi()))));
-       auto sinphi = TSU::L1TopoDataTypes<9,7>(TSU::Trigo::Sin.at(/*abs*/(parType_t((*tob)->phi()))));
-
-       summetx += (-1.)*(*tob)->Et()*float(cosphi)*corrfactor ;
-       summety += (-1.)*(*tob)->Et()*float(sinphi)*corrfactor ;
+       float cosphi;
+       float sinphi;
+       if (isLegacyTopo()){
+	 cosphi = TSU::Kinematics::calcCosLegacy((*tob)->phi());
+	 sinphi = TSU::Kinematics::calcSinLegacy((*tob)->phi());
+       }
+       else {
+	 cosphi = TSU::Kinematics::calcCos((*tob)->phi());
+	 sinphi = TSU::Kinematics::calcSin((*tob)->phi());
+       }
+
+       summetx += (-1.)*(*tob)->Et()*cosphi*corrfactor ;
+       summety += (-1.)*(*tob)->Et()*sinphi*corrfactor ;
             
 
         TRG_MSG_DEBUG("corr  " << corrfactor);
@@ -123,7 +130,7 @@ TCS::KalmanMETCorrection::processBitCorrect( const std::vector<TCS::TOBArray con
    
    KFmet = sqrt(summetx*summetx + summety*summety);
 
-   if (KFmet > 0 ) KFmetphi= TSU::Trigo::atan2(summetx,summety);
+   if (KFmet > 0 ) KFmetphi=isLegacyTopo()?TSU::Trigo::atan2leg(summetx,summety):TSU::Trigo::atan2(summetx,summety);
 
    for(unsigned int i=0; i<numberOutputBits(); ++i) {
 
diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/MetSort.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/MetSort.cxx
index b1cf1c6774eed18ccd30569860815e17360f0079..27e18aacd2e1b8c99c22060036eefce8664ba311 100644
--- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/MetSort.cxx
+++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/MetSort.cxx
@@ -49,7 +49,7 @@ TCS::MetSort::sortBitCorrect(const InputTOBArray & input, TOBArray & output) {
 
    const MetTOBArray & mets = dynamic_cast<const MetTOBArray&>(input);
    int missingET = quadraticSumBW(mets[0].Ex(), mets[0].Ey());
-   int metphi = TSU::Trigo::atan2(mets[0].Ex(),mets[0].Ey());
+   int metphi = isLegacyTopo()?TSU::Trigo::atan2leg(mets[0].Ex(),mets[0].Ey()):TSU::Trigo::atan2(mets[0].Ex(),mets[0].Ey());
 
    TRG_MSG_DEBUG("MET phi values " << metphi << " " );
    output.push_back( GenericTOB( missingET, 0, metphi ) );
diff --git a/Trigger/TrigT1/L1Topo/L1TopoCoreSim/src/test/TopoStandAlone.cxx b/Trigger/TrigT1/L1Topo/L1TopoCoreSim/src/test/TopoStandAlone.cxx
index 3a0013fe0590a835fa358fab4cd47fa5449e2c3c..e00b12928979079cda5d612c5b6c9ab730c285d5 100644
--- a/Trigger/TrigT1/L1Topo/L1TopoCoreSim/src/test/TopoStandAlone.cxx
+++ b/Trigger/TrigT1/L1Topo/L1TopoCoreSim/src/test/TopoStandAlone.cxx
@@ -101,7 +101,7 @@ int run(int argc, const char* argv[]) {
    // read the menu
    TrigConf::L1Menu l1menu;
    TrigConf::JsonFileLoader fileLoader;
-fileLoader.loadFile(argv[1], l1menu);
+   fileLoader.loadFile(argv[1], l1menu);
 
 
    //TFile *f = new TFile(argc>=4 ? argv[3] : "L1TopoSimulation.root","RECREATE");
@@ -122,7 +122,8 @@ fileLoader.loadFile(argv[1], l1menu);
 
    // instantiate steering
    TCS::TopoSteering steering;
-   steering.setUseBitwise(false);
+   steering.setUseBitwise(true);
+   steering.setLegacyMode(false);
    steering.setupFromConfiguration(l1menu);
 
    steering.setMsgLevel( msgLvl );
diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/L1TopoSimulationUtils/Expo.h b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/L1TopoSimulationUtils/Expo.h
new file mode 100644
index 0000000000000000000000000000000000000000..d3c074c59064213de1b43784b4aa0d731b6c9271
--- /dev/null
+++ b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/L1TopoSimulationUtils/Expo.h
@@ -0,0 +1,18 @@
+/*
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef EXPO_H
+#define EXPO_H
+
+#include <string>
+#include <vector>
+#include <unordered_map>
+#include "L1TopoSimulationUtils/L1TopoDataTypes.h"
+
+namespace TSU {
+  struct Expo{
+    static const std::unordered_map<int,std::string> E;
+  };
+}
+#endif
diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/L1TopoSimulationUtils/Hyperbolic.h b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/L1TopoSimulationUtils/Hyperbolic.h
index 926d789e1a52eff3727a2755d9c1791b86144d75..b5fba43e708ffa7ddec74af92cf8b30f633c0144 100644
--- a/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/L1TopoSimulationUtils/Hyperbolic.h
+++ b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/L1TopoSimulationUtils/Hyperbolic.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 /*********************************
  * Hyperbolic.h
@@ -15,11 +15,13 @@
 
 #include <string>
 #include <vector>
+#include <unordered_map>
 #include "L1TopoSimulationUtils/L1TopoDataTypes.h"
 
 namespace TSU {
    struct Hyperbolic{
-       static const std::vector<std::string> Cosh;
+     static const std::unordered_map<unsigned,std::string> Coshleg;
+     static const std::unordered_map<unsigned,std::string> Cosh;
    };
 }
 #endif
diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/L1TopoSimulationUtils/Kinematics.h b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/L1TopoSimulationUtils/Kinematics.h
index 39d99a165fc7fdcd5402d95a30baa29b0f12a140..feeae1d4e7b0f7cef31d7212e1e32cf1e6a98899 100644
--- a/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/L1TopoSimulationUtils/Kinematics.h
+++ b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/L1TopoSimulationUtils/Kinematics.h
@@ -22,12 +22,18 @@ namespace TSU {
 	static unsigned int calcInvMassBWLegacy(const TCS::GenericTOB* tob1, const TCS::GenericTOB* tob2);
 	static unsigned int calcTMassBWLegacy(const TCS::GenericTOB* tob1, const TCS::GenericTOB* tob2);
 	static unsigned int calcDeltaR2BWLegacy(const TCS::GenericTOB* tob1, const TCS::GenericTOB* tob2);
+	static float calcCosLegacy(unsigned phi);
+	static float calcSinLegacy(unsigned phi);
 	static unsigned int calcDeltaPhiBW(const TCS::GenericTOB* tob1, const TCS::GenericTOB* tob2);		
 	static unsigned int calcDeltaEtaBW(const TCS::GenericTOB* tob1, const TCS::GenericTOB* tob2);
 
 	static unsigned int calcInvMassBW(const TCS::GenericTOB* tob1, const TCS::GenericTOB* tob2);
 	static unsigned int calcTMassBW(const TCS::GenericTOB* tob1, const TCS::GenericTOB* tob2);
 	static unsigned int calcDeltaR2BW(const TCS::GenericTOB* tob1, const TCS::GenericTOB* tob2);
+	static unsigned int calcXi1(const TCS::GenericTOB* tob1, const TCS::GenericTOB* tob2);
+	static unsigned int calcXi2(const TCS::GenericTOB* tob1, const TCS::GenericTOB* tob2);
+	static float calcCos(unsigned phi);
+	static float calcSin(unsigned phi);
      /**
         @brief compute the sum in quadrature of two ints
 
diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/L1TopoSimulationUtils/Trigo.h b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/L1TopoSimulationUtils/Trigo.h
index 846f4c4ff19d0b176cdf8f7e717678e070bd1da9..f762b2a30e0d5f89afe227d27c29da1b0a1acfc8 100644
--- a/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/L1TopoSimulationUtils/Trigo.h
+++ b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/L1TopoSimulationUtils/Trigo.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 /*********************************
  * Trigo.h
@@ -15,13 +15,17 @@
 
 #include <string>
 #include <vector>
+#include <unordered_map>
 #include "L1TopoDataTypes.h"
 
 namespace TSU {
    struct Trigo{
-      static const std::vector<std::string> Cos;
-      static const std::vector<std::string> Sin;
-      static int atan2(TSU::L1TopoDataTypes<16,0> x, TSU::L1TopoDataTypes<16,0> y);
+     static const std::unordered_map<unsigned,std::string> Cosleg;
+     static const std::unordered_map<unsigned,std::string> Sinleg;
+     static const std::unordered_map<unsigned,std::string> Cos;
+     static const std::unordered_map<unsigned,std::string> Sin;
+     static int atan2leg(TSU::L1TopoDataTypes<16,0> x, TSU::L1TopoDataTypes<16,0> y);
+     static int atan2(TSU::L1TopoDataTypes<16,0> x, TSU::L1TopoDataTypes<16,0> y);
    };
 }
 #endif
diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/Expo.cxx b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/Expo.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..c81b744d1376bc82c2c616d8702adac49f04393c
--- /dev/null
+++ b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/Expo.cxx
@@ -0,0 +1,522 @@
+/*
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "L1TopoSimulationUtils/Expo.h"
+//extra comment
+// 10 integer bit(s) 10 decimal bit(s); (512 entries)
+const std::unordered_map<int,std::string> TSU::Expo::E =
+  {
+   {-6400,"00000000000000000010"}, // value = 0.001661557273173934(0.001953125),	 argument value = -6.4
+   {-6375,"00000000000000000010"}, // value = 0.001703619795802574(0.001953125),	 argument value = -6.375
+   {-6350,"00000000000000000010"}, // value = 0.0017467471362611182(0.001953125),	 argument value = -6.3500000000000005
+   {-6325,"00000000000000000010"}, // value = 0.0017909662505412698(0.001953125),	 argument value = -6.325
+   {-6300,"00000000000000000010"}, // value = 0.0018363047770289056(0.001953125),	 argument value = -6.300000000000001
+   {-6275,"00000000000000000010"}, // value = 0.0018827910537789773(0.001953125),	 argument value = -6.275
+   {-6250,"00000000000000000010"}, // value = 0.0019304541362277093(0.001953125),	 argument value = -6.25
+   {-6225,"00000000000000000010"}, // value = 0.001979323815353195(0.001953125),	 argument value = -6.2250000000000005
+   {-6200,"00000000000000000010"}, // value = 0.002029430636295734(0.001953125),	 argument value = -6.2
+   {-6175,"00000000000000000010"}, // value = 0.0020808059174495276(0.001953125),	 argument value = -6.175000000000001
+   {-6150,"00000000000000000010"}, // value = 0.002133481770037708(0.001953125),	 argument value = -6.15
+   {-6125,"00000000000000000010"}, // value = 0.002187491118182885(0.001953125),	 argument value = -6.125
+   {-6100,"00000000000000000010"}, // value = 0.002242867719485801(0.001953125),	 argument value = -6.1000000000000005
+   {-6075,"00000000000000000010"}, // value = 0.002299646186124936(0.001953125),	 argument value = -6.075
+   {-6050,"00000000000000000010"}, // value = 0.0023578620064902307(0.001953125),	 argument value = -6.050000000000001
+   {-6025,"00000000000000000010"}, // value = 0.0024175515673645035(0.001953125),	 argument value = -6.025
+   {-6000,"00000000000000000011"}, // value = 0.0024787521766663585(0.0029296875),	 argument value = -6.0
+   {-5975,"00000000000000000011"}, // value = 0.002541502086768856(0.0029296875),	 argument value = -5.9750000000000005
+   {-5950,"00000000000000000011"}, // value = 0.0026058405184084983(0.0029296875),	 argument value = -5.95
+   {-5925,"00000000000000000011"}, // value = 0.002671807685199448(0.0029296875),	 argument value = -5.925000000000001
+   {-5900,"00000000000000000011"}, // value = 0.0027394448187683684(0.0029296875),	 argument value = -5.9
+   {-5875,"00000000000000000011"}, // value = 0.0028087941945255128(0.0029296875),	 argument value = -5.875
+   {-5850,"00000000000000000011"}, // value = 0.0028798991580882404(0.0029296875),	 argument value = -5.8500000000000005
+   {-5825,"00000000000000000011"}, // value = 0.0029528041523734466(0.0029296875),	 argument value = -5.825
+   {-5800,"00000000000000000011"}, // value = 0.0030275547453758127(0.0029296875),	 argument value = -5.800000000000001
+   {-5775,"00000000000000000011"}, // value = 0.0031041976586493087(0.0029296875),	 argument value = -5.775
+   {-5750,"00000000000000000011"}, // value = 0.003182780796509667(0.0029296875),	 argument value = -5.75
+   {-5725,"00000000000000000011"}, // value = 0.0032633532759761452(0.0029296875),	 argument value = -5.7250000000000005
+   {-5700,"00000000000000000011"}, // value = 0.003345965457471272(0.0029296875),	 argument value = -5.7
+   {-5675,"00000000000000000100"}, // value = 0.0034306689762977315(0.00390625),	 argument value = -5.675000000000001
+   {-5650,"00000000000000000100"}, // value = 0.0035175167749121284(0.00390625),	 argument value = -5.65
+   {-5625,"00000000000000000100"}, // value = 0.0036065631360157305(0.00390625),	 argument value = -5.625
+   {-5600,"00000000000000000100"}, // value = 0.003697863716482929(0.00390625),	 argument value = -5.6000000000000005
+   {-5575,"00000000000000000100"}, // value = 0.003791475582148608(0.00390625),	 argument value = -5.575
+   {-5550,"00000000000000000100"}, // value = 0.003887457243476127(0.00390625),	 argument value = -5.550000000000001
+   {-5525,"00000000000000000100"}, // value = 0.0039858686921282905(0.00390625),	 argument value = -5.525
+   {-5500,"00000000000000000100"}, // value = 0.004086771438464067(0.00390625),	 argument value = -5.5
+   {-5475,"00000000000000000100"}, // value = 0.004190228549984576(0.00390625),	 argument value = -5.4750000000000005
+   {-5450,"00000000000000000100"}, // value = 0.00429630469075234(0.00390625),	 argument value = -5.45
+   {-5425,"00000000000000000101"}, // value = 0.004405066161808402(0.0048828125),	 argument value = -5.425000000000001
+   {-5400,"00000000000000000101"}, // value = 0.004516580942612666(0.0048828125),	 argument value = -5.4
+   {-5375,"00000000000000000101"}, // value = 0.004630918733533246(0.0048828125),	 argument value = -5.375
+   {-5350,"00000000000000000101"}, // value = 0.004748150999411473(0.0048828125),	 argument value = -5.3500000000000005
+   {-5325,"00000000000000000101"}, // value = 0.004868351014229763(0.0048828125),	 argument value = -5.325
+   {-5300,"00000000000000000101"}, // value = 0.004991593906910213(0.0048828125),	 argument value = -5.300000000000001
+   {-5275,"00000000000000000101"}, // value = 0.005117956708272651(0.0048828125),	 argument value = -5.275
+   {-5250,"00000000000000000101"}, // value = 0.005247518399181385(0.0048828125),	 argument value = -5.25
+   {-5225,"00000000000000000110"}, // value = 0.005380359959910816(0.005859375),	 argument value = -5.2250000000000005
+   {-5200,"00000000000000000110"}, // value = 0.0055165644207607716(0.005859375),	 argument value = -5.2
+   {-5175,"00000000000000000110"}, // value = 0.005656216913953104(0.005859375),	 argument value = -5.175000000000001
+   {-5150,"00000000000000000110"}, // value = 0.005799404726842141(0.005859375),	 argument value = -5.15
+   {-5125,"00000000000000000110"}, // value = 0.005946217356472094(0.005859375),	 argument value = -5.125
+   {-5100,"00000000000000000110"}, // value = 0.006096746565515633(0.005859375),	 argument value = -5.1000000000000005
+   {-5075,"00000000000000000110"}, // value = 0.006251086439628561(0.005859375),	 argument value = -5.075
+   {-5050,"00000000000000000111"}, // value = 0.006409333446256377(0.0068359375),	 argument value = -5.050000000000001
+   {-5025,"00000000000000000111"}, // value = 0.006571586494929613(0.0068359375),	 argument value = -5.025
+   {-5000,"00000000000000000111"}, // value = 0.006737946999085467(0.0068359375),	 argument value = -5.0
+   {-4975,"00000000000000000111"}, // value = 0.006908518939454525(0.0068359375),	 argument value = -4.9750000000000005
+   {-4950,"00000000000000000111"}, // value = 0.0070834089290521185(0.0068359375),	 argument value = -4.95
+   {-4925,"00000000000000000111"}, // value = 0.0072627262798148845(0.0068359375),	 argument value = -4.925000000000001
+   {-4900,"00000000000000001000"}, // value = 0.007446583070924338(0.0078125),	 argument value = -4.9
+   {-4875,"00000000000000001000"}, // value = 0.007635094218859962(0.0078125),	 argument value = -4.875
+   {-4850,"00000000000000001000"}, // value = 0.007828377549225767(0.0078125),	 argument value = -4.8500000000000005
+   {-4825,"00000000000000001000"}, // value = 0.008026553870395154(0.0078125),	 argument value = -4.825
+   {-4800,"00000000000000001000"}, // value = 0.008229747049020023(0.0078125),	 argument value = -4.800000000000001
+   {-4775,"00000000000000001001"}, // value = 0.00843808408745153(0.0087890625),	 argument value = -4.775
+   {-4750,"00000000000000001001"}, // value = 0.008651695203120634(0.0087890625),	 argument value = -4.75
+   {-4725,"00000000000000001001"}, // value = 0.008870713909928251(0.0087890625),	 argument value = -4.7250000000000005
+   {-4700,"00000000000000001001"}, // value = 0.009095277101695816(0.0087890625),	 argument value = -4.7
+   {-4675,"00000000000000001010"}, // value = 0.009325525137728318(0.009765625),	 argument value = -4.675000000000001
+   {-4650,"00000000000000001010"}, // value = 0.009561601930543505(0.009765625),	 argument value = -4.65
+   {-4625,"00000000000000001010"}, // value = 0.009803655035821828(0.009765625),	 argument value = -4.625
+   {-4600,"00000000000000001010"}, // value = 0.010051835744633576(0.009765625),	 argument value = -4.6000000000000005
+   {-4575,"00000000000000001011"}, // value = 0.01030629917800074(0.0107421875),	 argument value = -4.575
+   {-4550,"00000000000000001011"}, // value = 0.010567204383852646(0.0107421875),	 argument value = -4.550000000000001
+   {-4525,"00000000000000001011"}, // value = 0.010834714436436152(0.0107421875),	 argument value = -4.525
+   {-4500,"00000000000000001011"}, // value = 0.011108996538242306(0.0107421875),	 argument value = -4.5
+   {-4475,"00000000000000001100"}, // value = 0.011390222124513367(0.01171875),	 argument value = -4.4750000000000005
+   {-4450,"00000000000000001100"}, // value = 0.011678566970395442(0.01171875),	 argument value = -4.45
+   {-4425,"00000000000000001100"}, // value = 0.011974211300803611(0.01171875),	 argument value = -4.425000000000001
+   {-4400,"00000000000000001101"}, // value = 0.012277339903068436(0.0126953125),	 argument value = -4.4
+   {-4375,"00000000000000001101"}, // value = 0.012588142242433998(0.0126953125),	 argument value = -4.375
+   {-4350,"00000000000000001101"}, // value = 0.012906812580479873(0.0126953125),	 argument value = -4.35
+   {-4325,"00000000000000001110"}, // value = 0.013233550096540928(0.013671875),	 argument value = -4.325
+   {-4300,"00000000000000001110"}, // value = 0.013568559012200922(0.013671875),	 argument value = -4.300000000000001
+   {-4275,"00000000000000001110"}, // value = 0.01391204871893762(0.013671875),	 argument value = -4.275
+   {-4250,"00000000000000001111"}, // value = 0.014264233908999256(0.0146484375),	 argument value = -4.25
+   {-4225,"00000000000000001111"}, // value = 0.014625334709594222(0.0146484375),	 argument value = -4.225
+   {-4200,"00000000000000001111"}, // value = 0.014995576820477703(0.0146484375),	 argument value = -4.2
+   {-4175,"00000000000000010000"}, // value = 0.01537519165502142(0.015625),	 argument value = -4.175000000000001
+   {-4150,"00000000000000010000"}, // value = 0.015764416484854486(0.015625),	 argument value = -4.15
+   {-4125,"00000000000000010001"}, // value = 0.016163494588165874(0.0166015625),	 argument value = -4.125
+   {-4100,"00000000000000010001"}, // value = 0.016572675401761255(0.0166015625),	 argument value = -4.1
+   {-4075,"00000000000000010001"}, // value = 0.016992214676969066(0.0166015625),	 argument value = -4.075
+   {-4050,"00000000000000010010"}, // value = 0.0174223746394935(0.017578125),	 argument value = -4.050000000000001
+   {-4025,"00000000000000010010"}, // value = 0.017863424153314034(0.017578125),	 argument value = -4.025
+   {-4000,"00000000000000010011"}, // value = 0.01831563888873418(0.0185546875),	 argument value = -4.0
+   {-3975,"00000000000000010011"}, // value = 0.0187793014946844(0.0185546875),	 argument value = -3.975
+   {-3950,"00000000000000010100"}, // value = 0.01925470177538692(0.01953125),	 argument value = -3.95
+   {-3925,"00000000000000010100"}, // value = 0.019742136871492774(0.01953125),	 argument value = -3.9250000000000003
+   {-3900,"00000000000000010101"}, // value = 0.02024191144580438(0.0205078125),	 argument value = -3.9000000000000004
+   {-3875,"00000000000000010101"}, // value = 0.020754337873699742(0.0205078125),	 argument value = -3.875
+   {-3850,"00000000000000010110"}, // value = 0.02127973643837717(0.021484375),	 argument value = -3.85
+   {-3825,"00000000000000010110"}, // value = 0.021818435531042762(0.021484375),	 argument value = -3.825
+   {-3800,"00000000000000010111"}, // value = 0.02237077185616559(0.0224609375),	 argument value = -3.8000000000000003
+   {-3775,"00000000000000010111"}, // value = 0.02293709064192892(0.0224609375),	 argument value = -3.7750000000000004
+   {-3750,"00000000000000011000"}, // value = 0.023517745856009107(0.0234375),	 argument value = -3.75
+   {-3725,"00000000000000011001"}, // value = 0.024113100426816865(0.0244140625),	 argument value = -3.725
+   {-3700,"00000000000000011001"}, // value = 0.024723526470339388(0.0244140625),	 argument value = -3.7
+   {-3675,"00000000000000011010"}, // value = 0.02534940552272493(0.025390625),	 argument value = -3.6750000000000003
+   {-3650,"00000000000000011011"}, // value = 0.025991128778755333(0.0263671875),	 argument value = -3.6500000000000004
+   {-3625,"00000000000000011011"}, // value = 0.026649097336355485(0.0263671875),	 argument value = -3.625
+   {-3600,"00000000000000011100"}, // value = 0.02732372244729256(0.02734375),	 argument value = -3.6
+   {-3575,"00000000000000011101"}, // value = 0.028015425774221808(0.0283203125),	 argument value = -3.575
+   {-3550,"00000000000000011101"}, // value = 0.028724639654239423(0.0283203125),	 argument value = -3.5500000000000003
+   {-3525,"00000000000000011110"}, // value = 0.02945180736910728(0.029296875),	 argument value = -3.5250000000000004
+   {-3500,"00000000000000011111"}, // value = 0.0301973834223185(0.0302734375),	 argument value = -3.5
+   {-3475,"00000000000000100000"}, // value = 0.030961833823176882(0.03125),	 argument value = -3.475
+   {-3450,"00000000000000100001"}, // value = 0.03174563637806794(0.0322265625),	 argument value = -3.45
+   {-3425,"00000000000000100001"}, // value = 0.03254928098910342(0.0322265625),	 argument value = -3.4250000000000003
+   {-3400,"00000000000000100010"}, // value = 0.033373269960326066(0.033203125),	 argument value = -3.4000000000000004
+   {-3375,"00000000000000100011"}, // value = 0.03421811831166603(0.0341796875),	 argument value = -3.375
+   {-3350,"00000000000000100100"}, // value = 0.035084354100845025(0.03515625),	 argument value = -3.35
+   {-3325,"00000000000000100101"}, // value = 0.035972518753429654(0.0361328125),	 argument value = -3.325
+   {-3300,"00000000000000100110"}, // value = 0.036883167401239994(0.037109375),	 argument value = -3.3000000000000003
+   {-3275,"00000000000000100111"}, // value = 0.03781686922932507(0.0380859375),	 argument value = -3.2750000000000004
+   {-3250,"00000000000000101000"}, // value = 0.03877420783172201(0.0390625),	 argument value = -3.25
+   {-3225,"00000000000000101001"}, // value = 0.039755781576221304(0.0400390625),	 argument value = -3.225
+   {-3200,"00000000000000101010"}, // value = 0.04076220397836621(0.041015625),	 argument value = -3.2
+   {-3175,"00000000000000101011"}, // value = 0.041794104084919896(0.0419921875),	 argument value = -3.1750000000000003
+   {-3150,"00000000000000101100"}, // value = 0.042852126867040166(0.04296875),	 argument value = -3.1500000000000004
+   {-3125,"00000000000000101101"}, // value = 0.04393693362340742(0.0439453125),	 argument value = -3.125
+   {-3100,"00000000000000101110"}, // value = 0.0450492023935578(0.044921875),	 argument value = -3.1
+   {-3075,"00000000000000101111"}, // value = 0.0461896283816801(0.0458984375),	 argument value = -3.075
+   {-3050,"00000000000000110000"}, // value = 0.04735892439114091(0.046875),	 argument value = -3.0500000000000003
+   {-3025,"00000000000000110010"}, // value = 0.048557821270009946(0.048828125),	 argument value = -3.0250000000000004
+   {-3000,"00000000000000110011"}, // value = 0.049787068367863944(0.0498046875),	 argument value = -3.0
+   {-2975,"00000000000000110100"}, // value = 0.051047434004154395(0.05078125),	 argument value = -2.975
+   {-2950,"00000000000000110110"}, // value = 0.05233970594843238(0.052734375),	 argument value = -2.95
+   {-2925,"00000000000000110111"}, // value = 0.05366469191273011(0.0537109375),	 argument value = -2.9250000000000003
+   {-2900,"00000000000000111000"}, // value = 0.05502322005640721(0.0546875),	 argument value = -2.9000000000000004
+   {-2875,"00000000000000111010"}, // value = 0.05641613950377735(0.056640625),	 argument value = -2.875
+   {-2850,"00000000000000111011"}, // value = 0.057844320874838456(0.0576171875),	 argument value = -2.85
+   {-2825,"00000000000000111101"}, // value = 0.05930865682943872(0.0595703125),	 argument value = -2.825
+   {-2800,"00000000000000111110"}, // value = 0.06081006262521795(0.060546875),	 argument value = -2.8000000000000003
+   {-2775,"00000000000001000000"}, // value = 0.0623494766896734(0.0625),	 argument value = -2.7750000000000004
+   {-2750,"00000000000001000001"}, // value = 0.06392786120670757(0.0634765625),	 argument value = -2.75
+   {-2725,"00000000000001000011"}, // value = 0.06554620271802433(0.0654296875),	 argument value = -2.725
+   {-2700,"00000000000001000101"}, // value = 0.06720551273974976(0.0673828125),	 argument value = -2.7
+   {-2675,"00000000000001000111"}, // value = 0.06890682839466256(0.0693359375),	 argument value = -2.6750000000000003
+   {-2650,"00000000000001001000"}, // value = 0.07065121306042957(0.0703125),	 argument value = -2.6500000000000004
+   {-2625,"00000000000001001010"}, // value = 0.07243975703425146(0.072265625),	 argument value = -2.625
+   {-2600,"00000000000001001100"}, // value = 0.07427357821433388(0.07421875),	 argument value = -2.6
+   {-2575,"00000000000001001110"}, // value = 0.07615382279861033(0.076171875),	 argument value = -2.575
+   {-2550,"00000000000001010000"}, // value = 0.07808166600115313(0.078125),	 argument value = -2.5500000000000003
+   {-2525,"00000000000001010010"}, // value = 0.08005831278672051(0.080078125),	 argument value = -2.5250000000000004
+   {-2500,"00000000000001010100"}, // value = 0.0820849986238988(0.08203125),	 argument value = -2.5
+   {-2475,"00000000000001010110"}, // value = 0.08416299025731036(0.083984375),	 argument value = -2.475
+   {-2450,"00000000000001011000"}, // value = 0.0862935864993705(0.0859375),	 argument value = -2.45
+   {-2425,"00000000000001011011"}, // value = 0.08847811904208727(0.0888671875),	 argument value = -2.4250000000000003
+   {-2400,"00000000000001011101"}, // value = 0.09071795328941247(0.0908203125),	 argument value = -2.4000000000000004
+   {-2375,"00000000000001011111"}, // value = 0.09301448921066349(0.0927734375),	 argument value = -2.375
+   {-2350,"00000000000001100010"}, // value = 0.09536916221554957(0.095703125),	 argument value = -2.3500000000000005
+   {-2325,"00000000000001100100"}, // value = 0.09778344405135005(0.09765625),	 argument value = -2.325
+   {-2300,"00000000000001100111"}, // value = 0.10025884372280375(0.1005859375),	 argument value = -2.3
+   {-2275,"00000000000001101001"}, // value = 0.10279690843528635(0.1025390625),	 argument value = -2.2750000000000004
+   {-2250,"00000000000001101100"}, // value = 0.10539922456186433(0.10546875),	 argument value = -2.25
+   {-2225,"00000000000001101111"}, // value = 0.10806741863482922(0.1083984375),	 argument value = -2.2250000000000005
+   {-2200,"00000000000001110001"}, // value = 0.11080315836233387(0.1103515625),	 argument value = -2.2
+   {-2175,"00000000000001110100"}, // value = 0.11360815367076377(0.11328125),	 argument value = -2.175
+   {-2150,"00000000000001110111"}, // value = 0.11648415777349691(0.1162109375),	 argument value = -2.1500000000000004
+   {-2125,"00000000000001111010"}, // value = 0.11943296826671962(0.119140625),	 argument value = -2.125
+   {-2100,"00000000000001111101"}, // value = 0.12245642825298185(0.1220703125),	 argument value = -2.1000000000000005
+   {-2075,"00000000000010000001"}, // value = 0.1255564274931972(0.1259765625),	 argument value = -2.075
+   {-2050,"00000000000010000100"}, // value = 0.12873490358780423(0.12890625),	 argument value = -2.05
+   {-2025,"00000000000010000111"}, // value = 0.13199384318783017(0.1318359375),	 argument value = -2.0250000000000004
+   {-2000,"00000000000010001011"}, // value = 0.1353352832366127(0.1357421875),	 argument value = -2.0
+   {-1975,"00000000000010001110"}, // value = 0.13876131224295518(0.138671875),	 argument value = -1.9750000000000005
+   {-1950,"00000000000010010010"}, // value = 0.14227407158651353(0.142578125),	 argument value = -1.9500000000000002
+   {-1925,"00000000000010010101"}, // value = 0.14587575685622742(0.1455078125),	 argument value = -1.9249999999999998
+   {-1900,"00000000000010011001"}, // value = 0.149568619222635(0.1494140625),	 argument value = -1.9000000000000004
+   {-1875,"00000000000010011101"}, // value = 0.15335496684492847(0.1533203125),	 argument value = -1.875
+   {-1850,"00000000000010100001"}, // value = 0.15723716631362752(0.1572265625),	 argument value = -1.8500000000000005
+   {-1825,"00000000000010100101"}, // value = 0.16121764412977674(0.1611328125),	 argument value = -1.8250000000000002
+   {-1800,"00000000000010101001"}, // value = 0.16529888822158656(0.1650390625),	 argument value = -1.7999999999999998
+   {-1775,"00000000000010101110"}, // value = 0.16948344949947003(0.169921875),	 argument value = -1.7750000000000004
+   {-1750,"00000000000010110010"}, // value = 0.17377394345044514(0.173828125),	 argument value = -1.75
+   {-1725,"00000000000010110110"}, // value = 0.17817305177289833(0.177734375),	 argument value = -1.7250000000000005
+   {-1700,"00000000000010111011"}, // value = 0.1826835240527346(0.1826171875),	 argument value = -1.7000000000000002
+   {-1675,"00000000000011000000"}, // value = 0.18730817948195705(0.1875),	 argument value = -1.6749999999999998
+   {-1650,"00000000000011000101"}, // value = 0.19204990862075405(0.1923828125),	 argument value = -1.6500000000000004
+   {-1625,"00000000000011001010"}, // value = 0.19691167520419406(0.197265625),	 argument value = -1.625
+   {-1600,"00000000000011001111"}, // value = 0.20189651799465547(0.2021484375),	 argument value = -1.5999999999999996
+   {-1575,"00000000000011010100"}, // value = 0.2070075526811526(0.20703125),	 argument value = -1.5750000000000002
+   {-1550,"00000000000011011001"}, // value = 0.2122479738267431(0.2119140625),	 argument value = -1.5499999999999998
+   {-1525,"00000000000011011111"}, // value = 0.2176210568652328(0.2177734375),	 argument value = -1.5250000000000004
+   {-1500,"00000000000011100100"}, // value = 0.22313016014842982(0.22265625),	 argument value = -1.5
+   {-1475,"00000000000011101010"}, // value = 0.2287787270452225(0.228515625),	 argument value = -1.4749999999999996
+   {-1450,"00000000000011110000"}, // value = 0.23457028809379762(0.234375),	 argument value = -1.4500000000000002
+   {-1425,"00000000000011110110"}, // value = 0.24050846320834218(0.240234375),	 argument value = -1.4249999999999998
+   {-1400,"00000000000011111101"}, // value = 0.24659696394160638(0.2470703125),	 argument value = -1.4000000000000004
+   {-1375,"00000000000100000011"}, // value = 0.25283959580474646(0.2529296875),	 argument value = -1.375
+   {-1350,"00000000000100001001"}, // value = 0.2592402606458916(0.2587890625),	 argument value = -1.3499999999999996
+   {-1325,"00000000000100010000"}, // value = 0.26580295908892654(0.265625),	 argument value = -1.3250000000000002
+   {-1300,"00000000000100010111"}, // value = 0.27253179303401265(0.2724609375),	 argument value = -1.2999999999999998
+   {-1275,"00000000000100011110"}, // value = 0.2794309682214072(0.279296875),	 argument value = -1.2750000000000004
+   {-1250,"00000000000100100101"}, // value = 0.2865047968601901(0.2861328125),	 argument value = -1.25
+   {-1225,"00000000000100101101"}, // value = 0.29375770032353293(0.2939453125),	 argument value = -1.2249999999999996
+   {-1200,"00000000000100110100"}, // value = 0.301194211912202(0.30078125),	 argument value = -1.2000000000000002
+   {-1175,"00000000000100111100"}, // value = 0.3088189796880199(0.30859375),	 argument value = -1.1749999999999998
+   {-1150,"00000000000101000100"}, // value = 0.3166367693790531(0.31640625),	 argument value = -1.1500000000000004
+   {-1125,"00000000000101001100"}, // value = 0.32465246735834974(0.32421875),	 argument value = -1.125
+   {-1100,"00000000000101010101"}, // value = 0.33287108369807966(0.3330078125),	 argument value = -1.0999999999999996
+   {-1075,"00000000000101011101"}, // value = 0.3412977553009936(0.3408203125),	 argument value = -1.0750000000000002
+   {-1050,"00000000000101100110"}, // value = 0.34993774911115544(0.349609375),	 argument value = -1.0499999999999998
+   {-1025,"00000000000101101111"}, // value = 0.35879646540595145(0.3583984375),	 argument value = -1.0250000000000004
+   {-1000,"00000000000101111001"}, // value = 0.36787944117144233(0.3681640625),	 argument value = -1.0
+   {-975,"00000000000110000010"}, // value = 0.37719235356315706(0.376953125),	 argument value = -0.9749999999999996
+   {-950,"00000000000110001100"}, // value = 0.3867410234545011(0.38671875),	 argument value = -0.9500000000000002
+   {-925,"00000000000110010110"}, // value = 0.39653141907499295(0.396484375),	 argument value = -0.9249999999999998
+   {-900,"00000000000110100000"}, // value = 0.40656965974059894(0.40625),	 argument value = -0.9000000000000004
+   {-875,"00000000000110101011"}, // value = 0.4168620196785084(0.4169921875),	 argument value = -0.875
+   {-850,"00000000000110110110"}, // value = 0.4274149319487268(0.427734375),	 argument value = -0.8499999999999996
+   {-825,"00000000000111000001"}, // value = 0.4382349924649492(0.4384765625),	 argument value = -0.8250000000000002
+   {-800,"00000000000111001100"}, // value = 0.4493289641172217(0.44921875),	 argument value = -0.7999999999999998
+   {-775,"00000000000111011000"}, // value = 0.46070378099896564(0.4609375),	 argument value = -0.7750000000000004
+   {-750,"00000000000111100100"}, // value = 0.4723665527410147(0.47265625),	 argument value = -0.75
+   {-725,"00000000000111110000"}, // value = 0.48432456895536263(0.484375),	 argument value = -0.7249999999999996
+   {-700,"00000000000111111101"}, // value = 0.4965853037914094(0.4970703125),	 argument value = -0.7000000000000002
+   {-675,"00000000001000001001"}, // value = 0.5091564206075493(0.5087890625),	 argument value = -0.6749999999999998
+   {-650,"00000000001000010111"}, // value = 0.5220457767610158(0.5224609375),	 argument value = -0.6500000000000004
+   {-625,"00000000001000100100"}, // value = 0.5352614285189903(0.53515625),	 argument value = -0.625
+   {-600,"00000000001000110010"}, // value = 0.5488116360940266(0.548828125),	 argument value = -0.5999999999999996
+   {-575,"00000000001001000000"}, // value = 0.5627048688069556(0.5625),	 argument value = -0.5750000000000002
+   {-550,"00000000001001001111"}, // value = 0.5769498103804868(0.5771484375),	 argument value = -0.5499999999999998
+   {-525,"00000000001001011110"}, // value = 0.5915553643668149(0.591796875),	 argument value = -0.5250000000000004
+   {-500,"00000000001001101101"}, // value = 0.6065306597126334(0.6064453125),	 argument value = -0.5
+   {-475,"00000000001001111101"}, // value = 0.6218850564650203(0.6220703125),	 argument value = -0.47499999999999964
+   {-450,"00000000001010001101"}, // value = 0.6376281516217732(0.6376953125),	 argument value = -0.4500000000000002
+   {-425,"00000000001010011101"}, // value = 0.6537697851298474(0.6533203125),	 argument value = -0.4249999999999998
+   {-400,"00000000001010101110"}, // value = 0.6703200460356391(0.669921875),	 argument value = -0.40000000000000036
+   {-375,"00000000001011000000"}, // value = 0.6872892787909722(0.6875),	 argument value = -0.375
+   {-350,"00000000001011010010"}, // value = 0.7046880897187137(0.705078125),	 argument value = -0.34999999999999964
+   {-325,"00000000001011100100"}, // value = 0.7225273536420721(0.72265625),	 argument value = -0.3250000000000002
+   {-300,"00000000001011110111"}, // value = 0.740818220681718(0.7412109375),	 argument value = -0.2999999999999998
+   {-275,"00000000001100001010"}, // value = 0.7595721232249683(0.759765625),	 argument value = -0.27500000000000036
+   {-250,"00000000001100011101"}, // value = 0.7788007830714049(0.7783203125),	 argument value = -0.25
+   {-225,"00000000001100110010"}, // value = 0.7985162187593773(0.798828125),	 argument value = -0.22499999999999964
+   {-200,"00000000001101000110"}, // value = 0.8187307530779817(0.818359375),	 argument value = -0.20000000000000018
+   {-175,"00000000001101011100"}, // value = 0.8394570207692075(0.83984375),	 argument value = -0.17499999999999982
+   {-150,"00000000001101110001"}, // value = 0.8607079764250575(0.8603515625),	 argument value = -0.15000000000000036
+   {-125,"00000000001110001000"}, // value = 0.8824969025845955(0.8828125),	 argument value = -0.125
+   {-100,"00000000001110011111"}, // value = 0.9048374180359599(0.9052734375),	 argument value = -0.09999999999999964
+   {-75,"00000000001110110110"}, // value = 0.9277434863285527(0.927734375),	 argument value = -0.07500000000000018
+   {-50,"00000000001111001110"}, // value = 0.9512294245007141(0.951171875),	 argument value = -0.04999999999999982
+   {-25,"00000000001111100111"}, // value = 0.9753099120283323(0.9755859375),	 argument value = -0.025000000000000355
+   {0,"00000000010000000000"}, // value = 1.0(1.0),	 argument value = 0.0
+   {25,"00000000010000011010"}, // value = 1.0253151205244293(1.025390625),	 argument value = 0.025000000000000355
+   {50,"00000000010000110101"}, // value = 1.051271096376024(1.0517578125),	 argument value = 0.04999999999999982
+   {75,"00000000010001010000"}, // value = 1.0778841508846317(1.078125),	 argument value = 0.07500000000000018
+   {100,"00000000010001101100"}, // value = 1.1051709180756473(1.10546875),	 argument value = 0.09999999999999964
+   {125,"00000000010010001000"}, // value = 1.1331484530668263(1.1328125),	 argument value = 0.125
+   {150,"00000000010010100110"}, // value = 1.1618342427282835(1.162109375),	 argument value = 0.15000000000000036
+   {175,"00000000010011000100"}, // value = 1.1912462166123579(1.19140625),	 argument value = 0.17499999999999982
+   {200,"00000000010011100011"}, // value = 1.22140275816017(1.2216796875),	 argument value = 0.20000000000000018
+   {225,"00000000010100000010"}, // value = 1.252322716191864(1.251953125),	 argument value = 0.22499999999999964
+   {250,"00000000010100100011"}, // value = 1.2840254166877414(1.2841796875),	 argument value = 0.25
+   {275,"00000000010101000100"}, // value = 1.316530674867622(1.31640625),	 argument value = 0.27500000000000036
+   {300,"00000000010101100110"}, // value = 1.349858807576003(1.349609375),	 argument value = 0.2999999999999998
+   {325,"00000000010110001001"}, // value = 1.3840306459807517(1.3837890625),	 argument value = 0.3250000000000002
+   {350,"00000000010110101101"}, // value = 1.4190675485932567(1.4189453125),	 argument value = 0.34999999999999964
+   {375,"00000000010111010010"}, // value = 1.4549914146182013(1.455078125),	 argument value = 0.375
+   {400,"00000000010111111000"}, // value = 1.4918246976412708(1.4921875),	 argument value = 0.40000000000000036
+   {425,"00000000011000011110"}, // value = 1.5295904196633785(1.529296875),	 argument value = 0.4249999999999998
+   {450,"00000000011001000110"}, // value = 1.5683121854901692(1.568359375),	 argument value = 0.4500000000000002
+   {475,"00000000011001101111"}, // value = 1.6080141974857822(1.6083984375),	 argument value = 0.47499999999999964
+   {500,"00000000011010011000"}, // value = 1.6487212707001282(1.6484375),	 argument value = 0.5
+   {525,"00000000011011000011"}, // value = 1.6904588483790919(1.6904296875),	 argument value = 0.5250000000000004
+   {550,"00000000011011101111"}, // value = 1.7332530178673948(1.7333984375),	 argument value = 0.5499999999999998
+   {575,"00000000011100011100"}, // value = 1.7771305269140387(1.77734375),	 argument value = 0.5750000000000002
+   {600,"00000000011101001010"}, // value = 1.8221188003905082(1.822265625),	 argument value = 0.5999999999999996
+   {625,"00000000011101111001"}, // value = 1.8682459574322223(1.8681640625),	 argument value = 0.625
+   {650,"00000000011110101010"}, // value = 1.9155408290138967(1.916015625),	 argument value = 0.6500000000000004
+   {675,"00000000011111011011"}, // value = 1.964032975969847(1.9638671875),	 argument value = 0.6749999999999998
+   {700,"00000000100000001110"}, // value = 2.013752707470477(2.013671875),	 argument value = 0.7000000000000002
+   {725,"00000000100001000010"}, // value = 2.064731099966486(2.064453125),	 argument value = 0.7249999999999996
+   {750,"00000000100001111000"}, // value = 2.117000016612675(2.1171875),	 argument value = 0.75
+   {775,"00000000100010101111"}, // value = 2.170592127183443(2.1708984375),	 argument value = 0.7750000000000004
+   {800,"00000000100011100111"}, // value = 2.2255409284924674(2.2255859375),	 argument value = 0.7999999999999998
+   {825,"00000000100100100001"}, // value = 2.281880765329304(2.2822265625),	 argument value = 0.8250000000000002
+   {850,"00000000100101011100"}, // value = 2.3396468519259903(2.33984375),	 argument value = 0.8499999999999996
+   {875,"00000000100110011000"}, // value = 2.398875293967098(2.3984375),	 argument value = 0.875
+   {900,"00000000100111010111"}, // value = 2.4596031111569507(2.4599609375),	 argument value = 0.9000000000000004
+   {925,"00000000101000010110"}, // value = 2.5218682603581475(2.521484375),	 argument value = 0.9249999999999998
+   {950,"00000000101001011000"}, // value = 2.585709659315847(2.5859375),	 argument value = 0.9500000000000002
+   {975,"00000000101010011011"}, // value = 2.6511672109826057(2.6513671875),	 argument value = 0.9749999999999996
+   {1000,"00000000101011100000"}, // value = 2.718281828459045(2.71875),	 argument value = 1.0
+   {1025,"00000000101100100110"}, // value = 2.7870954605658516(2.787109375),	 argument value = 1.0250000000000004
+   {1050,"00000000101101101110"}, // value = 2.8576511180631634(2.857421875),	 argument value = 1.0499999999999998
+   {1075,"00000000101110111000"}, // value = 2.929992900533702(2.9296875),	 argument value = 1.0750000000000002
+   {1100,"00000000110000000100"}, // value = 3.004166023946432(3.00390625),	 argument value = 1.0999999999999996
+   {1125,"00000000110001010010"}, // value = 3.080216848918031(3.080078125),	 argument value = 1.125
+   {1150,"00000000110010100010"}, // value = 3.158192909689769(3.158203125),	 argument value = 1.1500000000000004
+   {1175,"00000000110011110100"}, // value = 3.23814294383796(3.23828125),	 argument value = 1.1749999999999998
+   {1200,"00000000110101001000"}, // value = 3.320116922736548(3.3203125),	 argument value = 1.2000000000000002
+   {1225,"00000000110110011110"}, // value = 3.404166082790818(3.404296875),	 argument value = 1.2249999999999996
+   {1250,"00000000110111110110"}, // value = 3.4903429574618414(3.490234375),	 argument value = 1.25
+   {1275,"00000000111001010001"}, // value = 3.5787014101015804(3.5791015625),	 argument value = 1.2750000000000004
+   {1300,"00000000111010101101"}, // value = 3.6692966676192436(3.6689453125),	 argument value = 1.2999999999999998
+   {1325,"00000000111100001100"}, // value = 3.7621853549999114(3.76171875),	 argument value = 1.3250000000000002
+   {1350,"00000000111101101110"}, // value = 3.857425530696973(3.857421875),	 argument value = 1.3499999999999996
+   {1375,"00000000111111010010"}, // value = 3.955076722920577(3.955078125),	 argument value = 1.375
+   {1400,"00000001000000111001"}, // value = 4.055199966844676(4.0556640625),	 argument value = 1.4000000000000004
+   {1425,"00000001000010100010"}, // value = 4.157857842756006(4.158203125),	 argument value = 1.4249999999999998
+   {1450,"00000001000100001101"}, // value = 4.263114515168819(4.2626953125),	 argument value = 1.4500000000000002
+   {1475,"00000001000101111100"}, // value = 4.371035772929757(4.37109375),	 argument value = 1.4749999999999996
+   {1500,"00000001000111101101"}, // value = 4.4816890703380645(4.4814453125),	 argument value = 1.5
+   {1525,"00000001001001100001"}, // value = 4.59514356930669(4.5947265625),	 argument value = 1.5250000000000004
+   {1550,"00000001001011011001"}, // value = 4.71147018259074(4.7119140625),	 argument value = 1.5499999999999998
+   {1575,"00000001001101010011"}, // value = 4.830741618110279(4.8310546875),	 argument value = 1.5750000000000002
+   {1600,"00000001001111010000"}, // value = 4.953032424395113(4.953125),	 argument value = 1.5999999999999996
+   {1625,"00000001010001010000"}, // value = 5.0784190371800815(5.078125),	 argument value = 1.625
+   {1650,"00000001010011010100"}, // value = 5.20697982717985(5.20703125),	 argument value = 1.6500000000000004
+   {1675,"00000001010101011011"}, // value = 5.33879514907318(5.3388671875),	 argument value = 1.6750000000000007
+   {1700,"00000001010111100101"}, // value = 5.4739473917271955(5.4736328125),	 argument value = 1.6999999999999993
+   {1725,"00000001011001110011"}, // value = 5.612521029693155(5.6123046875),	 argument value = 1.7249999999999996
+   {1750,"00000001011100000101"}, // value = 5.754602676005731(5.7548828125),	 argument value = 1.75
+   {1775,"00000001011110011010"}, // value = 5.900281136319018(5.900390625),	 argument value = 1.7750000000000004
+   {1800,"00000001100000110011"}, // value = 6.04964746441295(6.0498046875),	 argument value = 1.8000000000000007
+   {1825,"00000001100011010000"}, // value = 6.202795019104861(6.203125),	 argument value = 1.8249999999999993
+   {1850,"00000001100101110000"}, // value = 6.359819522601829(6.359375),	 argument value = 1.8499999999999996
+   {1875,"00000001101000010101"}, // value = 6.5208191203301125(6.5205078125),	 argument value = 1.875
+   {1900,"00000001101010111110"}, // value = 6.685894442279272(6.685546875),	 argument value = 1.9000000000000004
+   {1925,"00000001101101101100"}, // value = 6.855148665899183(6.85546875),	 argument value = 1.9250000000000007
+   {1950,"00000001110000011101"}, // value = 7.028687580589288(7.0283203125),	 argument value = 1.9499999999999993
+   {1975,"00000001110011010100"}, // value = 7.206619653820465(7.20703125),	 argument value = 1.9749999999999996
+   {2000,"00000001110110001110"}, // value = 7.38905609893065(7.388671875),	 argument value = 2.0
+   {2025,"00000001111001001110"}, // value = 7.576110944636849(7.576171875),	 argument value = 2.0250000000000004
+   {2050,"00000001111100010010"}, // value = 7.767901106306778(7.767578125),	 argument value = 2.0500000000000007
+   {2075,"00000001111111011100"}, // value = 7.964546459034766(7.96484375),	 argument value = 2.0749999999999993
+   {2100,"00000010000010101010"}, // value = 8.166169912567646(8.166015625),	 argument value = 2.0999999999999996
+   {2125,"00000010000101111110"}, // value = 8.372897488127265(8.373046875),	 argument value = 2.125
+   {2150,"00000010001001010111"}, // value = 8.584858397177896(8.5849609375),	 argument value = 2.1500000000000004
+   {2175,"00000010001100110101"}, // value = 8.802185122187613(8.8017578125),	 argument value = 2.1750000000000007
+   {2200,"00000010010000011010"}, // value = 9.025013499434115(9.025390625),	 argument value = 2.1999999999999993
+   {2225,"00000010010100000100"}, // value = 9.25348280390689(9.25390625),	 argument value = 2.2249999999999996
+   {2250,"00000010010111110011"}, // value = 9.487735836358526(9.4873046875),	 argument value = 2.25
+   {2275,"00000010011011101001"}, // value = 9.727919012559887(9.7275390625),	 argument value = 2.2750000000000004
+   {2300,"00000010011111100110"}, // value = 9.974182454814727(9.974609375),	 argument value = 2.3000000000000007
+   {2325,"00000010100011101000"}, // value = 10.226680085790992(10.2265625),	 argument value = 2.3249999999999993
+   {2350,"00000010100111110001"}, // value = 10.48556972472757(10.4853515625),	 argument value = 2.3499999999999996
+   {2375,"00000010101100000001"}, // value = 10.751013186076355(10.7509765625),	 argument value = 2.375
+   {2400,"00000010110000011000"}, // value = 11.023176380641605(11.0234375),	 argument value = 2.4000000000000004
+   {2425,"00000010110100110101"}, // value = 11.30222941927959(11.3017578125),	 argument value = 2.4250000000000007
+   {2450,"00000010111001011010"}, // value = 11.58834671922338(11.587890625),	 argument value = 2.4499999999999993
+   {2475,"00000010111110000111"}, // value = 11.881707113099395(11.8818359375),	 argument value = 2.4749999999999996
+   {2500,"00000011000010111011"}, // value = 12.182493960703473(12.1826171875),	 argument value = 2.5
+   {2525,"00000011000111110111"}, // value = 12.490895263606813(12.4912109375),	 argument value = 2.5250000000000004
+   {2550,"00000011001100111010"}, // value = 12.807103782663042(12.806640625),	 argument value = 2.5500000000000007
+   {2575,"00000011010010000110"}, // value = 13.131317158490006(13.130859375),	 argument value = 2.5749999999999993
+   {2600,"00000011010111011011"}, // value = 13.463738035001686(13.4638671875),	 argument value = 2.5999999999999996
+   {2625,"00000011011100111000"}, // value = 13.804574186067095(13.8046875),	 argument value = 2.625
+   {2650,"00000011100010011110"}, // value = 14.154038645375808(14.154296875),	 argument value = 2.6500000000000004
+   {2675,"00000011101000001101"}, // value = 14.512349839590925(14.5126953125),	 argument value = 2.6750000000000007
+   {2700,"00000011101110000101"}, // value = 14.879731724872823(14.8798828125),	 argument value = 2.6999999999999993
+   {2725,"00000011110100000111"}, // value = 15.256413926859151(15.2568359375),	 argument value = 2.7249999999999996
+   {2750,"00000011111010010010"}, // value = 15.642631884188171(15.642578125),	 argument value = 2.75
+   {2775,"00000100000000101000"}, // value = 16.038626995655676(16.0390625),	 argument value = 2.7750000000000004
+   {2800,"00000100000111000111"}, // value = 16.444646771097062(16.4443359375),	 argument value = 2.8000000000000007
+   {2825,"00000100001101110010"}, // value = 16.86094498608902(16.861328125),	 argument value = 2.8249999999999993
+   {2850,"00000100010100100111"}, // value = 17.287781840567632(17.2880859375),	 argument value = 2.8499999999999996
+   {2875,"00000100011011100111"}, // value = 17.725424121461643(17.7255859375),	 argument value = 2.875
+   {2900,"00000100100010110010"}, // value = 18.174145369443067(18.173828125),	 argument value = 2.9000000000000004
+   {2925,"00000100101010001001"}, // value = 18.634226049899016(18.6337890625),	 argument value = 2.9250000000000007
+   {2950,"00000100110001101100"}, // value = 19.105953728231633(19.10546875),	 argument value = 2.9499999999999993
+   {2975,"00000100111001011100"}, // value = 19.589623249595984(19.58984375),	 argument value = 2.9749999999999996
+   {3000,"00000101000001011000"}, // value = 20.085536923187668(20.0859375),	 argument value = 3.0
+   {3025,"00000101001001100000"}, // value = 20.594004711196035(20.59375),	 argument value = 3.0250000000000004
+   {3050,"00000101010001110110"}, // value = 21.115344422540627(21.115234375),	 argument value = 3.0500000000000007
+   {3075,"00000101011010011001"}, // value = 21.64988191151204(21.6494140625),	 argument value = 3.0749999999999993
+   {3100,"00000101100011001011"}, // value = 22.197951281441625(22.1982421875),	 argument value = 3.0999999999999996
+   {3125,"00000101101100001010"}, // value = 22.75989509352673(22.759765625),	 argument value = 3.125
+   {3150,"00000101110101011000"}, // value = 23.336064580942722(23.3359375),	 argument value = 3.1500000000000004
+   {3175,"00000101111110110101"}, // value = 23.92681986837515(23.9267578125),	 argument value = 3.1750000000000007
+   {3200,"00000110001000100001"}, // value = 24.532530197109374(24.5322265625),	 argument value = 3.200000000000001
+   {3225,"00000110010010011101"}, // value = 25.153574155818355(25.1533203125),	 argument value = 3.2249999999999996
+   {3250,"00000110011100101001"}, // value = 25.790339917193062(25.7900390625),	 argument value = 3.25
+   {3275,"00000110100111000110"}, // value = 26.443225480562802(26.443359375),	 argument value = 3.2750000000000004
+   {3300,"00000110110001110011"}, // value = 27.112638920657908(27.1123046875),	 argument value = 3.3000000000000007
+   {3325,"00000110111100110010"}, // value = 27.79899864266969(27.798828125),	 argument value = 3.325000000000001
+   {3350,"00000111001000000011"}, // value = 28.502733643767268(28.5029296875),	 argument value = 3.3499999999999996
+   {3375,"00000111010011100110"}, // value = 29.22428378123494(29.224609375),	 argument value = 3.375
+   {3400,"00000111011111011011"}, // value = 29.964100047397025(29.9638671875),	 argument value = 3.4000000000000004
+   {3425,"00000111101011100100"}, // value = 30.722644851502935(30.72265625),	 argument value = 3.4250000000000007
+   {3450,"00000111111000000000"}, // value = 31.500392308747966(31.5),	 argument value = 3.450000000000001
+   {3475,"00001000000100110001"}, // value = 32.297828536610666(32.2978515625),	 argument value = 3.4749999999999996
+   {3500,"00001000010001110110"}, // value = 33.11545195869231(33.115234375),	 argument value = 3.5
+   {3525,"00001000011111010001"}, // value = 33.95377361624755(33.9541015625),	 argument value = 3.5250000000000004
+   {3550,"00001000101101000001"}, // value = 34.81331748760205(34.8134765625),	 argument value = 3.5500000000000007
+   {3575,"00001000111011000111"}, // value = 35.69462081565591(35.6943359375),	 argument value = 3.575000000000001
+   {3600,"00001001001001100101"}, // value = 36.598234443677974(36.5986328125),	 argument value = 3.5999999999999996
+   {3625,"00001001011000011001"}, // value = 37.524723159601(37.5244140625),	 argument value = 3.625
+   {3650,"00001001100111100110"}, // value = 38.47466604903214(38.474609375),	 argument value = 3.6500000000000004
+   {3675,"00001001110111001011"}, // value = 39.448656857200554(39.4482421875),	 argument value = 3.6750000000000007
+   {3700,"00001010000111001010"}, // value = 40.447304360067434(40.447265625),	 argument value = 3.700000000000001
+   {3725,"00001010010111100011"}, // value = 41.471232744830736(41.4716796875),	 argument value = 3.7249999999999996
+   {3750,"00001010101000010110"}, // value = 42.52108200006278(42.521484375),	 argument value = 3.75
+   {3775,"00001010111001100100"}, // value = 43.59750831572351(43.59765625),	 argument value = 3.7750000000000004
+   {3800,"00001011001011001110"}, // value = 44.70118449330086(44.701171875),	 argument value = 3.8000000000000007
+   {3825,"00001011011101010101"}, // value = 45.832800366333515(45.8330078125),	 argument value = 3.825000000000001
+   {3850,"00001011101111111001"}, // value = 46.993063231579264(46.9931640625),	 argument value = 3.8499999999999996
+   {3875,"00001100000010111011"}, // value = 48.182698291098816(48.1826171875),	 argument value = 3.875
+   {3900,"00001100010110011100"}, // value = 49.40244910553019(49.40234375),	 argument value = 3.9000000000000004
+   {3925,"00001100101010011101"}, // value = 50.653078058838666(50.6533203125),	 argument value = 3.9250000000000007
+   {3950,"00001100111110111110"}, // value = 51.93536683483149(51.935546875),	 argument value = 3.950000000000001
+   {3975,"00001101010100000000"}, // value = 53.250116905735595(53.25),	 argument value = 3.9749999999999996
+   {4000,"00001101101001100101"}, // value = 54.598150033144236(54.5986328125),	 argument value = 4.0
+   {4025,"00001101111111101100"}, // value = 55.980308781644155(55.98046875),	 argument value = 4.025
+   {4050,"00001110010110010111"}, // value = 57.39745704544624(57.3974609375),	 argument value = 4.050000000000001
+   {4075,"00001110101101100111"}, // value = 58.85048058834746(58.8505859375),	 argument value = 4.075000000000001
+   {4100,"00001111000101011100"}, // value = 60.34028759736195(60.33984375),	 argument value = 4.1
+   {4125,"00001111011101111001"}, // value = 61.867809250367884(61.8681640625),	 argument value = 4.125
+   {4150,"00001111110110111100"}, // value = 63.434000298123344(63.43359375),	 argument value = 4.15
+   {4175,"00010000010000101001"}, // value = 65.03983966101701(65.0400390625),	 argument value = 4.175000000000001
+   {4200,"00010000101010111111"}, // value = 66.68633104092521(66.6865234375),	 argument value = 4.200000000000001
+   {4225,"00010001000101111111"}, // value = 68.3745035485581(68.3740234375),	 argument value = 4.225
+   {4250,"00010001100001101100"}, // value = 70.10541234668786(70.10546875),	 argument value = 4.25
+   {4275,"00010001111110000101"}, // value = 71.88013930965907(71.8798828125),	 argument value = 4.275
+   {4300,"00010010011011001101"}, // value = 73.69979369959584(73.7001953125),	 argument value = 4.300000000000001
+   {4325,"00010010111001000011"}, // value = 75.56551285972668(75.5654296875),	 argument value = 4.325000000000001
+   {4350,"00010011010111101010"}, // value = 77.47846292526083(77.478515625),	 argument value = 4.35
+   {4375,"00010011110111000010"}, // value = 79.43983955226133(79.439453125),	 argument value = 4.375
+   {4400,"00010100010111001110"}, // value = 81.45086866496814(81.451171875),	 argument value = 4.4
+   {4425,"00010100111000001101"}, // value = 83.51280722204127(83.5126953125),	 argument value = 4.425000000000001
+   {4450,"00010101011010000010"}, // value = 85.62694400220066(85.626953125),	 argument value = 4.450000000000001
+   {4475,"00010101111100101110"}, // value = 87.79460040975476(87.794921875),	 argument value = 4.475
+   {4500,"00010110100000010010"}, // value = 90.01713130052181(90.017578125),	 argument value = 4.5
+   {4525,"00010111000100101111"}, // value = 92.29592582865789(92.2958984375),	 argument value = 4.525
+   {4550,"00010111101010001000"}, // value = 94.63240831492415(94.6328125),	 argument value = 4.550000000000001
+   {4575,"00011000010000011101"}, // value = 97.02803913693344(97.0283203125),	 argument value = 4.575000000000001
+   {4600,"00011000110111110000"}, // value = 99.48431564193378(99.484375),	 argument value = 4.6
+   {4625,"00011001100000000011"}, // value = 102.00277308269969(102.0029296875),	 argument value = 4.625
+   {4650,"00011010001001010111"}, // value = 104.58498557711422(104.5849609375),	 argument value = 4.65
+   {4675,"00011010110011101110"}, // value = 107.23256709204456(107.232421875),	 argument value = 4.675000000000001
+   {4700,"00011011011111001010"}, // value = 109.94717245212361(109.947265625),	 argument value = 4.700000000000001
+   {4725,"00011100001011101100"}, // value = 112.73049837406913(112.73046875),	 argument value = 4.725
+   {4750,"00011100111001010110"}, // value = 115.58428452718766(115.583984375),	 argument value = 4.75
+   {4775,"00011101101000001011"}, // value = 118.51031462072334(118.5107421875),	 argument value = 4.775
+   {4800,"00011110011000001011"}, // value = 121.51041751873497(121.5107421875),	 argument value = 4.800000000000001
+   {4825,"00011111001001011001"}, // value = 124.58646838319545(124.5869140625),	 argument value = 4.825000000000001
+   {4850,"00011111111011110110"}, // value = 127.7403898460288(127.740234375),	 argument value = 4.85
+   {4875,"00100000101111100110"}, // value = 130.9741532108186(130.974609375),	 argument value = 4.875
+   {4900,"00100001100100101001"}, // value = 134.28977968493552(134.2900390625),	 argument value = 4.9
+   {4925,"00100010011011000010"}, // value = 137.68934164285872(137.689453125),	 argument value = 4.925000000000001
+   {4950,"00100011010010110011"}, // value = 141.174963921477(141.1748046875),	 argument value = 4.950000000000001
+   {4975,"00100100001011111111"}, // value = 144.74882514818088(144.7490234375),	 argument value = 4.975
+   {5000,"00100101000110100111"}, // value = 148.4131591025766(148.4130859375),	 argument value = 5.0
+   {5025,"00100110000010101110"}, // value = 152.17025611266962(152.169921875),	 argument value = 5.025
+   {5050,"00100111000000010111"}, // value = 156.0224644863951(156.0224609375),	 argument value = 5.050000000000001
+   {5075,"00100111111111100100"}, // value = 159.97219197938668(159.97265625),	 argument value = 5.075000000000001
+   {5100,"00101001000000010110"}, // value = 164.0219072999017(164.021484375),	 argument value = 5.1
+   {5125,"00101010000010110010"}, // value = 168.17414165184545(168.173828125),	 argument value = 5.125
+   {5150,"00101011000110111010"}, // value = 172.43149031685434(172.431640625),	 argument value = 5.15
+   {5175,"00101100001100110000"}, // value = 176.79661427643245(176.796875),	 argument value = 5.175000000000001
+   {5200,"00101101010100010111"}, // value = 181.27224187515137(181.2724609375),	 argument value = 5.200000000000001
+   {5225,"00101110011101110010"}, // value = 185.86117052595398(185.861328125),	 argument value = 5.225
+   {5250,"00101111101001000100"}, // value = 190.56626845863(190.56640625),	 argument value = 5.25
+   {5275,"00110000110110010000"}, // value = 195.39047651255095(195.390625),	 argument value = 5.275
+   {5300,"00110010000101011001"}, // value = 200.33680997479183(200.3369140625),	 argument value = 5.300000000000001
+   {5325,"00110011010110100010"}, // value = 205.40836046478336(205.408203125),	 argument value = 5.325000000000001
+   {5350,"00110100101001101111"}, // value = 210.60829786667438(210.6083984375),	 argument value = 5.35
+   {5375,"00110101111111000010"}, // value = 215.9398723106141(215.939453125),	 argument value = 5.375
+   {5400,"00110111010110100000"}, // value = 221.40641620418717(221.40625),	 argument value = 5.4
+   {5425,"00111000110000001100"}, // value = 227.0113463152781(227.01171875),	 argument value = 5.425000000000001
+   {5450,"00111010001100001000"}, // value = 232.7581659076623(232.7578125),	 argument value = 5.450000000000001
+   {5475,"00111011101010011010"}, // value = 238.65046693065943(238.650390625),	 argument value = 5.475
+   {5500,"00111101001011000101"}, // value = 244.69193226422038(244.6923828125),	 argument value = 5.5
+   {5525,"00111110101110001100"}, // value = 250.8863380208446(250.88671875),	 argument value = 5.525
+   {5550,"01000000010011110011"}, // value = 257.23755590577497(257.2373046875),	 argument value = 5.550000000000001
+   {5575,"01000001111100000000"}, // value = 263.74955563693925(263.75),	 argument value = 5.575000000000001
+   {5600,"01000011100110110101"}, // value = 270.42640742615254(270.4267578125),	 argument value = 5.6
+   {5625,"01000101010100010111"}, // value = 277.272284523134(277.2724609375),	 argument value = 5.625
+   {5650,"01000111000100101010"}, // value = 284.29146582392093(284.291015625),	 argument value = 5.65
+   {5675,"01001000110111110100"}, // value = 291.4883385453202(291.48828125),	 argument value = 5.675000000000001
+   {5700,"01001010101101111000"}, // value = 298.8674009670606(298.8671875),	 argument value = 5.700000000000001
+   {5725,"01001100100110111100"}, // value = 306.4332652433641(306.43359375),	 argument value = 5.725
+   {5750,"01001110100011000011"}, // value = 314.1906602856942(314.1904296875),	 argument value = 5.75
+   {5775,"01010000100010010100"}, // value = 322.14443471847653(322.14453125),	 argument value = 5.775
+   {5800,"01010010100100110011"}, // value = 330.2995599096489(330.2998046875),	 argument value = 5.800000000000001
+   {5825,"01010100101010100101"}, // value = 338.66113307792756(338.6611328125),	 argument value = 5.825000000000001
+   {5850,"01010110110011110000"}, // value = 347.23438047873447(347.234375),	 argument value = 5.85
+   {5875,"01011001000000011001"}, // value = 356.0246606707791(356.0244140625),	 argument value = 5.875
+   {5900,"01011011010000100110"}, // value = 365.0374678653289(365.037109375),	 argument value = 5.9
+   {5925,"01011101100100011101"}, // value = 374.27843536027217(374.2783203125),	 argument value = 5.925000000000001
+   {5950,"01011111111100000011"}, // value = 383.75333906111223(383.7529296875),	 argument value = 5.950000000000001
+   {5975,"01100010010111011111"}, // value = 393.4681010910957(393.4677734375),	 argument value = 5.975
+   {6000,"01100100110110110111"}, // value = 403.4287934927351(403.4287109375),	 argument value = 6.0
+   {6025,"01100111011010010001"}, // value = 413.6416420230288(413.6416015625),	 argument value = 6.025
+   {6050,"01101010000001110100"}, // value = 424.11303004476457(424.11328125),	 argument value = 6.050000000000001
+   {6075,"01101100101101100110"}, // value = 434.84950251632864(434.849609375),	 argument value = 6.075000000000001
+   {6100,"01101111011101101110"}, // value = 445.85777008251677(445.857421875),	 argument value = 6.1
+   {6125,"01110010010010010100"}, // value = 457.14471326890896(457.14453125),	 argument value = 6.125
+   {6150,"01110101001011011111"}, // value = 468.717386782417(468.7177734375),	 argument value = 6.15
+   {6175,"01111000001001010101"}, // value = 480.58302392070937(480.5830078125),	 argument value = 6.175000000000001
+   {6200,"01111011001011111111"}, // value = 492.7490410932568(492.7490234375),	 argument value = 6.200000000000001
+   {6225,"01111110010011100100"}, // value = 505.2230424568286(505.22265625),	 argument value = 6.225
+   {6250,"10000001100000001101"}, // value = 518.012824668342(518.0126953125),	 argument value = 6.25
+   {6275,"10000100110010000001"}, // value = 531.1263817580211(531.1259765625),	 argument value = 6.275
+   {6300,"10001000001001001010"}, // value = 544.5719101259294(544.572265625),	 argument value = 6.300000000000001
+   {6325,"10001011100101101110"}, // value = 558.357813664986(558.357421875),	 argument value = 6.325000000000001
+   {6350,"10001111000111111001"}, // value = 572.4927090136708(572.4931640625),	 argument value = 6.35
+   {6375,"10010010101111110001"} // value = 586.9854309417088(586.9853515625),	 argument value = 6.375
+  };
diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/Hyperbolic.cxx b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/Hyperbolic.cxx
index 312a34021f5d088be266cd19a6a7b6c41b56005e..3ea82b7cbe34f7cad959156f16de43993ff38e8e 100644
--- a/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/Hyperbolic.cxx
+++ b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/Hyperbolic.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 /*********************************
  * Hyperbolic.cxx
@@ -9,90 +9,489 @@
  * @brief Lookup table for hyperbolic functions.
  *        Values is in Qm.n format m=11, n = 7
  *
-**********************************/
+ **********************************/
 
 #include "L1TopoSimulationUtils/Hyperbolic.h"
 //extra comment
 // 11 integer bit(s) + 7decimal bit(s); (79 entries)
-const std::vector<std::string> TSU::Hyperbolic::Cosh = {
-	"000000000010000000", // value = 1.0,	 argument value = 0.0
-	"000000000010000001", // value = 1.0050041680558035,	 argument value = 0.1
-	"000000000010000011", // value = 1.020066755619076,	 argument value = 0.2
-	"000000000010000110", // value = 1.0453385141288605,	 argument value = 0.30000000000000004
-	"000000000010001010", // value = 1.081072371838455,	 argument value = 0.4
-	"000000000010010000", // value = 1.1276259652063807,	 argument value = 0.5
-	"000000000010011000", // value = 1.1854652182422678,	 argument value = 0.6000000000000001
-	"000000000010100001", // value = 1.255169005630943,	 argument value = 0.7000000000000001
-	"000000000010101011", // value = 1.3374349463048447,	 argument value = 0.8
-	"000000000010110111", // value = 1.4330863854487745,	 argument value = 0.9
-	"000000000011000110", // value = 1.5430806348152437,	 argument value = 1.0
-	"000000000011010110", // value = 1.6685185538222564,	 argument value = 1.1
-	"000000000011101000", // value = 1.8106555673243752,	 argument value = 1.2000000000000002
-	"000000000011111100", // value = 1.9709142303266285,	 argument value = 1.3
-	"000000000100010011", // value = 2.150898465393141,	 argument value = 1.4000000000000001
-	"000000000100101101", // value = 2.352409615243247,	 argument value = 1.5
-	"000000000101001010", // value = 2.5774644711948853,	 argument value = 1.6
-	"000000000101101010", // value = 2.8283154578899676,	 argument value = 1.7000000000000002
-	"000000000110001110", // value = 3.1074731763172667,	 argument value = 1.8
-	"000000000110110101", // value = 3.417731530750953,	 argument value = 1.9000000000000001
-	"000000000111100010", // value = 3.7621956910836314,	 argument value = 2.0
-	"000000001000010010", // value = 4.144313170410316,	 argument value = 2.1
-	"000000001001001001", // value = 4.567908328898228,	 argument value = 2.2
-	"000000001010000101", // value = 5.037220649268764,	 argument value = 2.3000000000000003
-	"000000001011000111", // value = 5.556947166965509,	 argument value = 2.4000000000000004
-	"000000001100010001", // value = 6.132289479663686,	 argument value = 2.5
-	"000000001101100010", // value = 6.769005806608012,	 argument value = 2.6
-	"000000001110111101", // value = 7.473468618806294,	 argument value = 2.7
-	"000000010000100000", // value = 8.252728416861137,	 argument value = 2.8000000000000003
-	"000000010010001111", // value = 9.114584294749738,	 argument value = 2.9000000000000004
-	"000000010100001001", // value = 10.067661995777765,	 argument value = 3.0
-	"000000010110010000", // value = 11.121500241917596,	 argument value = 3.1
-	"000000011000100101", // value = 12.28664620054386,	 argument value = 3.2
-	"000000011011001010", // value = 13.574761044029566,	 argument value = 3.3000000000000003
-	"000000011110000000", // value = 14.998736658678675,	 argument value = 3.4000000000000004
-	"000000100001001001", // value = 16.572824671057315,	 argument value = 3.5
-	"000000100100101000", // value = 18.31277908306264,	 argument value = 3.6
-	"000000101000011110", // value = 20.23601394326887,	 argument value = 3.7
-	"000000101100101110", // value = 22.3617776325785,	 argument value = 3.8000000000000003
-	"000000110001011011", // value = 24.711345508487994,	 argument value = 3.9000000000000004
-	"000000110110100111", // value = 27.308232836016487,	 argument value = 4.0
-	"000000111100010111", // value = 30.17843013638188,	 argument value = 4.1000000000000005
-	"000001000010101101", // value = 33.35066330887282,	 argument value = 4.2
-	"000001001001101110", // value = 36.85668112930399,	 argument value = 4.3
-	"000001010001011110", // value = 40.7315730024356,	 argument value = 4.4
-	"000001011010000010", // value = 45.014120148530026,	 argument value = 4.5
-	"000001100011100000", // value = 49.74718373883925,	 argument value = 4.6000000000000005
-	"000001101101111101", // value = 54.97813386461261,	 argument value = 4.7
-	"000001111001100001", // value = 60.75932363289199,	 argument value = 4.800000000000001
-	"000010000110010011", // value = 67.14861313400323,	 argument value = 4.9
-	"000010010100011011", // value = 74.20994852478785,	 argument value = 5.0
-	"000010100100000010", // value = 82.01400202323367,	 argument value = 5.1000000000000005
-	"000010110101010010", // value = 90.63887921978599,	 argument value = 5.2
-	"000011001000010110", // value = 100.17090078434937,	 argument value = 5.300000000000001
-	"000011011101011010", // value = 110.70546639256489,	 argument value = 5.4
-	"000011110100101101", // value = 122.34800951782942,	 argument value = 5.5
-	"000100001110011100", // value = 135.21505264493462,	 argument value = 5.6000000000000005
-	"000100101010111000", // value = 149.43537346625888,	 argument value = 5.7
-	"000101001010010011", // value = 165.15129373219713,	 argument value = 5.800000000000001
-	"000101101101000011", // value = 182.52010365507383,	 argument value = 5.9
-	"000110010011011100", // value = 201.7156361224559,	 argument value = 6.0
-	"000110111101110111", // value = 222.93000647511832,	 argument value = 6.1000000000000005
-	"000111101100110000", // value = 246.3755352619463,	 argument value = 6.2
-	"001000100000100101", // value = 272.28687321535324,	 argument value = 6.300000000000001
-	"001001011001110110", // value = 300.9233497146777,	 argument value = 6.4
-	"001010011001001001", // value = 332.5715682417774,	 argument value = 6.5
-	"001011011111000110", // value = 367.5482748050054,	 argument value = 6.6000000000000005
-	"001100101100011010", // value = 406.203528039723,	 argument value = 6.7
-	"001110000001110110", // value = 448.9242027127831,	 argument value = 6.800000000000001
-	"001111100000010010", // value = 496.1378616952276,	 argument value = 6.9
-	"010001001000101001", // value = 548.317035155212,	 argument value = 7.0
-	"010010111011111110", // value = 605.9839497987504,	 argument value = 7.1000000000000005
-	"010100111011011100", // value = 669.7157554901132,	 argument value = 7.2
-	"010111001000010011", // value = 740.1503015616607,	 argument value = 7.300000000000001
-	"011001100011111111", // value = 817.992520624344,	 argument value = 7.4
-	"011100010000000011", // value = 904.0214837702166,	 argument value = 7.5
-	"011111001110001101", // value = 999.0981977777762,	 argument value = 7.6000000000000005
-	"100010100000010110", // value = 1104.174222357196,	 argument value = 7.7
-	"100110001000100111" // value = 1220.3011936797398,	 argument value = 7.800000000000001
-};
+const std::unordered_map<unsigned,std::string> TSU::Hyperbolic::Coshleg =
+  {
+   //Legacy
+   {0,"000000000010000000"}, // value = 1.0,	 argument value = 0.0
+   {1,"000000000010000001"}, // value = 1.0050041680558035,	 argument value = 0.1
+   {2,"000000000010000011"}, // value = 1.020066755619076,	 argument value = 0.2
+   {3,"000000000010000110"}, // value = 1.0453385141288605,	 argument value = 0.30000000000000004
+   {4,"000000000010001010"}, // value = 1.081072371838455,	 argument value = 0.4
+   {5,"000000000010010000"}, // value = 1.1276259652063807,	 argument value = 0.5
+   {6,"000000000010011000"}, // value = 1.1854652182422678,	 argument value = 0.6000000000000001
+   {7,"000000000010100001"}, // value = 1.255169005630943,	 argument value = 0.7000000000000001
+   {8,"000000000010101011"}, // value = 1.3374349463048447,	 argument value = 0.8
+   {9,"000000000010110111"}, // value = 1.4330863854487745,	 argument value = 0.9
+   {10,"000000000011000110"}, // value = 1.5430806348152437,	 argument value = 1.0
+   {11,"000000000011010110"}, // value = 1.6685185538222564,	 argument value = 1.1
+   {12,"000000000011101000"}, // value = 1.8106555673243752,	 argument value = 1.2000000000000002
+   {13,"000000000011111100"}, // value = 1.9709142303266285,	 argument value = 1.3
+   {14,"000000000100010011"}, // value = 2.150898465393141,	 argument value = 1.4000000000000001
+   {15,"000000000100101101"}, // value = 2.352409615243247,	 argument value = 1.5
+   {16,"000000000101001010"}, // value = 2.5774644711948853,	 argument value = 1.6
+   {17,"000000000101101010"}, // value = 2.8283154578899676,	 argument value = 1.7000000000000002
+   {18,"000000000110001110"}, // value = 3.1074731763172667,	 argument value = 1.8
+   {19,"000000000110110101"}, // value = 3.417731530750953,	 argument value = 1.9000000000000001
+   {20,"000000000111100010"}, // value = 3.7621956910836314,	 argument value = 2.0
+   {21,"000000001000010010"}, // value = 4.144313170410316,	 argument value = 2.1
+   {22,"000000001001001001"}, // value = 4.567908328898228,	 argument value = 2.2
+   {23,"000000001010000101"}, // value = 5.037220649268764,	 argument value = 2.3000000000000003
+   {24,"000000001011000111"}, // value = 5.556947166965509,	 argument value = 2.4000000000000004
+   {25,"000000001100010001"}, // value = 6.132289479663686,	 argument value = 2.5
+   {26,"000000001101100010"}, // value = 6.769005806608012,	 argument value = 2.6
+   {27,"000000001110111101"}, // value = 7.473468618806294,	 argument value = 2.7
+   {28,"000000010000100000"}, // value = 8.252728416861137,	 argument value = 2.8000000000000003
+   {29,"000000010010001111"}, // value = 9.114584294749738,	 argument value = 2.9000000000000004
+   {30,"000000010100001001"}, // value = 10.067661995777765,	 argument value = 3.0
+   {31,"000000010110010000"}, // value = 11.121500241917596,	 argument value = 3.1
+   {32,"000000011000100101"}, // value = 12.28664620054386,	 argument value = 3.2
+   {33,"000000011011001010"}, // value = 13.574761044029566,	 argument value = 3.3000000000000003
+   {34,"000000011110000000"}, // value = 14.998736658678675,	 argument value = 3.4000000000000004
+   {35,"000000100001001001"}, // value = 16.572824671057315,	 argument value = 3.5
+   {36,"000000100100101000"}, // value = 18.31277908306264,	 argument value = 3.6
+   {37,"000000101000011110"}, // value = 20.23601394326887,	 argument value = 3.7
+   {38,"000000101100101110"}, // value = 22.3617776325785,	 argument value = 3.8000000000000003
+   {39,"000000110001011011"}, // value = 24.711345508487994,	 argument value = 3.9000000000000004
+   {40,"000000110110100111"}, // value = 27.308232836016487,	 argument value = 4.0
+   {41,"000000111100010111"}, // value = 30.17843013638188,	 argument value = 4.1000000000000005
+   {42,"000001000010101101"}, // value = 33.35066330887282,	 argument value = 4.2
+   {43,"000001001001101110"}, // value = 36.85668112930399,	 argument value = 4.3
+   {44,"000001010001011110"}, // value = 40.7315730024356,	 argument value = 4.4
+   {45,"000001011010000010"}, // value = 45.014120148530026,	 argument value = 4.5
+   {46,"000001100011100000"}, // value = 49.74718373883925,	 argument value = 4.6000000000000005
+   {47,"000001101101111101"}, // value = 54.97813386461261,	 argument value = 4.7
+   {48,"000001111001100001"}, // value = 60.75932363289199,	 argument value = 4.800000000000001
+   {49,"000010000110010011"}, // value = 67.14861313400323,	 argument value = 4.9
+   {50,"000010010100011011"}, // value = 74.20994852478785,	 argument value = 5.0
+   {51,"000010100100000010"}, // value = 82.01400202323367,	 argument value = 5.1000000000000005
+   {52,"000010110101010010"}, // value = 90.63887921978599,	 argument value = 5.2
+   {53,"000011001000010110"}, // value = 100.17090078434937,	 argument value = 5.300000000000001
+   {54,"000011011101011010"}, // value = 110.70546639256489,	 argument value = 5.4
+   {55,"000011110100101101"}, // value = 122.34800951782942,	 argument value = 5.5
+   {56,"000100001110011100"}, // value = 135.21505264493462,	 argument value = 5.6000000000000005
+   {57,"000100101010111000"}, // value = 149.43537346625888,	 argument value = 5.7
+   {58,"000101001010010011"}, // value = 165.15129373219713,	 argument value = 5.800000000000001
+   {59,"000101101101000011"}, // value = 182.52010365507383,	 argument value = 5.9
+   {60,"000110010011011100"}, // value = 201.7156361224559,	 argument value = 6.0
+   {61,"000110111101110111"}, // value = 222.93000647511832,	 argument value = 6.1000000000000005
+   {62,"000111101100110000"}, // value = 246.3755352619463,	 argument value = 6.2
+   {63,"001000100000100101"}, // value = 272.28687321535324,	 argument value = 6.300000000000001
+   {64,"001001011001110110"}, // value = 300.9233497146777,	 argument value = 6.4
+   {65,"001010011001001001"}, // value = 332.5715682417774,	 argument value = 6.5
+   {66,"001011011111000110"}, // value = 367.5482748050054,	 argument value = 6.6000000000000005
+   {67,"001100101100011010"}, // value = 406.203528039723,	 argument value = 6.7
+   {68,"001110000001110110"}, // value = 448.9242027127831,	 argument value = 6.800000000000001
+   {69,"001111100000010010"}, // value = 496.1378616952276,	 argument value = 6.9
+   {70,"010001001000101001"}, // value = 548.317035155212,	 argument value = 7.0
+   {71,"010010111011111110"}, // value = 605.9839497987504,	 argument value = 7.1000000000000005
+   {72,"010100111011011100"}, // value = 669.7157554901132,	 argument value = 7.2
+   {73,"010111001000010011"}, // value = 740.1503015616607,	 argument value = 7.300000000000001
+   {74,"011001100011111111"}, // value = 817.992520624344,	 argument value = 7.4
+   {75,"011100010000000011"}, // value = 904.0214837702166,	 argument value = 7.5
+   {76,"011111001110001101"}, // value = 999.0981977777762,	 argument value = 7.6000000000000005
+   {77,"100010100000010110"}, // value = 1104.174222357196,	 argument value = 7.7
+   {78,"100110001000100111"}, // value = 1220.3011936797398,	 argument value = 7.800000000000001
+  };
 
+//Phase1
+const std::unordered_map<unsigned,std::string> TSU::Hyperbolic::Cosh =
+  {
+   {0,"000000000000010000000000"}, // value = 1.0(1.0),	 argument value = 0.0
+   {25,"000000000000010000000000"}, // value = 1.0003125162763808(1.0),	 argument value = 0.025
+   {50,"000000000000010000000001"}, // value = 1.001250260438369(1.0009765625),	 argument value = 0.05
+   {75,"000000000000010000000011"}, // value = 1.0028138186065922(1.0029296875),	 argument value = 0.07500000000000001
+   {100,"000000000000010000000101"}, // value = 1.0050041680558035(1.0048828125),	 argument value = 0.1
+   {125,"000000000000010000001000"}, // value = 1.0078226778257109(1.0078125),	 argument value = 0.125
+   {150,"000000000000010000001100"}, // value = 1.0112711095766704(1.01171875),	 argument value = 0.15000000000000002
+   {175,"000000000000010000010000"}, // value = 1.0153516186907827(1.015625),	 argument value = 0.17500000000000002
+   {200,"000000000000010000010101"}, // value = 1.020066755619076(1.0205078125),	 argument value = 0.2
+   {225,"000000000000010000011010"}, // value = 1.0254194674756207(1.025390625),	 argument value = 0.225
+   {250,"000000000000010000100000"}, // value = 1.0314130998795732(1.03125),	 argument value = 0.25
+   {275,"000000000000010000100111"}, // value = 1.038051399046295(1.0380859375),	 argument value = 0.275
+   {300,"000000000000010000101110"}, // value = 1.0453385141288605(1.044921875),	 argument value = 0.30000000000000004
+   {325,"000000000000010000110111"}, // value = 1.0532789998114118(1.0537109375),	 argument value = 0.325
+   {350,"000000000000010000111111"}, // value = 1.0618778191559854(1.0615234375),	 argument value = 0.35000000000000003
+   {375,"000000000000010001001001"}, // value = 1.0711403467045868(1.0712890625),	 argument value = 0.375
+   {400,"000000000000010001010011"}, // value = 1.081072371838455(1.0810546875),	 argument value = 0.4
+   {425,"000000000000010001011110"}, // value = 1.091680102396613(1.091796875),	 argument value = 0.42500000000000004
+   {450,"000000000000010001101001"}, // value = 1.102970168555971(1.1025390625),	 argument value = 0.45
+   {475,"000000000000010001110110"}, // value = 1.1149496269754016(1.115234375),	 argument value = 0.47500000000000003
+   {500,"000000000000010010000011"}, // value = 1.1276259652063807(1.1279296875),	 argument value = 0.5
+   {525,"000000000000010010010000"}, // value = 1.1410071063729532(1.140625),	 argument value = 0.525
+   {550,"000000000000010010011111"}, // value = 1.155101414123941(1.1552734375),	 argument value = 0.55
+   {575,"000000000000010010101110"}, // value = 1.169917697860497(1.169921875),	 argument value = 0.5750000000000001
+   {600,"000000000000010010111110"}, // value = 1.1854652182422678(1.185546875),	 argument value = 0.6000000000000001
+   {625,"000000000000010011001111"}, // value = 1.2017536929756063(1.2021484375),	 argument value = 0.625
+   {650,"000000000000010011100000"}, // value = 1.2187933028874562(1.21875),	 argument value = 0.65
+   {675,"000000000000010011110010"}, // value = 1.2365946982886982(1.236328125),	 argument value = 0.675
+   {700,"000000000000010100000101"}, // value = 1.255169005630943(1.2548828125),	 argument value = 0.7000000000000001
+   {725,"000000000000010100011001"}, // value = 1.2745278344609245(1.2744140625),	 argument value = 0.7250000000000001
+   {750,"000000000000010100101110"}, // value = 1.2946832846768448(1.294921875),	 argument value = 0.75
+   {775,"000000000000010101000011"}, // value = 1.315647954091204(1.3154296875),	 argument value = 0.775
+   {800,"000000000000010101011010"}, // value = 1.3374349463048447(1.337890625),	 argument value = 0.8
+   {825,"000000000000010101110001"}, // value = 1.3600578788971267(1.3603515625),	 argument value = 0.8250000000000001
+   {850,"000000000000010110001001"}, // value = 1.383530891937359(1.3837890625),	 argument value = 0.8500000000000001
+   {875,"000000000000010110100010"}, // value = 1.4078686568228032(1.408203125),	 argument value = 0.875
+   {900,"000000000000010110111011"}, // value = 1.4330863854487745(1.4326171875),	 argument value = 0.9
+   {925,"000000000000010111010110"}, // value = 1.4591998397165704(1.458984375),	 argument value = 0.925
+   {950,"000000000000010111110010"}, // value = 1.4862253413851738(1.486328125),	 argument value = 0.9500000000000001
+   {975,"000000000000011000001111"}, // value = 1.514179782272882(1.5146484375),	 argument value = 0.9750000000000001
+   {1000,"000000000000011000101100"}, // value = 1.5430806348152437(1.54296875),	 argument value = 1.0
+   {1025,"000000000000011001001011"}, // value = 1.5729459629859013(1.5732421875),	 argument value = 1.0250000000000001
+   {1050,"000000000000011001101010"}, // value = 1.6037944335871597(1.603515625),	 argument value = 1.05
+   {1075,"000000000000011010001011"}, // value = 1.6356453279173475(1.6357421875),	 argument value = 1.075
+   {1100,"000000000000011010101101"}, // value = 1.6685185538222564(1.6689453125),	 argument value = 1.1
+   {1125,"000000000000011011001111"}, // value = 1.7024346581381904(1.7021484375),	 argument value = 1.125
+   {1150,"000000000000011011110011"}, // value = 1.7374148395344107(1.7373046875),	 argument value = 1.1500000000000001
+   {1175,"000000000000011100011000"}, // value = 1.7734809617629903(1.7734375),	 argument value = 1.175
+   {1200,"000000000000011100111110"}, // value = 1.8106555673243752(1.810546875),	 argument value = 1.2000000000000002
+   {1225,"000000000000011101100101"}, // value = 1.848961891557176(1.8486328125),	 argument value = 1.225
+   {1250,"000000000000011110001110"}, // value = 1.8884238771610158(1.888671875),	 argument value = 1.25
+   {1275,"000000000000011110110111"}, // value = 1.9290661891614935(1.9287109375),	 argument value = 1.2750000000000001
+   {1300,"000000000000011111100010"}, // value = 1.9709142303266285(1.970703125),	 argument value = 1.3
+   {1325,"000000000000100000001110"}, // value = 2.013994157044419(2.013671875),	 argument value = 1.3250000000000002
+   {1350,"000000000000100000111100"}, // value = 2.058332895671433(2.05859375),	 argument value = 1.35
+   {1375,"000000000000100001101010"}, // value = 2.1039581593626617(2.103515625),	 argument value = 1.375
+   {1400,"000000000000100010011011"}, // value = 2.150898465393141(2.1513671875),	 argument value = 1.4000000000000001
+   {1425,"000000000000100011001100"}, // value = 2.1991831529821746(2.19921875),	 argument value = 1.425
+   {1450,"000000000000100011111111"}, // value = 2.248842401631308(2.2490234375),	 argument value = 1.4500000000000002
+   {1475,"000000000000100100110011"}, // value = 2.2999072499874904(2.2998046875),	 argument value = 1.475
+   {1500,"000000000000100101101001"}, // value = 2.352409615243247(2.3525390625),	 argument value = 1.5
+   {1525,"000000000000100110100000"}, // value = 2.406382313085961(2.40625),	 argument value = 1.5250000000000001
+   {1550,"000000000000100111011001"}, // value = 2.4618590782087426(2.4619140625),	 argument value = 1.55
+   {1575,"000000000000101000010011"}, // value = 2.5188745853957157(2.5185546875),	 argument value = 1.5750000000000002
+   {1600,"000000000000101001001111"}, // value = 2.5774644711948853(2.5771484375),	 argument value = 1.6
+   {1625,"000000000000101010001101"}, // value = 2.6376653561921377(2.6376953125),	 argument value = 1.625
+   {1650,"000000000000101011001100"}, // value = 2.6995148679003016(2.69921875),	 argument value = 1.6500000000000001
+   {1675,"000000000000101100001101"}, // value = 2.7630516642775667(2.7626953125),	 argument value = 1.675
+   {1700,"000000000000101101010000"}, // value = 2.8283154578899676(2.828125),	 argument value = 1.7000000000000002
+   {1725,"000000000000101110010101"}, // value = 2.8953470407330277(2.8955078125),	 argument value = 1.725
+   {1750,"000000000000101111011011"}, // value = 2.964188309728088(2.9638671875),	 argument value = 1.75
+   {1775,"000000000000110000100100"}, // value = 3.0348822929092436(3.03515625),	 argument value = 1.7750000000000001
+   {1800,"000000000000110001101110"}, // value = 3.1074731763172667(3.107421875),	 argument value = 1.8
+   {1825,"000000000000110010111010"}, // value = 3.1820063316173215(3.181640625),	 argument value = 1.8250000000000002
+   {1850,"000000000000110100001001"}, // value = 3.25852834445773(3.2587890625),	 argument value = 1.85
+   {1875,"000000000000110101011001"}, // value = 3.3370870435875206(3.3369140625),	 argument value = 1.875
+   {1900,"000000000000110110101100"}, // value = 3.417731530750953(3.41796875),	 argument value = 1.9000000000000001
+   {1925,"000000000000111000000001"}, // value = 3.500512211377703(3.5009765625),	 argument value = 1.925
+   {1950,"000000000000111001011000"}, // value = 3.585480826087904(3.5859375),	 argument value = 1.9500000000000002
+   {1975,"000000000000111010110001"}, // value = 3.6726904830317118(3.6728515625),	 argument value = 1.975
+   {2000,"000000000000111100001100"}, // value = 3.7621956910836314(3.76171875),	 argument value = 2.0
+   {2025,"000000000000111101101011"}, // value = 3.8540523939123377(3.8544921875),	 argument value = 2.025
+   {2050,"000000000000111111001011"}, // value = 3.9483180049472892(3.9482421875),	 argument value = 2.0500000000000003
+   {2075,"000000000001000000101110"}, // value = 4.0450514432639855(4.044921875),	 argument value = 2.075
+   {2100,"000000000001000010010100"}, // value = 4.144313170410316(4.14453125),	 argument value = 2.1
+   {2125,"000000000001000011111100"}, // value = 4.246165228196992(4.24609375),	 argument value = 2.125
+   {2150,"000000000001000101100111"}, // value = 4.350671277475695(4.3505859375),	 argument value = 2.15
+   {2175,"000000000001000111010101"}, // value = 4.457896637929187(4.4580078125),	 argument value = 2.1750000000000003
+   {2200,"000000000001001001000110"}, // value = 4.567908328898228(4.568359375),	 argument value = 2.2
+   {2225,"000000000001001010111001"}, // value = 4.6807751112708615(4.6806640625),	 argument value = 2.225
+   {2250,"000000000001001100110000"}, // value = 4.796567530460195(4.796875),	 argument value = 2.25
+   {2275,"000000000001001110101001"}, // value = 4.915357960497585(4.9150390625),	 argument value = 2.275
+   {2300,"000000000001010000100110"}, // value = 5.037220649268764(5.037109375),	 argument value = 2.3000000000000003
+   {2325,"000000000001010010100110"}, // value = 5.1622317649211755(5.162109375),	 argument value = 2.325
+   {2350,"000000000001010100101001"}, // value = 5.2904694434715624(5.2900390625),	 argument value = 2.35
+   {2375,"000000000001010110110000"}, // value = 5.422013837643509(5.421875),	 argument value = 2.375
+   {2400,"000000000001011000111010"}, // value = 5.556947166965509(5.556640625),	 argument value = 2.4000000000000004
+   {2425,"000000000001011011001000"}, // value = 5.695353769160835(5.6953125),	 argument value = 2.4250000000000003
+   {2450,"000000000001011101011001"}, // value = 5.837320152861381(5.8369140625),	 argument value = 2.45
+   {2475,"000000000001011111101111"}, // value = 5.982935051678355(5.9833984375),	 argument value = 2.475
+   {2500,"000000000001100010000111"}, // value = 6.132289479663686(6.1318359375),	 argument value = 2.5
+   {2525,"000000000001100100100100"}, // value = 6.285476788196767(6.28515625),	 argument value = 2.5250000000000004
+   {2550,"000000000001100111000101"}, // value = 6.442592724332095(6.4423828125),	 argument value = 2.5500000000000003
+   {2575,"000000000001101001101010"}, // value = 6.603735490644314(6.603515625),	 argument value = 2.575
+   {2600,"000000000001101100010011"}, // value = 6.769005806608012(6.7685546875),	 argument value = 2.6
+   {2625,"000000000001101111000001"}, // value = 6.938506971550673(6.9384765625),	 argument value = 2.625
+   {2650,"000000000001110001110011"}, // value = 7.112344929218119(7.1123046875),	 argument value = 2.6500000000000004
+   {2675,"000000000001110100101010"}, // value = 7.290628333992791(7.291015625),	 argument value = 2.6750000000000003
+   {2700,"000000000001110111100101"}, // value = 7.473468618806294(7.4736328125),	 argument value = 2.7
+   {2725,"000000000001111010100101"}, // value = 7.660980064788592(7.6611328125),	 argument value = 2.725
+   {2750,"000000000001111101101010"}, // value = 7.853279872697439(7.853515625),	 argument value = 2.75
+   {2775,"000000000010000000110100"}, // value = 8.050488236172674(8.05078125),	 argument value = 2.7750000000000004
+   {2800,"000000000010000100000011"}, // value = 8.252728416861137(8.2529296875),	 argument value = 2.8000000000000003
+   {2825,"000000000010000111010111"}, // value = 8.460126821459237(8.4599609375),	 argument value = 2.825
+   {2850,"000000000010001010110001"}, // value = 8.67281308072124(8.6728515625),	 argument value = 2.85
+   {2875,"000000000010001110010000"}, // value = 8.89092013048271(8.890625),	 argument value = 2.875
+   {2900,"000000000010010001110101"}, // value = 9.114584294749738(9.1142578125),	 argument value = 2.9000000000000004
+   {2925,"000000000010010101100000"}, // value = 9.343945370905868(9.34375),	 argument value = 2.9250000000000003
+   {2950,"000000000010011001010001"}, // value = 9.579146717090042(9.5791015625),	 argument value = 2.95
+   {2975,"000000000010011101001000"}, // value = 9.820335341800075(9.8203125),	 argument value = 2.975
+   {3000,"000000000010100001000101"}, // value = 10.067661995777765(10.0673828125),	 argument value = 3.0
+   {3025,"000000000010100101001001"}, // value = 10.321281266233022(10.3212890625),	 argument value = 3.0250000000000004
+   {3050,"000000000010101001010011"}, // value = 10.581351673465878(10.5810546875),	 argument value = 3.0500000000000003
+   {3075,"000000000010101101100100"}, // value = 10.848035769946868(10.84765625),	 argument value = 3.075
+   {3100,"000000000010110001111100"}, // value = 11.121500241917596(11.12109375),	 argument value = 3.1
+   {3125,"000000000010110110011100"}, // value = 11.401916013575068(11.40234375),	 argument value = 3.125
+   {3150,"000000000010111011000010"}, // value = 11.68945835390488(11.689453125),	 argument value = 3.1500000000000004
+   {3175,"000000000010111111110000"}, // value = 11.984306986230031(11.984375),	 argument value = 3.1750000000000003
+   {3200,"000000000011000100100110"}, // value = 12.28664620054386(12.287109375),	 argument value = 3.2
+   {3225,"000000000011001001100011"}, // value = 12.596664968697294(12.5966796875),	 argument value = 3.225
+   {3250,"000000000011001110101001"}, // value = 12.914557062512392(12.9150390625),	 argument value = 3.25
+   {3275,"000000000011010011110110"}, // value = 13.240521174896063(13.240234375),	 argument value = 3.2750000000000004
+   {3300,"000000000011011001001101"}, // value = 13.574761044029566(13.5751953125),	 argument value = 3.3000000000000003
+   {3325,"000000000011011110101100"}, // value = 13.917485580711547(13.91796875),	 argument value = 3.325
+   {3350,"000000000011100100010011"}, // value = 14.268908998934064(14.2685546875),	 argument value = 3.35
+   {3375,"000000000011101010000100"}, // value = 14.629250949773304(14.62890625),	 argument value = 3.375
+   {3400,"000000000011101111111111"}, // value = 14.998736658678675(14.9990234375),	 argument value = 3.4000000000000004
+   {3425,"000000000011110110000011"}, // value = 15.377597066246011(15.3779296875),	 argument value = 3.4250000000000003
+   {3450,"000000000011111100010000"}, // value = 15.766068972563003(15.765625),	 argument value = 3.45
+   {3475,"000000000100000010101000"}, // value = 16.16439518521693(16.1640625),	 argument value = 3.475
+   {3500,"000000000100001001001011"}, // value = 16.572824671057315(16.5732421875),	 argument value = 3.5
+   {3525,"000000000100001111110111"}, // value = 16.99161271180833(16.9912109375),	 argument value = 3.5250000000000004
+   {3550,"000000000100010110101111"}, // value = 17.421021063628135(17.4208984375),	 argument value = 3.5500000000000003
+   {3575,"000000000100011101110010"}, // value = 17.86131812071505(17.861328125),	 argument value = 3.575
+   {3600,"000000000100100101000000"}, // value = 18.31277908306264(18.3125),	 argument value = 3.6
+   {3625,"000000000100101100011010"}, // value = 18.775686128468678(18.775390625),	 argument value = 3.625
+   {3650,"000000000100110100000000"}, // value = 19.250328588905447(19.25),	 argument value = 3.6500000000000004
+   {3675,"000000000100111011110011"}, // value = 19.73700313136163(19.7373046875),	 argument value = 3.6750000000000003
+   {3700,"000000000101000011110010"}, // value = 20.23601394326887(20.236328125),	 argument value = 3.7
+   {3725,"000000000101001011111110"}, // value = 20.747672922628787(20.748046875),	 argument value = 3.725
+   {3750,"000000000101010100010111"}, // value = 21.272299872959398(21.2724609375),	 argument value = 3.75
+   {3775,"000000000101011100111110"}, // value = 21.81022270318272(21.810546875),	 argument value = 3.7750000000000004
+   {3800,"000000000101100101110010"}, // value = 22.3617776325785(22.361328125),	 argument value = 3.8000000000000003
+   {3825,"000000000101101110110110"}, // value = 22.92730940093226(22.927734375),	 argument value = 3.825
+   {3850,"000000000101111000000111"}, // value = 23.507171484008833(23.5068359375),	 argument value = 3.85
+   {3875,"000000000110000001101000"}, // value = 24.101726314486257(24.1015625),	 argument value = 3.875
+   {3900,"000000000110001011011000"}, // value = 24.711345508487994(24.7109375),	 argument value = 3.9000000000000004
+   {3925,"000000000110010101011000"}, // value = 25.33641009785507(25.3359375),	 argument value = 3.9250000000000003
+   {3950,"000000000110011111101001"}, // value = 25.977310768303415(25.9775390625),	 argument value = 3.95
+   {3975,"000000000110101010001010"}, // value = 26.634448103615153(26.634765625),	 argument value = 3.975
+   {4000,"000000000110110100111100"}, // value = 27.308232836016487(27.30859375),	 argument value = 4.0
+   {4025,"000000000110111111111111"}, // value = 27.999086102898733(27.9990234375),	 argument value = 4.025
+   {4050,"000000000111001011010100"}, // value = 28.70743971004284(28.70703125),	 argument value = 4.05
+   {4075,"000000000111010110111100"}, // value = 29.43373640151219(29.43359375),	 argument value = 4.075
+   {4100,"000000000111100010110111"}, // value = 30.17843013638188(30.1787109375),	 argument value = 4.1000000000000005
+   {4125,"000000000111101111000101"}, // value = 30.941986372478024(30.9423828125),	 argument value = 4.125
+   {4150,"000000000111111011100110"}, // value = 31.7248823573041(31.724609375),	 argument value = 4.15
+   {4175,"000000001000001000011100"}, // value = 32.52760742633599(32.52734375),	 argument value = 4.175
+   {4200,"000000001000010101100111"}, // value = 33.35066330887282(33.3505859375),	 argument value = 4.2
+   {4225,"000000001000100011000111"}, // value = 34.19456444163387(34.1943359375),	 argument value = 4.2250000000000005
+   {4250,"000000001000110000111101"}, // value = 35.05983829029843(35.0595703125),	 argument value = 4.25
+   {4275,"000000001000111111001010"}, // value = 35.947025679189004(35.947265625),	 argument value = 4.275
+   {4300,"000000001001001101101101"}, // value = 36.85668112930399(36.8564453125),	 argument value = 4.3
+   {4325,"000000001001011100101000"}, // value = 37.789373204911584(37.7890625),	 argument value = 4.325
+   {4350,"000000001001101011111100"}, // value = 38.74568486892069(38.74609375),	 argument value = 4.3500000000000005
+   {4375,"000000001001111011101000"}, // value = 39.726213847251884(39.7265625),	 argument value = 4.375
+   {4400,"000000001010001011101101"}, // value = 40.7315730024356(40.7314453125),	 argument value = 4.4
+   {4425,"000000001010011100001101"}, // value = 41.762390716671(41.7626953125),	 argument value = 4.425
+   {4450,"000000001010101101000111"}, // value = 42.81931128458549(42.8193359375),	 argument value = 4.45
+   {4475,"000000001010111110011101"}, // value = 43.902995315939684(43.9033203125),	 argument value = 4.4750000000000005
+   {4500,"000000001011010000001110"}, // value = 45.014120148530026(45.013671875),	 argument value = 4.5
+   {4525,"000000001011100010011101"}, // value = 46.153380271547164(46.1533203125),	 argument value = 4.525
+   {4550,"000000001011110101001001"}, // value = 47.321487759653955(47.3212890625),	 argument value = 4.55
+   {4575,"000000001100001000010100"}, // value = 48.51917271805568(48.51953125),	 argument value = 4.575
+   {4600,"000000001100011011111101"}, // value = 49.74718373883925(49.7470703125),	 argument value = 4.6000000000000005
+   {4625,"000000001100110000000110"}, // value = 51.00628836886776(51.005859375),	 argument value = 4.625
+   {4650,"000000001101000100110000"}, // value = 52.29727358952238(52.296875),	 argument value = 4.65
+   {4675,"000000001101011001111100"}, // value = 53.6209463085911(53.62109375),	 argument value = 4.675
+   {4700,"000000001101101111101010"}, // value = 54.97813386461261(54.978515625),	 argument value = 4.7
+   {4725,"000000001110000101111011"}, // value = 56.36968454398958(56.3701171875),	 argument value = 4.7250000000000005
+   {4750,"000000001110011100110000"}, // value = 57.796468111195395(57.796875),	 argument value = 4.75
+   {4775,"000000001110110100001010"}, // value = 59.25937635240539(59.259765625),	 argument value = 4.775
+   {4800,"000000001111001100001010"}, // value = 60.75932363289199(60.759765625),	 argument value = 4.800000000000001
+   {4825,"000000001111100100110000"}, // value = 62.29724746853287(62.296875),	 argument value = 4.825
+   {4850,"000000001111111101111111"}, // value = 63.874109111789075(63.8740234375),	 argument value = 4.8500000000000005
+   {4875,"000000010000010111110111"}, // value = 65.49089415251873(65.4912109375),	 argument value = 4.875
+   {4900,"000000010000110010011000"}, // value = 67.14861313400323(67.1484375),	 argument value = 4.9
+   {4925,"000000010001001101100101"}, // value = 68.84830218456926(68.8486328125),	 argument value = 4.925000000000001
+   {4950,"000000010001101001011101"}, // value = 70.59102366520295(70.5908203125),	 argument value = 4.95
+   {4975,"000000010010000110000011"}, // value = 72.37786683356023(72.3779296875),	 argument value = 4.9750000000000005
+   {5000,"000000010010100011010111"}, // value = 74.20994852478785(74.2099609375),	 argument value = 5.0
+   {5025,"000000010011000001011011"}, // value = 76.08841384958228(76.0888671875),	 argument value = 5.025
+   {5050,"000000010011100000001111"}, // value = 78.01443690992068(78.0146484375),	 argument value = 5.050000000000001
+   {5075,"000000010011111111110101"}, // value = 79.98922153291308(79.9892578125),	 argument value = 5.075
+   {5100,"000000010100100000001110"}, // value = 82.01400202323367(82.013671875),	 argument value = 5.1000000000000005
+   {5125,"000000010101000001011100"}, // value = 84.09004393460096(84.08984375),	 argument value = 5.125
+   {5150,"000000010101100011100000"}, // value = 86.21864486079059(86.21875),	 argument value = 5.15
+   {5175,"000000010110000110011011"}, // value = 88.4011352466732(88.4013671875),	 argument value = 5.175000000000001
+   {5200,"000000010110101010001110"}, // value = 90.63887921978599(90.638671875),	 argument value = 5.2
+   {5225,"000000010111001110111100"}, // value = 92.93327544295703(92.93359375),	 argument value = 5.2250000000000005
+   {5250,"000000010111110100100101"}, // value = 95.28575798851459(95.2861328125),	 argument value = 5.25
+   {5275,"000000011000011011001011"}, // value = 97.6977972346296(97.6982421875),	 argument value = 5.275
+   {5300,"000000011001000010101111"}, // value = 100.17090078434937(100.1708984375),	 argument value = 5.300000000000001
+   {5325,"000000011001101011010100"}, // value = 102.7066144078987(102.70703125),	 argument value = 5.325
+   {5350,"000000011010010100111010"}, // value = 105.30652300883698(105.306640625),	 argument value = 5.3500000000000005
+   {5375,"000000011010111111100100"}, // value = 107.97225161467382(107.97265625),	 argument value = 5.375
+   {5400,"000000011011101011010010"}, // value = 110.70546639256489(110.705078125),	 argument value = 5.4
+   {5425,"000000011100011000001000"}, // value = 113.50787569071996(113.5078125),	 argument value = 5.425000000000001
+   {5450,"000000011101000110000110"}, // value = 116.38123110617641(116.380859375),	 argument value = 5.45
+   {5475,"000000011101110101001111"}, // value = 119.32732857960482(119.3271484375),	 argument value = 5.4750000000000005
+   {5500,"000000011110100101100100"}, // value = 122.34800951782942(122.34765625),	 argument value = 5.5
+   {5525,"000000011111010111001000"}, // value = 125.44516194476836(125.4453125),	 argument value = 5.525
+   {5550,"000000100000001001111100"}, // value = 128.62072168150922(128.62109375),	 argument value = 5.550000000000001
+   {5575,"000000100000111110000010"}, // value = 131.87667355626058(131.876953125),	 argument value = 5.575
+   {5600,"000000100001110011011100"}, // value = 135.21505264493462(135.21484375),	 argument value = 5.6000000000000005
+   {5625,"000000100010101010001101"}, // value = 138.637945543135(138.6376953125),	 argument value = 5.625
+   {5650,"000000100011100010010111"}, // value = 142.14749167034793(142.1474609375),	 argument value = 5.65
+   {5675,"000000100100011011111100"}, // value = 145.74588460714824(145.74609375),	 argument value = 5.675000000000001
+   {5700,"000000100101010110111110"}, // value = 149.43537346625888(149.435546875),	 argument value = 5.7
+   {5725,"000000100110010011100000"}, // value = 153.21826429832015(153.21875),	 argument value = 5.7250000000000005
+   {5750,"000000100111010001100011"}, // value = 157.09692153324536(157.0966796875),	 argument value = 5.75
+   {5775,"000000101000010001001100"}, // value = 161.0737694580676(161.07421875),	 argument value = 5.775
+   {5800,"000000101001010010011011"}, // value = 165.15129373219713(165.1513671875),	 argument value = 5.800000000000001
+   {5825,"000000101010010101010100"}, // value = 169.33204294103982(169.33203125),	 argument value = 5.825
+   {5850,"000000101011011001111001"}, // value = 173.6186301889464(173.6181640625),	 argument value = 5.8500000000000005
+   {5875,"000000101100100000001110"}, // value = 178.01373473248682(178.013671875),	 argument value = 5.875
+   {5900,"000000101101101000010101"}, // value = 182.52010365507383(182.5205078125),	 argument value = 5.9
+   {5925,"000000101110110010010000"}, // value = 187.1405535839787(187.140625),	 argument value = 5.925000000000001
+   {5950,"000000101111111110000011"}, // value = 191.87797245081515(191.8779296875),	 argument value = 5.95
+   {5975,"000000110001001011110001"}, // value = 196.73532129659145(196.7353515625),	 argument value = 5.9750000000000005
+   {6000,"000000110010011011011101"}, // value = 201.7156361224559(201.7158203125),	 argument value = 6.0
+   {6025,"000000110011101101001010"}, // value = 206.82202978729808(206.822265625),	 argument value = 6.025
+   {6050,"000000110101000000111011"}, // value = 212.05769395338552(212.0576171875),	 argument value = 6.050000000000001
+   {6075,"000000110110010110110100"}, // value = 217.4259010812572(217.42578125),	 argument value = 6.075
+   {6100,"000000110111101110111000"}, // value = 222.93000647511832(222.9296875),	 argument value = 6.1000000000000005
+   {6125,"000000111001001001001011"}, // value = 228.57345038001358(228.5732421875),	 argument value = 6.125
+   {6150,"000000111010100101110000"}, // value = 234.35976013209353(234.359375),	 argument value = 6.15
+   {6175,"000000111100000100101100"}, // value = 240.2925523633134(240.29296875),	 argument value = 6.175000000000001
+   {6200,"000000111101100110000001"}, // value = 246.3755352619463(246.3759765625),	 argument value = 6.2
+   {6225,"000000111111001001110011"}, // value = 252.6125108903222(252.6123046875),	 argument value = 6.2250000000000005
+   {6250,"000001000000110000001000"}, // value = 259.0073775612391(259.0078125),	 argument value = 6.25
+   {6275,"000001000010011001000010"}, // value = 265.5641322745374(265.564453125),	 argument value = 6.275
+   {6300,"000001000100000100100110"}, // value = 272.28687321535324(272.287109375),	 argument value = 6.300000000000001
+   {6325,"000001000101110010111000"}, // value = 279.17980231561796(279.1796875),	 argument value = 6.325
+   {6350,"000001000111100011111101"}, // value = 286.24722788040384(286.2470703125),	 argument value = 6.3500000000000005
+   {6375,"000001001001010111111001"}, // value = 293.4935672807523(293.4931640625),	 argument value = 6.375
+   {6400,"000001001011001110110010"}, // value = 300.9233497146777(300.923828125),	 argument value = 6.4
+   {6425,"000001001101001000101010"}, // value = 308.5412190380608(308.541015625),	 argument value = 6.425000000000001
+   {6450,"000001001111000101101000"}, // value = 316.35193666721113(316.3515625),	 argument value = 6.45
+   {6475,"000001010001000101110001"}, // value = 324.3603845549079(324.3603515625),	 argument value = 6.4750000000000005
+   {6500,"000001010011001001001001"}, // value = 332.5715682417774(332.5712890625),	 argument value = 6.5
+   {6525,"000001010101001111110110"}, // value = 340.9906199849213(340.990234375),	 argument value = 6.525
+   {6550,"000001010111011001111110"}, // value = 349.62280196574204(349.623046875),	 argument value = 6.550000000000001
+   {6575,"000001011001100111100101"}, // value = 358.47350957897885(358.4736328125),	 argument value = 6.575
+   {6600,"000001011011111000110001"}, // value = 367.5482748050054(367.5478515625),	 argument value = 6.6000000000000005
+   {6625,"000001011110001101101001"}, // value = 376.85276966749615(376.8525390625),	 argument value = 6.625
+   {6650,"000001100000100110010010"}, // value = 386.3928097786277(386.392578125),	 argument value = 6.65
+   {6675,"000001100011000010110011"}, // value = 396.17435797402396(396.1748046875),	 argument value = 6.675000000000001
+   {6700,"000001100101100011010000"}, // value = 406.203528039723(406.203125),	 argument value = 6.7
+   {6725,"000001101000000111110010"}, // value = 416.4865885334937(416.486328125),	 argument value = 6.7250000000000005
+   {6750,"000001101010110000011111"}, // value = 427.02996670288616(427.0302734375),	 argument value = 6.75
+   {6775,"000001101101011101011100"}, // value = 437.84025250247294(437.83984375),	 argument value = 6.775
+   {6800,"000001110000001110110010"}, // value = 448.9242027127831(448.923828125),	 argument value = 6.800000000000001
+   {6825,"000001110011000100101000"}, // value = 460.28874516351084(460.2890625),	 argument value = 6.825
+   {6850,"000001110101111111000100"}, // value = 471.94098306363594(471.94140625),	 argument value = 6.8500000000000005
+   {6875,"000001111000111110001110"}, // value = 483.8881994411576(483.888671875),	 argument value = 6.875
+   {6900,"000001111100000010001101"}, // value = 496.1378616952276(496.1376953125),	 argument value = 6.9
+   {6925,"000001111111001011001010"}, // value = 508.6976262635147(508.697265625),	 argument value = 6.925000000000001
+   {6950,"000010000010011001001101"}, // value = 521.5753434077284(521.5751953125),	 argument value = 6.95
+   {6975,"000010000101101100011110"}, // value = 534.7790621202903(534.779296875),	 argument value = 6.9750000000000005
+   {7000,"000010001001000101000101"}, // value = 548.317035155212(548.3173828125),	 argument value = 7.0
+   {7025,"000010001100100011001010"}, // value = 562.1977241863401(562.197265625),	 argument value = 7.025
+   {7050,"000010010000000110111000"}, // value = 576.4298050961729(576.4296875),	 argument value = 7.050000000000001
+   {7075,"000010010011110000010111"}, // value = 591.0221733985724(591.0224609375),	 argument value = 7.075
+   {7100,"000010010111011111110000"}, // value = 605.9839497987504(605.984375),	 argument value = 7.1000000000000005
+   {7125,"000010011011010101001100"}, // value = 621.324485894003(621.32421875),	 argument value = 7.125
+   {7150,"000010011111010000110111"}, // value = 637.0533700187677(637.0537109375),	 argument value = 7.15
+   {7175,"000010100011010010111001"}, // value = 653.1804332376405(653.1806640625),	 argument value = 7.175000000000001
+   {7200,"000010100111011011011101"}, // value = 669.7157554901132(669.7158203125),	 argument value = 7.2
+   {7225,"000010101011101010101110"}, // value = 686.6696718908651(686.669921875),	 argument value = 7.2250000000000005
+   {7250,"000010110000000000110110"}, // value = 704.0527791895422(704.052734375),	 argument value = 7.25
+   {7275,"000010110100011110000001"}, // value = 721.8759423940755(721.8759765625),	 argument value = 7.275
+   {7300,"000010111001000010011010"}, // value = 740.1503015616607(740.150390625),	 argument value = 7.300000000000001
+   {7325,"000010111101101110001101"}, // value = 758.8872787616575(758.8876953125),	 argument value = 7.325
+   {7350,"000011000010100001100101"}, // value = 778.0985852147576(778.0986328125),	 argument value = 7.3500000000000005
+   {7375,"000011000111011100101111"}, // value = 797.7962286128738(797.7958984375),	 argument value = 7.375
+   {7400,"000011001100011111111000"}, // value = 817.992520624344(817.9921875),	 argument value = 7.4
+   {7425,"000011010001101011001101"}, // value = 838.7000845891201(838.7001953125),	 argument value = 7.425000000000001
+   {7450,"000011010110111110111010"}, // value = 859.9318634087675(859.931640625),	 argument value = 7.45
+   {7475,"000011011100011011001110"}, // value = 881.701127636203(881.701171875),	 argument value = 7.4750000000000005
+   {7500,"000011100010000000010110"}, // value = 904.0214837702166(904.021484375),	 argument value = 7.5
+   {7525,"000011100111101110100001"}, // value = 926.9068827599834(926.9072265625),	 argument value = 7.525
+   {7550,"000011101101100101111101"}, // value = 950.3716287248538(950.3720703125),	 argument value = 7.550000000000001
+   {7575,"000011110011100110111001"}, // value = 974.4303878948974(974.4306640625),	 argument value = 7.575
+   {7600,"000011111001110001100101"}, // value = 999.0981977777762(999.0986328125),	 argument value = 7.6000000000000005
+   {7625,"000100000000000110010000"}, // value = 1024.3904765576706(1024.390625),	 argument value = 7.625
+   {7650,"000100000110100101001011"}, // value = 1050.3230327321533(1050.3232421875),	 argument value = 7.65
+   {7675,"000100001101001110100110"}, // value = 1076.9120749930087(1076.912109375),	 argument value = 7.675000000000001
+   {7700,"000100010100000010110010"}, // value = 1104.174222357196(1104.173828125),	 argument value = 7.7
+   {7725,"000100011011000010000010"}, // value = 1132.1265145542775(1132.126953125),	 argument value = 7.7250000000000005
+   {7750,"000100100010001100100101"}, // value = 1160.7864226767988(1160.7861328125),	 argument value = 7.75
+   {7775,"000100101001100010110000"}, // value = 1190.1718601002976(1190.171875),	 argument value = 7.775
+   {7800,"000100110001000100110100"}, // value = 1220.3011936797398(1220.30078125),	 argument value = 7.800000000000001
+   {7825,"000100111000110011000110"}, // value = 1251.1932552294047(1251.193359375),	 argument value = 7.825
+   {7850,"000101000000101101111000"}, // value = 1282.8673532933847(1282.8671875),	 argument value = 7.8500000000000005
+   {7875,"000101001000110101100000"}, // value = 1315.3432852140468(1315.34375),	 argument value = 7.875
+   {7900,"000101010001001010010001"}, // value = 1348.641349506025(1348.6416015625),	 argument value = 7.9
+   {7925,"000101011001101100100001"}, // value = 1382.782358543445(1382.7822265625),	 argument value = 7.925000000000001
+   {7950,"000101100010011100100111"}, // value = 1417.7876515683374(1417.7880859375),	 argument value = 7.95
+   {7975,"000101101011011010110111"}, // value = 1453.679108028365(1453.6787109375),	 argument value = 7.9750000000000005
+   {8000,"000101110100100111101011"}, // value = 1490.479161252178(1490.4794921875),	 argument value = 8.0
+   {8025,"000101111110000011011000"}, // value = 1528.2108124709878(1528.2109375),	 argument value = 8.025
+   {8050,"000110000111101110010111"}, // value = 1566.897645195074(1566.8974609375),	 argument value = 8.05
+   {8075,"000110010001101001000001"}, // value = 1606.5638399542527(1606.5634765625),	 argument value = 8.075000000000001
+   {8100,"000110011011110011110000"}, // value = 1647.2341894114893(1647.234375),	 argument value = 8.1
+   {8125,"000110100110001110111101"}, // value = 1688.9341138591324(1688.9345703125),	 argument value = 8.125
+   {8150,"000110110000111011000010"}, // value = 1731.6896771074073(1731.689453125),	 argument value = 8.15
+   {8175,"000110111011111000011100"}, // value = 1775.5276027751552(1775.52734375),	 argument value = 8.175
+   {8200,"000111000111000111100111"}, // value = 1820.4752909929643(1820.4755859375),	 argument value = 8.200000000000001
+   {8225,"000111010010101000111110"}, // value = 1866.5608355291386(1866.560546875),	 argument value = 8.225
+   {8250,"000111011110011101000001"}, // value = 1913.8130413492318(1913.8134765625),	 argument value = 8.25
+   {8275,"000111101010100100001100"}, // value = 1962.2614426200678(1962.26171875),	 argument value = 8.275
+   {8300,"000111110110111110111111"}, // value = 2011.93632116957(2011.9365234375),	 argument value = 8.3
+   {8325,"001000000011101101111010"}, // value = 2062.8687254138863(2062.869140625),	 argument value = 8.325000000000001
+   {8350,"001000010000110001011101"}, // value = 2115.0904897636565(2115.0908203125),	 argument value = 8.35
+   {8375,"001000011110001010001001"}, // value = 2168.634254521569(2168.6337890625),	 argument value = 8.375
+   {8400,"001000101011111000100010"}, // value = 2223.533486283591(2223.533203125),	 argument value = 8.4
+   {8425,"001000111001111101001010"}, // value = 2279.822498856696(2279.822265625),	 argument value = 8.425
+   {8450,"001001001000011000100101"}, // value = 2337.536474706104(2337.5361328125),	 argument value = 8.450000000000001
+   {8475,"001001010111001011011001"}, // value = 2396.7114869454663(2396.7119140625),	 argument value = 8.475
+   {8500,"001001100110010110001010"}, // value = 2457.384521883752(2457.384765625),	 argument value = 8.5
+   {8525,"001001110101111001100000"}, // value = 2519.593502142867(2519.59375),	 argument value = 8.525
+   {8550,"001010000101110110000010"}, // value = 2583.377310360547(2583.376953125),	 argument value = 8.55
+   {8575,"001010010110001100011010"}, // value = 2648.7758134932687(2648.775390625),	 argument value = 8.575000000000001
+   {8600,"001010100110111101010010"}, // value = 2715.829887734386(2715.830078125),	 argument value = 8.6
+   {8625,"001010111000001001010011"}, // value = 2784.5814440631048(2784.5810546875),	 argument value = 8.625
+   {8650,"001011001001110001001011"}, // value = 2855.0734544401785(2855.0732421875),	 argument value = 8.65
+   {8675,"001011011011110101100110"}, // value = 2927.349978666803(2927.349609375),	 argument value = 8.675
+   {8700,"001011101110010111010011"}, // value = 3001.4561919234197(3001.4560546875),	 argument value = 8.700000000000001
+   {8725,"001100000001010111000001"}, // value = 3077.438413005671(3077.4384765625),	 argument value = 8.725
+   {8750,"001100010100110101100000"}, // value = 3155.344133275175(3155.34375),	 argument value = 8.75
+   {8775,"001100101000110011100011"}, // value = 3235.2220463431404(3235.2216796875),	 argument value = 8.775
+   {8800,"001100111101010001111101"}, // value = 3317.1220785054825(3317.1220703125),	 argument value = 8.8
+   {8825,"001101010010010001100010"}, // value = 3401.0954199483745(3401.095703125),	 argument value = 8.825000000000001
+   {8850,"001101100111110011000111"}, // value = 3487.194556743776(3487.1943359375),	 argument value = 8.85
+   {8875,"001101111101110111100101"}, // value = 3575.4733036549615(3575.4736328125),	 argument value = 8.875
+   {8900,"001110010100011111110011"}, // value = 3665.986837772461(3665.9873046875),	 argument value = 8.9
+   {8925,"001110101011101100101011"}, // value = 3758.7917330015634(3758.7919921875),	 argument value = 8.925
+   {8950,"001111000011011111001001"}, // value = 3853.945995422843(3853.9462890625),	 argument value = 8.950000000000001
+   {8975,"001111011011111000001001"}, // value = 3951.5090995478395(3951.5087890625),	 argument value = 8.975
+   {9000,"001111110100111000101011"}, // value = 4051.5420254925943(4051.5419921875),	 argument value = 9.0
+   {9025,"010000001110100001101110"}, // value = 4154.107297092162(4154.107421875),	 argument value = 9.025
+   {9050,"010000101000110100010011"}, // value = 4259.269020980078(4259.2685546875),	 argument value = 9.05
+   {9075,"010001000011110001011111"}, // value = 4367.092926657075(4367.0927734375),	 argument value = 9.075000000000001
+   {9100,"010001011111011010010110"}, // value = 4477.646407574158(4477.646484375),	 argument value = 9.1
+   {9125,"010001111011101111111111"}, // value = 4590.998563255739(4590.9990234375),	 argument value = 9.125
+   {9150,"010010011000110011100010"}, // value = 4707.220242489037(4707.220703125),	 argument value = 9.15
+   {9175,"010010110110100110001001"}, // value = 4826.384087606909(4826.3837890625),	 argument value = 9.175
+   {9200,"010011010101001001000010"}, // value = 4948.564579891665(4948.564453125),	 argument value = 9.200000000000001
+   {9225,"010011110100011101011010"}, // value = 5073.838086128286(5073.837890625),	 argument value = 9.225
+   {9250,"010100010100100100100010"}, // value = 5202.282906336188(5202.283203125),	 argument value = 9.25
+   {9275,"010100110101011111101011"}, // value = 5333.979322709224(5333.9794921875),	 argument value = 9.275
+   {9300,"010101010111010000001010"}, // value = 5469.009649794712(5469.009765625),	 argument value = 9.3
+   {9325,"010101111001110111010101"}, // value = 5607.458285942687(5607.4580078125),	 argument value = 9.325000000000001
+   {9350,"010110011101010110100110"}, // value = 5749.411766057619(5749.412109375),	 argument value = 9.35
+   {9375,"010111000001101111010110"}, // value = 5894.958815685577(5894.958984375),	 argument value = 9.375
+   {9400,"010111100111000011000011"}, // value = 6044.190406470527(6044.1904296875),	 argument value = 9.4
+   {9425,"011000001101010011001101"}, // value = 6197.19981301461(6197.2001953125),	 argument value = 9.425
+   {9450,"011000110100100001010101"}, // value = 6354.082671177795(6354.0830078125),	 argument value = 9.450000000000001
+   {9475,"011001011100101111000000"}, // value = 6514.937037853392(6514.9375),	 argument value = 9.475
+   {9500,"011010000101111101110100"}, // value = 6679.863452256852(6679.86328125),	 argument value = 9.5
+   {9525,"011010110000001111011100"}, // value = 6848.964998765972(6848.96484375),	 argument value = 9.525
+   {9550,"011011011011100101100100"}, // value = 7022.347371352046(7022.34765625),	 argument value = 9.55
+   {9575,"011100001000000001111010"}, // value = 7200.118939642016(7200.119140625),	 argument value = 9.575000000000001
+   {9600,"011100110101100110010000"}, // value = 7382.3908166530155(7382.390625),	 argument value = 9.600000000000001
+   {9625,"011101100100010100011100"}, // value = 7569.276928241617(7569.27734375),	 argument value = 9.625
+   {9650,"011110010100001110010100"}, // value = 7760.8940843112505(7760.89453125),	 argument value = 9.65
+   {9675,"011111000101010101110011"}, // value = 7957.362051822112(7957.3623046875),	 argument value = 9.675
+   {9700,"011111110111101100110111"}, // value = 8158.803629649473(8158.8037109375),	 argument value = 9.700000000000001
+   {9725,"100000101011010101100001"}, // value = 8365.34472533695(8365.3447265625),	 argument value = 9.725000000000001
+   {9750,"100001100000010001110101"}, // value = 8577.114433792824(8577.1142578125),	 argument value = 9.75
+   {9775,"100010010110100011111011"}, // value = 8794.245117978593(8794.2451171875),	 argument value = 9.775
+   {9800,"100011001110001101111101"} // value = 9016.872491640062(9016.8720703125),	 argument value = 9.8
+  };
diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/KFLUT.cxx b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/KFLUT.cxx
index c30a7b3a7ed7fbd07d1304527b38ee959027d765..f048ce01d31b896f5e2b7dd3dec40dbb90bc7129 100644
--- a/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/KFLUT.cxx
+++ b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/KFLUT.cxx
@@ -83,6 +83,10 @@ void TCS::KFLUT::fillLUT(){
     LUTKF.push_back(v3);
     LUTKF.push_back(v4);
 
-
-
+    //Correction for rounding when 7 decimal bit applied
+    for (auto &vet : LUTKF){
+      for (auto &veta : vet){
+	veta = std::round(veta*std::pow(2,7))/std::pow(2,7);
+      }
+    }
 }
diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/Kinematics.cxx b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/Kinematics.cxx
index e9cf4ed6292ccb8bc26f2eeec61a5a3a4ea4cdf6..8b4b4ba4c3ac50b28007e698da9372406ddbada8 100644
--- a/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/Kinematics.cxx
+++ b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/Kinematics.cxx
@@ -12,6 +12,7 @@
 #include "L1TopoSimulationUtils/Hyperbolic.h"
 #include "L1TopoSimulationUtils/L1TopoDataTypes.h"
 #include "L1TopoSimulationUtils/Trigo.h"
+#include "L1TopoSimulationUtils/Expo.h"
 #include "L1TopoEvent/GenericTOB.h"
 
 
@@ -32,7 +33,7 @@ unsigned int TSU::Kinematics::calcDeltaEtaBWLegacy(const TCS::GenericTOB* tob1,
 
 unsigned int TSU::Kinematics::calcInvMassBWLegacy(const TCS::GenericTOB* tob1, const TCS::GenericTOB* tob2){
 
-  auto bit_cosheta = TSU::L1TopoDataTypes<19,7>(TSU::Hyperbolic::Cosh.at(std::abs(tob1->eta() - tob2->eta())));
+  auto bit_cosheta = TSU::L1TopoDataTypes<19,7>(TSU::Hyperbolic::Coshleg.at(std::abs(tob1->eta() - tob2->eta())));
   //In case of EM objects / jets / taus the phi angle goes between 0 and 64 while muons are between -32 and 32, applying a shift to keep delta-phi in the allowed range. 
   int phi_tob1 = tob1->phi();
   int phi_tob2 = tob2->phi();
@@ -42,7 +43,7 @@ unsigned int TSU::Kinematics::calcInvMassBWLegacy(const TCS::GenericTOB* tob1, c
       if(phi_tob1 >= 32) phi_tob1 = phi_tob1-64;
       if(phi_tob2 >= 32) phi_tob2 = phi_tob2-64;
     }
-  auto bit_cosphi = TSU::L1TopoDataTypes<9,7>(TSU::Trigo::Cos.at(std::abs( phi_tob1 - phi_tob2 )));
+  auto bit_cosphi = TSU::L1TopoDataTypes<9,7>(TSU::Trigo::Cosleg.at(std::abs( phi_tob1 - phi_tob2 )));
   TSU::L1TopoDataTypes<11,0> bit_Et1(tob1->Et());
   TSU::L1TopoDataTypes<11,0> bit_Et2(tob2->Et());
   auto bit_invmass2 = bit_Et1*bit_Et2*(bit_cosheta - bit_cosphi)*2;
@@ -50,7 +51,7 @@ unsigned int TSU::Kinematics::calcInvMassBWLegacy(const TCS::GenericTOB* tob1, c
 }
 
 unsigned int TSU::Kinematics::calcTMassBWLegacy(const TCS::GenericTOB* tob1, const TCS::GenericTOB* tob2) {
-  auto bit_cosphi = TSU::L1TopoDataTypes<9,7>(TSU::Trigo::Cos.at(std::abs(tob1->phi() - tob2->phi())));
+  auto bit_cosphi = TSU::L1TopoDataTypes<9,7>(TSU::Trigo::Cosleg.at(std::abs(tob1->phi() - tob2->phi())));
   TSU::L1TopoDataTypes<11,0> bit_Et1(tob1->Et());
   TSU::L1TopoDataTypes<11,0> bit_Et2(tob2->Et());
   TSU::L1TopoDataTypes<22,0> bit_tmass2 = 2*bit_Et1*bit_Et2*(1.  - bit_cosphi);
@@ -70,6 +71,14 @@ unsigned int TSU::Kinematics::calcDeltaR2BWLegacy(const TCS::GenericTOB* tob1, c
   return bit_dr2;
 }
 
+float TSU::Kinematics::calcCosLegacy(unsigned phi){
+  return float(TSU::L1TopoDataTypes<9,7>(TSU::Trigo::Cosleg.at(phi)));
+}
+
+float TSU::Kinematics::calcSinLegacy(unsigned phi){
+  return float(TSU::L1TopoDataTypes<9,7>(TSU::Trigo::Sinleg.at(phi)));
+}
+
 unsigned int TSU::Kinematics::calcDeltaPhiBW(const TCS::GenericTOB* tob1, const TCS::GenericTOB* tob2){
   int dphiB = std::abs( tob1->phi() - tob2->phi() );
   if(dphiB>64)
@@ -87,25 +96,26 @@ unsigned int TSU::Kinematics::calcDeltaEtaBW(const TCS::GenericTOB* tob1, const
 
 unsigned int TSU::Kinematics::calcInvMassBW(const TCS::GenericTOB* tob1, const TCS::GenericTOB* tob2){
 
-  auto bit_cosheta = TSU::L1TopoDataTypes<19,7>(TSU::Hyperbolic::Cosh.at(std::abs(tob1->eta() - tob2->eta())));
+  auto bit_cosheta = TSU::L1TopoDataTypes<14,10>(TSU::Hyperbolic::Cosh.at(100*std::abs(tob1->eta() - tob2->eta())));
   //In case of EM objects / jets / taus the phi angle goes between 0 and 64 while muons are between -32 and 32, applying a shift to keep delta-phi in the allowed range. 
+  //those cases should happen only in mixed EM/jets/tau plus mu triggers, if both phi's are in [0,2pi] will not get in
   int phi_tob1 = tob1->phi();
   int phi_tob2 = tob2->phi();
-  //those cases should happen only in mixed EM/jets/tau plus mu triggers, if both phi's are in [0,2pi] will not get in
   if ( std::abs(phi_tob1-phi_tob2)>=64 )
     {
       if(phi_tob1 >= 32) phi_tob1 = phi_tob1-64;
       if(phi_tob2 >= 32) phi_tob2 = phi_tob2-64;
     }
-  auto bit_cosphi = TSU::L1TopoDataTypes<9,7>(TSU::Trigo::Cos.at(std::abs( phi_tob1 - phi_tob2 )));
+  auto bit_cosphi = TSU::L1TopoDataTypes<12,10>(TSU::Trigo::Cos.at(100*std::abs( phi_tob1 - phi_tob2 )));
   TSU::L1TopoDataTypes<11,0> bit_Et1(tob1->Et());
   TSU::L1TopoDataTypes<11,0> bit_Et2(tob2->Et());
   auto bit_invmass2 = bit_Et1*bit_Et2*(bit_cosheta - bit_cosphi)*2;
+  
   return int(bit_invmass2) ;
 }
 
 unsigned int TSU::Kinematics::calcTMassBW(const TCS::GenericTOB* tob1, const TCS::GenericTOB* tob2) {
-  auto bit_cosphi = TSU::L1TopoDataTypes<9,7>(TSU::Trigo::Cos.at(std::abs(tob1->phi() - tob2->phi())));
+  auto bit_cosphi = TSU::L1TopoDataTypes<12,10>(TSU::Trigo::Cos.at(100*std::abs(tob1->phi() - tob2->phi())));
   TSU::L1TopoDataTypes<11,0> bit_Et1(tob1->Et());
   TSU::L1TopoDataTypes<11,0> bit_Et2(tob2->Et());
   TSU::L1TopoDataTypes<22,0> bit_tmass2 = 2*bit_Et1*bit_Et2*(1.  - bit_cosphi);
@@ -153,6 +163,40 @@ unsigned long TSU::Kinematics::quadraticSumBW(int i1, int i2){
   return result;
 }
 
+unsigned int TSU::Kinematics::calcXi1(const TCS::GenericTOB* tob1, const TCS::GenericTOB* tob2) {
+  double scale = 1.4; // this will be converted MeV and unsigned when unit is right
+  double shift = 20; // this will be converted MeV and unsigned when unit is right
+  TSU::L1TopoDataTypes<11,0> bit_Et1(static_cast<unsigned>(scale*tob1->Et()+shift));
+  TSU::L1TopoDataTypes<11,0> bit_Et2(static_cast<unsigned>(scale*tob2->Et()+shift));
+  auto bit_eeta1 = TSU::L1TopoDataTypes<20,10>(TSU::Expo::E.at(100*tob1->eta()));
+  auto bit_eeta2 = TSU::L1TopoDataTypes<20,10>(TSU::Expo::E.at(100*tob2->eta()));
+
+  auto xi_bit = bit_Et1*bit_eeta1+bit_Et2*bit_eeta2;
+
+  return int(xi_bit);
+}
+
+unsigned int TSU::Kinematics::calcXi2(const TCS::GenericTOB* tob1, const TCS::GenericTOB* tob2) {
+  double scale = 1.4; // this will be converted MeV and unsigned when unit is right
+  double shift = 20; // this will be converted MeV and unsigned when unit is right
+  TSU::L1TopoDataTypes<11,0> bit_Et1(static_cast<unsigned>(scale*tob1->Et()+shift));
+  TSU::L1TopoDataTypes<11,0> bit_Et2(static_cast<unsigned>(scale*tob2->Et()+shift));
+  auto bit_eeta1 = TSU::L1TopoDataTypes<20,10>(TSU::Expo::E.at(-100*tob1->eta()));
+  auto bit_eeta2 = TSU::L1TopoDataTypes<20,10>(TSU::Expo::E.at(-100*tob2->eta()));
+
+  auto xi_bit = bit_Et1*bit_eeta1+bit_Et2*bit_eeta2;
+
+  return int(xi_bit);
+}
+
+float TSU::Kinematics::calcCos(unsigned phi){
+  return float(TSU::L1TopoDataTypes<12,10>(TSU::Trigo::Cos.at(100*phi)));
+}
+
+float TSU::Kinematics::calcSin(unsigned phi){
+  return float(TSU::L1TopoDataTypes<12,10>(TSU::Trigo::Sin.at(100*phi)));
+}
+
 /*------------------------------------------ NON-BITWISE --------------------------------------------------*/
 
 unsigned int TSU::Kinematics::calcDeltaPhi(const TCS::GenericTOB* tob1, const TCS::GenericTOB* tob2) {
diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/Trigo.cxx b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/Trigo.cxx
index 9761e5895b749b84f41ea42b6b5d3d21361d6845..d377460b15321e25e9093df1a97dadce12d22c5f 100644
--- a/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/Trigo.cxx
+++ b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/Trigo.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 /*********************************
  * Trigo.cxx
@@ -10,214 +10,583 @@
  *        Resolution is in PI/32. Values is in Qm.n format 
  *        with the MSB reserved for sign, and m=1, n = 7
  *
-**********************************/
+ **********************************/
 
 #include "L1TopoSimulationUtils/Trigo.h"
 #include <cmath>
 
-const std::vector<std::string> TSU::Trigo::Cos= {
-	std::string("010000000"),  // 1.0
-	std::string("001111111"),  // 0.9951847266721969
-	std::string("001111110"),  // 0.9807852804032304
-	std::string("001111010"),  // 0.9569403357322088
-	std::string("001110110"),  // 0.9238795325112867
-	std::string("001110001"),  // 0.881921264348355  // 5
-	std::string("001101010"),  // 0.8314696123025452
-	std::string("001100011"),  // 0.773010453362737
-	std::string("001011011"),  // 0.7071067811865476
-	std::string("001010001"),  // 0.6343932841636455
-	std::string("001000111"),  // 0.5555702330196023 // 10
-	std::string("000111100"),  // 0.4713967368259978
-	std::string("000110001"),  // 0.38268343236508984
-	std::string("000100101"),  // 0.29028467725446233
-	std::string("000011001"),  // 0.19509032201612833
-	std::string("000001101"),  // 0.09801714032956077 // 15 
-	std::string("000000000"),  // 6.123233995736766e-17
-	std::string("111110011"),  // -0.09801714032956065
-	std::string("111100111"),  // -0.1950903220161282
-	std::string("111011011"),  // -0.29028467725446216
-	std::string("111001111"),  // -0.3826834323650897 // 20
-	std::string("111000100"),  // -0.4713967368259977
-	std::string("110111001"),  // -0.555570233019602
-	std::string("110101111"),  // -0.6343932841636454
-	std::string("110100101"),  // -0.7071067811865475
-	std::string("110011101"),  // -0.773010453362737  // 25
-	std::string("110010110"),  // -0.8314696123025453
-	std::string("110001111"),  // -0.8819212643483549
-	std::string("110001010"),  // -0.9238795325112867
-	std::string("110000110"),  // -0.9569403357322088
-	std::string("110000010"),  // -0.9807852804032304 // 30 
-	std::string("110000001"),  // -0.9951847266721968
-	std::string("110000000"),  // -1.0
-	std::string("110000001"),  // -0.9951847266721969
-	std::string("110000010"),  // -0.9807852804032304
-	std::string("110000110"),  // -0.9569403357322089 // 35
-	std::string("110001010"),  // -0.9238795325112868
-	std::string("110001111"),  // -0.881921264348355
-	std::string("110010110"),  // -0.8314696123025455
-	std::string("110011101"),  // -0.7730104533627371
-	std::string("110100101"),  // -0.7071067811865477 // 40
-	std::string("110101111"),  // -0.6343932841636459
-	std::string("110111001"),  // -0.5555702330196022
-	std::string("111000100"),  // -0.47139673682599786
-	std::string("111001111"),  // -0.38268343236509034
-	std::string("111011011"),  // -0.29028467725446244 // 45
-	std::string("111100111"),  // -0.19509032201612866
-	std::string("111110011"),  // -0.09801714032956045
-	std::string("000000000"),  // -1.8369701987210297e-16
-	std::string("000001101"),  // 0.09801714032956009
-	std::string("000011001"),  // 0.1950903220161283
-	std::string("000100101"),  // 0.29028467725446205
-	std::string("000110001"),  // 0.38268343236509
-	std::string("000111100"),  // 0.4713967368259976
-	std::string("001000111"),  // 0.5555702330196018
-	std::string("001010001"),  // 0.6343932841636456
-	std::string("001011011"),  // 0.7071067811865474
-	std::string("001100011"),  // 0.7730104533627367
-	std::string("001101010"),  // 0.8314696123025452
-	std::string("001110001"),  // 0.8819212643483548
-	std::string("001110110"),  // 0.9238795325112865
-	std::string("001111010"),  // 0.9569403357322088
-	std::string("001111110"),  // 0.9807852804032303
-	std::string("001111111")  // 0.9951847266721969
-};
-
-
-const std::vector<std::string> TSU::Trigo::Sin = {
-	std::string("000000000"), // 0.0                 // 0
-	std::string("000001101"), // 0.0980171403295606
-	std::string("000011001"), // 0.19509032201612825
-	std::string("000100101"), // 0.29028467725446233
-	std::string("000110001"), // 0.3826834323650898
-	std::string("000111100"), // 0.47139673682599764 // 5
-	std::string("001000111"), // 0.5555702330196022
-	std::string("001010001"), // 0.6343932841636455
-	std::string("001011011"), // 0.7071067811865475
-	std::string("001100011"), // 0.773010453362737
-	std::string("001101010"), // 0.8314696123025452 // 10
-	std::string("001110001"), // 0.8819212643483549
-	std::string("001110110"), // 0.9238795325112867
-	std::string("001111010"), // 0.9569403357322089
-	std::string("001111110"), // 0.9807852804032304
-	std::string("001111111"), // 0.9951847266721968 // 15
-	std::string("010000000"), // 1.0
-	std::string("001111111"), // 0.9951847266721969
-	std::string("001111110"), // 0.9807852804032304
-	std::string("001111010"), // 0.9569403357322089
-	std::string("001110110"), // 0.9238795325112867 // 20
-	std::string("001110001"), // 0.881921264348355
-	std::string("001101010"), // 0.8314696123025455
-	std::string("001100011"), // 0.7730104533627371
-	std::string("001011011"), // 0.7071067811865476
-	std::string("001010001"), // 0.6343932841636455 // 25
-	std::string("001000111"), // 0.5555702330196022
-	std::string("000111100"), // 0.47139673682599786
-	std::string("000110001"), // 0.3826834323650899
-	std::string("000100101"), // 0.2902846772544624
-	std::string("000011001"), // 0.1950903220161286 // 30
-	std::string("000001101"), // 0.09801714032956083
-	std::string("000000000"), // 1.2246467991473532e-16
-	std::string("111110011"), // -0.09801714032956059
-	std::string("111100111"), // -0.19509032201612836
-	std::string("111011011"), // -0.2902846772544621 // 35 
-	std::string("111001111"), // -0.38268343236508967
-	std::string("111000100"), // -0.47139673682599764
-	std::string("110111001"), // -0.555570233019602
-	std::string("110101111"), // -0.6343932841636453
-	std::string("110100101"), // -0.7071067811865475 // 40
-	std::string("110011101"), // -0.7730104533627367
-	std::string("110010110"), // -0.8314696123025452
-	std::string("110001111"), // -0.8819212643483549
-	std::string("110001010"), // -0.9238795325112865
-	std::string("110000110"), // -0.9569403357322088 // 45
-	std::string("110000010"), // -0.9807852804032303
-	std::string("110000001"), // -0.9951847266721969
-	std::string("110000000"), // -1.0
-	std::string("110000001"), // -0.9951847266721969
-	std::string("110000010"), // -0.9807852804032304 // 50
-	std::string("110000110"), // -0.9569403357322089
-	std::string("110001010"), // -0.9238795325112866
-	std::string("110001111"), // -0.881921264348355
-	std::string("110010110"), // -0.8314696123025455
-	std::string("110011101"), // -0.7730104533627369 // 55
-	std::string("110100101"), // -0.7071067811865477
-	std::string("110101111"), // -0.6343932841636459
-	std::string("110111001"), // -0.5555702330196022
-	std::string("111000100"), // -0.4713967368259979
-	std::string("111001111"), // -0.3826834323650904 // 60
-	std::string("111011011"), // -0.2902846772544625
-	std::string("111100111"), // -0.19509032201612872
-	std::string("111110011") // -0.0980171403295605  // 63
-};
+const std::unordered_map<unsigned,std::string> TSU::Trigo::Cosleg=
+  {
+   //legacy
+   {0,"010000000"},  // 1.0
+   {1,"001111111"},  // 0.9951847266721969
+   {2,"001111110"},  // 0.9807852804032304
+   {3,"001111010"},  // 0.9569403357322088
+   {4,"001110110"},  // 0.9238795325112867
+   {5,"001110001"},  // 0.881921264348355  // 5
+   {6,"001101010"},  // 0.8314696123025452
+   {7,"001100011"},  // 0.773010453362737
+   {8,"001011011"},  // 0.7071067811865476
+   {9,"001010001"},  // 0.6343932841636455
+   {10,"001000111"},  // 0.5555702330196023 // 10
+   {11,"000111100"},  // 0.4713967368259978
+   {12,"000110001"},  // 0.38268343236508984
+   {13,"000100101"},  // 0.29028467725446233
+   {14,"000011001"},  // 0.19509032201612833
+   {15,"000001101"},  // 0.09801714032956077 // 15 
+   {16,"000000000"},  // 6.123233995736766e-17
+   {17,"111110011"},  // -0.09801714032956065
+   {18,"111100111"},  // -0.1950903220161282
+   {19,"111011011"},  // -0.29028467725446216
+   {20,"111001111"},  // -0.3826834323650897 // 20
+   {21,"111000100"},  // -0.4713967368259977
+   {22,"110111001"},  // -0.555570233019602
+   {23,"110101111"},  // -0.6343932841636454
+   {24,"110100101"},  // -0.7071067811865475
+   {25,"110011101"},  // -0.773010453362737  // 25
+   {26,"110010110"},  // -0.8314696123025453
+   {27,"110001111"},  // -0.8819212643483549
+   {28,"110001010"},  // -0.9238795325112867
+   {29,"110000110"},  // -0.9569403357322088
+   {30,"110000010"},  // -0.9807852804032304 // 30 
+   {31,"110000001"},  // -0.9951847266721968
+   {32,"110000000"},  // -1.0
+   {33,"110000001"},  // -0.9951847266721969
+   {34,"110000010"},  // -0.9807852804032304
+   {35,"110000110"},  // -0.9569403357322089 // 35
+   {36,"110001010"},  // -0.9238795325112868
+   {37,"110001111"},  // -0.881921264348355
+   {38,"110010110"},  // -0.8314696123025455
+   {39,"110011101"},  // -0.7730104533627371
+   {40,"110100101"},  // -0.7071067811865477 // 40
+   {41,"110101111"},  // -0.6343932841636459
+   {42,"110111001"},  // -0.5555702330196022
+   {43,"111000100"},  // -0.47139673682599786
+   {44,"111001111"},  // -0.38268343236509034
+   {45,"111011011"},  // -0.29028467725446244 // 45
+   {46,"111100111"},  // -0.19509032201612866
+   {47,"111110011"},  // -0.09801714032956045
+   {48,"000000000"},  // -1.8369701987210297e-16
+   {49,"000001101"},  // 0.09801714032956009
+   {50,"000011001"},  // 0.1950903220161283
+   {51,"000100101"},  // 0.29028467725446205
+   {52,"000110001"},  // 0.38268343236509
+   {53,"000111100"},  // 0.4713967368259976
+   {54,"001000111"},  // 0.5555702330196018
+   {55,"001010001"},  // 0.6343932841636456
+   {56,"001011011"},  // 0.7071067811865474
+   {57,"001100011"},  // 0.7730104533627367
+   {58,"001101010"},  // 0.8314696123025452
+   {59,"001110001"},  // 0.8819212643483548
+   {60,"001110110"},  // 0.9238795325112865
+   {61,"001111010"},  // 0.9569403357322088
+   {62,"001111110"},  // 0.9807852804032303
+   {63,"001111111"}  // 0.9951847266721969
+  };
+
+//phase1
+const std::unordered_map<unsigned,std::string> TSU::Trigo::Cos=
+  {
+   {0,"010000000000"}, // value = 1.0(1.0),	 argument value = 0.0
+   {50,"001111111111"}, // value = 0.9987954562051724(0.9990234375),	 argument value = 0.04908738521234052
+   {100,"001111111011"}, // value = 0.9951847266721969(0.9951171875),	 argument value = 0.09817477042468103
+   {150,"001111110101"}, // value = 0.989176509964781(0.9892578125),	 argument value = 0.14726215563702155
+   {200,"001111101100"}, // value = 0.9807852804032304(0.98046875),	 argument value = 0.19634954084936207
+   {250,"001111100001"}, // value = 0.970031253194544(0.9697265625),	 argument value = 0.2454369260617026
+   {300,"001111010100"}, // value = 0.9569403357322088(0.95703125),	 argument value = 0.2945243112740431
+   {350,"001111000100"}, // value = 0.9415440651830208(0.94140625),	 argument value = 0.3436116964863836
+   {400,"001110110010"}, // value = 0.9238795325112867(0.923828125),	 argument value = 0.39269908169872414
+   {450,"001110011110"}, // value = 0.9039892931234433(0.904296875),	 argument value = 0.44178646691106466
+   {500,"001110000111"}, // value = 0.881921264348355(0.8818359375),	 argument value = 0.4908738521234052
+   {550,"001101101110"}, // value = 0.8577286100002721(0.857421875),	 argument value = 0.5399612373357456
+   {600,"001101010011"}, // value = 0.8314696123025452(0.8310546875),	 argument value = 0.5890486225480862
+   {650,"001100110110"}, // value = 0.8032075314806449(0.802734375),	 argument value = 0.6381360077604268
+   {700,"001100011000"}, // value = 0.773010453362737(0.7734375),	 argument value = 0.6872233929727672
+   {750,"001011110111"}, // value = 0.7409511253549591(0.7412109375),	 argument value = 0.7363107781851077
+   {800,"001011010100"}, // value = 0.7071067811865476(0.70703125),	 argument value = 0.7853981633974483
+   {850,"001010110000"}, // value = 0.6715589548470183(0.671875),	 argument value = 0.8344855486097889
+   {900,"001010001010"}, // value = 0.6343932841636455(0.634765625),	 argument value = 0.8835729338221293
+   {950,"001001100010"}, // value = 0.5956993044924335(0.595703125),	 argument value = 0.9326603190344698
+   {1000,"001000111001"}, // value = 0.5555702330196023(0.5556640625),	 argument value = 0.9817477042468103
+   {1050,"001000001110"}, // value = 0.5141027441932217(0.513671875),	 argument value = 1.030835089459151
+   {1100,"000111100011"}, // value = 0.4713967368259978(0.4716796875),	 argument value = 1.0799224746714913
+   {1150,"000110110110"}, // value = 0.4275550934302822(0.427734375),	 argument value = 1.1290098598838318
+   {1200,"000110001000"}, // value = 0.38268343236508984(0.3828125),	 argument value = 1.1780972450961724
+   {1250,"000101011001"}, // value = 0.33688985339222005(0.3369140625),	 argument value = 1.227184630308513
+   {1300,"000100101001"}, // value = 0.29028467725446233(0.2900390625),	 argument value = 1.2762720155208536
+   {1350,"000011111001"}, // value = 0.24298017990326398(0.2431640625),	 argument value = 1.325359400733194
+   {1400,"000011001000"}, // value = 0.19509032201612833(0.1953125),	 argument value = 1.3744467859455345
+   {1450,"000010010110"}, // value = 0.14673047445536175(0.146484375),	 argument value = 1.423534171157875
+   {1500,"000001100100"}, // value = 0.09801714032956077(0.09765625),	 argument value = 1.4726215563702154
+   {1550,"000000110010"}, // value = 0.049067674327418126(0.048828125),	 argument value = 1.521708941582556
+   {1600,"000000000000"}, // value = 6.123233995736766e-17(0.0),	 argument value = 1.5707963267948966
+   {1650,"111111001110"}, // value = -0.04906767432741801(-0.048828125),	 argument value = 1.6198837120072371
+   {1700,"111110011100"}, // value = -0.09801714032956065(-0.09765625),	 argument value = 1.6689710972195777
+   {1750,"111101101010"}, // value = -0.14673047445536164(-0.146484375),	 argument value = 1.718058482431918
+   {1800,"111100111000"}, // value = -0.1950903220161282(-0.1953125),	 argument value = 1.7671458676442586
+   {1850,"111100000111"}, // value = -0.24298017990326387(-0.2431640625),	 argument value = 1.8162332528565992
+   {1900,"111011010111"}, // value = -0.29028467725446216(-0.2900390625),	 argument value = 1.8653206380689396
+   {1950,"111010100111"}, // value = -0.33688985339221994(-0.3369140625),	 argument value = 1.9144080232812801
+   {2000,"111001111000"}, // value = -0.3826834323650897(-0.3828125),	 argument value = 1.9634954084936207
+   {2050,"111001001010"}, // value = -0.42755509343028186(-0.427734375),	 argument value = 2.012582793705961
+   {2100,"111000011101"}, // value = -0.4713967368259977(-0.4716796875),	 argument value = 2.061670178918302
+   {2150,"110111110010"}, // value = -0.5141027441932217(-0.513671875),	 argument value = 2.110757564130642
+   {2200,"110111000111"}, // value = -0.555570233019602(-0.5556640625),	 argument value = 2.1598449493429825
+   {2250,"110110011110"}, // value = -0.5956993044924334(-0.595703125),	 argument value = 2.2089323345553233
+   {2300,"110101110110"}, // value = -0.6343932841636454(-0.634765625),	 argument value = 2.2580197197676637
+   {2350,"110101010000"}, // value = -0.6715589548470184(-0.671875),	 argument value = 2.3071071049800045
+   {2400,"110100101100"}, // value = -0.7071067811865475(-0.70703125),	 argument value = 2.356194490192345
+   {2450,"110100001001"}, // value = -0.7409511253549589(-0.7412109375),	 argument value = 2.405281875404685
+   {2500,"110011101000"}, // value = -0.773010453362737(-0.7734375),	 argument value = 2.454369260617026
+   {2550,"110011001010"}, // value = -0.8032075314806448(-0.802734375),	 argument value = 2.5034566458293663
+   {2600,"110010101101"}, // value = -0.8314696123025453(-0.8310546875),	 argument value = 2.552544031041707
+   {2650,"110010010010"}, // value = -0.857728610000272(-0.857421875),	 argument value = 2.6016314162540475
+   {2700,"110001111001"}, // value = -0.8819212643483549(-0.8818359375),	 argument value = 2.650718801466388
+   {2750,"110001100010"}, // value = -0.9039892931234433(-0.904296875),	 argument value = 2.6998061866787286
+   {2800,"110001001110"}, // value = -0.9238795325112867(-0.923828125),	 argument value = 2.748893571891069
+   {2850,"110000111100"}, // value = -0.9415440651830207(-0.94140625),	 argument value = 2.7979809571034093
+   {2900,"110000101100"}, // value = -0.9569403357322088(-0.95703125),	 argument value = 2.84706834231575
+   {2950,"110000011111"}, // value = -0.970031253194544(-0.9697265625),	 argument value = 2.8961557275280905
+   {3000,"110000010100"}, // value = -0.9807852804032304(-0.98046875),	 argument value = 2.945243112740431
+   {3050,"110000001011"}, // value = -0.989176509964781(-0.9892578125),	 argument value = 2.9943304979527716
+   {3100,"110000000101"}, // value = -0.9951847266721968(-0.9951171875),	 argument value = 3.043417883165112
+   {3150,"110000000001"}, // value = -0.9987954562051724(-0.9990234375),	 argument value = 3.0925052683774528
+   {3200,"110000000000"}, // value = -1.0(-1.0),	 argument value = 3.141592653589793
+   {3250,"110000000001"}, // value = -0.9987954562051724(-0.9990234375),	 argument value = 3.1906800388021335
+   {3300,"110000000101"}, // value = -0.9951847266721969(-0.9951171875),	 argument value = 3.2397674240144743
+   {3350,"110000001011"}, // value = -0.989176509964781(-0.9892578125),	 argument value = 3.2888548092268146
+   {3400,"110000010100"}, // value = -0.9807852804032304(-0.98046875),	 argument value = 3.3379421944391554
+   {3450,"110000011111"}, // value = -0.970031253194544(-0.9697265625),	 argument value = 3.3870295796514958
+   {3500,"110000101100"}, // value = -0.9569403357322089(-0.95703125),	 argument value = 3.436116964863836
+   {3550,"110000111100"}, // value = -0.9415440651830208(-0.94140625),	 argument value = 3.485204350076177
+   {3600,"110001001110"}, // value = -0.9238795325112868(-0.923828125),	 argument value = 3.5342917352885173
+   {3650,"110001100010"}, // value = -0.9039892931234434(-0.904296875),	 argument value = 3.5833791205008576
+   {3700,"110001111001"}, // value = -0.881921264348355(-0.8818359375),	 argument value = 3.6324665057131984
+   {3750,"110010010010"}, // value = -0.8577286100002721(-0.857421875),	 argument value = 3.6815538909255388
+   {3800,"110010101101"}, // value = -0.8314696123025455(-0.8310546875),	 argument value = 3.730641276137879
+   {3850,"110011001010"}, // value = -0.8032075314806449(-0.802734375),	 argument value = 3.77972866135022
+   {3900,"110011101000"}, // value = -0.7730104533627371(-0.7734375),	 argument value = 3.8288160465625602
+   {3950,"110100001001"}, // value = -0.7409511253549591(-0.7412109375),	 argument value = 3.877903431774901
+   {4000,"110100101100"}, // value = -0.7071067811865477(-0.70703125),	 argument value = 3.9269908169872414
+   {4050,"110101010000"}, // value = -0.6715589548470187(-0.671875),	 argument value = 3.9760782021995817
+   {4100,"110101110110"}, // value = -0.6343932841636459(-0.634765625),	 argument value = 4.025165587411922
+   {4150,"110110011110"}, // value = -0.5956993044924331(-0.595703125),	 argument value = 4.074252972624263
+   {4200,"110111000111"}, // value = -0.5555702330196022(-0.5556640625),	 argument value = 4.123340357836604
+   {4250,"110111110010"}, // value = -0.5141027441932218(-0.513671875),	 argument value = 4.172427743048944
+   {4300,"111000011101"}, // value = -0.47139673682599786(-0.4716796875),	 argument value = 4.221515128261284
+   {4350,"111001001010"}, // value = -0.4275550934302825(-0.427734375),	 argument value = 4.270602513473625
+   {4400,"111001111000"}, // value = -0.38268343236509034(-0.3828125),	 argument value = 4.319689898685965
+   {4450,"111010100111"}, // value = -0.33688985339221994(-0.3369140625),	 argument value = 4.368777283898306
+   {4500,"111011010111"}, // value = -0.29028467725446244(-0.2900390625),	 argument value = 4.417864669110647
+   {4550,"111100000111"}, // value = -0.24298017990326412(-0.2431640625),	 argument value = 4.466952054322987
+   {4600,"111100111000"}, // value = -0.19509032201612866(-0.1953125),	 argument value = 4.516039439535327
+   {4650,"111101101010"}, // value = -0.1467304744553623(-0.146484375),	 argument value = 4.565126824747668
+   {4700,"111110011100"}, // value = -0.09801714032956045(-0.09765625),	 argument value = 4.614214209960009
+   {4750,"111111001110"}, // value = -0.04906767432741803(-0.048828125),	 argument value = 4.663301595172349
+   {4800,"000000000000"}, // value = -1.8369701987210297e-16(0.0),	 argument value = 4.71238898038469
+   {4850,"000000110010"}, // value = 0.04906767432741766(0.048828125),	 argument value = 4.76147636559703
+   {4900,"000001100100"}, // value = 0.09801714032956009(0.09765625),	 argument value = 4.81056375080937
+   {4950,"000010010110"}, // value = 0.14673047445536194(0.146484375),	 argument value = 4.859651136021712
+   {5000,"000011001000"}, // value = 0.1950903220161283(0.1953125),	 argument value = 4.908738521234052
+   {5050,"000011111001"}, // value = 0.24298017990326376(0.2431640625),	 argument value = 4.957825906446392
+   {5100,"000100101001"}, // value = 0.29028467725446205(0.2900390625),	 argument value = 5.006913291658733
+   {5150,"000101011001"}, // value = 0.3368898533922196(0.3369140625),	 argument value = 5.056000676871073
+   {5200,"000110001000"}, // value = 0.38268343236509(0.3828125),	 argument value = 5.105088062083414
+   {5250,"000110110110"}, // value = 0.42755509343028214(0.427734375),	 argument value = 5.154175447295755
+   {5300,"000111100011"}, // value = 0.4713967368259976(0.4716796875),	 argument value = 5.203262832508095
+   {5350,"001000001110"}, // value = 0.5141027441932216(0.513671875),	 argument value = 5.252350217720435
+   {5400,"001000111001"}, // value = 0.5555702330196018(0.5556640625),	 argument value = 5.301437602932776
+   {5450,"001001100010"}, // value = 0.5956993044924329(0.595703125),	 argument value = 5.350524988145116
+   {5500,"001010001010"}, // value = 0.6343932841636456(0.634765625),	 argument value = 5.399612373357457
+   {5550,"001010110000"}, // value = 0.6715589548470183(0.671875),	 argument value = 5.448699758569798
+   {5600,"001011010100"}, // value = 0.7071067811865474(0.70703125),	 argument value = 5.497787143782138
+   {5650,"001011110111"}, // value = 0.7409511253549589(0.7412109375),	 argument value = 5.546874528994478
+   {5700,"001100011000"}, // value = 0.7730104533627367(0.7734375),	 argument value = 5.595961914206819
+   {5750,"001100110110"}, // value = 0.803207531480645(0.802734375),	 argument value = 5.64504929941916
+   {5800,"001101010011"}, // value = 0.8314696123025452(0.8310546875),	 argument value = 5.6941366846315
+   {5850,"001101101110"}, // value = 0.857728610000272(0.857421875),	 argument value = 5.743224069843841
+   {5900,"001110000111"}, // value = 0.8819212643483548(0.8818359375),	 argument value = 5.792311455056181
+   {5950,"001110011110"}, // value = 0.9039892931234431(0.904296875),	 argument value = 5.841398840268521
+   {6000,"001110110010"}, // value = 0.9238795325112865(0.923828125),	 argument value = 5.890486225480862
+   {6050,"001111000100"}, // value = 0.9415440651830208(0.94140625),	 argument value = 5.939573610693203
+   {6100,"001111010100"}, // value = 0.9569403357322088(0.95703125),	 argument value = 5.988660995905543
+   {6150,"001111100001"}, // value = 0.970031253194544(0.9697265625),	 argument value = 6.037748381117884
+   {6200,"001111101100"}, // value = 0.9807852804032303(0.98046875),	 argument value = 6.086835766330224
+   {6250,"001111110101"}, // value = 0.9891765099647809(0.9892578125),	 argument value = 6.135923151542564
+   {6300,"001111111011"}, // value = 0.9951847266721969(0.9951171875),	 argument value = 6.1850105367549055
+   {6350,"001111111111"} // value = 0.9987954562051724(0.9990234375),	 argument value = 6.234097921967246
+  };
+
+
+const std::unordered_map<unsigned,std::string> TSU::Trigo::Sinleg =
+  {
+   {0,"000000000"}, // 0.0                 // 0
+   {1,"000001101"}, // 0.0980171403295606
+   {2,"000011001"}, // 0.19509032201612825
+   {3,"000100101"}, // 0.29028467725446233
+   {4,"000110001"}, // 0.3826834323650898
+   {5,"000111100"}, // 0.47139673682599764 // 5
+   {6,"001000111"}, // 0.5555702330196022
+   {7,"001010001"}, // 0.6343932841636455
+   {8,"001011011"}, // 0.7071067811865475
+   {9,"001100011"}, // 0.773010453362737
+   {10,"001101010"}, // 0.8314696123025452 // 10
+   {11,"001110001"}, // 0.8819212643483549
+   {12,"001110110"}, // 0.9238795325112867
+   {13,"001111010"}, // 0.9569403357322089
+   {14,"001111110"}, // 0.9807852804032304
+   {15,"001111111"}, // 0.9951847266721968 // 15
+   {16,"010000000"}, // 1.0
+   {17,"001111111"}, // 0.9951847266721969
+   {18,"001111110"}, // 0.9807852804032304
+   {19,"001111010"}, // 0.9569403357322089
+   {20,"001110110"}, // 0.9238795325112867 // 20
+   {21,"001110001"}, // 0.881921264348355
+   {22,"001101010"}, // 0.8314696123025455
+   {23,"001100011"}, // 0.7730104533627371
+   {24,"001011011"}, // 0.7071067811865476
+   {25,"001010001"}, // 0.6343932841636455 // 25
+   {26,"001000111"}, // 0.5555702330196022
+   {27,"000111100"}, // 0.47139673682599786
+   {28,"000110001"}, // 0.3826834323650899
+   {29,"000100101"}, // 0.2902846772544624
+   {30,"000011001"}, // 0.1950903220161286 // 30
+   {31,"000001101"}, // 0.09801714032956083
+   {32,"000000000"}, // 1.2246467991473532e-16
+   {33,"111110011"}, // -0.09801714032956059
+   {34,"111100111"}, // -0.19509032201612836
+   {35,"111011011"}, // -0.2902846772544621 // 35 
+   {36,"111001111"}, // -0.38268343236508967
+   {37,"111000100"}, // -0.47139673682599764
+   {38,"110111001"}, // -0.555570233019602
+   {39,"110101111"}, // -0.6343932841636453
+   {40,"110100101"}, // -0.7071067811865475 // 40
+   {41,"110011101"}, // -0.7730104533627367
+   {42,"110010110"}, // -0.8314696123025452
+   {43,"110001111"}, // -0.8819212643483549
+   {44,"110001010"}, // -0.9238795325112865
+   {45,"110000110"}, // -0.9569403357322088 // 45
+   {46,"110000010"}, // -0.9807852804032303
+   {47,"110000001"}, // -0.9951847266721969
+   {48,"110000000"}, // -1.0
+   {49,"110000001"}, // -0.9951847266721969
+   {50,"110000010"}, // -0.9807852804032304 // 50
+   {51,"110000110"}, // -0.9569403357322089
+   {52,"110001010"}, // -0.9238795325112866
+   {53,"110001111"}, // -0.881921264348355
+   {54,"110010110"}, // -0.8314696123025455
+   {55,"110011101"}, // -0.7730104533627369 // 55
+   {56,"110100101"}, // -0.7071067811865477
+   {57,"110101111"}, // -0.6343932841636459
+   {58,"110111001"}, // -0.5555702330196022
+   {59,"111000100"}, // -0.4713967368259979
+   {60,"111001111"}, // -0.3826834323650904 // 60
+   {61,"111011011"}, // -0.2902846772544625
+   {62,"111100111"}, // -0.19509032201612872
+   {63,"111110011"} // -0.0980171403295605  // 63
+  };
+
+//phase1
+const std::unordered_map<unsigned,std::string> TSU::Trigo::Sin=
+  {
+   {0,"000000000000"}, // 0.0
+   {50,"000000110010"}, // 0.049067674327418015
+   {100,"000001100100"}, // 0.0980171403295606
+   {150,"000010010110"}, // 0.14673047445536175
+   {200,"000011001000"}, // 0.19509032201612825
+   {250,"000011111001"}, // 0.24298017990326387
+   {300,"000100101001"}, // 0.29028467725446233
+   {350,"000101011001"}, // 0.33688985339222005
+   {400,"000110001000"}, // 0.3826834323650898
+   {450,"000110110110"}, // 0.4275550934302821
+   {500,"000111100011"}, // 0.47139673682599764
+   {550,"001000001110"}, // 0.5141027441932217
+   {600,"001000111001"}, // 0.5555702330196022
+   {650,"001001100010"}, // 0.5956993044924334
+   {700,"001010001010"}, // 0.6343932841636455
+   {750,"001010110000"}, // 0.6715589548470183
+   {800,"001011010100"}, // 0.7071067811865475
+   {850,"001011110111"}, // 0.7409511253549591
+   {900,"001100011000"}, // 0.773010453362737
+   {950,"001100110110"}, // 0.8032075314806448
+   {1000,"001101010011"}, // 0.8314696123025452
+   {1050,"001101101110"}, // 0.8577286100002721
+   {1100,"001110000111"}, // 0.8819212643483549
+   {1150,"001110011110"}, // 0.9039892931234433
+   {1200,"001110110010"}, // 0.9238795325112867
+   {1250,"001111000100"}, // 0.9415440651830208
+   {1300,"001111010100"}, // 0.9569403357322089
+   {1350,"001111100001"}, // 0.970031253194544
+   {1400,"001111101100"}, // 0.9807852804032304
+   {1450,"001111110101"}, // 0.989176509964781
+   {1500,"001111111011"}, // 0.9951847266721968
+   {1550,"001111111111"}, // 0.9987954562051724
+   {1600,"010000000000"}, // 1.0
+   {1650,"001111111111"}, // 0.9987954562051724
+   {1700,"001111111011"}, // 0.9951847266721969
+   {1750,"001111110101"}, // 0.989176509964781
+   {1800,"001111101100"}, // 0.9807852804032304
+   {1850,"001111100001"}, // 0.970031253194544
+   {1900,"001111010100"}, // 0.9569403357322089
+   {1950,"001111000100"}, // 0.9415440651830208
+   {2000,"001110110010"}, // 0.9238795325112867
+   {2050,"001110011110"}, // 0.9039892931234434
+   {2100,"001110000111"}, // 0.881921264348355
+   {2150,"001101101110"}, // 0.8577286100002721
+   {2200,"001101010011"}, // 0.8314696123025455
+   {2250,"001100110110"}, // 0.8032075314806449
+   {2300,"001100011000"}, // 0.7730104533627371
+   {2350,"001011110111"}, // 0.740951125354959
+   {2400,"001011010100"}, // 0.7071067811865476
+   {2450,"001010110000"}, // 0.6715589548470186
+   {2500,"001010001010"}, // 0.6343932841636455
+   {2550,"001001100010"}, // 0.5956993044924335
+   {2600,"001000111001"}, // 0.5555702330196022
+   {2650,"001000001110"}, // 0.5141027441932218
+   {2700,"000111100011"}, // 0.47139673682599786
+   {2750,"000110110110"}, // 0.42755509343028203
+   {2800,"000110001000"}, // 0.3826834323650899
+   {2850,"000101011001"}, // 0.33688985339222033
+   {2900,"000100101001"}, // 0.2902846772544624
+   {2950,"000011111001"}, // 0.24298017990326407
+   {3000,"000011001000"}, // 0.1950903220161286
+   {3050,"000010010110"}, // 0.1467304744553618
+   {3100,"000001100100"}, // 0.09801714032956083
+   {3150,"000000110010"}, // 0.049067674327417966
+   {3200,"000000000000"}, // 1.2246467991473532e-16
+   {3250,"111111001110"}, // -0.049067674327417724
+   {3300,"111110011100"}, // -0.09801714032956059
+   {3350,"111101101010"}, // -0.14673047445536158
+   {3400,"111100111000"}, // -0.19509032201612836
+   {3450,"111100000111"}, // -0.24298017990326382
+   {3500,"111011010111"}, // -0.2902846772544621
+   {3550,"111010100111"}, // -0.3368898533922201
+   {3600,"111001111000"}, // -0.38268343236508967
+   {3650,"111001001010"}, // -0.4275550934302818
+   {3700,"111000011101"}, // -0.47139673682599764
+   {3750,"110111110010"}, // -0.5141027441932216
+   {3800,"110111000111"}, // -0.555570233019602
+   {3850,"110110011110"}, // -0.5956993044924332
+   {3900,"110101110110"}, // -0.6343932841636453
+   {3950,"110101010000"}, // -0.6715589548470184
+   {4000,"110100101100"}, // -0.7071067811865475
+   {4050,"110100001001"}, // -0.7409511253549589
+   {4100,"110011101000"}, // -0.7730104533627367
+   {4150,"110011001010"}, // -0.803207531480645
+   {4200,"110010101101"}, // -0.8314696123025452
+   {4250,"110010010010"}, // -0.857728610000272
+   {4300,"110001111001"}, // -0.8819212643483549
+   {4350,"110001100010"}, // -0.9039892931234431
+   {4400,"110001001110"}, // -0.9238795325112865
+   {4450,"110000111100"}, // -0.9415440651830208
+   {4500,"110000101100"}, // -0.9569403357322088
+   {4550,"110000011111"}, // -0.970031253194544
+   {4600,"110000010100"}, // -0.9807852804032303
+   {4650,"110000001011"}, // -0.9891765099647809
+   {4700,"110000000101"}, // -0.9951847266721969
+   {4750,"110000000001"}, // -0.9987954562051724
+   {4800,"110000000000"}, // -1.0
+   {4850,"110000000001"}, // -0.9987954562051724
+   {4900,"110000000101"}, // -0.9951847266721969
+   {4950,"110000001011"}, // -0.9891765099647809
+   {5000,"110000010100"}, // -0.9807852804032304
+   {5050,"110000011111"}, // -0.970031253194544
+   {5100,"110000101100"}, // -0.9569403357322089
+   {5150,"110000111100"}, // -0.9415440651830209
+   {5200,"110001001110"}, // -0.9238795325112866
+   {5250,"110001100010"}, // -0.9039892931234433
+   {5300,"110001111001"}, // -0.881921264348355
+   {5350,"110010010010"}, // -0.8577286100002722
+   {5400,"110010101101"}, // -0.8314696123025455
+   {5450,"110011001010"}, // -0.8032075314806453
+   {5500,"110011101000"}, // -0.7730104533627369
+   {5550,"110100001001"}, // -0.7409511253549591
+   {5600,"110100101100"}, // -0.7071067811865477
+   {5650,"110101010000"}, // -0.6715589548470187
+   {5700,"110101110110"}, // -0.6343932841636459
+   {5750,"110110011110"}, // -0.5956993044924332
+   {5800,"110111000111"}, // -0.5555702330196022
+   {5850,"110111110010"}, // -0.5141027441932219
+   {5900,"111000011101"}, // -0.4713967368259979
+   {5950,"111001001010"}, // -0.42755509343028253
+   {6000,"111001111000"}, // -0.3826834323650904
+   {6050,"111010100111"}, // -0.33688985339222
+   {6100,"111011010111"}, // -0.2902846772544625
+   {6150,"111100000111"}, // -0.24298017990326418
+   {6200,"111100111000"}, // -0.19509032201612872
+   {6250,"111101101010"}, // -0.1467304744553624
+   {6300,"111110011100"}, // -0.0980171403295605
+   {6350,"111111001110"}  // -0.04906767432741809
+  };
+
+int TSU::Trigo::atan2leg(TSU::L1TopoDataTypes<16,0> x, TSU::L1TopoDataTypes<16,0> y){
+  short int octant=0;
+  if((x.value()&(1<<16))&&(y.value()&(1<<16))){ // Ex and Ey negative
+    if(std::abs(y.to_float()) < std::abs(x.to_float())) octant = 4; //100
+    else octant = 5; // 101
+  } else if(x.value()&(1<<16)){
+    if(std::abs(y.to_float()) < std::abs(x.to_float())) octant = 3; //011
+    else octant = 2; // 010
+  } else if(y.value()&(1<<16)){
+    if(std::abs(y.to_float()) < std::abs(x.to_float())) octant = 7; //111
+    else octant = 6; // 110
+  } else { // Ex and Ey both positive
+    if(std::abs(y.to_float()) < std::abs(x.to_float())) octant = 0; //000
+    else octant = 1; // 001
+  }
+
+  auto signed_x_f = x;
+  auto signed_y_f = y;
+  if(octant==0||octant==3||octant==4||octant==7){
+    //signed_x_f = (abs(int(x)));
+    signed_x_f = x.abs();
+    signed_y_f = y.abs();
+  } else {
+    //signed_x_f = (abs(int(y)));
+    signed_x_f = y.abs();
+    signed_y_f = x.abs();
+  }
+
+  const std::vector<std::string> atan2_thresholds = {
+						     "000010011101100",  //  1.260 (0.9)
+						     "000011000010101", //  1.557 (1.0)
+						     "000011110101100", //  1.964 (1.1)
+						     "000101000001100", //  2.572 (1.2)
+						     "000111000010010", //  3.602 (1.3)
+						     "001011010100101", //  5.797 (1.4)
+						     "011011100010101"}; // 14.101 (1.5)
+  unsigned int flag = 0;
+  for(size_t j=0;j<atan2_thresholds.size(); ++j){
+    auto thresh =  TSU::L1TopoDataTypes<15,10>(atan2_thresholds.at(j));
+    auto yy = signed_y_f*thresh;
+    if(signed_x_f.to_float() > yy.to_float()) flag = (flag | (1<<j));
+  }
+  unsigned int octant_fine = 0;
+  if(flag==0) octant_fine = 7;
+  else if(flag==1) octant_fine = 6;
+  else if(flag==3) octant_fine = 5;
+  else if(flag==7) octant_fine = 4;
+  else if(flag==15) octant_fine = 3;
+  else if(flag==31) octant_fine = 2;
+  else if(flag==63) octant_fine = 1;
+  else if(flag==127) octant_fine = 0;
+
+  unsigned int octant_fine2 = 0;
+  if(flag==0) octant_fine2 = 0;
+  else if(flag==1) octant_fine2 = 1;
+  else if(flag==3) octant_fine2 = 2;
+  else if(flag==7) octant_fine2 = 3;
+  else if(flag==15) octant_fine2 = 4;
+  else if(flag==31) octant_fine2 = 5;
+  else if(flag==63) octant_fine2 = 6;
+  else if(flag==127) octant_fine2 = 7;
+
+  int intphi = octant << 3;
+  if(octant==0||octant==2||octant==4||octant==6){
+    intphi |= octant_fine;
+  } else {
+    intphi |= octant_fine2;
+  }
+
+  return intphi;
+}
 
 int TSU::Trigo::atan2(TSU::L1TopoDataTypes<16,0> x, TSU::L1TopoDataTypes<16,0> y){
-         short int octant=0;
-         if((x.value()&(1<<16))&&(y.value()&(1<<16))){ // Ex and Ey negative
-           if(std::abs(y.to_float()) < std::abs(x.to_float())) octant = 4; //100
-            else octant = 5; // 101
-         } else if(x.value()&(1<<16)){
-            if(std::abs(y.to_float()) < std::abs(x.to_float())) octant = 3; //011
-            else octant = 2; // 010
-         } else if(y.value()&(1<<16)){
-            if(std::abs(y.to_float()) < std::abs(x.to_float())) octant = 7; //111
-            else octant = 6; // 110
-         } else { // Ex and Ey both positive
-            if(std::abs(y.to_float()) < std::abs(x.to_float())) octant = 0; //000
-            else octant = 1; // 001
-         }
-
-         auto signed_x_f = x;
-         auto signed_y_f = y;
-         if(octant==0||octant==3||octant==4||octant==7){
-            //signed_x_f = (abs(int(x)));
-            signed_x_f = x.abs();
-            signed_y_f = y.abs();
-         } else {
-            //signed_x_f = (abs(int(y)));
-            signed_x_f = y.abs();
-            signed_y_f = x.abs();
-         }
-
-         const std::vector<std::string> atan2_thresholds = {
-                                        "000010011101100",  //  1.260 (0.9)
-                                        "000011000010101", //  1.557 (1.0)
-                                        "000011110101100", //  1.964 (1.1)
-                                        "000101000001100", //  2.572 (1.2)
-                                        "000111000010010", //  3.602 (1.3)
-                                        "001011010100101", //  5.797 (1.4)
-                                        "011011100010101"}; // 14.101 (1.5)
-         unsigned int flag = 0;
-         for(size_t j=0;j<atan2_thresholds.size(); ++j){
-            auto thresh =  TSU::L1TopoDataTypes<15,10>(atan2_thresholds.at(j));
-            auto yy = signed_y_f*thresh;
-            if(signed_x_f.to_float() > yy.to_float()) flag = (flag | (1<<j));
-         }
-         unsigned int octant_fine = 0;
-         if(flag==0) octant_fine = 7;
-         else if(flag==1) octant_fine = 6;
-         else if(flag==3) octant_fine = 5;
-         else if(flag==7) octant_fine = 4;
-         else if(flag==15) octant_fine = 3;
-         else if(flag==31) octant_fine = 2;
-         else if(flag==63) octant_fine = 1;
-         else if(flag==127) octant_fine = 0;
-
-         unsigned int octant_fine2 = 0;
-         if(flag==0) octant_fine2 = 0;
-         else if(flag==1) octant_fine2 = 1;
-         else if(flag==3) octant_fine2 = 2;
-         else if(flag==7) octant_fine2 = 3;
-         else if(flag==15) octant_fine2 = 4;
-         else if(flag==31) octant_fine2 = 5;
-         else if(flag==63) octant_fine2 = 6;
-         else if(flag==127) octant_fine2 = 7;
-
-         int intphi = octant << 3;
-         if(octant==0||octant==2||octant==4||octant==6){
-            intphi |= octant_fine;
-         } else {
-            intphi |= octant_fine2;
-         }
-
-         return intphi;
+  short int octant=0;
+  if((x.value()&(1<<16))&&(y.value()&(1<<16))){ // Ex and Ey negative
+    if(std::abs(y.to_float()) < std::abs(x.to_float())) octant = 4; //100
+    else octant = 5; // 101
+  } else if(x.value()&(1<<16)){
+    if(std::abs(y.to_float()) < std::abs(x.to_float())) octant = 3; //011
+    else octant = 2; // 010
+  } else if(y.value()&(1<<16)){
+    if(std::abs(y.to_float()) < std::abs(x.to_float())) octant = 7; //111
+    else octant = 6; // 110
+  } else { // Ex and Ey both positive
+    if(std::abs(y.to_float()) < std::abs(x.to_float())) octant = 0; //000
+    else octant = 1; // 001
+  }
+
+  auto signed_x_f = x;
+  auto signed_y_f = y;
+  if(octant==0||octant==3||octant==4||octant==7){
+    //signed_x_f = (abs(int(x)));
+    signed_x_f = x.abs();
+    signed_y_f = y.abs();
+  } else {
+    //signed_x_f = (abs(int(y)));
+    signed_x_f = y.abs();
+    signed_y_f = x.abs();
+  }
+  
+  // For phi in the first sector (0.8 < phi < 1.6) store the possible values of the tan
+  const std::vector<std::string> atan2_thresholds =
+    {
+     "00000010010001101", // tan(0.85)=1.1383327132284393 rounded to 1.1376953125
+     "00000010100001010", // tan(0.9)=1.2601582175503392 rounded to 1.259765625
+     "00000010110010111", // tan(0.95)=1.398382589287699 rounded to 1.3974609375
+     "00000011000111010", // tan(1.0)=1.5574077246549023 rounded to 1.556640625
+     "00000011011111001", // tan(1.05)=1.7433153099831704 rounded to 1.7431640625
+     "00000011111011011", // tan(1.1)=1.9647596572486523 rounded to 1.9638671875
+     "00000100011110000", // tan(1.15)=2.2344969487553255 rounded to 2.234375
+     "00000101001001001", // tan(1.2)=2.5721516221263188 rounded to 2.5712890625
+     "00000110000001001", // tan(1.25)=3.0095696738628313 rounded to 3.0087890625
+     "00000111001101000", // tan(1.3)=3.6021024479679786 rounded to 3.6015625
+     "00001000111010010", // tan(1.35)=4.455221759562705 rounded to 4.455078125
+     "00001011100110001", // tan(1.4)=5.797883715482887 rounded to 5.7978515625
+     "00010000011110011", // tan(1.4500000000000002)=8.238092752965619 rounded to 8.2373046875
+     "00011100001100111", // tan(1.5)=14.101419947171719 rounded to 14.1005859375
+     "01100000001010000" // tan(1.55)=48.07848247921907 rounded to 48.078125
+    };
+  
+  unsigned int flag = 0;
+  for(size_t j=0;j<atan2_thresholds.size(); ++j){
+    auto thresh =  TSU::L1TopoDataTypes<17,10>(atan2_thresholds.at(j));
+    auto yy = signed_y_f*thresh;
+    if(signed_x_f.to_float() > yy.to_float()) flag = (flag | (1<<j));
+  }
+  unsigned int octant_fine = 0;
+  if(flag==0) octant_fine = 15;
+  else if(flag==1) octant_fine = 14;
+  else if(flag==3) octant_fine = 13;
+  else if(flag==7) octant_fine = 12;
+  else if(flag==15) octant_fine = 11;
+  else if(flag==31) octant_fine = 10;
+  else if(flag==63) octant_fine = 9;
+  else if(flag==127) octant_fine = 8;
+  else if(flag==255) octant_fine = 7;
+  else if(flag==511) octant_fine = 6;
+  else if(flag==1023) octant_fine = 5;
+  else if(flag==2047) octant_fine = 4;
+  else if(flag==3071) octant_fine = 3;
+  else if(flag==5119) octant_fine = 2;
+  else if(flag==9215) octant_fine = 1;
+  else if(flag==17407) octant_fine = 0;
+
+  unsigned int octant_fine2 = 0;
+  if(flag==0) octant_fine2 = 0;
+  else if(flag==1) octant_fine2 = 1;
+  else if(flag==3) octant_fine2 = 2;
+  else if(flag==7) octant_fine2 = 3;
+  else if(flag==15) octant_fine2 = 4;
+  else if(flag==31) octant_fine2 = 5;
+  else if(flag==63) octant_fine2 = 6;
+  else if(flag==127) octant_fine2 = 7;
+  else if(flag==255) octant_fine2 = 8;
+  else if(flag==511) octant_fine2 = 9;
+  else if(flag==1023) octant_fine2 = 10;
+  else if(flag==2047) octant_fine2 = 11;
+  else if(flag==3071) octant_fine2 = 12;
+  else if(flag==5119) octant_fine2 = 13;
+  else if(flag==9215) octant_fine2 = 14;
+  else if(flag==17407) octant_fine2 = 15;
+
+  int intphi = octant << 3;
+  if(octant==0||octant==2||octant==4||octant==6){
+    intphi |= octant_fine;
+  } else {
+    intphi |= octant_fine2;
+  }
+
+  return intphi;
 }
diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/share/L1TopoSimulationUtils_test.ref b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/share/L1TopoSimulationUtils_test.ref
index 1f9caaf4de0dc5ef3c4f8100995dd5dbf15d4d4a..9fd7e940c1598619ed75b265ec5aca647cbbef6b 100644
--- a/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/share/L1TopoSimulationUtils_test.ref
+++ b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/share/L1TopoSimulationUtils_test.ref
@@ -1,16 +1,16 @@
 ** test1: L1TopoSimulationUtils cosh at different delta-eta values**
-delta eta:  abs(0 - 23) = 23, cosh 000000001010000101
-delta eta:  abs(0 - 23) = 23, cosh 000000001010000101
-delta eta:  abs(0 - 24) = 24, cosh 000000001011000111
+delta eta:  abs(0 - 23) = 23, cosh 000000000001010000100110
+delta eta:  abs(0 - 23) = 23, cosh 000000000001010000100110
+delta eta:  abs(0 - 24) = 24, cosh 000000000001011000111010
 ** test2: L1TopoSimulationUtils KFLUT correction vs. et and eta**
- et 4 [0],  eta 2.4 [12] : 0.52 >>>
- et 12 [0],  eta 2.4 [12] : 0.52 >>>
- et 4 [0],  eta 2.6 [13] : 0.59 >>>
- et 12 [0],  eta 2.6 [13] : 0.59 >>>
- et 4 [0],  eta 2.9 [14] : 0.62 >>>
- et 12 [0],  eta 2.9 [14] : 0.62 >>>
- et 4 [0],  eta 3.1 [14] : 0.62 >>>
- et 12 [0],  eta 3.1 [14] : 0.62 >>>
+ et 4 [0],  eta 2.4 [12] : 0.523438 >>>
+ et 12 [0],  eta 2.4 [12] : 0.523438 >>>
+ et 4 [0],  eta 2.6 [13] : 0.59375 >>>
+ et 12 [0],  eta 2.6 [13] : 0.59375 >>>
+ et 4 [0],  eta 2.9 [14] : 0.617188 >>>
+ et 12 [0],  eta 2.9 [14] : 0.617188 >>>
+ et 4 [0],  eta 3.1 [14] : 0.617188 >>>
+ et 12 [0],  eta 3.1 [14] : 0.617188 >>>
 ** test3: L1TopoSimulationUtils KFLUT saturation**
 This out_of_range is expected for ET values beyond 1024 : vector::_M_range_check: __n (which is 5) >= this->size() (which is 5)
 ** test4: L1TopoSimulationUtils quadraticSumBW bitshift**
@@ -46,4 +46,4 @@ This out_of_range is expected for ET values beyond 1024 : vector::_M_range_check
  sum2(-32767, -32767) : std = 46339 bw = 46339
  sum2(0, 65535) : std = 65535 bw = 65535
  sum2(362, 65535) : std = 65535 bw = 65535
- sum2(46340, 46340) : std = 65534 bw = 65534
+ sum2(46340, 46340) : std = 65534 bw = 65534
\ No newline at end of file
diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/test/L1TopoSimulationUtils_test.cxx b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/test/L1TopoSimulationUtils_test.cxx
index 3153ce0007ee043231e9a013238657326c86d400..e63aa6fc49fd076687298d33c190dcb0e5e96a05 100644
--- a/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/test/L1TopoSimulationUtils_test.cxx
+++ b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/test/L1TopoSimulationUtils_test.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 /**
@@ -39,9 +39,9 @@ void test1()
     ClusterTOB cluster_fix0; // one cluster fixed at eta=0
     ClusterTOB cluster_var; // one cluster scanning eta values
 
-    for(double ieta : {23, int(23.5), 24}) {
+    for(double ieta : {23., 23.5, 24.}) {
         cluster_var.setEta(ieta);
-        auto cosh_val = TSU::Hyperbolic::Cosh.at(abs(cluster_fix0.eta() - cluster_var.eta()));
+        auto cosh_val = TSU::Hyperbolic::Cosh.at(static_cast<int>(100*abs(cluster_fix0.eta() - cluster_var.eta())));
         cout<<"delta eta: "
             <<" abs("<<cluster_fix0.eta()<<" - "<<cluster_var.eta()<<")"
             <<" = "<<abs(cluster_fix0.eta() - cluster_var.eta())
@@ -55,24 +55,24 @@ void test2()
 {
     cout << "** test2: L1TopoSimulationUtils KFLUT correction vs. et and eta**\n";
     TCS::KFLUT  kflut;
-
+    
     // use roughly the center of the bins defined in KFLUT.cxx + one outsider
     for(const double eta : {0.05, 0.2, 0.41, 0.6, 0.8, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.2, 2.4, 2.6, 2.9, 3.1, 3.5}) {
-        for(const unsigned int et : {4, 12, 24, 48, 96, 360}) {
-            int iet = kflut.getetbin(et);
-            int ieta = kflut.getetabin(std::abs(eta));
-            double corrfactor = kflut.getcorrKF(iet, ieta);
-            const bool large = corrfactor>+0.5;
-            const bool small = corrfactor<-0.5;
-            if(small or large) {
-                cout<<" et "<<et<<" ["<<iet<<"], "
-                    <<" eta "<<eta<<" ["<<ieta<<"] : "
-                    <<corrfactor<<(large ? " >>>" :
-                                   small ? " <<<" :
-                                   "")
-                    <<endl;
-            }
-        } // for(et)
+      for(const unsigned int et : {4, 12, 24, 48, 96, 360}) {
+	int iet = kflut.getetbin(et);
+	int ieta = kflut.getetabin(std::abs(eta));
+	double corrfactor = kflut.getcorrKF(iet, ieta);
+	const bool large = corrfactor>+0.5;
+	const bool small = corrfactor<-0.5;
+	if(small or large) {
+	  cout<<" et "<<et<<" ["<<iet<<"], "
+	      <<" eta "<<eta<<" ["<<ieta<<"] : "
+	      <<corrfactor<<(large ? " >>>" :
+			     small ? " <<<" :
+			     "")
+	      <<endl;
+	}
+      } // for(et)
     } // for(eta)
 }
 
@@ -174,11 +174,10 @@ int test4()
 
 
 int main()
-{
+{  
   test1();
   test2();
   test3();
   int result = test4();
-
   return result;
 }
diff --git a/Trigger/TrigTools/TrigInDetConfig/python/ConfigSettings.py b/Trigger/TrigTools/TrigInDetConfig/python/ConfigSettings.py
index 468b35ef7a542f3b5f48a116df8cb5bbf330dc67..c09e1aadd450264f33882b79f57f0d650707154d 100644
--- a/Trigger/TrigTools/TrigInDetConfig/python/ConfigSettings.py
+++ b/Trigger/TrigTools/TrigInDetConfig/python/ConfigSettings.py
@@ -503,6 +503,7 @@ class _GlobalSettings() :
       self._isLRT     = False
       self._adaptiveVertex = False
       self._vertex    = None
+      self._addSingleTrackVertices = False
 
 
    @property
@@ -537,6 +538,10 @@ class _GlobalSettings() :
    def vertex(self):
        return self._vertex
 
+   @property
+   def addSingleTrackVertices(self):
+       return self._addSingleTrackVertices
+
 
 
 class _Settings_electron( _GlobalSettings ):
@@ -626,6 +631,7 @@ class _Settings_tauIso( _GlobalSettings ):
       self._doRecord = True #Allow recording of track collections
       self._vertex  = "HLT_IDVertex_Tau"
       self._adaptiveVertex = True
+      self._addSingleTrackVertices = True
 
 #This might be redundant but lets keep them for the time being...
 class _Settings_tauIsoBDT( _GlobalSettings ):
diff --git a/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetPriVtxConfig.py b/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetPriVtxConfig.py
index a8f4b51852a74f3a2a724f29faf08c35adeb7053..8371b1f3229b6eb9ce9024bf8b331985e9be8f9f 100644
--- a/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetPriVtxConfig.py
+++ b/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetPriVtxConfig.py
@@ -316,11 +316,16 @@ def adaptiveMultiVertexFinderTool_builder( signature ) :
     # to be disabled we can add a flag and some additional logic 
     from InDetPriVxFinderTool.InDetPriVxFinderToolConf import InDet__InDetAdaptiveMultiPriVxFinderTool
 
+    from TrigInDetConfig.ConfigSettings import getInDetTrigConfig
+    singleTrackVertices= getInDetTrigConfig( signature ).addSingleTrackVertices 
+
+
     vertexFinderTool = InDet__InDetAdaptiveMultiPriVxFinderTool(name              = "InDetTrigAdaptiveMultiPriVxFinderTool" + signature,
                                                                         SeedFinder        = seedFinder,
                                                                         VertexFitterTool  = vertexFitterTool,
                                                                         TrackSelector     = trackSelectorTool,
                                                                         useBeamConstraint = True,
+                                                                        addSingleTrackVertices = singleTrackVertices,
                                                                         selectiontype     = 0, # what is this?
                                                                         do3dSplitting     = doVtx3DFinding)
     
diff --git a/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_AODtoTrkNtuple.py b/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_AODtoTrkNtuple.py
index d9e0304dc0f28d28666cd5eefcf32d019d242e30..8ad1a190be328c3b50a10847daf47ff718b0b605 100644
--- a/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_AODtoTrkNtuple.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_AODtoTrkNtuple.py
@@ -182,6 +182,7 @@ if ( True ) :
 
     # two stage tau precision tracking - empty ???
     "HLT_tau.*_idperf.*tracktwo.*:HLT_IDTrack_Tau_IDTrig:roi=HLT_Roi_TauIso",
+    "HLT_tau.*_idperf.*tracktwo.*:HLT_IDTrack_Tau_IDTrig:roi=HLT_Roi_TauIso:vtx=HLT_IDVertex_Tau",
 
 
     # should get single stage tau
diff --git a/Trigger/TrigValidation/TrigInDetValidation/share/comparitor.json b/Trigger/TrigValidation/TrigInDetValidation/share/comparitor.json
index 5bc5ac46a0fa3c97eed057d58269415e2992e345..3ae0d4f621a6d1775e144fae77983156a0d0a8f7 100644
--- a/Trigger/TrigValidation/TrigInDetValidation/share/comparitor.json
+++ b/Trigger/TrigValidation/TrigInDetValidation/share/comparitor.json
@@ -32,6 +32,9 @@
     "EFtau":{ 
         "chains" : "HLT_tau25_idperf_tracktwo_L1TAU12IM:HLT_IDTrack_TauIso_FTF:HLT_Roi_TauIso HLT_tau25_idperf_tracktwo_L1TAU12IM:HLT_IDTrack_Tau_IDTrig:HLT_Roi_TauIso"
     },
+    "EFtauvtx":{ 
+        "chains" : "HLT_tau25_idperf_tracktwo_L1TAU12IM:HLT_IDTrack_Tau_IDTrig:HLT_Roi_TauIso:HLT_IDVertex_Tau/HLT_IDVertex_Tau"
+    },
     "L2bjet":{ 
         "chains" : "HLT_j45_subjesgscIS_ftf_boffperf_split_L1J20:HLT_IDTrack_Bjet_FTF"
     },
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_tau_ztautau_pu46.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_tau_ztautau_pu46.py
index cc6b814541c1c3f4903e00cd62083fc7e049cec5..800d9af51f9a818dd599e443ea930f8a320558fc 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_tau_ztautau_pu46.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_tau_ztautau_pu46.py
@@ -39,7 +39,9 @@ Jobs = [ ( "Offline",  " TIDAdata-run3-offline.dat -r Offline -o data-hists-offl
 Comp = [ ( "L2tau",        "L2tau",       "data-hists.root",          " -c TIDAhisto-panel.dat  -d HLTL2-plots " ),
          ( "EFtau",        "EFtau",       "data-hists.root",          " -c TIDAhisto-panel.dat  -d HLTEF-plots " ),
          ( "L2tauOff",     "L2tau",       "data-hists-offline.root",  " -c TIDAhisto-panel.dat  -d HLTL2-plots-offline " ),
-         ( "EFtauOff",     "EFtau",       "data-hists-offline.root",  " -c TIDAhisto-panel.dat  -d HLTEF-plots-offline " ) ]
+         ( "EFtauOff",     "EFtau",       "data-hists-offline.root",  " -c TIDAhisto-panel.dat  -d HLTEF-plots-offline " ),
+         ( "EFvtx",        "EFtauvtx",    "data-hists-offline.root",  " -c TIDAhisto-panel-vtx.dat  -d HLTL2-plots-vtx  --ncols 3" ) ]
+
    
 from AthenaCommon.Include import include 
 include("TrigInDetValidation/TrigInDetValidation_Base.py")
diff --git a/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py b/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py
index b8f374c8283809853a5fdde909834b770c656d4f..11504c3bdd0f3a5b97c00061503842b971fcaddb 100644
--- a/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py
+++ b/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py
@@ -434,7 +434,7 @@ TriggerHLTListRun3 = [
 
     # FS tracks
     ('xAOD::TrackParticleContainer#HLT_IDTrack_FS_FTF',                 'BS ESD AODFULL', 'Jet'),
-    ('xAOD::TrackParticleAuxContainer#HLT_IDTrack_FS_FTFAux.',          'BS ESD AODFULL', 'Jet'),
+    ('xAOD::TrackParticleAuxContainer#HLT_IDTrack_FS_FTFAux.passPFTrackPresel.muonCaloTag.muonScore.ptCone20.etConeCore.trackIso.RErr.EOverP.caloIso.trkPtFraction.tagFakeTrack.tagMuonTrack.tagIsoTrack',          'BS ESD AODFULL', 'Jet'),
 
     # FS vertices
     ('xAOD::VertexContainer#HLT_IDVertex_FS',                  'BS ESD AODFULL', 'Jet'),
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigFlags.py b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigFlags.py
index f61a991a82dd44f6b27b89b8962980d9400dcdf0..918a9f83c8e83d8e1f7453ac9bf576bf88b35d5e 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigFlags.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigFlags.py
@@ -1,6 +1,7 @@
 # Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 
 from AthenaConfiguration.AthConfigFlags import AthConfigFlags
+from AthenaCommon.SystemOfUnits import GeV
 from AthenaCommon.Logging import logging
 log=logging.getLogger('TriggerConfigFlags')
 
@@ -342,6 +343,18 @@ def createTriggerFlags():
     from TrigInDetConfig.TrigTrackingCutFlags import createTrigTrackingFlags
     flags.addFlagsCategory( 'Trigger.InDetTracking', createTrigTrackingFlags )
 
+    # NB: Longer term it may be worth moving these into a PF set of config flags, but right now the only ones that exist do not seem to be used in the HLT.
+    # When we use component accumulators for this in the HLT maybe we should revisit this
+    # PFO-muon removal option for the full-scan hadronic signatures.
+    # Options are:
+    #   "None": Do no PFO-muon removal
+    #   "Calo": Use the calo-tagging tools from the muon slice
+    #   "Iso" : Use the mainly isolation-based selections based on the MET associator package
+    flags.addFlag("Trigger.FSHad.PFOMuonRemoval", "None")
+
+    # the minimum pT threshold to use for the muon removal
+    flags.addFlag("Trigger.FSHad.PFOMuonRemovalMinPt", 10 * GeV)
+
     return flags
     # for reference, this flags are skipped as never used or never set in fact, or set identical to de default or used in a very old JO:
     # fakeLVL1, useCaloTTL
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetRecoSequences.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetRecoSequences.py
index e7e3a69abbaefec142f23442f137a4ac504fd167..09cd6c5167309b12b57ffd6c8e0874def944d6d6 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetRecoSequences.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetRecoSequences.py
@@ -91,7 +91,7 @@ def standardJetBuildSequence( configFlags, dataSource, clustersKey, **jetRecoDic
         from eflowRec.PFHLTSequence import PFHLTSequence
         (pfseq, pfoPrefix) = RecoFragmentsPool.retrieve(
             PFHLTSequence,
-            configFlags, clustersin=clustersKey, tracktype=jetRecoDict["trkopt"])
+            configFlags, clustersin=clustersKey, tracktype=jetRecoDict["trkopt"], cellsin="CaloCellsFS")
         buildSeq += pfseq
         jetDef = JetRecoConfiguration.defineJets(jetRecoDict,pfoPrefix=pfoPrefix,prefix=jetNamePrefix)
     else:
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetTrackingConfig.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetTrackingConfig.py
index 4aee716c433b804f2fdb939440fbb9e1d128a9dc..b9d5b83ef4b0f5bfd882c86a616243ed376cace1 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetTrackingConfig.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetTrackingConfig.py
@@ -49,22 +49,10 @@ def JetTrackingSequence(dummyFlags,trkopt,RoIs):
     if trkopt not in trackcollectionmap.keys():
         trackcollectionmap[trkopt] = trkcolls
 
-    # Track decoration.
-    trkdecortool = CompFactory.getComp('InDet::InDetUsedInFitTrackDecoratorTool') \
-                   ("jetTrkDecorTool",
-                    TrackContainer  = trackcollectionmap[trkopt]["Tracks"],
-                    VertexContainer = trackcollectionmap[trkopt]["Vertices"]
-                    )
-    trkdecoralg = CompFactory.getComp('InDet::InDetUsedInVertexFitTrackDecorator') \
-                  ("jetTrkDecorAlg",
-                   UsedInFitDecoratorTool = trkdecortool
-                   )
-    jetTrkSeq += conf2toConfigurable( trkdecoralg )
-
     # Jet track selection
     jettrackselloose = getTrackSelTool(trkopt,doWriteTracks=True)
     jettracksname = jettrackselloose.OutputContainer
-    jettvassoc = getTrackVertexAssocTool(trkopt)
+    jettvassoc = getTrackVertexAssocTool(trkopt, jetTrkSeq)
 
     trackcollectionmap[trkopt]["JetTracks"] = jettracksname
 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MET/AlgInputConfig.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MET/AlgInputConfig.py
index 56482c0ec8c2fe846bb5f6c5a18b61559c29e4a0..f2f784a8eb7e15b0efc4a08cb032e88d95457fd9 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MET/AlgInputConfig.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MET/AlgInputConfig.py
@@ -46,13 +46,16 @@ return the mapping of input nicknames to values.
 
 from abc import ABC, abstractmethod
 from collections import defaultdict
+from AthenaCommon.Logging import logging
+
+log = logging.getLogger(__name__)
 
 
 class AlgInputConfig(ABC):
     """ Base class for building up inputs for the FEXes """
 
     def __init__(self, produces, step=None):
-        """ Initialise the class
+        """Initialise the class
 
         =========
         Arguments
@@ -102,7 +105,7 @@ class InputConfigRegistry:
             self._configs[x] = config
 
     def build_steps(self, requested, RoIs, recoDict):
-        """ Build the necessary input sequence, separated by steps
+        """Build the necessary input sequence, separated by steps
 
         =========
         Arguments
@@ -124,6 +127,7 @@ class InputConfigRegistry:
         inputs = {}
         # Internal mapping of input nickname to step
         input_steps = {}
+        log.debug("Producing steps for requested inputs: %s", requested)
         for name in requested:
             this_steps = self._create_input(
                 name, RoIs, recoDict, input_steps=input_steps, inputs=inputs
@@ -132,11 +136,13 @@ class InputConfigRegistry:
                 steps[step] += seq_list
         # Now convert the steps into a list
         steps = [steps[idx] for idx in range(max(steps.keys()) + 1)]
+        log.debug("Built steps for inputs: %s", inputs)
+        log.debug("Steps are:\n%s", steps)
         return steps, inputs
 
     def _create_input(self, name, RoIs, recoDict, input_steps, inputs, _seen=None):
-        """ Create an input and its dependencies 
-        
+        """Create an input and its dependencies
+
         =========
         Arguments
         =========
@@ -155,6 +161,7 @@ class InputConfigRegistry:
         The provided input_steps and inputs parameters are also updated with
         the new inputs that have been produced
         """
+        log.debug("Creating inputs for %s", name)
         if _seen is None:
             _seen = []
         elif name in _seen:
@@ -162,6 +169,7 @@ class InputConfigRegistry:
                 "Circular dependency: {}".format(" -> ".join(_seen + [name]))
             )
         if name in input_steps:
+            log.debug("Input already created")
             # We've already seen this step so return dummies
             return {}
         steps = defaultdict(list)
@@ -170,10 +178,9 @@ class InputConfigRegistry:
             config = self._configs[name]
         except KeyError:
             raise KeyError(f"Requested input {name} not defined")
-        # If config.step is None, use this to record the max step among
-        # config's dependencies
-        step = config.step if config.step is not None else -1
-        for dep_name in config.dependencies(recoDict):
+        dependencies = config.dependencies(recoDict)
+        log.debug("Dependencies are %s", dependencies)
+        for dep_name in dependencies:
             dep_steps = self._create_input(
                 dep_name, RoIs, recoDict, input_steps, inputs, _seen + [name]
             )
@@ -182,20 +189,24 @@ class InputConfigRegistry:
                 raise ValueError(
                     f"Dependency {dep_name} is in a later step '{dep_step}' than {name} which requires it (step = {config.step})"
                 )
-            else:
-                step = max(step, dep_step)
             # Add these reco sequences to our output lists
             for step, seq_list in dep_steps.items():
                 steps[step] += seq_list
+        if config.step is None:
+            if len(dependencies) == 0:
+                raise ValueError(f"Unable to work out step for input config {name}!")
+            # If the config doesn't specify a step then we run this as early as possible - i.e. in the latest step of all its dependencies
+            this_step = max(input_steps[dep] for dep in dependencies)
+        else:
+            this_step = config.step
+        log.debug("%s step is %i", name, this_step)
         # Finally, add *our* info
-        if step < 0:
-            raise ValueError(f"Unable to work out step for input config {name}!")
-        if step > len(RoIs):
-            raise ValueError(f"Step {step} is greater than the number of RoIs ({RoIs})")
-        sequences, this_inputs = config.create_sequence(inputs, RoIs[step], recoDict)
-        steps[step] += sequences
+        if this_step > len(RoIs):
+            raise ValueError(f"Step {this_step} is greater than the number of RoIs ({RoIs})")
+        sequences, this_inputs = config.create_sequence(inputs, RoIs[this_step], recoDict)
+        steps[this_step] += sequences
         inputs.update(this_inputs)
         # Add this to the list of things we've already seen, along with everything else it's made
         for made in this_inputs.keys():
-            input_steps[made] = step
+            input_steps[made] = this_step
         return steps
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MET/METRecoSequences.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MET/METRecoSequences.py
index c9442641ff3a1ceb2dd2cd5f5d1ba58866f27c9b..709e87aa6e915d14b55ad09d65f817fa3ab0d71f 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MET/METRecoSequences.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MET/METRecoSequences.py
@@ -28,9 +28,7 @@ from ..Menu.SignatureDicts import JetChainParts_Default
 from InDetTrackSelectionTool.InDetTrackSelectionToolConf import (
     InDet__InDetTrackSelectionTool,
 )
-from TrackVertexAssociationTool.TrackVertexAssociationToolConf import (
-    CP__TrackVertexAssociationTool,
-)
+from TrackVertexAssociationTool.getTTVAToolForReco import getTTVAToolForReco
 import copy
 
 log = logging.getLogger(__name__)
@@ -38,8 +36,12 @@ log = logging.getLogger(__name__)
 
 def jetRecoDictForMET(**recoDict):
     """ Get a jet reco dict that's usable for the MET slice """
-    jrd = {k: recoDict.get(k, JetChainParts_Default[k]) for k in jetRecoKeys if not k=='cleaning'}
-    jrd.update({'cleaning':'noCleaning'})
+    jrd = {
+        k: recoDict.get(k, JetChainParts_Default[k])
+        for k in jetRecoKeys
+        if not k == "cleaning"
+    }
+    jrd.update({"cleaning": "noCleaning"})
     # Rename the cluster calibration
     try:
         jrd["clusterCalib"] = recoDict["calib"]
@@ -118,8 +120,8 @@ default_inputs.add_input(ClusterInputConfig())
 
 
 class EMClusterInputConfig(AlgInputConfig):
-    """ Input config that forces the clusters produced to be at the EM scale
-    
+    """Input config that forces the clusters produced to be at the EM scale
+
     We have this so that we can force PFOs to be produced at the EM scale,
     however a better solution would probably be to add 'em' to the trigger name
     or to change the 'calib' default to be "default" and then have the algorithm
@@ -175,7 +177,7 @@ class PFOInputConfig(AlgInputConfig):
         return "Clusters" if recoDict["calib"] == "em" else "EMClusters"
 
     def dependencies(self, recoDict):
-        return [self._input_clusters(recoDict), "Tracks", "Vertices", "TVA"]
+        return [self._input_clusters(recoDict), "Tracks", "Vertices", "TVA", "Cells"]
 
     def create_sequence(self, inputs, RoIs, recoDict):
         pfSeq, pfoPrefix = RecoFragmentsPool.retrieve(
@@ -183,6 +185,7 @@ class PFOInputConfig(AlgInputConfig):
             flags=None,
             clustersin=inputs[self._input_clusters(recoDict)],
             tracktype="ftf",
+            cellsin=inputs["Cells"],
         )
         # The jet constituent modifier sequence here is to apply the correct weights
         # and decorate the PV matching decoration. If we've specified constituent
@@ -269,9 +272,15 @@ class CVFClusterInputConfig(AlgInputConfig):
                 InputVertexKey=inputVertices,
                 OutputCVFKey="CVF",
                 TrackSelectionTool=InDet__InDetTrackSelectionTool(CutLevel="TightPrimary"),
-                TVATool=CP__TrackVertexAssociationTool(
-                    WorkingPoint="Custom", d0_cut=2.0, dzSinTheta_cut=2.0,
-                    TrackContName = inputTracks,
+                # Note: Currently (March 2021), this is configured to not use the TTVA decorations
+                # provided by tracking CP. This will work with the current configured WP. 
+                #
+                # If you need the decorations, you need to make sure to pass
+                # this method the correct alg sequence to add to, since it needs 
+                # to schedule an algorithm to provide the information. 
+                TVATool=getTTVAToolForReco(
+                    WorkingPoint="Custom", d0_cut=2.0, dzSinTheta_cut=2.0, addDecoAlg=False,
+                    TrackContName=inputTracks, VertexContName=inputVertices
                 ),
                 ExtensionTool=ApproximateTrackToLayerTool()
             )
@@ -306,7 +315,7 @@ default_inputs.add_input(CVFClusterInputConfig())
 
 
 class JetInputConfig(AlgInputConfig):
-    """ Helper input config for jets
+    """Helper input config for jets
 
     Note that if the jets require JVT but are topo jets there is nothing in the
     recoDict (unless the calibration is gsc) to force tracking to run. Therefore
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/generateMuon.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/generateMuon.py
index d6c6c787295b9bdbf3972ef95c403026560cff5f..1e6ff10965b35fb9b97d8f1b5b2751bd6a26c082 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/generateMuon.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/generateMuon.py
@@ -26,6 +26,7 @@ from TileGeoModel.TileGMConfig import TileGMCfg
 from MuonConfig.MuonSegmentFindingConfig import MooSegmentFinderAlgCfg
 from MuonConfig.MuonTrackBuildingConfig import MuonTrackBuildingCfg
 from MuonCombinedConfig.MuonCombinedReconstructionConfig import MuonCombinedMuonCandidateAlgCfg, MuonInsideOutRecoAlgCfg
+from MuonSegmentTrackMaker.MuonTrackMakerAlgsMonitoring import MuPatTrackBuilderMonitoring
 from MuonCombinedConfig.MuonCombinedReconstructionConfig import MuonCombinedInDetCandidateAlgCfg, MuonCombinedAlgCfg, MuonCreatorAlgCfg
 
 from TrigMuonEF.TrigMuonEFConfig_newJO import TrigMuonEFTrackIsolationAlgCfg, MuonFilterAlgCfg, MergeEFMuonsAlgCfg
@@ -366,7 +367,7 @@ def muEFSAStep(flags, chainDict, name='RoI'):
     #Reco
     recoMS.mergeReco( MooSegmentFinderAlgCfg(flags,name="TrigMooSegmentFinder_"+name,UseTGCNextBC=False, UseTGCPriorBC=False))
 
-    recoMS.mergeReco(MuonTrackBuildingCfg(flags, name="TrigMuPatTrackBuilder_"+name))
+    recoMS.mergeReco(MuonTrackBuildingCfg(flags, name="TrigMuPatTrackBuilder_"+name, MonTool = MuPatTrackBuilderMonitoring("MuPatTrackBuilderMonitoringSA_"+name)))
     recoMS.mergeReco(MuonTrackParticleCnvCfg(flags, name = "TrigMuonTrackParticleCnvAlg_"+name))
     recoMS.mergeReco(MuonCombinedMuonCandidateAlgCfg(flags, name = "TrigMuonCandidateAlg_"+name))
     recoMS.mergeReco(MuonCreatorAlgCfg(flags, name = "TrigMuonCreatorAlg_"+name, MuonContainerLocation="Muons_"+name))
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/UnconventionalTracking/IsoHighPtTrackTriggerConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/UnconventionalTracking/IsoHighPtTrackTriggerConfiguration.py
new file mode 100644
index 0000000000000000000000000000000000000000..18da83ea13ea8578d280031eb669fc58318a4cd8
--- /dev/null
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/UnconventionalTracking/IsoHighPtTrackTriggerConfiguration.py
@@ -0,0 +1,78 @@
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+from AthenaCommon.CFElements import seqAND
+from ..CommonSequences.FullScanDefs import caloFSRoI
+from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import MenuSequence, RecoFragmentsPool
+from AthenaCommon.Logging import logging
+
+logging.getLogger().info("Importing %s",__name__)
+log = logging.getLogger("TriggerMenuMT.HLTMenuConfig.IsoHighPtTrackTriggerConfiguration")
+
+
+def FTFTrackSequence(ConfigFlags):
+
+    from TriggerMenuMT.HLTMenuConfig.Jet.JetMenuSequences import getTrackingInputMaker
+    InputMakerAlg=getTrackingInputMaker()
+
+    from TrigInDetConfig.ConfigSettings import getInDetTrigConfig
+    IDTrigConfig = getInDetTrigConfig( 'jet' )
+
+    from TrigEDMConfig.TriggerEDMRun3 import recordable
+    from TrigInDetConfig.InDetSetup import makeInDetAlgsNoView
+    TrkInputNoViewAlg = makeInDetAlgsNoView( config = IDTrigConfig, rois=caloFSRoI)
+
+    from TrigInDetConfig.TrigInDetPriVtxConfig import makeVertices
+
+    verticesname = recordable("HLT_IDVertex_FS")
+    vtxAlgs = makeVertices( "jet", IDTrigConfig.FT.tracksFTF( doRecord = IDTrigConfig.isRecordable ) , verticesname, IDTrigConfig )
+    prmVtx = vtxAlgs[-1]
+
+    TrkSeq =  [InputMakerAlg,TrkInputNoViewAlg, prmVtx]
+    sequenceOut = IDTrigConfig.FT.tracksFTF( doRecord = IDTrigConfig.isRecordable )
+
+    return (TrkSeq, InputMakerAlg, sequenceOut)
+
+
+
+
+
+def IsoHPtTrackTriggerHypoSequence():
+        from TrigLongLivedParticlesHypo.TrigIsoHPtTrackTriggerHypoTool import TrigIsoHPtTrackTriggerHypoToolFromDict
+        from TrigLongLivedParticlesHypo.TrigLongLivedParticlesHypoConf import (TrigIsoHPtTrackTriggerHypoAlgMT)
+
+        # Get sequence name
+        from TrigInDetConfig.ConfigSettings import getInDetTrigConfig
+        IDTrigConfig = getInDetTrigConfig( 'jet' )
+        sequenceOut = IDTrigConfig.FT.tracksFTF( doRecord = IDTrigConfig.isRecordable )
+
+        #Setup the hypothesis algorithm
+        theIsoHPtTrackTriggerHypo = TrigIsoHPtTrackTriggerHypoAlgMT("L2IsoHPtTrack")
+        theIsoHPtTrackTriggerHypo.trackKey =  sequenceOut
+
+        from AthenaConfiguration.ComponentAccumulator import conf2toConfigurable
+        from AthenaConfiguration.ComponentFactory import CompFactory
+        DummyInputMakerAlg = conf2toConfigurable(CompFactory.InputMakerForRoI( "IM_IsoHPtTrack_HypoOnlyStep" ))
+        DummyInputMakerAlg.RoITool = conf2toConfigurable(CompFactory.ViewCreatorInitialROITool())
+
+        log.debug("Building the Step dictinary for IsoHPt!")
+        return MenuSequence( Sequence    = seqAND("UncTrkEmptySeq",[DummyInputMakerAlg]),
+                            Maker       = DummyInputMakerAlg,
+                            Hypo        = theIsoHPtTrackTriggerHypo,
+                            HypoToolGen = TrigIsoHPtTrackTriggerHypoToolFromDict,
+                            )
+
+def FTFRecoOnlySequence():
+        from TrigStreamerHypo.TrigStreamerHypoConf import TrigStreamerHypoAlgMT
+        from TrigStreamerHypo.TrigStreamerHypoConfigMT import StreamerHypoToolMTgenerator
+
+        from AthenaConfiguration.AllConfigFlags import ConfigFlags
+        ( TrkSeq, InputMakerAlg, sequenceOut) = RecoFragmentsPool.retrieve(FTFTrackSequence,ConfigFlags)
+
+        HypoAlg = TrigStreamerHypoAlgMT("UncTrkDummyStream")
+
+
+        log.debug("Building the Step dictinary for IsoHPt!")
+        return MenuSequence( Sequence    = seqAND("UncTrkrecoSeq", TrkSeq),
+                            Maker       = InputMakerAlg,
+                            Hypo        = HypoAlg,
+                            HypoToolGen = StreamerHypoToolMTgenerator
+                            )
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/UnconventionalTracking/UnconventionalTrackingChainConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/UnconventionalTracking/UnconventionalTrackingChainConfiguration.py
index 0c6f7ac227ebbf80eaf3335ac6e03889d440966f..6bf0ddf7d857808ec0717220c5c196d7c65a90a4 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/UnconventionalTracking/UnconventionalTrackingChainConfiguration.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/UnconventionalTracking/UnconventionalTrackingChainConfiguration.py
@@ -5,9 +5,7 @@ logging.getLogger().info("Importing %s",__name__)
 log = logging.getLogger("TriggerMenuMT.HLTMenuConfig.UnconventionalTracking.UnconventionalTrackingChainConfiguration")
 
 from TriggerMenuMT.HLTMenuConfig.Menu.ChainConfigurationBase import ChainConfigurationBase
-from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import MenuSequence, RecoFragmentsPool
-from AthenaCommon.CFElements import seqAND
-from ..CommonSequences.FullScanDefs import caloFSRoI
+
 
 
 def unconventionalTrackingChainParts(chainParts):
@@ -63,7 +61,7 @@ class UnconventionalTrackingChainConfiguration(ChainConfigurationBase):
         # --------------------
 
         stepDictionary = {
-            "isohpttrack" : [['getSkipStep'],['getFTFTrackReco'],['getIsoHPtTrackTrigger']],
+            "isohpttrack" : [['getIsoHPtTrackEmtpy'],['getFTFTrackReco'],['getIsoHPtTrackTrigger']],
             "fslrt": [['getFSLRTEmpty'], ['getFSLRTTrigger']]
         }
 
@@ -77,7 +75,7 @@ class UnconventionalTrackingChainConfiguration(ChainConfigurationBase):
     def getFTFTrackReco(self):
         return self.getStep(6,'FTFRecoOnlyCfg',[FTFRecoOnlyCfg])
 
-    def getSkipStep(self):
+    def getIsoHPtTrackEmtpy(self):
         return  self.getEmptyStep(1,"EmptyUncTrk")
 
     def getFSLRTTrigger(self):
@@ -87,84 +85,13 @@ class UnconventionalTrackingChainConfiguration(ChainConfigurationBase):
         return self.getEmptyStep(1, 'FSLRTEmptyStep')
 
 
-def FTFTrackSequence(ConfigFlags):
-
-    from TriggerMenuMT.HLTMenuConfig.Jet.JetMenuSequences import getTrackingInputMaker
-    InputMakerAlg=getTrackingInputMaker()
-
-    from TrigInDetConfig.ConfigSettings import getInDetTrigConfig
-    IDTrigConfig = getInDetTrigConfig( 'jet' )
-
-    from TrigEDMConfig.TriggerEDMRun3 import recordable
-    from TrigInDetConfig.InDetSetup import makeInDetAlgsNoView
-    TrkInputNoViewAlg = makeInDetAlgsNoView( config = IDTrigConfig, rois=caloFSRoI)
-
-    from TrigInDetConfig.TrigInDetPriVtxConfig import makeVertices
-
-    verticesname = recordable("HLT_IDVertex_FS")
-    vtxAlgs = makeVertices( "jet", IDTrigConfig.FT.tracksFTF( doRecord = IDTrigConfig.isRecordable ) , verticesname, IDTrigConfig )
-    prmVtx = vtxAlgs[-1]
-
-    TrkSeq =  [InputMakerAlg,TrkInputNoViewAlg, prmVtx]
-    sequenceOut = IDTrigConfig.FT.tracksFTF( doRecord = IDTrigConfig.isRecordable )
-
-    return (TrkSeq, InputMakerAlg, sequenceOut)
-
-
-
-
-
-def IsoHPtTrackTriggerHypoSequence():
-        from TrigLongLivedParticlesHypo.TrigIsoHPtTrackTriggerHypoTool import TrigIsoHPtTrackTriggerHypoToolFromDict
-        from TrigLongLivedParticlesHypo.TrigLongLivedParticlesHypoConf import (TrigIsoHPtTrackTriggerHypoAlgMT)
-
-        # Get sequence name
-        from TrigInDetConfig.ConfigSettings import getInDetTrigConfig
-        IDTrigConfig = getInDetTrigConfig( 'jet' )
-        sequenceOut = IDTrigConfig.FT.tracksFTF( doRecord = IDTrigConfig.isRecordable )
-
-        #Setup the hypothesis algorithm
-        theIsoHPtTrackTriggerHypo = TrigIsoHPtTrackTriggerHypoAlgMT("L2IsoHPtTrack")
-        theIsoHPtTrackTriggerHypo.trackKey =  sequenceOut
-
-        from AthenaConfiguration.ComponentAccumulator import conf2toConfigurable
-        from AthenaConfiguration.ComponentFactory import CompFactory
-        DummyInputMakerAlg = conf2toConfigurable(CompFactory.InputMakerForRoI( "IM_IsoHPtTrack_HypoOnlyStep" ))
-        DummyInputMakerAlg.RoITool = conf2toConfigurable(CompFactory.ViewCreatorInitialROITool())
-
-        log.debug("Building the Step dictinary for IsoHPt!")
-        return MenuSequence( Sequence    = seqAND("UncTrkEmptySeq",[DummyInputMakerAlg]),
-                            Maker       = DummyInputMakerAlg,
-                            Hypo        = theIsoHPtTrackTriggerHypo,
-                            HypoToolGen = TrigIsoHPtTrackTriggerHypoToolFromDict,
-                            )
-
-def FTFRecoOnlySequence():
-        from TrigStreamerHypo.TrigStreamerHypoConf import TrigStreamerHypoAlgMT
-        from TrigStreamerHypo.TrigStreamerHypoConfigMT import StreamerHypoToolMTgenerator
-
-        from AthenaConfiguration.AllConfigFlags import ConfigFlags
-        ( TrkSeq, InputMakerAlg, sequenceOut) = RecoFragmentsPool.retrieve(FTFTrackSequence,ConfigFlags)
-
-        HypoAlg = TrigStreamerHypoAlgMT("UncTrkDummyStream")
-
-
-        log.debug("Building the Step dictinary for IsoHPt!")
-        return MenuSequence( Sequence    = seqAND("UncTrkrecoSeq", TrkSeq),
-                            Maker       = InputMakerAlg,
-                            Hypo        = HypoAlg,
-                            HypoToolGen = StreamerHypoToolMTgenerator
-                            )
-
-
-
-
-
 
 
 def IsoHPtTrackTriggerCfg(flags):
+    from TriggerMenuMT.HLTMenuConfig.UnconventionalTracking.IsoHighPtTrackTriggerConfiguration import IsoHPtTrackTriggerHypoSequence
     return IsoHPtTrackTriggerHypoSequence()
 def FTFRecoOnlyCfg(flags):
+    from TriggerMenuMT.HLTMenuConfig.UnconventionalTracking.IsoHighPtTrackTriggerConfiguration import FTFRecoOnlySequence
     return FTFRecoOnlySequence()
 
 def FSLRTTriggerCfg(flags):